GPS data : How to Capture it ?


ekianjo

Hardcore Member
Joined
May 7, 2012
Messages
8,261
Location
神戸市、日本 (Japan)
Quick question here. After connecting a GPS to the Pandora via Bluetooth, what is the best way to capture the data of the GPS at regular time intervals without doing anything with it ? (I don't want it to be displayed on any map or anything, I just want the raw data) -> For example, one data point per minute. 

Any idea how to get that data via a bash or python script ? 
 
In Windows, you open it as a COM: device, so I imagine in Linux, you read it from a device, like everything else.

The device will keep streaming strings of comma seperated values IIRC, which will give you the location.

Haven't played with a GPS in a long time, but that's how I remember it
 
Hi,

Once connected, my BT GPS can be accessed via /dev/rfcomm0 .

Then, to get raw data from GPS I type:

$ cat /dev/rfcomm0

If your GPS is NMEA compliant  (most of them are) you should see these sort of lines filling up your terminal:

    $GPRMC,212215.000,A,4553.7413,...
    $GPGGA,212216.000,4553.7425,N,006...
    $GPGSA,A,3,31,11,23,32,,,,,,,,,5.7,3.7,4.2*30...
 
Of course. You just need to know the NMEA specification tells you and what your "other application" requires in. Providing the data is available from one (or can be calculated by the other data provided), you can translate and send it across
 
You could use gpsdecode .

this commandline tool comes with Gpsd package

See http://pandorawiki.org/GPS .

gpsdecode can convert raw data to JSON ouput. So you could write a simple shell/python script to extract some useful data (coordinates, altitude, etc).
 
It should be registered into /etc/bluetooth/rfcomm.conf

This is a simple text file where you can declare your GPS.

Mine looks like that:

rfcomm0 {
bind no;
device xx:xx:xx:xx:xx:xx;
channel 1;
comment “GPS”;
}

So the device name is /dev/rfcomm0 .

May be it's slighty different on your side...
 
Back
Top