- Sat Oct 29, 2011 4:27 pm
#135129
I have a 9600 baud communication link between an Arduino and a Linux box using these two products:
http://www.sparkfun.com/products/9822 (USB to RS-485)
http://www.sparkfun.com/products/10124 (CMOS logic to RS-485)
I have connected the two together using 30 feet of 2 strand signal wire with foil and wire shield cable. The center wires are used for the A and B. I used the shield for the ground connection.
For the most part, the system works well. But I have two small issues that are driving me nuts.
1) On occasions (~10 times a day), the data coming from the Arduino seems to get corrupted. But the corruption is not overt. Seems like a lost byte not a corrupted byte. Not too worried about this in that I can compensate with checksums and the like. But this may be a symptom of my "real" problem.
2) On occasions (~20 times a day), my Python program barfs trying to determine the number of bytes in the incoming buffer. When this happens, the Linux error log (/var/log/messages) reports the following:
My goggling finds people who have had this issue with devices that generate lots of static like those vinyl dance pads. My implementation does not seem to have include a large static source, but it might include sparking as the furnace it monitors includes relays. But the monitoring is all done via optical isolators and isolated power supplies for the Arduino.
So I am wondering what I might do differently to suppress noise that somehow is going up the USB cable and nuking the USB device driver on the Linux box. Any ideas welcome.
I have been thinking of making sure the ground/shield on my 485 cable is well grounded to the safety ground in the house, but I am unsure if that is wise.
http://www.sparkfun.com/products/9822 (USB to RS-485)
http://www.sparkfun.com/products/10124 (CMOS logic to RS-485)
I have connected the two together using 30 feet of 2 strand signal wire with foil and wire shield cable. The center wires are used for the A and B. I used the shield for the ground connection.
For the most part, the system works well. But I have two small issues that are driving me nuts.
1) On occasions (~10 times a day), the data coming from the Arduino seems to get corrupted. But the corruption is not overt. Seems like a lost byte not a corrupted byte. Not too worried about this in that I can compensate with checksums and the like. But this may be a symptom of my "real" problem.
2) On occasions (~20 times a day), my Python program barfs trying to determine the number of bytes in the incoming buffer. When this happens, the Linux error log (/var/log/messages) reports the following:
Code: Select all
The USB subsystem seems to close down the port and that kills my Python application. If I wait a few moments I can often restart the program. But sometimes the OS reassigns the USB device to a new device.Oct 29 18:12:17 tux kernel: hub 3-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
Oct 29 18:12:17 tux kernel: usb 3-1: USB disconnect, address 28
Oct 29 18:12:17 tux kernel: ftdi_sio ttyUSB2: FTDI USB Serial Device converter now disconnected from ttyUSB2
Oct 29 18:12:17 tux kernel: ftdi_sio 3-1:1.0: device disconnected
Oct 29 18:12:17 tux python: abrt: detected unhandled Python exception in ./FurnaceMonitor.py
Oct 29 18:12:17 tux kernel: usb 3-1: new full speed USB device using uhci_hcd and address 29
Oct 29 18:12:17 tux kernel: usb 3-1: New USB device found, idVendor=0403, idProduct=6001
Oct 29 18:12:17 tux kernel: usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 29 18:12:17 tux kernel: usb 3-1: Product: FT232R USB UART
Oct 29 18:12:17 tux kernel: usb 3-1: Manufacturer: FTDI
Oct 29 18:12:17 tux kernel: usb 3-1: SerialNumber: A800f8b7
Oct 29 18:12:17 tux kernel: usb 3-1: configuration #1 chosen from 1 choice
Oct 29 18:12:17 tux kernel: ftdi_sio 3-1:1.0: FTDI USB Serial Device converter detected
Oct 29 18:12:17 tux kernel: usb 3-1: Detected FT232RL
Oct 29 18:12:17 tux kernel: usb 3-1: Number of endpoints 2
Oct 29 18:12:17 tux kernel: usb 3-1: Endpoint 1 MaxPacketSize 64
Oct 29 18:12:17 tux kernel: usb 3-1: Endpoint 2 MaxPacketSize 64
Oct 29 18:12:17 tux kernel: usb 3-1: Setting MaxPacketSize 64
Oct 29 18:12:17 tux kernel: usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB2
My goggling finds people who have had this issue with devices that generate lots of static like those vinyl dance pads. My implementation does not seem to have include a large static source, but it might include sparking as the furnace it monitors includes relays. But the monitoring is all done via optical isolators and isolated power supplies for the Arduino.
So I am wondering what I might do differently to suppress noise that somehow is going up the USB cable and nuking the USB device driver on the Linux box. Any ideas welcome.
I have been thinking of making sure the ground/shield on my 485 cable is well grounded to the safety ground in the house, but I am unsure if that is wise.