When I connect my detector to a laptop with a USB to RS-232 adapter without any extra cabling, the detector works fine. A Python program on the PC logs all the bytes sent and they all match what they should be.
If I add in 30 feet of cable it still works fine.
If I connect it to a much faster desktop PC running Fedora Core 12, running the same Python program using the exact same (30′) cabling, most 0x05 bytes get logged as 0x00. Many other bytes seem to get logged just fine. The results are the same if I use the USB-RS232 converter or a native RS-232 port on the PC.
So what was going to be a simple fix has turned into a three day marathon of making cables, moving computer, and a gazillion other tests. I am now at a loss.
At first I figured that the cabling I had to the desktop must have been poor or running past an EMI source. I have discounted that by using the same cables in the same path.
I figured that the baud rate was off a bit and would work on one machine but not the other. But this seems very unlikely as the same USB-RS232 converter (that would be sensitive to a baud rate problem) on different machines behaves differently. The problem is following the Linux PC not the Windows laptop.
I also figured that perhaps the Sparkfun level converters did not have enough drive for a long-ish cable. But the system works with the same 30 feet on the laptop.
So I am down the a problem on the Linux box. A quick search on the web for RS-232 issues on Linux Fedora Core 12 has drawn a blank. This same box drives a DVD burning robot over RS-232 at the same baud rate and I have never had a hipcup from it.
Tried a third computer (desktop Windows with same converter as the other computers) and it demonstrated the 0x5 bytes converted to 0x00. So what is magical about my old beater laptop? What is magical about 0x05 other than alternating bits? Tomorrow I will bring home an RS-232 serial protocol analyzer that may shed some light on this. I had hoped to solve this tonight as tomorrow we are due for a line of thunderstorms I could have finalized my testing on.
Any ideas for further tests?