driver20.html revision 1.1.1.5 1 1.1 kardel <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 1.1.1.2 christos <html><head>
3 1.1.1.2 christos <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Generic NMEA GPS Receiver</title>
4 1.1.1.4 christos <!-- Changed by: Pearly &, 04-Feb-2019 -->
5 1.1.1.2 christos <link href="scripts/style.css" type="text/css" rel="stylesheet">
6 1.1.1.2 christos <style type="text/css">
7 1.1.1.2 christos table.dlstable { font-size:85%; }
8 1.1.1.2 christos td.ttf{ font-family:Courier; font-weight:bold; }
9 1.1.1.2 christos </style></head>
10 1.1 kardel
11 1.1 kardel
12 1.1 kardel
13 1.1.1.2 christos <body>
14 1.1.1.2 christos <h3>Generic NMEA GPS Receiver</h3>
15 1.1.1.3 christos <p>Last update:
16 1.1.1.5 christos <!-- #BeginDate format:En2m -->17-Oct-2020 16:00<!-- #EndDate -->
17 1.1.1.3 christos UTC</p>
18 1.1.1.2 christos <hr>
19 1.1.1.2 christos <h4>Synopsis</h4>
20 1.1.1.2 christos
21 1.1.1.2 christos <p>
22 1.1.1.2 christos Address: 127.127.20.<i>u</i><br>
23 1.1.1.2 christos Reference ID: <tt>GPS</tt><br>
24 1.1.1.2 christos Driver ID: <tt>GPS_NMEA</tt><br>
25 1.1.1.2 christos Serial Port: <tt>/dev/gps<i>u</i></tt>; 4800 - 115200 bps, 8-bits, no parity<br>
26 1.1.1.2 christos Serial Port: <tt>/dev/gpspps<i>u</i></tt>; for just the PPS signal (this
27 1.1.1.2 christos is tried first for PPS, before <tt>/dev/gps<i>u</i></tt>)<br>
28 1.1.1.2 christos Serial Port: <tt>/dev/gps<i>u</i></tt>; symlink to server:port (for nmead)<br>
29 1.1.1.2 christos Features: <tt>tty_clk</tt>
30 1.1.1.2 christos </p>
31 1.1.1.2 christos
32 1.1.1.2 christos <h4>Description</h4>
33 1.1.1.2 christos
34 1.1.1.2 christos <p>
35 1.1.1.2 christos This driver supports GPS receivers with
36 1.1.1.2 christos the <tt>$GPRMC</tt>, <tt>$GPGLL</tt>, <tt>$GPGGA</tt>, <tt>$GPZDA</tt>
37 1.1.1.2 christos and <tt>$GPZDG</tt> NMEA sentences by default. Note that Accord's
38 1.1.1.2 christos custom NMEA sentence <tt>$GPZDG</tt> reports using the GPS timescale,
39 1.1.1.2 christos while the rest of the sentences report UTC. The difference between
40 1.1.1.2 christos the two is a whole number of seconds which increases with each leap
41 1.1.1.2 christos second insertion in UTC. To avoid problems mixing UTC and GPS
42 1.1.1.2 christos timescales, the driver disables processing of UTC sentences
43 1.1.1.2 christos once <tt>$GPZDG</tt> is received.
44 1.1.1.4 christos <br>
45 1.1.1.4 christos <strong>Caveat:</strong> Please see <a href="#talkerids">Talker
46 1.1.1.4 christos IDs</a> when using non-GPS or multi-system receivers.
47 1.1.1.2 christos </p>
48 1.1.1.2 christos <p>
49 1.1.1.2 christos The driver expects the receiver to be set up to transmit at least one
50 1.1.1.2 christos supported sentence every second.
51 1.1.1.2 christos </p>
52 1.1.1.2 christos <p>
53 1.1.1.2 christos The accuracy depends on the receiver used. Inexpensive GPS models are
54 1.1.1.2 christos available with a claimed PPS signal accuracy of
55 1.1.1.2 christos 1 μs or better relative to the broadcast
56 1.1.1.2 christos signal. However, in most cases the actual accuracy is limited by the
57 1.1.1.2 christos precision of the timecode and the latencies of the serial interface and
58 1.1.1.2 christos operating system.
59 1.1.1.2 christos </p>
60 1.1.1.2 christos <p>
61 1.1.1.2 christos If the Operating System supports PPSAPI
62 1.1.1.2 christos (<a href="http://www.ietf.org/rfc/rfc2783.txt">RFC 2783</a>), fudge flag1
63 1.1.1.2 christos 1 enables its use.
64 1.1.1.2 christos </p>
65 1.1.1.2 christos <p>
66 1.1.1.2 christos The various GPS sentences that this driver recognises look like this:<br>
67 1.1.1.2 christos (others quietly ignored)
68 1.1.1.2 christos </p>
69 1.1.1.2 christos
70 1.1.1.2 christos <p><table class="dlstable" border="1">
71 1.1.1.2 christos <caption>Accepted NMEA sentences</caption>
72 1.1.1.2 christos <tbody><tr>
73 1.1.1.2 christos <th>Sentence</th>
74 1.1.1.2 christos <th>Vendor</th>
75 1.1.1.2 christos </tr><tr>
76 1.1.1.2 christos <td class="ttf">$GPRMC,UTC,POS_STAT,LAT,LAT_REF,LON,LON_REF,SPD,HDG,DATE,MAG_VAR,MAG_REF*CS<cr><lf></td>
77 1.1.1.2 christos </tr><tr>
78 1.1.1.2 christos <td class="ttf">$GPGLL,LAT,LAT_REF,LON,LON_REF,UTC,POS_STAT*CS<cr><lf></td>
79 1.1.1.2 christos </tr><tr>
80 1.1.1.2 christos <td class="ttf">$GPGGA,UTC,LAT,LAT_REF,LON,LON_REF,FIX_MODE,SAT_USED,HDOP,ALT,ALT_UNIT,GEO,G_UNIT,D_AGE,D_REF*CS<cr><lf></td>
81 1.1.1.2 christos </tr><tr>
82 1.1.1.2 christos <td class="ttf">$GPZDA,UTC,DD,MM,YYYY,TH,TM,*CS<cr><lf></td>
83 1.1.1.2 christos </tr><tr>
84 1.1.1.2 christos <td class="ttf">$GPZDG,GPSTIME,DD,MM,YYYY,AA.BB,V*CS<cr><lf></td>
85 1.1.1.2 christos <td>Accord</td>
86 1.1.1.4 christos </tr><tr>
87 1.1.1.4 christos </tr><tr>
88 1.1.1.4 christos <td class="ttf">$PGRMF,gpsWk,gpsTow,DATE,UTC,LEAPS,LAT,LAT_REF,LON,LON_REF,TYPE,MODE,SPD,HDOP,TDOP*CS<cr><lf></td>
89 1.1.1.4 christos <td>Garmin</td>
90 1.1.1.4 christos </tr><tr>
91 1.1.1.4 christos <td class="ttf">$PUBX,04,UTC,DATE,utcTow,utcWk,LEAPS,clkBias,clkDrift,tpGran,*CS<cr><lf></td>
92 1.1.1.4 christos <td>UBLOX</td>
93 1.1.1.4 christos </tr>
94 1.1.1.2 christos </tbody></table></p>
95 1.1.1.2 christos
96 1.1.1.2 christos <p><table class="dlstable" border="1">
97 1.1.1.2 christos <caption>NMEA data items</caption>
98 1.1.1.2 christos <tbody><tr>
99 1.1.1.2 christos <th>Symbol</th>
100 1.1.1.2 christos <th>Meaning and Format</th>
101 1.1.1.2 christos </tr>
102 1.1.1.2 christos
103 1.1.1.2 christos <tr>
104 1.1.1.4 christos <td class="ttf">ALT</td>
105 1.1.1.4 christos <td>Antenna Altitude</td>
106 1.1.1.2 christos </tr><tr>
107 1.1.1.4 christos <td class="ttf">ALT_UNIT</td>
108 1.1.1.4 christos <td>Altitude Units (Metres/Feet)</td>
109 1.1.1.2 christos </tr><tr>
110 1.1.1.4 christos <td class="ttf">DATE</td>
111 1.1.1.4 christos <td>Date (ddmmyy)</td>
112 1.1.1.2 christos </tr><tr>
113 1.1.1.4 christos <td class="ttf">DD</td>
114 1.1.1.4 christos <td>Day of the month (1-31)</td>
115 1.1.1.2 christos </tr><tr>
116 1.1.1.4 christos <td class="ttf">D_AGE</td>
117 1.1.1.4 christos <td>Age of last DGPS Fix</td>
118 1.1.1.2 christos </tr><tr>
119 1.1.1.4 christos <td class="ttf">D_REF</td>
120 1.1.1.4 christos <td>Reference ID of DGPS station</td>
121 1.1.1.2 christos </tr><tr>
122 1.1.1.4 christos <td class="ttf">FIX_MODE</td>
123 1.1.1.4 christos <td>Position Fix Mode (0 = Invalid, >0 = Valid)</td>
124 1.1.1.2 christos </tr><tr>
125 1.1.1.4 christos <td class="ttf">GEO</td>
126 1.1.1.4 christos <td>Geoid/Elipsoid separation</td>
127 1.1.1.2 christos </tr><tr>
128 1.1.1.4 christos <td class="ttf">GPSTIME</td>
129 1.1.1.4 christos <td>Time of day on GPS timescale. Hours, minutes and seconds [fraction (opt.)] (hhmmss[.f])</td>
130 1.1.1.2 christos </tr><tr>
131 1.1.1.4 christos <td class="ttf">gpsTow</td>
132 1.1.1.4 christos <td>GPS week time, seconds since start of GPS week (0..604799)</td>
133 1.1.1.2 christos </tr><tr>
134 1.1.1.4 christos <td class="ttf">gpsWk</td>
135 1.1.1.4 christos <td>Week number in the GPS time scale (may exceed 1024)</td>
136 1.1.1.2 christos </tr><tr>
137 1.1.1.4 christos <td class="ttf">G_UNIT</td>
138 1.1.1.4 christos <td>Geoid units (M/F)</td>
139 1.1.1.2 christos </tr><tr>
140 1.1.1.4 christos <td class="ttf">HDG</td>
141 1.1.1.4 christos <td>Heading/track made good (degrees True) (x.x)</td>
142 1.1.1.2 christos </tr><tr>
143 1.1.1.2 christos <td class="ttf">HDOP</td>
144 1.1.1.2 christos <td>Horizontal Dilution of Precision</td>
145 1.1.1.2 christos </tr><tr>
146 1.1.1.4 christos <td class="ttf">LAT</td>
147 1.1.1.4 christos <td>Latitude (llll.ll)</td>
148 1.1.1.2 christos </tr><tr>
149 1.1.1.4 christos <td class="ttf">LAT_REF</td>
150 1.1.1.4 christos <td>Latitude direction (N = North, S = South)</td>
151 1.1.1.2 christos </tr><tr>
152 1.1.1.4 christos <td class="ttf">LEAPS</td>
153 1.1.1.4 christos <td>Leap seconds or difference between GPS time scale and UTC</td>
154 1.1.1.2 christos </tr><tr>
155 1.1.1.4 christos <td class="ttf">LON</td>
156 1.1.1.4 christos <td>Longitude (yyyyy.yy)</td>
157 1.1.1.2 christos </tr><tr>
158 1.1.1.4 christos <td class="ttf">LON_REF</td>
159 1.1.1.4 christos <td>Longitude direction (E = East, W = West)</td>
160 1.1.1.2 christos </tr><tr>
161 1.1.1.4 christos <td class="ttf">MAG_REF</td>
162 1.1.1.4 christos <td>Magnetic variation (E = East, W = West)</td>
163 1.1.1.2 christos </tr><tr>
164 1.1.1.4 christos <td class="ttf">MAG_VAR</td>
165 1.1.1.4 christos <td>Magnetic variation (degrees) (x.x)</td>
166 1.1.1.2 christos </tr><tr>
167 1.1.1.2 christos <td class="ttf">MM</td>
168 1.1.1.2 christos <td>Month of the year (1-12)</td>
169 1.1.1.2 christos </tr><tr>
170 1.1.1.4 christos <td class="ttf">POS_STAT</td>
171 1.1.1.4 christos <td>Position status. (A = Data valid, V = Data invalid)</td>
172 1.1.1.4 christos </tr><tr>
173 1.1.1.4 christos <td class="ttf">SAT_USED</td>
174 1.1.1.4 christos <td>Number of Satellites used in solution</td>
175 1.1.1.4 christos </tr><tr>
176 1.1.1.4 christos <td class="ttf">SPD</td>
177 1.1.1.4 christos <td>Speed over ground. (knots) (x.x)</td>
178 1.1.1.4 christos </tr><tr>
179 1.1.1.4 christos <td class="ttf">UTC</td>
180 1.1.1.4 christos <td>Time of day on UTC timescale. Hours, minutes and seconds [fraction (opt.)] (hhmmss[.fff])</td>
181 1.1.1.4 christos </tr><tr>
182 1.1.1.2 christos <td class="ttf">YYYY</td>
183 1.1.1.2 christos <td>Year</td>
184 1.1.1.2 christos </tr><tr>
185 1.1.1.4 christos <td class="ttf">WEEK</td>
186 1.1.1.4 christos <td>GPS week (0-1023)</td>
187 1.1.1.4 christos </tr><tr>
188 1.1.1.4 christos <td class="ttf">WSEC</td>
189 1.1.1.4 christos <td>Seconds since start of week (0-604799)</td>
190 1.1.1.4 christos </tr><tr>
191 1.1.1.4 christos <td class="ttf">LEAP</td>
192 1.1.1.4 christos <td>GPS leap seconds, that is, seconds ahead of UTC</td>
193 1.1.1.4 christos </tr><tr>
194 1.1.1.2 christos <td class="ttf">AA.BB</td>
195 1.1.1.2 christos <td>Denotes the signal strength (should be < 05.00)</td>
196 1.1.1.2 christos </tr><tr>
197 1.1.1.2 christos <td class="ttf">V</td>
198 1.1.1.2 christos <td>GPS sync status<br>
199 1.1.1.2 christos '0' => INVALID time,<br>
200 1.1.1.2 christos '1' => accuracy of +/- 20ms,<br>
201 1.1.1.2 christos '2' => accuracy of +/- 100ns</td>
202 1.1.1.2 christos </tr><tr>
203 1.1.1.2 christos <td class="ttf">CS</td>
204 1.1.1.2 christos <td> Checksum</td>
205 1.1.1.2 christos </tr><tr>
206 1.1.1.2 christos <td class="ttf"><cr><lf></td>
207 1.1.1.2 christos <td>Sentence terminator.</td>
208 1.1.1.2 christos </tr>
209 1.1.1.2 christos </tbody></table></p>
210 1.1.1.2 christos
211 1.1.1.2 christos
212 1.1.1.4 christos <h4><a name="talkerids"/>NMEA Talker IDs</h4>
213 1.1.1.4 christos
214 1.1.1.4 christos <p>
215 1.1.1.4 christos GNSS receivers use a distinct talker ID for the GNSS they
216 1.1.1.4 christos process. Receivers capable of tracking different systems at the same time
217 1.1.1.4 christos can emit <tt>$GPRMC</tt> (GPS), <tt>$GLRMC</tt> (GLONASS),
218 1.1.1.4 christos <tt>$GARMC</tt> (Galileo), <tt>$GNRMC</tt> (generic/combined) and others
219 1.1.1.4 christos all in one data stream.
220 1.1.1.4 christos </p><p>
221 1.1.1.4 christos The driver supports this to a certain degree by ignoring the
222 1.1.1.4 christos talker ID on the standard sentences RMC, GLL, GGA, ZDA and ZDG. (It
223 1.1.1.4 christos possibly should not do that on the latter, but for now, that's the way
224 1.1.1.4 christos it is.) So whenever <tt>$GPRMC</tt> is mentioned in this document,
225 1.1.1.4 christos substitute any possible talker ID your receiver might emit -- it will
226 1.1.1.4 christos still match.
227 1.1.1.4 christos </p><p>
228 1.1.1.4 christos This approach has a drawback. It is easy to use for single-system
229 1.1.1.4 christos receivers, but it cannot separate the data streams for multi-system
230 1.1.1.4 christos receiver modules. It is therefore undefined which GNSS actually
231 1.1.1.4 christos provides the data, and this can lead to strange behavior. This is
232 1.1.1.4 christos especially true if the different GNSS provide very different signal
233 1.1.1.4 christos quality to the receiver; the driver is not able to cherry-pick the best
234 1.1.1.4 christos source and might actually end up in using the worst available. It is
235 1.1.1.4 christos therefore recommended to set up such a receiver to either use just a
236 1.1.1.4 christos single GNSS (which would defeat its purpose) or to emit only the
237 1.1.1.4 christos combined data, which usually has the <tt>GN</tt> talker ID defined by
238 1.1.1.4 christos the NMEA standard.
239 1.1.1.4 christos <p>
240 1.1.1.4 christos
241 1.1.1.4 christos
242 1.1.1.2 christos <h4>The 'mode' byte</h4>
243 1.1.1.2 christos
244 1.1.1.2 christos <p>
245 1.1.1.2 christos Specific GPS sentences and bitrates may be selected by setting bits of
246 1.1.1.2 christos the 'mode' in the server configuration line:<br> <tt>server
247 1.1.1.2 christos 127.127.20.x mode X</tt>
248 1.1.1.2 christos </p>
249 1.1.1.2 christos
250 1.1.1.2 christos <table border="1">
251 1.1.1.2 christos <caption>mode byte bits and bit groups</caption>
252 1.1.1.2 christos <tbody><tr>
253 1.1.1.2 christos <th align="center">Bit</th>
254 1.1.1.3 christos <th align="center">Decimal</th>
255 1.1.1.3 christos <th align="center">Hex</th>
256 1.1.1.2 christos <th align="left">Meaning</th>
257 1.1.1.2 christos </tr>
258 1.1.1.2 christos
259 1.1.1.2 christos <tr>
260 1.1.1.2 christos <td align="center">0</td>
261 1.1.1.2 christos <td align="center">1</td>
262 1.1.1.3 christos <td align="center">1</td>
263 1.1.1.4 christos <td>process <tt>$GPRMC</tt></td>
264 1.1.1.2 christos </tr><tr>
265 1.1.1.2 christos <td align="center">1</td>
266 1.1.1.2 christos <td align="center">2</td>
267 1.1.1.3 christos <td align="center">2</td>
268 1.1.1.2 christos <td>process <tt>$GPGGA</tt></td>
269 1.1.1.2 christos </tr><tr>
270 1.1.1.2 christos <td align="center">2</td>
271 1.1.1.2 christos <td align="center">4</td>
272 1.1.1.3 christos <td align="center">4</td>
273 1.1.1.2 christos <td>process <tt>$GPGLL</tt></td>
274 1.1.1.2 christos </tr><tr>
275 1.1.1.2 christos <td align="center">3</td>
276 1.1.1.2 christos <td align="center">8</td>
277 1.1.1.3 christos <td align="center">8</td>
278 1.1.1.2 christos <td>process <tt>$GPZDA</tt> or <tt>$GPZDG</tt></td>
279 1.1.1.2 christos </tr><tr>
280 1.1.1.2 christos <td rowspan="6" align="center">4-6</td>
281 1.1.1.2 christos <td align="center">0</td>
282 1.1.1.3 christos <td align="center">0</td>
283 1.1.1.2 christos <td>linespeed 4800 bps</td>
284 1.1.1.2 christos </tr><tr>
285 1.1.1.2 christos <td align="center">16</td>
286 1.1.1.3 christos <td align="center">0x10</td>
287 1.1.1.2 christos <td>linespeed 9600 bps</td>
288 1.1.1.2 christos </tr><tr>
289 1.1.1.2 christos <td align="center">32</td>
290 1.1.1.3 christos <td align="center">0x20</td>
291 1.1.1.2 christos <td>linespeed 19200 bps</td>
292 1.1.1.2 christos </tr><tr>
293 1.1.1.2 christos <td align="center">48</td>
294 1.1.1.3 christos <td align="center">0x30</td>
295 1.1.1.2 christos <td>linespeed 38400 bps</td>
296 1.1.1.2 christos </tr><tr>
297 1.1.1.2 christos <td align="center">64</td>
298 1.1.1.3 christos <td align="center">0x40</td>
299 1.1.1.2 christos <td>linespeed 57600 bps</td>
300 1.1.1.2 christos </tr><tr>
301 1.1.1.2 christos <td align="center">80</td>
302 1.1.1.3 christos <td align="center">0x50</td>
303 1.1.1.2 christos <td>linespeed 115200 bps</td>
304 1.1.1.2 christos </tr><tr>
305 1.1.1.2 christos <td align="center">7</td>
306 1.1.1.2 christos <td align="center">128</td>
307 1.1.1.3 christos <td align="center">0x80</td>
308 1.1.1.2 christos <td>Write the sub-second fraction of the receive time stamp to the
309 1.1.1.2 christos clockstat file for all recognised NMEA sentences. This can be used to
310 1.1.1.2 christos get a useful value for fudge time2.<br><strong>Caveat:</strong> This
311 1.1.1.2 christos will fill your clockstat file rather fast. Use it only temporarily to
312 1.1.1.2 christos get the numbers for the NMEA sentence of your choice.</td>
313 1.1.1.2 christos </tr>
314 1.1.1.3 christos </tr><tr>
315 1.1.1.3 christos <td align="center">8</td>
316 1.1.1.3 christos <td align="center">256</td>
317 1.1.1.3 christos <td align="center">0x100</td>
318 1.1.1.3 christos <td>process <tt>$PGRMF</tt></td>
319 1.1.1.3 christos </tr><tr>
320 1.1.1.4 christos <td align="center">9</td>
321 1.1.1.4 christos <td align="center">512</td>
322 1.1.1.4 christos <td align="center">0x200</td>
323 1.1.1.4 christos <td>process <tt>$PUBX,04</tt></td>
324 1.1.1.4 christos </tr><tr>
325 1.1.1.4 christos <td align="center">10-15</td>
326 1.1.1.3 christos <td align="center"></td>
327 1.1.1.4 christos <td align="center">0xFC00</td>
328 1.1.1.3 christos <td>reserved - leave 0</td>
329 1.1.1.3 christos </tr><tr>
330 1.1.1.3 christos <td align="center">16</td>
331 1.1.1.3 christos <td align="center">65536</td>
332 1.1.1.3 christos <td align="center">0x10000</td>
333 1.1.1.3 christos <td>Append extra statistics to the clockstats line.
334 1.1.1.3 christos Details below.</td>
335 1.1.1.4 christos </tr><tr>
336 1.1.1.4 christos <td align="center">17</td>
337 1.1.1.4 christos <td align="center">131072</td>
338 1.1.1.4 christos <td align="center">0x20000</td>
339 1.1.1.4 christos <td>"Silent PPS" mode. Use the PPS channel (if enabled with
340 1.1.1.4 christos fudge flag 1) to get precise receive time stamps.
341 1.1.1.4 christos Do <em>not</em> set the PPS flag in the clock status, so the
342 1.1.1.4 christos clock is not considered as PPS peer.
343 1.1.1.4 christos </td>
344 1.1.1.4 christos </tr><tr>
345 1.1.1.4 christos <td align="center">18</td>
346 1.1.1.4 christos <td align="center">262144</td>
347 1.1.1.4 christos <td align="center">0x40000</td>
348 1.1.1.4 christos <td>Trust the date delivered via NMEA. Do this only if
349 1.1.1.4 christos you <em>really</em> trust the receiver!
350 1.1.1.4 christos See <a href="#datetrust">below</a>. <strong>Caveat:</strong>
351 1.1.1.4 christos This (hitherto undocumented) bit has moved!
352 1.1.1.4 christos </td>
353 1.1.1.5 christos </tr><tr>
354 1.1.1.5 christos <td align="center">19</td>
355 1.1.1.5 christos <td align="center">524288</td>
356 1.1.1.5 christos <td align="center">0x80000</td>
357 1.1.1.5 christos <td>Ignore receiver status, assume time is always good as long
358 1.1.1.5 christos as it is present at all. A possible option for receivers
359 1.1.1.5 christos with a good hold-over characteristic, but most likely
360 1.1.1.5 christos harmful in general. Use at own risk.
361 1.1.1.5 christos </td>
362 1.1.1.3 christos </tr>
363 1.1.1.2 christos </tbody></table>
364 1.1.1.2 christos
365 1.1.1.2 christos
366 1.1.1.2 christos <p>
367 1.1.1.2 christos The default (mode 0) is to process all supported sentences at a linespeed
368 1.1.1.2 christos of 4800 bps, which results in the first one received and recognised in
369 1.1.1.2 christos each cycle being used. If only specific sentences should be
370 1.1.1.2 christos recognised, then the mode byte must be chosen to enable only the selected
371 1.1.1.2 christos ones. Multiple sentences may be selected by adding their mode bit
372 1.1.1.2 christos values, but of those enabled still only the first received sentence in a
373 1.1.1.2 christos cycle will be used. Using more than one sentence per cycle is
374 1.1.1.2 christos impossible, because
375 1.1.1.2 christos </p><ul>
376 1.1.1.2 christos <li>there is only <a href="#fudgetime2">fudge time2</a> available to
377 1.1.1.2 christos compensate for transmission delays but every sentence would need a
378 1.1.1.2 christos different one and
379 1.1.1.2 christos </li><li>using more than one sentence per cycle overstuffs the internal data
380 1.1.1.2 christos filters.
381 1.1.1.2 christos </li></ul>
382 1.1.1.2 christos The driver uses 4800 bits per second by default, but faster bitrates can
383 1.1.1.2 christos be selected using bits 4 to 6 of the mode field.
384 1.1.1.4 christos </p>
385 1.1.1.2 christos
386 1.1.1.2 christos <p>
387 1.1.1.2 christos <strong>Caveat:</strong> Using higher line speeds does not necessarily
388 1.1.1.2 christos increase the precision of the timing device. Higher line speeds are
389 1.1.1.2 christos not necessarily helpful for the NMEA driver, either. They can be
390 1.1.1.2 christos used to accomodate for an amount of data that does not fit into a
391 1.1.1.2 christos 1-second cycle at 4800 bps, but high-speed high-volume NMEA data is likely
392 1.1.1.2 christos to cause trouble with the serial line driver since NMEA supports no
393 1.1.1.2 christos protocol handshake. Any device that is exclusively used for time
394 1.1.1.2 christos synchronisation purposes should be configured to transmit the relevant
395 1.1.1.2 christos data only, e.g. one <tt>$GPRMC</tt> or <tt>$GPZDA</tt> per second, at a
396 1.1.1.2 christos linespeed of 4800 bps or 9600 bps.
397 1.1.1.2 christos </p>
398 1.1.1.2 christos
399 1.1.1.4 christos <h4><a name="datetrust"/>About distrusting NMEA date stamps</h4>
400 1.1.1.4 christos <p>
401 1.1.1.4 christos Trusting the calendar dates delivered via NMEA is a risky thing, and by
402 1.1.1.4 christos default these dates are handled with a huge dose of skepticism. Many
403 1.1.1.4 christos receivers deliver a correct calendar date for a period of just 1024 weeks,
404 1.1.1.4 christos with a starting point baked somewhere into their firmware. Beyond that,
405 1.1.1.4 christos they warp back to the begin of their era and simply provide wrong date
406 1.1.1.4 christos information. To battle this widely observed effect, the date delivered is
407 1.1.1.4 christos by default reduced to GPS time again and then (re-)mapped according to the
408 1.1.1.4 christos base date, either the implicit value or the value set via "tos basedate".
409 1.1.1.4 christos If the receiver can <em>really</em> be trusted to deliver the right date
410 1.1.1.4 christos (which is not impossible, just more expensive for the manufacturer), then
411 1.1.1.4 christos mode bit 18 can be used to bypass the era mapping. Setting this bit is
412 1.1.1.4 christos not needed under most circumstances, and setting it with an unreliable
413 1.1.1.4 christos receiver can have severe effects. Handle with care.
414 1.1.1.4 christos </p><p>
415 1.1.1.4 christos <strong>Note:</strong> This functionality was available for some time as
416 1.1.1.4 christos undocumented feature, with a different bit value. It was moved in the
417 1.1.1.4 christos process of becoming officially acknowledged to avoid excessive scattering
418 1.1.1.4 christos of the mode bit mask.
419 1.1.1.4 christos </p>
420 1.1.1.4 christos
421 1.1.1.4 christos
422 1.1.1.3 christos <h4>Monitor Data</h4>
423 1.1.1.3 christos
424 1.1.1.3 christos <p>The last GPS sentence that is accepted or rejected is written to the
425 1.1.1.3 christos clockstats file and available with <code>ntpq -c clockvar</code>.
426 1.1.1.3 christos (Logging the rejected sentences lets you see/debug why they were rejected.)
427 1.1.1.3 christos Filtered sentences are not logged.</p>
428 1.1.1.3 christos
429 1.1.1.3 christos <p>
430 1.1.1.3 christos If the 0x10000 mode bit is on and clockstats is enabled, several extra
431 1.1.1.3 christos counters will be appended to the NMEA sentence that gets logged.
432 1.1.1.3 christos For example:
433 1.1.1.3 christos <pre>
434 1.1.1.3 christos 56299 76876.691 127.127.20.20 $GPGGA,212116.000,3726.0785,N,12212.2605,W,1,05,2.0,17.0,M,-25.7,M,,0000*5C 228 64 0 0 64 0
435 1.1.1.3 christos </pre>
436 1.1.1.3 christos </p>
437 1.1.1.3 christos
438 1.1.1.3 christos <table border="1">
439 1.1.1.3 christos <caption>Clockstats</caption>
440 1.1.1.3 christos <tbody><tr>
441 1.1.1.3 christos <th align="center">Column</th>
442 1.1.1.3 christos <th align="center">Sample</th>
443 1.1.1.3 christos <th align="left">Meaning</th>
444 1.1.1.3 christos </tr>
445 1.1.1.3 christos
446 1.1.1.3 christos <tr>
447 1.1.1.3 christos <td align="center">1</td>
448 1.1.1.3 christos <td align="center">56299</td>
449 1.1.1.3 christos <td>MJD</td>
450 1.1.1.3 christos </tr><tr>
451 1.1.1.3 christos <td align="center">2</td>
452 1.1.1.3 christos <td align="center">76876.691</td>
453 1.1.1.3 christos <td>Time of day in seconds</td>
454 1.1.1.3 christos </tr><tr>
455 1.1.1.3 christos <td align="center">3</td>
456 1.1.1.3 christos <td align="center">127.127.20.20</td>
457 1.1.1.3 christos <td>IP Address from server config line</td>
458 1.1.1.3 christos </tr><tr>
459 1.1.1.3 christos <td align="center">4</td>
460 1.1.1.3 christos <td align="center">$GPGGA,...0*5C</td>
461 1.1.1.3 christos <td>NMEA Sentence</td>
462 1.1.1.3 christos </tr><tr>
463 1.1.1.3 christos <td align="center">5</td>
464 1.1.1.3 christos <td align="center">228</td>
465 1.1.1.3 christos <td>Number of sentences received</td>
466 1.1.1.3 christos </tr><tr>
467 1.1.1.3 christos <td align="center">6</td>
468 1.1.1.3 christos <td align="center">64</td>
469 1.1.1.3 christos <td>Number of sentences accepted and used for timekeeping</td>
470 1.1.1.3 christos </tr><tr>
471 1.1.1.3 christos <td align="center">7</td>
472 1.1.1.3 christos <td align="center">0</td>
473 1.1.1.3 christos <td>Number of sentences rejected because they were marked invalid (poor signal)</td>
474 1.1.1.3 christos </tr><tr>
475 1.1.1.3 christos <td align="center">8</td>
476 1.1.1.3 christos <td align="center">0</td>
477 1.1.1.3 christos <td>Number of sentences rejected because of bad checksum or invalid date/time</td>
478 1.1.1.3 christos </tr><tr>
479 1.1.1.3 christos <td align="center">9</td>
480 1.1.1.3 christos <td align="center">64</td>
481 1.1.1.3 christos <td>Number of sentences filtered by mode bits or same second</td>
482 1.1.1.3 christos </tr><tr>
483 1.1.1.3 christos <td align="center">10</td>
484 1.1.1.3 christos <td align="center">0</td>
485 1.1.1.3 christos <td>Number of PPS pulses used, overrides NMEA sentences</td>
486 1.1.1.3 christos </tr>
487 1.1.1.3 christos </tbody></table>
488 1.1.1.3 christos
489 1.1.1.3 christos Sentences like $GPGSV that don't contain the time will get
490 1.1.1.3 christos counted in the total but otherwise ignored.
491 1.1.1.3 christos
492 1.1.1.2 christos <p>
493 1.1.1.2 christos <a href="https://support.ntp.org/bin/view/Support/ConfiguringNMEARefclocks">Configuring
494 1.1.1.2 christos NMEA Refclocks</a> might give further useful hints for specific hardware
495 1.1.1.2 christos devices that exhibit strange or curious behaviour.
496 1.1.1.2 christos </p>
497 1.1.1.2 christos
498 1.1.1.2 christos <p>
499 1.1.1.2 christos To make a specific setting, select the corresponding decimal values from
500 1.1.1.2 christos the mode byte table, add them all together and enter the resulting
501 1.1.1.2 christos decimal value into the clock configuration line.
502 1.1.1.2 christos </p>
503 1.1.1.2 christos
504 1.1.1.2 christos <h4>Setting up the Garmin GPS-25XL</h4>
505 1.1.1.2 christos
506 1.1.1.2 christos Switch off all output with by sending it the following string.
507 1.1.1.2 christos <pre>"$PGRMO,,2<cr><lf>"</pre>
508 1.1.1.2 christos <p>Now switch only $GPRMC on by sending it the following string.</p>
509 1.1.1.2 christos <pre>"$PGRMO,GPRMC,1<cr><lf>"</pre>
510 1.1.1.2 christos
511 1.1.1.2 christos <p>On some systems the PPS signal isn't switched on by default. It can be
512 1.1.1.2 christos switched on by sending the following string.</p>
513 1.1.1.2 christos <pre>"$PGRMC,,,,,,,,,,,,2<cr><lf>"</pre>
514 1.1.1.2 christos
515 1.1.1.2 christos <h4>Fudge Factors</h4>
516 1.1.1.2 christos
517 1.1.1.2 christos <dl>
518 1.1.1.2 christos <dt><tt>time1 <i>time</i></tt></dt>
519 1.1.1.2 christos <dd>Specifies the PPS time offset calibration factor, in seconds and fraction, with default 0.0.</dd>
520 1.1.1.2 christos <dt><a name="fudgetime2"><tt>time2 <i>time</i></tt></a></dt>
521 1.1.1.2 christos <dd>Specifies the serial end of line time offset calibration factor, in seconds and fraction, with default
522 1.1.1.2 christos 0.0.</dd>
523 1.1.1.2 christos <dt><tt>stratum <i>number</i></tt></dt>
524 1.1.1.2 christos <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.</dd>
525 1.1.1.2 christos <dt><tt>refid <i>string</i></tt></dt>
526 1.1.1.2 christos <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with
527 1.1.1.2 christos default <tt>GPS</tt>.</dd>
528 1.1.1.2 christos <dt><tt>flag1 0 | 1</tt></dt>
529 1.1.1.2 christos <dd>Disable PPS signal processing if 0 (default); enable PPS signal processing if 1.</dd>
530 1.1.1.2 christos <dt><tt>flag2 0 | 1</tt></dt>
531 1.1.1.2 christos <dd>If PPS signal processing is enabled, capture the pulse on the rising edge if 0 (default); capture on the
532 1.1.1.2 christos falling edge if 1.</dd>
533 1.1.1.2 christos <dt><tt>flag3 0 | 1</tt></dt>
534 1.1.1.2 christos <dd>If PPS signal processing is enabled, use the <tt>ntpd</tt> clock discipline if 0 (default); use the kernel
535 1.1.1.2 christos discipline if 1.</dd>
536 1.1.1.2 christos <dt><tt>flag4 0 | 1</tt></dt>
537 1.1.1.2 christos <dd>Obscures location in timecode: 0 for disable (default), 1 for enable.</dd>
538 1.1.1.2 christos </dl>
539 1.1.1.2 christos
540 1.1.1.2 christos <p>Additional Information</p>
541 1.1.1.3 christos <p><tt>flag1</tt>, <tt>flag2</tt>, and <tt>flag3</tt> are ignored under Windows.</p>
542 1.1.1.2 christos <p><a href="../refclock.html">Reference Clock Drivers</a></p>
543 1.1.1.2 christos <hr>
544 1.1.1.2 christos <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
545 1.1.1.2 christos </body></html>
546