Chapter 11. Global Positioning System (GPS)

Table of Contents

GPSD
GpsDrive

GPS, which stands for Global Positioning System, is the only system today able to show you your exact position on the Earth anytime, in any weather, anywhere. GPS satellites, 24 in all, orbit at 11,000 nautical miles above the Earth. They are continuously monitored by ground stations located worldwide. The satellites transmit signals that can be detected by anyone with a GPS receiver. Using the receiver, you can determine your location with great precision.

GPS is one of history's most exciting and revolutionary developments, and new uses for it are constantly being discovered. But before we learn more about GPS, it's important to understand a bit more about navigation. A good GPS reference can be found at: GPS.

The follow sections will explore various ways that GPS navigation can be used with NST.

GPSD

Gpsd is a user land daemon acting as a liason between a gps or Loran-C receiver and clients. This utility program was written by Remco Treffkorn and released under the terms and conditions of the GNU GENERAL PUBLIC LICENSE Version 2, June 1991 by Russell Nelson. The receiver is expected to generate position information as NMEA-0183 sentences, or Rockwell binary format.

Gpsd listens on TCP port: 2947 for clients requesting position, time, velocity or altitude information. It can take information from a GPS receiver and translate it into something easier to understand for clients.

Fritz Ganter, the developer of GpsDrive has extended the original gpsd for use with the GpsDrive application. Additional features for gpsd are shown below in the usage output.

        
[root@probe1 root]# /usr/local/bin/gpsd -h
usage:  gpsd [options]
  options include:
  -D level     [ set debug level. If >= 2, remain in foreground ]
  -L longitude [ set longitude ]
  -l latitude  [ set latitude ]
  -S port      [ set gpsd listening port ]
  -T type      [ set DeLorme models. e = Earthmate, t = Tripmate ]
  -h           [ help message ]
  -p path      [ set gps device pathname ]
  -s baud_rate [ set baud rate on gps device ]
  -c           [ use dgps service for corrections ]
  -d host      [ set dgps server hostname]
  -r port      [ set dgps server port ]
  -n           [ disable setting default values for longitute and latitute ]
  -F filename  [ read input from file ]
  -f seconds   [ delay per input file line in seconds (default=0.2)]
  -K           [ keep gps device open all the time (linux USB workaround) ]
        
      

Below is an example of starting up gpsd on a probe: probe1 using a USB serial device: "/dev/ttyUSB0"

Note

It is a good idea to reset the serial device prior to starting the gpsd application.

         
[root@probe1 root]# /usr/local/bin/reset_serial /dev/ttyUSB0 > /dev/null 2>&1
[root@probe1 root]# /usr/local/bin/gpsd -p /dev/ttyUSB0
         
       

A description of the gpsd protocol can be found at: gpsd. This was written by: Thomas Hargrove. The client for gpsd services does not have to run on the same system. Remote access over a LAN can be used to attach to a gpsd daemon. An example is now shown using the Netcat - (nc) utility to interrogate the gpsd daemon.

Figure 11.1. NetCat - (nc) TCP/IP Network Utility Interrogating the GPSD Daemon

          
[root@probe2 root]# /usr/bin/nc probe1 2947
P
GPSD,P=42.694432 -73.861363
D
GPSD,D=10/08/2003 18:22:26
PAMS
GPSD,P=42.694420 -73.861352,A=101.600000,M=2,S=1
R
GPSD,R=1
$GPGGA,182300,4241.6651,N,07351.6809,W,1,05,1.9,101.9,M,-33.5,M,,*74
$GPGSA,M,2,01,02,,,,,16,20,25,,,,2.1,1.9,1.0*34
$GPGSV,3,2,10,13,18,316,00,14,04,143,00,16,87,198,35,20,27,246,38*73
$PGRME,7.8,M,6.8,M,10.3,M*1D
R$GPRMC,182301,A,4241.6650,N,07351.6809,W,000.0,326.7,081003,014.2,W*73
$GPGGA,182301,4241.6650,N,07351.6809,W,1,05,1.9,101.8,M,-33.5,M,,*75
$GPGSA,M,2,01,02,,,,,16,20,25,,,,2.1,1.9,1.0*34

GPSD,R=0