I have an arduino operating at a fair distance from the computer (~15-20 meters). It's connected using an 'active usb extension cable' (aka powered). About 2-3 times a day though I have to reboot the computer because the usb port gets to an unusable/frozen state. Trying to connect to the Arduino then yields an exception in the software, only to be fixed by rebooting.
I'm trying to understand can be causing this. I don't actually suspect the Arduino itself. It's externally powered so is always on. Rebooting the computer (the computer's usb hub will be power cycled) wouldn't reset the Arduino. An obvious suspect to me is that the long usb cable causes faults in the data which 'confuses' the usb/serial driver and creates a deadlock situation, pardon the psuedo-technical explanation. I'd love a second opinion on this
ps -> I've considered that the program hosting the Serial connection might not have the best Serial support. I was using Unity (C#) but have also tried using Processing to handle the Serial connection; I have more experience and faith in its Serial capabilities. Same behavior though.
ps 2 -> Might I yield better results by using a usb-over-ethernet usb-ethernet extender (like this)? It doesn't seem like a huge improvement but maybe an ethernet cable has better resistance to data corruption?
If I had to guess, since that is all I can do with the complete lack of specifics, I’d say your Arduino power supply is fighting with you PC power. This is possible if you power the Arduino directly from the 5 volt pin and have the USB cable attached to a PC providing 5 volts via the USB port as well.
One easy solution is to remove (desolder) the Arduino SMD fuse in series with the USB 5 volt supply or make a USB adapter that only passes the data and ground lines.
Another scenario could be a ground loop issue between the computer an Arduino power supplies. In that case one of the standard Chinese USB isolators would solve the problem.
I use Arduino boards daily plugged into an 8 m active USB cable with a powered USB hub on the end. I went through a few cables that died quickly until I got a good one that has lasted me for years now without any problems.
I tried the cheapest Ethernet cable version from eBay and that didn't work at all, even when testing with a 1 m Ethernet cable, so I was not at all impressed by those. However, I suspect that I was just paying the price for being cheap and a more expensive Ethernet extended from a reputable company would work.
WattsThat:
If I had to guess, since that is all I can do with the complete lack of specifics, I’d say your Arduino power supply is fighting with you PC power. This is possible if you power the Arduino directly from the 5 volt pin and have the USB cable attached to a PC providing 5 volts via the USB port as well.
One easy solution is to remove (desolder) the Arduino SMD fuse in series with the USB 5 volt supply or make a USB adapter that only passes the data and ground lines.
Another scenario could be a ground loop issue between the computer an Arduino power supplies. In that case one of the standard Chinese USB isolators would solve the problem.
Thanks for the ideas. Yes I apologize for the lack of specifics, I didn't know how else to specify. My external power supply is connected to the barrel jack of the Arduino, which shouldn't create the situation where it's fighting the usb power supply right? I understand that the Arduino switches between them automatically. However, the issue of the usb port freezing also happened without the external power supply connected. I should have added that, I now realize. I added the external power supply because I was having a difficult time reprogramming the Arduino, which also points me in the direction of an unhealthy connection quality from the USB cable.
I'll look into the ground loop issue.
pert:
I use Arduino boards daily plugged into an 8 m active USB cable with a powered USB hub on the end. I went through a few cables that died quickly until I got a good one that has lasted me for years now without any problems.
This is exactly the kind of reporting that disheartens me. I read so often that people have success in particular circumstances or with particular products. Paints the picture that the domain of active usb extenders or usb-ethernet extenders is just trying to fill in a user need while usb itself wasn't ever designed to be extended so long. I rarely hear specific product or brand names that are reliable. Can you by any chance prove me wrong?
Personally I would switch to RS232 communication. With the correct adapters (DTR available), it can also be used to program the Arduino over that distance.