GPS programming in Python

August 15, 2003 | My Projects | By: Mark VandeWettering


I just recently bought a new laptop, and on a total spur of the moment bought
a Delorme Earthmate GPS to go along with it. It’s a pretty slick little unit that
plugs into the USB port. After playing with Street Atlas 2003 for a few minutes (and getting directed over speedbump after speedbump) I decided to see if I could figure out how to get data from it.

A little quick research showed that there were two drivers for this little toy: a USB one that made it look like an HID device, and a different one that made it look like a serial device that speaks the NMEA 0183 protocol. I don’t know much about the first one, but I have docs on the second from my Garmin
days, so I set to work.

I decided to use the curses module in Python to present a simple interface. It does little more than monitor the messages output from the GPS and display
them in a somewhat neat fashion on the screen. After an hour or so of hacking around, I had the display shown on the right. Not too bad, and can be adapted to my Garmin with minimal work.

There are a few warts: opening serial ports on windows really requires a bit more work to make sure that baud rates are set. Also hot plugging the garmin doesn’t always detect when using the NMEA driver. But overall, not too bad.


Comments

Comment from Anonymous
Time 5/26/2004 at 2:37 am

Fun…
Have you release the code ?
Where did you get the documentation ?

Cordially

Jean CARTIER

Comment from Anonymous
Time 6/5/2004 at 11:34 am

I haven’t as yet released the code. It isn’t that hard to find documentation on
the GPS protocols. Try http://vancouver-webpages.com/peter/ as a good place to start. I’ll try to get around to cleaning up the code, but for now you are on your own. 🙂