NAME
gpsfs, gpsevermore – GPS time and position service

SYNOPSIS
aux/gpsfs [ –d device ] [ –b baud ] [ –s srvname ] [ –m mntpt ]

aux/gpsevermore [ –d device ] [ –b baud ] [ –n baud ] [ –l location ]

DESCRIPTION
Aux/gpsfs reads an NMEA–compatible serial GPS (Global Positioning System) device and provides time and position through a file system, by default mounted on /mnt and implementing /mnt/gps.

It implements four files in the gps directory: position, time, satellites, and raw.

The read–only position file contains one line of information in 9 tab–separated fields:
fix quality       0 means position data invalid, 1 means a 2D position is available, 2 means a 3D position is available. The value is 8, 9, or 10, respectively, when the fix data comes from a file rather than an actual GPS.
zulu time        universal coordinated time encoded as hhmmss followed by the character 'Z'.
system time      time and date converted to the format of time(2).
longitude        in degrees, east of Greenwich is positive, west negative.
latitude         in degrees, positive is north, negative south of the equator.
altitude         above sea level, in meters.
course          degrees, clockwise from true north.
ground speed     in km/h
magnetic deviation(not provided by all GPSs), in degrees, positive is westerly, negative easterly.

The read–only time file contains one line of information in 4 tab–separated fields:
gps time    in time(2) format.
gps time    in nsec (see time(2)) format (ms accuracy).
system timein nsec format. This is the system time at the time of the gps time sample. The difference between this and the previous field is used in clock synchronization. See timesync(8).
validity     the character A meaning sample valid and usable for clock synchronization. The other values are not usable for clock sync: B means valid sample from file playback, V means invalid sample, and W means invalid playback sample.

The read–only satellites file contains information about the current satellite constellation. It consists of one line of general information, followed by zero or more lines, one for each satellite in use. The first line contains two fields:
fix quality      same as in the position file.
satellites in viewnumber of satellites above the horizon

Subsequent lines have four fields:
prn     satellite ID
elevationabove the horizon, degrees.
azimuth   direction, degrees from true north
snr     Signal to noise ratio, 0 – 99 dB

The contents of these files are refreshed once per second when reading from an actual GPS, and once per 100 ms (giving a speed up of a factor 10) when playing back from file.

The read–only raw file can be read to obtain a copy of the raw NMEA GPS output. Gpsfs keeps an internal buffer of 8KB, so the reader must keep up with the output (typically 500 or so bytes per second).

The –d flag establishes the device the GPS samples are read from. If the device file is not a serial interface, gpsfs assumes playback from file and modifies quality parameters as such.

The –b flag specifies the baud rate of the serial line. The standard baud rate for NMEA GPS is 4800 baud, but many device allow changing to higher speeds.

The –s flag specifies the name under which the gpsfs service is posted in /srv.

The –m flag specifies a mount other than /mnt.

Evermore
Aux/gpsevermore is used to configure GPSs using an Evermore chipset.

The –d flag specifies the serial device to the GPS.

The –b flag specifies the baud rate of the serial line. The standard baud rate for NMEA GPS is 4800 baud, but many device allow changing to higher speeds.

The –n flag specifies the speed to set the GPS to. When the command finishes, the GPS should be read (and configured) at the new speed.

The –l flag is sued to specify the location to initialize the GPS to. The format is dd:mm:ssX or dd:mm.mmmX or dd.dddX, where dd stands for degrees (one or more digits), mm for minutes and ss for seconds of arc. X is one of W, E, N or S. Longitudes come with W or E, latitudes with N or S. The –l flag is followed by two such fields, one for longitude, one for latitude. They may be given in a single argument (separated by white space), or in two arguments, in either order. Initialization time is taken from time(2).

SEE ALSO
timesync(8), time(2)

FILES
/mnt/gps/position     position, time, speed and heading
/mnt/gps/satellites   satellites in view
/mnt/gps/time         GPS time (millisecond accuracy)
/dev/eia0            default GPS device

SOURCE
/sys/src/cmd/aux/gps