Saturday, August 23, 2014

Debugging GPS Units

I’m working to build a WarPi (see other blog posts on this effort). To get that project going, here’s what I did:

  1. First, I found an old Streets & Trips GPS unit – yah! No cost, baby…
  2. I proved it worked on my Mint box (see my blog post about it)
  3. Then I connected it to my PI and did the same thing – using Minicom, I proved it worked on the Pi
  4. Then I started the install steps to get the WarPi configured, including installing GPSD.

It was here that things fell apart. Once GPSD was installed, I ran the GPSD client to check that the GPS worked correctly – all I got was garbled text. Everything I read said garbled text is a symptom of baud rate connection issues, but I knew I had it right: 4800 7E1. Over and over I troubleshooted stuff. It didn’t matter what com settings I specified, I still got garbage.

Finally I ran across this article that indicates gpsd puts the GPS into binary mode—which explains the garbage!

Troubleshooting Tips: Important Commands

Kill GPSD: my Pi keeps flipping to British keyboard and I can’t find the pipe symbol ( | ), so it’s difficult to find GPSD’s PID. Here’s a tip for another way to kill the process:

  1. ps –C gpsd –fww is used to get the PID for gpsd
  2. sudo kill <PID> will kill gpsd

GPSCTL – controlling your GPS

In this article, I figured out how I got into binary mode (scroll to the bottom). It also lists how to get out of binary mode, which works intermittently for me, at best.

sudo gpsctl –f –n –s 4800 /dev/ttyUSB0 should reset the Pharos GPS-360 device to NMEA mode. But it doesn’t work for me.

GPSD Debug Mode

This article on setting up GPSD was helpful for putting GPSD output on the screen. The command

gpsd -D 5 -N -n /dev/ttyUSB0

should get you going.



Conclusion


For some reason, my GPS unit won’t honor the command to switch back to NMEA mode. All is not lost, however – if you let a GPS sit unpowered for 3 days, it reverts on its own. After waiting the 3 days I plugged my GPS unit back in and saw that it was in NMEA mode. It now has a second issue – it’s no longer communicating successfully with satellites (the “validity” bit is set to “V” which—while you’d think means ‘valid’—actually means there is a warning. The NMEA string contains bad data.


I understand these old Streets and Trips USB devices can take 30-45 min to pick up enough satellites the first time, so I’m letting it sit and burn electrons.


The ultimate goal here is to feed GPS data to Kismet, which can be done via gpsd or Kismet can read NMEA strings directly, so I think I’ll uninstall GPSD, let the GPS sit for a few days, then configure Kismet to read the NMEA string off serial. I also intend to invest in a modern USB GPS unit—I need something that’s robust, and my old device… just isn’t.

No comments:

Post a Comment