Getting GPS console output with gllin

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(catchg)
 
(25 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This article describes the "quick start" procedure allowing to see the first output and actually use the GPS device in the command line mode, using the [[gllin]] driver.
+
[[gllin]] is the driver used to access GPS data in the Neo 1973. If you have a FreeRunner you don't need to look at this page.
  
After you download, scp and install the gllin_1.0+r350-r0_fic-gta01.ipk (or similar), it creates the folder 'gllin' in the root home. This folder contains the executable with the same name which starts the driver.
+
== How to see gllin output ==
 +
 
 +
This page describes the "quick start" procedure allowing to see the first output and actually use the GPS device in the command line mode, using the [[gllin]] driver.
 +
 
 +
After you download and install the gllin_1.0+r350-r0_fic-gta01.ipk (or similar), it creates the folder 'gllin' in the root home. This folder contains the executable with the same name which starts the driver.
  
 
To get the output of this driver, read the file /tmp/nmeaNP (it is actually a pipe, not a file). The simplest way is to open another ssh connection to the phone and use cat:
 
To get the output of this driver, read the file /tmp/nmeaNP (it is actually a pipe, not a file). The simplest way is to open another ssh connection to the phone and use cat:
Line 11: Line 15:
 
  (and so on).  
 
  (and so on).  
  
The data are presented in [http://gpsinformation.org/dale/nmea.htm NMEA format] which gives a lot of data. The coordinates themselves are reported with the two messages that are described below. Both messages occur in the normal output (also in conditions when the the device does not see any satellites and cannot give actually report the coordinates). They consist of multiple comma separated fields. Even numeric fields like coordinates under some circumstances are empty. Empty fields are easy to recognize because commas are included anyway.
+
The data are presented in [http://gpsinformation.org/dale/nmea.htm NMEA format] which gives a lot of data. The coordinates themselves are reported with the two messages (GPRMC and GPGGA) that are described below. Both messages occur in the normal output (also in conditions when the the device does not see any satellites and cannot give actually report the coordinates). They consist of multiple comma separated fields. Even numeric fields like coordinates under some circumstances are empty. Empty fields are easy to recognize because commas are included anyway.
 +
 
 +
Below we discuss both messages, giving the real examples that were taken in  surroundings of Zurich (official coordinates 47°22′N, 8°33′E with approximate elevation about 408 m) early morning (about 6:44 UTC), in the 8th of January 2008.
  
 
== GPRMC message ==
 
== GPRMC message ==
 
GPRMC tels the latitude, longitude, speed, time and date. Hence the proper signal could also be used to set up the clock. If the device can see the satellites, the message looks like
 
GPRMC tels the latitude, longitude, speed, time and date. Hence the proper signal could also be used to set up the clock. If the device can see the satellites, the message looks like
  
$GPRMC,143812,A,4301.028,N,01232.000,E,020.0,083.4,240307,003.2,W*6A
+
GPRMC,064459.00,A,4723.078551,N,00831.004788,E,000.0,000.0,080108,,,A*50
  
 
Where:
 
Where:
*'''143812'''       Fix taken at 14:38:12 UTC
+
*'''064459.00'''   Fix taken at 6:44:59.00 UTC (early morning)
 
*'''A'''            '''A''' for the normal (active) message or '''V''' for the void message. Void messages are described below.
 
*'''A'''            '''A''' for the normal (active) message or '''V''' for the void message. Void messages are described below.
*'''4301.028,N'''  Latitude 43 deg 01.028' N
+
*'''4723.078551,N'''  Latitude 47 degrees 23.078551 minutes North.
*'''01232.000,E'''  Longitude 12 deg 32.000' E
+
*'''00831.004788,E'''  Longitude 8 degrees 31.004788 minutes East
*'''020.0'''        Ground speed in knots
+
*'''000.0'''        Ground speed in knots (we are just standing in place). Multiply by 1.852 to get kilometers per hour.
*'''083.4'''        Track angle in degrees True
+
*'''000.0'''        Track angle in degrees
*'''240307'''      Date - 24rd of March 2007
+
*'''080108'''      Date - 8th of January 2008 (year goes last, 240307 is 24th of March 2007)
*'''003.2,W'''      Magnetic variation
+
*'''(empty)'''      Would be magnetic variation
*'''<nowiki>*</nowiki>6A'''          The checksum, begins with *
+
*'''<nowiki>*</nowiki>50'''          The checksum, begins with *
  
 
If the device cannot see the satellites properly (it usually does not work indoors unless very close to the window), it puts 'V' (void) at the output. In this case the GPRMC messages look like
 
If the device cannot see the satellites properly (it usually does not work indoors unless very close to the window), it puts 'V' (void) at the output. In this case the GPRMC messages look like
GPRMC,114031.52,V,,,,,,,120108,,,N*76
+
 
 +
GPRMC,114031.52,V,,,,,,,120108,,,N*76
  
 
In this case it is necessary to go to the more open place. It may take several minutes before device reports the correct location.
 
In this case it is necessary to go to the more open place. It may take several minutes before device reports the correct location.
  
 
== GPGGA message ==
 
== GPGGA message ==
This message does not tell the speed but it tells the number of satellites, estimates the quality and gives the latitude. The message looks like
+
This message does not tell the speed but it tells the number of satellites, estimates the quality and gives the altitude. The message looks like  
$GPGGA,133515,4407.048,N,01131.000,E,1,07,0.9,544.4,M,44.4,M,,*47
+
 
 +
GPGGA,064458.00,4723.078480,N,00831.004426,E,1,06,1.0,464.0,M,0.271000,M,0.0100505,*42
 +
 
 +
Here
 +
*'''064458.00'''    Current time is 06:44:54 UTC (the test was done early morning)
 +
*'''4723.078480,N'''  Latitude 47 degrees 23.078480 seconds North
 +
*'''00831.004426'''  Longitude 8 deg 31.004426 seconds East
 +
*'''1'''            Fix quality: 0 = invalid, 1 = GPS fix (SPS),                              2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinematic, 5 = Float RTK,                              6 = estimated, 7 = manual input, 8 = simulation mode
 +
*'''06'''          Number of satellites being tracked (six are seen)
 +
*'''1.0'''          Horizontal dilution of position
 +
*'''464.0,M'''      Altitude (in meters) above mean sea level.
 +
*'''0.271000, M'''      Height of geoid (mean sea level) above WGS84 ellipsoid
 +
*'''0.0100505''' time in seconds since last DGPS update
 +
* Following the spec, next should go the  DGPS station ID number but seems missing.
 +
* '''<nowiki>*</nowiki>42''' the checksum, always begins with *
 +
 
 +
If the device cannot see the satellites properly it reports the zero quality. The number of satellites can also be checked. For instance, the device indoors may report:
 +
 
 +
GPGGA,120213.58,,,,,00,00,1.0,,M,0.0001999,M,0.0020599,*56
 +
 
 +
Which means that the UTM time is 12:02:13.58 (correct), the quality is 0 and no any satellites can be seen. This explains why the coordinate fields are empty.
  
*133515      Fix taken at 13:35:15 UTC
+
== Using grep ==
*4407.048,N  Latitude 44 deg 07.048' N
+
The trivial way to concentrate on one type of the GPS messages is to use grep which is installed in the phone:
*01431.400,E  Longitude 14 deg 31.040' E
+
cat /tmp/nmeaNP | grep GPRMC
*1            Fix quality: 0 = invalid, 1 = GPS fix (SPS),                              2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinematic, 5 = Float RTK,                              6 = estimated, 7 = manual input, 8 = simulation mode
+
*07          Number of satellites being tracked
+
*0.8          Horizontal dilution of position
+
*544.4,M      Altitude, Meters, above mean sea level
+
* 44.4,M      Height of geoid (mean sea level) above WGS84
+
                      ellipsoid
+
*    (empty field) time in seconds since last DGPS update
+
*    (empty field) DGPS station ID number
+
* '''<nowiki>*</nowiki>47 the checksum, always begins with *
+
  
If the device cannot see the satellites properly it reports the zero quality. The number of satellites can also be checked. For instance, the device on the writers desk (indoors) is currently reporting a rather sad story:
+
From other interesting messages, device emits GPGSV (detailed information about satellites and where they are in the sky). See [http://gpsinformation.org/dale/nmea.htm NMEA documenation] for details.
  
  GPGGA,120213.58,,,,,00,00,1.0,,M,0.0001999,M,0.0020599,*56
+
== Using awk ==
 +
The awk tool provides some more elegant parsing capabilities. For example, find your current location with
 +
awk -F, '/\$GPGGA/ {print (substr($3,0,2) + (substr($3,3) / 60.0)) $4, (substr($5,0,3) + (substr($5,4) / 60.0)) $6}' /tmp/nmeaNP
  
Which means that the UTM time is 12:02:13.58 (correct), the quality is 0 and 0 satellites can be seen. This explains why the coordinate fields are empty.
 
 
[[Category:GPS]]
 
[[Category:GPS]]

Latest revision as of 08:14, 19 July 2009

gllin is the driver used to access GPS data in the Neo 1973. If you have a FreeRunner you don't need to look at this page.

Contents

[edit] How to see gllin output

This page describes the "quick start" procedure allowing to see the first output and actually use the GPS device in the command line mode, using the gllin driver.

After you download and install the gllin_1.0+r350-r0_fic-gta01.ipk (or similar), it creates the folder 'gllin' in the root home. This folder contains the executable with the same name which starts the driver.

To get the output of this driver, read the file /tmp/nmeaNP (it is actually a pipe, not a file). The simplest way is to open another ssh connection to the phone and use cat:

cat /tmp/nmeaNP

Type cat after you start the gllin, not before. The output from the GPS driver looks like

$GPRMC,235946.99,V,,,,,,,120180,,,N*78
$GPGSA,A,1,,,,,,,,,,,,,11.2,5.0,10.0*36
$GPGGA,235946.99,,,,,00,00,5.0,,M,0.0001999,M,0.0020199,*57
(and so on). 

The data are presented in NMEA format which gives a lot of data. The coordinates themselves are reported with the two messages (GPRMC and GPGGA) that are described below. Both messages occur in the normal output (also in conditions when the the device does not see any satellites and cannot give actually report the coordinates). They consist of multiple comma separated fields. Even numeric fields like coordinates under some circumstances are empty. Empty fields are easy to recognize because commas are included anyway.

Below we discuss both messages, giving the real examples that were taken in surroundings of Zurich (official coordinates 47°22′N, 8°33′E with approximate elevation about 408 m) early morning (about 6:44 UTC), in the 8th of January 2008.

[edit] GPRMC message

GPRMC tels the latitude, longitude, speed, time and date. Hence the proper signal could also be used to set up the clock. If the device can see the satellites, the message looks like

GPRMC,064459.00,A,4723.078551,N,00831.004788,E,000.0,000.0,080108,,,A*50

Where:

  • 064459.00 Fix taken at 6:44:59.00 UTC (early morning)
  • A A for the normal (active) message or V for the void message. Void messages are described below.
  • 4723.078551,N Latitude 47 degrees 23.078551 minutes North.
  • 00831.004788,E Longitude 8 degrees 31.004788 minutes East
  • 000.0 Ground speed in knots (we are just standing in place). Multiply by 1.852 to get kilometers per hour.
  • 000.0 Track angle in degrees
  • 080108 Date - 8th of January 2008 (year goes last, 240307 is 24th of March 2007)
  • (empty) Would be magnetic variation
  • *50 The checksum, begins with *

If the device cannot see the satellites properly (it usually does not work indoors unless very close to the window), it puts 'V' (void) at the output. In this case the GPRMC messages look like

GPRMC,114031.52,V,,,,,,,120108,,,N*76

In this case it is necessary to go to the more open place. It may take several minutes before device reports the correct location.

[edit] GPGGA message

This message does not tell the speed but it tells the number of satellites, estimates the quality and gives the altitude. The message looks like

GPGGA,064458.00,4723.078480,N,00831.004426,E,1,06,1.0,464.0,M,0.271000,M,0.0100505,*42

Here

  • 064458.00 Current time is 06:44:54 UTC (the test was done early morning)
  • 4723.078480,N Latitude 47 degrees 23.078480 seconds North
  • 00831.004426 Longitude 8 deg 31.004426 seconds East
  • 1 Fix quality: 0 = invalid, 1 = GPS fix (SPS), 2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinematic, 5 = Float RTK, 6 = estimated, 7 = manual input, 8 = simulation mode
  • 06 Number of satellites being tracked (six are seen)
  • 1.0 Horizontal dilution of position
  • 464.0,M Altitude (in meters) above mean sea level.
  • 0.271000, M Height of geoid (mean sea level) above WGS84 ellipsoid
  • 0.0100505 time in seconds since last DGPS update
  • Following the spec, next should go the DGPS station ID number but seems missing.
  • *42 the checksum, always begins with *

If the device cannot see the satellites properly it reports the zero quality. The number of satellites can also be checked. For instance, the device indoors may report:

GPGGA,120213.58,,,,,00,00,1.0,,M,0.0001999,M,0.0020599,*56

Which means that the UTM time is 12:02:13.58 (correct), the quality is 0 and no any satellites can be seen. This explains why the coordinate fields are empty.

[edit] Using grep

The trivial way to concentrate on one type of the GPS messages is to use grep which is installed in the phone:

cat /tmp/nmeaNP | grep GPRMC

From other interesting messages, device emits GPGSV (detailed information about satellites and where they are in the sky). See NMEA documenation for details.

[edit] Using awk

The awk tool provides some more elegant parsing capabilities. For example, find your current location with

awk -F, '/\$GPGGA/ {print (substr($3,0,2) + (substr($3,3) / 60.0)) $4,  (substr($5,0,3) + (substr($5,4) / 60.0)) $6}' /tmp/nmeaNP
Personal tools

This article describes the "quick start" procedure allowing to see the first output and actually use the GPS device in the command line mode, using the gllin driver.

After you download, scp and install the gllin_1.0+r350-r0_fic-gta01.ipk (or similar), it creates the folder 'gllin' in the root home. This folder contains the executable with the same name which starts the driver.

To get the output of this driver, read the file /tmp/nmeaNP (it is actually a pipe, not a file). The simplest way is to open another ssh connection to the phone and use cat:

cat /tmp/nmeaNP

Type cat after you start the gllin, not before. The output from the GPS driver looks like

$GPRMC,235946.99,V,,,,,,,120180,,,N*78
$GPGSA,A,1,,,,,,,,,,,,,11.2,5.0,10.0*36
$GPGGA,235946.99,,,,,00,00,5.0,,M,0.0001999,M,0.0020199,*57
(and so on). 

The data are presented in NMEA format which gives a lot of data. The coordinates themselves are reported with the two messages that are described below. Both messages occur in the normal output (also in conditions when the the device does not see any satellites and cannot give actually report the coordinates). They consist of multiple comma separated fields. Even numeric fields like coordinates under some circumstances are empty. Empty fields are easy to recognize because commas are included anyway.

GPRMC message

GPRMC tels the latitude, longitude, speed, time and date. Hence the proper signal could also be used to set up the clock. If the device can see the satellites, the message looks like

$GPRMC,143812,A,4301.028,N,01232.000,E,020.0,083.4,240307,003.2,W*6A

Where:

  • 143812 Fix taken at 14:38:12 UTC
  • A A for the normal (active) message or V for the void message. Void messages are described below.
  • 4301.028,N Latitude 43 deg 01.028' N
  • 01232.000,E Longitude 12 deg 32.000' E
  • 020.0 Ground speed in knots
  • 083.4 Track angle in degrees True
  • 240307 Date - 24rd of March 2007
  • 003.2,W Magnetic variation
  • *6A The checksum, begins with *

If the device cannot see the satellites properly (it usually does not work indoors unless very close to the window), it puts 'V' (void) at the output. In this case the GPRMC messages look like

GPRMC,114031.52,V,,,,,,,120108,,,N*76

In this case it is necessary to go to the more open place. It may take several minutes before device reports the correct location.

GPGGA message

This message does not tell the speed but it tells the number of satellites, estimates the quality and gives the latitude. The message looks like

$GPGGA,133515,4407.048,N,01131.000,E,1,07,0.9,544.4,M,44.4,M,,*47
  • 133515 Fix taken at 13:35:15 UTC
  • 4407.048,N Latitude 44 deg 07.048' N
  • 01431.400,E Longitude 14 deg 31.040' E
  • 1 Fix quality: 0 = invalid, 1 = GPS fix (SPS), 2 = DGPS fix, 3 = PPS fix, 4 = Real Time Kinematic, 5 = Float RTK, 6 = estimated, 7 = manual input, 8 = simulation mode
  • 07 Number of satellites being tracked
  • 0.8 Horizontal dilution of position
  • 544.4,M Altitude, Meters, above mean sea level
  • 44.4,M Height of geoid (mean sea level) above WGS84
                     ellipsoid
  • (empty field) time in seconds since last DGPS update
  • (empty field) DGPS station ID number
  • *47 the checksum, always begins with *

If the device cannot see the satellites properly it reports the zero quality. The number of satellites can also be checked. For instance, the device on the writers desk (indoors) is currently reporting a rather sad story:

GPGGA,120213.58,,,,,00,00,1.0,,M,0.0001999,M,0.0020599,*56

Which means that the UTM time is 12:02:13.58 (correct), the quality is 0 and 0 satellites can be seen. This explains why the coordinate fields are empty.