1

After days and days of trying to get my Serial to USB to work I am no further forward - I am trying to log NMEA sentences from a GPS Module via USB to Serial.

I have two leads:

Bus 001 Device 010: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

Bus 001 Device 011: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter

and both work on a Windows XP machine, which is frustrating to say the least.

When I try on my Pi I receive garbled text no matter what speed/parity/stopbits I choose. I am using Minicom to see the incoming data.

I have read, and tried solutions therein, many reports on various forums without making any progress. I'm beginning to doubt my sanity!

Does anyone have any idea however bizarre it might seem that might help me? Serial comms is not difficult but I seem to have come up against a brick wall.

  • You have a GPS unit. You have a Pi. You have a lead. Post a photo of the GPS unit connected to the Pi with the lead. The photo(s) should be clear enough to make out the connections and the pins/sockets being used. – joan Oct 3 '15 at 16:13
  • Are there any flow control options being used on the laptop? – bobstro Oct 3 '15 at 18:12
  • The GPS unit attaches to the Pi with a USB to 9 pin D connector, the USBAMA0 is not being used. – RoddyJoff Oct 5 '15 at 11:09
  • There are no flow control options in use. – RoddyJoff Oct 5 '15 at 11:09
1

To debug this, I'd suggest:

  • Verify that loopback works on the USB serial device. To do so, you can physically wire pins 2/3 of a serial port DB-9 connector together and then do:

    echo blah > /dev/ttyUSB0

    and then:

    cat /dev/ttyUSB0

    Note, the actual name of the device may be different than ttyUSB0. By default, you'll likely need to login as root. It may also be that you need to also turn off "echo" for this to work - you can do so with stty -F /dev/ttyUSB0 -echo.

  • If that works, hook up the GPS. You can use cat to dump the output as above. Use stty -F /dev/ttyUSB0 <baudrate> to set the baudrate. Try baudrates: 9600, 19200, 38400, 57600, 115200. It's often the case that you can "guess" if the baudrate is too low/high by the garbledness of data. If it looks very random, with lots of special characters, the baudrate you have set is likely lower than the correct rate. If there are repeating, less random characters, its likely higher.

  • It could be that parity/stop/other bits are off, but look at this as a last resort. Nowadays, 8N1 is nearly universal.

  • Best bet, if you have a scope or logic analyzer, its quite quick and easy to see what the baudrate is - but likely you don't or you probably wouldn't ask. But there are cheap and good logic analyzers out there in the $100 range.

  • The GPS unit is set up as standard as 4800 8N1. I have proved the USB to Serial works by connection TX and RX and whatever I type is returned without any corruption. I have tried every combination of bits/parity/stop in desperation but as it works on the Windows machine I didn't hold out any hope, and nothing worked. I have tried another Pi with the same result. – RoddyJoff Oct 5 '15 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.