driver20.html   [plain text]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


		<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
		<title>Generic NMEA GPS Receiver</title>
		<link href="scripts/style.css" type="text/css" rel="stylesheet">

		<h3>Generic NMEA GPS Receiver</h3>
		<p>Address: 127.127.20.<i>u</i><br>
			Reference ID: <tt>GPS</tt><br>
			Driver ID: <tt>GPS_NMEA</tt><br>
			Serial Port: <tt>/dev/gps<i>u</i></tt>; 4800 - 115200 bps, 8-bits, no parity<br>
			Serial Port: <tt>/dev/gpspps<i>u</i></tt>; for just the PPS signal (this is tried first for PPS, before <tt>/dev/gps<i>u</i></tt>)<br>
			Serial Port: <tt>/dev/gps<i>u</i></tt>; symlink to server:port (for nmead) Features: <tt>tty_clk</tt></p>
		<p>This driver supports GPS receivers with the <tt>$GPRMC, $GPGLL, $GPGGA, $GPZDA, and $GPZDG</tt> NMEA sentences by default.&nbsp; Note that Accord's custom NMEA sentence <tt>$GPZDG</tt> reports using the GPS timescale, while the rest of the sentences report UTC.&nbsp; The difference between the two is a whole number of seconds which increases with each leap second insertion in UTC.&nbsp; To avoid problems mixing UTC and GPS timescales, the driver disables processing of UTC sentences once <tt>$GPZDG</tt> is received.</p>
		<p>The driver expects the receiver to be set up to transmit at least one supported sentence every second.</p>
		<p>The accuracy depends on the receiver used. Inexpensive GPS models are available with a claimed PPS signal accuracy of 1 <font face="Symbol">m</font>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.</p>
		<p>If the Operating System supports PPSAPI (<a href="">RFC 2783</a>), fudge flag1 1 enables its use.<br>&nbsp;</p>
		<p>The various GPS sentences that this driver recognises look like this:<br>
			(others quietly ignored)</p>

&nbsp; UTC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Time of day on UTC timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.fff])
&nbsp; POS_STAT - Position status. (A = Data valid, V = Data invalid)
&nbsp; LAT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Latitude (llll.ll)
&nbsp; LAT_REF&nbsp; - Latitude direction. (N = North, S = South)
&nbsp; LON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Longitude (yyyyy.yy)
&nbsp; LON_REF&nbsp; - Longitude direction (E = East, W = West)
&nbsp; SPD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Speed over ground. (knots) (x.x)
&nbsp; HDG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Heading/track made good (degrees True) (x.x)
&nbsp; DATE&nbsp;&nbsp;&nbsp;&nbsp; - Date (ddmmyy)
&nbsp; MAG_VAR&nbsp; - Magnetic variation (degrees) (x.x)
&nbsp; MAG_REF&nbsp; - Magnetic variation (E = East, W = West)
&nbsp; FIX_MODE - Position Fix Mode (0 = Invalid, &gt;0 = Valid)
&nbsp; SAT_USED - Number Satellites used in solution
&nbsp; HDOP&nbsp;&nbsp;&nbsp;&nbsp; - Horizontal Dilution of Precision
&nbsp; ALT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Antenna Altitude
&nbsp; ALT_UNIT - Altitude Units (Metres/Feet)
&nbsp; GEO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Geoid/Elipsoid separation
&nbsp; G_UNIT&nbsp;&nbsp; - Geoid units (M/F)
&nbsp; D_AGE&nbsp;&nbsp;&nbsp; - Age of last DGPS Fix
&nbsp; D_REF&nbsp;&nbsp;&nbsp; - Reference ID of DGPS station
&nbsp; GPSTIME&nbsp; - Time of day on GPS timescale. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.f])
&nbsp; DD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Day of the month (1-31)
&nbsp; MM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Month of the year (1-12)
&nbsp; YYYY&nbsp;&nbsp;&nbsp;&nbsp; - Year
&nbsp; AA.BB&nbsp;&nbsp;&nbsp; - Denotes the signal strength (should be &lt 05.00)
&nbsp; V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - GPS sync status
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '0' =&gt INVALID time,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '1' =&gt accuracy of +/- 20ms,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '2' =&gt accuracy of +/- 100ns	
&nbsp; CS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Checksum
&nbsp; &lt;cr&gt;&lt;lf&gt; - Sentence terminator.</tt></pre>

<p>Specific GPS sentences and bitrates may be selected by setting bits of the 'mode' in the server configuration line:<br>
  &nbsp;&nbsp;<tt>server 127.127.20.x mode X</tt><br>&nbsp;&nbsp;&nbsp; bit 0 - process <tt>$GPMRC</tt>&nbsp;&nbsp;&nbsp; (value = 1)<br>&nbsp;&nbsp;&nbsp; bit 1 - process <tt>$GPGGA</tt>&nbsp;&nbsp;&nbsp; (value = 2)<br>&nbsp;&nbsp;&nbsp; bit 2 - process <tt>$GPGLL</tt>&nbsp;&nbsp;&nbsp; (value = 4)<br>&nbsp;&nbsp;&nbsp; bit 4 - process <tt>$GPZDA</tt> or <tt>$GPZDG</tt>&nbsp;&nbsp;&nbsp; (value = 8)<br> 
<p>The default (mode 0) is to process all supported sentences, which results in the last received each cycle being used.&nbsp; Multiple sentences may be selected by adding their mode bit values.&nbsp; The driver uses 4800 bits per second by default.&nbsp; Faster bitrates can be selected using bits 4, 5, and 6 of the mode field:<br><br>
		&nbsp;&nbsp;&nbsp; bits 4/5/6 - select serial bitrate&nbsp;&nbsp; (0 for 4800 - the default, 16 for 9600, 32 for 19200, 48 for 38400, 64 for 57600, 80 for 115200)<br></p>
		<p>The driver will send a <tt>$PMOTG,RMC,0000*1D&lt;cr&gt;&lt;lf&gt;</tt> command each poll interval.&nbsp; This is not needed on most GPS receivers because they automatically send <tt>$GPRMC</tt> every second, but helps a Motorola GPS receiver that is otherwise silent.&nbsp; NMEA devices ignore commands they do not understand.</p>
		<h4>Setting up the Garmin GPS-25XL</h4>
		Switch off all output with by sending it the following string.
		<p>Now switch only $GPRMC on by sending it the following string.</p>
		<p>On some systems the PPS signal isn't switched on by default. It can be switched on by sending the following string.</p>
		<h4>Monitor Data</h4>
		<p>The GPS sentence that is used is written to the clockstats file and available with ntpq -c clockvar.</p>
		<h4>Fudge Factors</h4>
			<dt><tt>time1 <i>time</i></tt>
			<dd>Specifies the PPS time offset calibration factor, in seconds and fraction, with default 0.0.
			<dt><tt>time2 <i>time</i></tt>
			<dd>Specifies the serial end of line time offset calibration factor, in seconds and fraction, with default 0.0.
			<dt><tt>stratum <i>number</i></tt>
			<dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
			<dt><tt>refid <i>string</i></tt>
			<dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>.
			<dt><tt>flag1 0 | 1</tt>
			<dd>Disable PPS signal processing if 0 (default); enable PPS signal processing if 1.
			<dt><tt>flag2 0 | 1</tt>
			<dd>If PPS signal processing is enabled, capture the pulse on the rising edge if 0 (default); capture on the falling edge if 1.
			<dt><tt>flag3 0 | 1</tt>
			<dd>If PPS signal processing is enabled, use the <tt>ntpd</tt> clock discipline if 0 (default); use the kernel discipline if 1.
			<dt><tt>flag4 0 | 1</tt>
			<dd>Obscures location in timecode: 0 for disable (default), 1 for enable.
		<p>Additional Information</p>
		<p><a href="../refclock.html">Reference Clock Drivers</a></p>
		<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>