Posts: 1
Joined: Thu Apr 25, 2019 9:46 am


Thu Apr 25, 2019 9:55 am

I am trying to read raw NMEA data from a USB GPS device. If I connect to it using:-

Code: Select all

gpsmon /dev/ttyUSB0
I get valid location data, and the serial configuration shows

Code: Select all

/dev/ttyUSB0 4800 8N1   SiRF>

This seems fine, but if I try to connect to the device using putty/miniterm/screen/...... using the same serial parameters (4800 8N1) I get unprintable characters. I have tried every baud rate and none seem to produce readable characters.

Is the output from a typical USB GPS not human readable? I assumed they were standard ASCII but perhaps they are hex or binary strings?

User avatar
Posts: 17
Joined: Thu Apr 25, 2019 9:45 am

Re: USB GPS Speed

Thu Apr 25, 2019 12:50 pm

What is the baud rate of the GPS, is it fixed and mentioned in the datasheet?

User avatar
Posts: 148
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: USB GPS Speed

Thu Apr 25, 2019 1:00 pm

Most, if not all NMEA devices default to 9600, 8 bit, NP.

All NMEA messages (with the exception of images, radar blobs etc) are strictly ASCII, and in most cases human readable messages.

However, all the above is assuming that the device is actually NMEA compliant. A lot of copy/generic/cheapo devices (GPS boards, Sounders, Sensors) are often not strict NMEA. A concern to me is your device is USB based, so therefore using a 'virtual serial port'. Serial ports over USB are challenging, mostly due to the device driver. USB does not actually adjust its 'Baud Rate' aka serial speed, as it maintains its core speed (usually 1,10,100Mbp/s). The 'virtual serial port' is either simulated or encapsulated in the USB protocol.

Anyway to your problem.

Some apps (maybe minterm) connect to the Unix Device driver in a raw format, and what you are seeing is the encapsulated serial protocol. Whereas your pgm gpsmon, is probably 'un-encapsulating (what a lovely word) ' the data stream.

I would approach this problem by first trying to get the source code for gpsmon and understanding how they invoke the system USB driver and process the data stream. Then take this learning to your application. Does the mfg of your GPS modules provide a 'generic driver' ?

As a Plan B', write a script/app that calls gpsmon, and writes the data to a IP Sox Server App, or a file, then your app gets its data from the sox or file. You could also write the data to a RDBMS. Linux/Raspbian has the advantage of being able to run multiple processes at once, and serve these processes data up via IPC. Unlike Arduino apps.
..the only thing worse than a stupid question is a question not asked.

Return to “Automation, sensing and robotics”