Friday, February 22, 2008

Playing with Freedom Keychain GPS 2000 on Gutsy Gibbon - Part 2

Well, the first though that struck me, was ah ha! why not Google Earth. Got me self a subscription to Google Earth plus only to be disappointed - it cannot talk to gpsd. Canceled my subscription. But, don't loose heart. Download the gegpsd.py and gps.kml from here.

rfcomm connect 4
gpsd -n /dev/rfcomm4

gedit gegpsd.py
gps = serial.Serial('/dev/rfcomm4', 4800, timeout=1)
python gegpsd.py
./googleearth
In google earth open > gps.kml


What this does is this - it reads the NMEA formated string and generates the KML (Keyhole Markup Language) formated file called. /tmp/nmea.kml, which is then read by google earth at 1 second intervals.

As a side note, remember to make sure you don't have xgps running simultaneously with this script. I guess since both of them read from the same device at the same time, it causes the python script to fail as it tries to parse the partial NMEA strings at times (parts of the string may have been read from the buffer by xgps).

Okie dokey so far so good.

I have been talking about this NMEA string. If you like you can use the python script to make your own script to peek at the NMEA string that is sent by your device. Here is what it looks like

$GPGGA,081445.000,1829.8610,N,07354.3305,E,1,6,1.38,621.6,M,-64.8,M,,*75
$GPRMC,081445.000,A,1829.8610,N,07354.3305,E,0.21,78.40,230208,,,A*5C
$GPGGA,081446.000,1829.8606,N,07354.3310,E,1,6,1.38,621.6,M,-64.8,M,,*75
$GPRMC,081446.000,A,1829.8606,N,07354.3310,E,0.21,78.40,230208,,,A*5C
$GPGGA,081447.000,1829.8603,N,07354.3313,E,1,6,1.38,621.6,M,-64.8,M,,*72


excerpt from Wiki
"NMEA 0183 (or NMEA for short) is a combined electrical and data specification for communication between marine electronic devices such as echo sounder, sonars, Anemometer (winds speed and direction), gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined by, and is controlled by, the US-based National Marine Electronics Association."

cool isn't it?

REF -
http://en.wikipedia.org/wiki/NMEA_0183
http://www2.warwick.ac.uk/fac/sci/csc/people/computingstaff/jaroslaw_zachwieja/gegpsd/.

No comments: