Reference ID: GPS
Driver ID: GPS_NMEA
Serial Port: /dev/gpsu; 4800 - 115200 bps, 8-bits, no parity
Serial Port: /dev/gpsppsu; for just the PPS signal (this is tried first for PPS, before /dev/gpsu)
Serial Port: /dev/gpsu; symlink to server:port (for nmead)
This driver supports GPS receivers with the $GPRMC, $GPGLL, $GPGGA, $GPZDA and $GPZDG NMEA sentences by default. Note that Accord's custom NMEA sentence $GPZDG reports using the GPS timescale, while the rest of the sentences report UTC. The difference between the two is a whole number of seconds which increases with each leap second insertion in UTC. To avoid problems mixing UTC and GPS timescales, the driver disables processing of UTC sentences once $GPZDG is received.
The driver expects the receiver to be set up to transmit at least one supported sentence every second.
The accuracy depends on the receiver used. Inexpensive GPS models are available with a claimed PPS signal accuracy of 1 μs or better relative to the broadcast signal. However, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.
If the Operating System supports PPSAPI (RFC 2783), fudge flag1 1 enables its use.
The various GPS sentences that this driver recognises look like this:
(others quietly ignored)
|Symbol||Meaning and Format|
|UTC||Time of day on UTC timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.fff])|
|POS_STAT||Position status. (A = Data valid, V = Data invalid)|
|LAT_REF||Latitude direction. (N = North, S = South)|
|LON_REF||Longitude direction (E = East, W = West)|
|SPD||Speed over ground. (knots) (x.x)|
|HDG||Heading/track made good (degrees True) (x.x)|
|MAG_VAR||Magnetic variation (degrees) (x.x)|
|MAG_REF||Magnetic variation (E = East, W = West)|
|FIX_MODE||Position Fix Mode (0 = Invalid, >0 = Valid)|
|SAT_USED||Number of Satellites used in solution|
|HDOP||Horizontal Dilution of Precision|
|ALT_UNIT||Altitude Units (Metres/Feet)|
|G_UNIT||Geoid units (M/F)|
|D_AGE||Age of last DGPS Fix|
|D_REF||Reference ID of DGPS station|
|GPSTIME||Time of day on GPS timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.f])|
|DD||Day of the month (1-31)|
|MM||Month of the year (1-12)|
|AA.BB||Denotes the signal strength (should be < 05.00)|
|V||GPS sync status
'0' => INVALID time,
'1' => accuracy of +/- 20ms,
'2' => accuracy of +/- 100ns
Specific GPS sentences and bitrates may be selected by setting bits of
the 'mode' in the server configuration line:
server 127.127.20.x mode X
|3||8||process $GPZDA or $GPZDG|
|4-6||0||linespeed 4800 bps|
|16||linespeed 9600 bps|
|32||linespeed 19200 bps|
|48||linespeed 38400 bps|
|64||linespeed 57600 bps|
|80||linespeed 115200 bps|
|7||128||Write the sub-second fraction of the receive time stamp to the
clockstat file for all recognised NMEA sentences. This can be used to
get a useful value for fudge time2.
Caveat: This will fill your clockstat file rather fast. Use it only temporarily to get the numbers for the NMEA sentence of your choice.
The default (mode 0) is to process all supported sentences at a linespeed of 4800 bps, which results in the first one received and recognised in each cycle being used. If only specific sentences should be recognised, then the mode byte must be chosen to enable only the selected ones. Multiple sentences may be selected by adding their mode bit values, but of those enabled still only the first received sentence in a cycle will be used. Using more than one sentence per cycle is impossible, because
Caveat: Using higher line speeds does not necessarily increase the precision of the timing device. Higher line speeds are not necessarily helpful for the NMEA driver, either. They can be used to accomodate for an amount of data that does not fit into a 1-second cycle at 4800 bps, but high-speed high-volume NMEA data is likely to cause trouble with the serial line driver since NMEA supports no protocol handshake. Any device that is exclusively used for time synchronisation purposes should be configured to transmit the relevant data only, e.g. one $GPRMC or $GPZDA per second, at a linespeed of 4800 bps or 9600 bps.
Configuring NMEA Refclocks might give further useful hints for specific hardware devices that exhibit strange or curious behaviour.
To make a specific setting, select the corresponding decimal values from the mode byte table, add them all together and enter the resulting decimal value into the clock configuration line.
Now switch only $GPRMC on by sending it the following string.
On some systems the PPS signal isn't switched on by default. It can be switched on by sending the following string.
The GPS sentence that is used is written to the clockstats file and available with ntpq -c clockvar.
Reference Clock Drivers