1GPSD_JSON(5) GPSD Documentation GPSD_JSON(5)
2
3
4
6 gpsd_json - gpsd request/response protocol
7
9 gpsd is a service daemon that can be used to monitor GPSes, DGPS
10 receivers, Marine AIS broadcasts, and various other location-related
11 and kinematic sensors.
12
13 Clients may communicate with gpsd via textual requests and responses
14 over a socket. It is a bad idea for applications to speak the protocol
15 directly: rather, they should use the libgps client library (for C;
16 bindings also exist for other languages) and take appropriate care to
17 conditionalize their code on the major and minor protocol version
18 symbols.
19
20 The GPSD protocol is built on top of JSON, JavaScript Object Notation,
21 as specified in RFC 7159: The JavaScript Object Notation (JSON) Data
22 Interchange Format. GPSD's use of JSON is restricted in some ways that
23 make parsing it in fixed-extent languages (such as C) easier.
24
25 A request line is introduced by "?" and may include multiple commands.
26 Commands begin with a command identifier, followed either by a
27 terminating ';' or by an equal sign "=" and a JSON object treated as an
28 argument. Any ';' or newline indication (either LF or CR-LF) after the
29 end of a command is ignored. All request lines must be composed of
30 US-ASCII characters and may be no more than 80 characters in length,
31 exclusive of the trailing newline.
32
33 Responses are JSON objects all of which have a "class" attribute the
34 value of which is either the name of the invoking command. There are
35 reports (including but not limited to as "TPV", "SKY", "DEVICE", and
36 "ERROR") which are not direct responses to commands.
37
38 The order of JSON attributes within a response object is never
39 significant, and you may specify attributes in commands in any order.
40 Responses never contain the special JSON value null; instead,
41 attributes with empty or undefined values are omitted. The length limit
42 for responses and reports is 1536 characters, including trailing
43 newline; longer responses will be truncated, so client code must be
44 prepared for the possibility of invalid JSON fragments.
45
46 In JSON reports, if an attribute is present only if the parent
47 attribute is present or has a particular range, then the parent
48 attribute is emitted first.
49
50 There is one constraint on the order in which attributes will be
51 omitted. If an optional attribute is present only when a parent
52 attribute has a specified value or range of values, the parent
53 attribute will be emitted first to make parsing easier.
54
55 The next subsection section documents the core GPSD protocol.
56 Extensions are documented in the following subsections. The extensions
57 may not be supported in your gpsd instance if it has been compiled with
58 a restricted feature set.
59
61 Here are the core-protocol responses:
62
63 TPV
64 A TPV object is a time-position-velocity report. The "class" and
65 "mode" fields will reliably be present. The "mode" field will be
66 emitted before optional fields that may be absent when there is no
67 fix. Error estimates will be emitted after the fix components
68 they're associated with. Others may be reported or not depending on
69 the fix quality.
70
71 All error estimates (epc, epd, epe, eph, ept, epv, epx, epy) are
72 assumed to be 95% confidence, may also be 50%, one sigma, or two
73 sigma confidence. Many GPS do not specify a confidence level. No
74 GPS specifies how the value is calculated. Use error estimates with
75 caution, and only as relative "goodness" indicators. If the GPS
76 reports a value to gpsd, then gpsd will report that value.
77 Otherwise gpsd will try to compute the value from the skyview.
78
79 Table 1. TPV object
80 ┌────────────┬─────────┬──────────────┬─────────────────────┐
81 │Name │ Always? │ Type │ Description │
82 ├────────────┼─────────┼──────────────┼─────────────────────┤
83 │class │ Yes │ string │ Fixed: "TPV" │
84 ├────────────┼─────────┼──────────────┼─────────────────────┤
85 │device │ No │ string │ Name of │
86 │ │ │ │ originating │
87 │ │ │ │ device. │
88 ├────────────┼─────────┼──────────────┼─────────────────────┤
89 │status │ No │ numeric │ GPS status: %d, │
90 │ │ │ │ 2=DGPS fix, │
91 │ │ │ │ otherwise not │
92 │ │ │ │ present. │
93 ├────────────┼─────────┼──────────────┼─────────────────────┤
94 │mode │ Yes │ numeric │ NMEA mode: %d, │
95 │ │ │ │ 0=no mode value │
96 │ │ │ │ yet seen, 1=no │
97 │ │ │ │ fix, 2=2D, 3=3D. │
98 ├────────────┼─────────┼──────────────┼─────────────────────┤
99 │time │ No │ string │ Time/date stamp │
100 │ │ │ │ in ISO8601 │
101 │ │ │ │ format, UTC. May │
102 │ │ │ │ have a │
103 │ │ │ │ fractional │
104 │ │ │ │ part of up to │
105 │ │ │ │ .001sec │
106 │ │ │ │ precision. May │
107 │ │ │ │ be absent if │
108 │ │ │ │ mode │
109 │ │ │ │ is not 2 │
110 │ │ │ │ or 3. │
111 ├────────────┼─────────┼──────────────┼─────────────────────┤
112 │alt │ No │ numeric │ Altitude in │
113 │ │ │ │ meters. Present │
114 │ │ │ │ if mode is 3. │
115 ├────────────┼─────────┼──────────────┼─────────────────────┤
116 │climb │ No │ numeric │ Climb (positive) │
117 │ │ │ │ or sink │
118 │ │ │ │ (negative) rate, │
119 │ │ │ │ meters per │
120 │ │ │ │ second. │
121 ├────────────┼─────────┼──────────────┼─────────────────────┤
122 │datum │ No │ string │ Current datum. │
123 ├────────────┼─────────┼──────────────┼─────────────────────┤
124 │epc │ No │ numeric │ Estimated climb │
125 │ │ │ │ error in meters │
126 │ │ │ │ per second. │
127 │ │ │ │ Present │
128 │ │ │ │ if │
129 │ │ │ │ consecutive 3D │
130 │ │ │ │ fixes. │
131 ├────────────┼─────────┼──────────────┼─────────────────────┤
132 │epd │ No │ numeric │ Estimated track │
133 │ │ │ │ (direction) │
134 │ │ │ │ error in │
135 │ │ │ │ degrees. Present │
136 │ │ │ │ if │
137 │ │ │ │ consecutive │
138 │ │ │ │ 2D fixes. │
139 ├────────────┼─────────┼──────────────┼─────────────────────┤
140 │eph │ No │ numeric │ Estimated │
141 │ │ │ │ horizontal Position │
142 │ │ │ │ (2D) Error in │
143 │ │ │ │ meters. │
144 │ │ │ │ Also known │
145 │ │ │ │ as Estimated │
146 │ │ │ │ Position Error │
147 │ │ │ │ (epe). Present │
148 │ │ │ │ if mode is │
149 │ │ │ │ 2D or 3D and DOPs │
150 │ │ │ │ can be calculated │
151 │ │ │ │ from the satellite │
152 │ │ │ │ view. │
153 ├────────────┼─────────┼──────────────┼─────────────────────┤
154 │eps │ No │ numeric │ Estimated speed │
155 │ │ │ │ error in meters per │
156 │ │ │ │ second. Present │
157 │ │ │ │ for │
158 │ │ │ │ consecutive 2D or │
159 │ │ │ │ 3D fixes. │
160 ├────────────┼─────────┼──────────────┼─────────────────────┤
161 │ept │ No │ numeric │ Estimated timestamp │
162 │ │ │ │ error in seconds. │
163 │ │ │ │ Present if │
164 │ │ │ │ time is present. │
165 ├────────────┼─────────┼──────────────┼─────────────────────┤
166 │epx │ No │ numeric │ Longitude error │
167 │ │ │ │ estimate in meters. │
168 │ │ │ │ Present │
169 │ │ │ │ if mode is │
170 │ │ │ │ 2D or 3D and DOPs │
171 │ │ │ │ can be calculated │
172 │ │ │ │ from the satellite │
173 │ │ │ │ view. │
174 ├────────────┼─────────┼──────────────┼─────────────────────┤
175 │epy │ No │ numeric │ Latitude error │
176 │ │ │ │ estimate in meters. │
177 │ │ │ │ Present │
178 │ │ │ │ if mode is │
179 │ │ │ │ 2 or 3 and DOPs can │
180 │ │ │ │ be calculated from │
181 │ │ │ │ the satellite │
182 │ │ │ │ view. │
183 ├────────────┼─────────┼──────────────┼─────────────────────┤
184 │epv │ No │ numeric │ Estimated vertical │
185 │ │ │ │ error in meters. │
186 │ │ │ │ Present │
187 │ │ │ │ if mode is │
188 │ │ │ │ 3 and DOPs can be │
189 │ │ │ │ calculated from the │
190 │ │ │ │ satellite │
191 │ │ │ │ view. │
192 ├────────────┼─────────┼──────────────┼─────────────────────┤
193 │lat │ No │ numeric │ Latitude in │
194 │ │ │ │ degrees: +/- │
195 │ │ │ │ signifies │
196 │ │ │ │ North/South. │
197 │ │ │ │ Present │
198 │ │ │ │ when mode │
199 │ │ │ │ is 2 or 3. │
200 ├────────────┼─────────┼──────────────┼─────────────────────┤
201 │leapseconds │ integer │ Current leap │ │
202 │ │ │ seconds. │ │
203 ├────────────┼─────────┼──────────────┼─────────────────────┤
204 │lon │ No │ numeric │ Longitude in │
205 │ │ │ │ degrees: +/- │
206 │ │ │ │ signifies │
207 │ │ │ │ East/West. Present │
208 │ │ │ │ when mode │
209 │ │ │ │ is 2 or 3. │
210 ├────────────┼─────────┼──────────────┼─────────────────────┤
211 │track │ No │ numeric │ Course over ground, │
212 │ │ │ │ degrees from true │
213 │ │ │ │ north. │
214 ├────────────┼─────────┼──────────────┼─────────────────────┤
215 │magtrack │ No │ numeric │ Course over ground, │
216 │ │ │ │ degrees magnetic. │
217 ├────────────┼─────────┼──────────────┼─────────────────────┤
218 │speed │ No │ numeric │ Speed over ground, │
219 │ │ │ │ meters per second. │
220 ├────────────┼─────────┼──────────────┼─────────────────────┤
221 │ecefx │ No │ numeric │ ECEF X position in │
222 │ │ │ │ meters. │
223 ├────────────┼─────────┼──────────────┼─────────────────────┤
224 │ecefy │ No │ numeric │ ECEF Y position in │
225 │ │ │ │ meters. │
226 ├────────────┼─────────┼──────────────┼─────────────────────┤
227 │ecefz │ No │ numeric │ ECEF Z position in │
228 │ │ │ │ meters. │
229 ├────────────┼─────────┼──────────────┼─────────────────────┤
230 │ecefpAcc │ No │ numeric │ ECEF position error │
231 │ │ │ │ in meters. │
232 ├────────────┼─────────┼──────────────┼─────────────────────┤
233 │ecefvx │ No │ numeric │ ECEF X velocity in │
234 │ │ │ │ meters/second. │
235 ├────────────┼─────────┼──────────────┼─────────────────────┤
236 │ecefvy │ No │ numeric │ ECEF Y velocity in │
237 │ │ │ │ meters/second. │
238 ├────────────┼─────────┼──────────────┼─────────────────────┤
239 │ecefvz │ No │ numeric │ ECEF Z velocity in │
240 │ │ │ │ meters/second. │
241 ├────────────┼─────────┼──────────────┼─────────────────────┤
242 │ecefvAcc │ No │ numeric │ ECEF velocity error │
243 │ │ │ │ in meters/second. │
244 ├────────────┼─────────┼──────────────┼─────────────────────┤
245 │sep │ No │ numeric │ Estimated Spherical │
246 │ │ │ │ (3D) Position Error │
247 │ │ │ │ in meters. │
248 │ │ │ │ Present if │
249 │ │ │ │ mode is 3D and DOPs │
250 │ │ │ │ can be calculated │
251 │ │ │ │ from the satellite │
252 │ │ │ │ view. │
253 │ │ │ │ Assumed to be 95% │
254 │ │ │ │ confidence, but │
255 │ │ │ │ many GPS do not │
256 │ │ │ │ specify. │
257 └────────────┴─────────┴──────────────┴─────────────────────┘
258 When the C client library parses a response of this kind, it will
259 assert validity bits in the top-level set member for each field
260 actually received; see gps.h for bitmask names and values.
261
262 Here's an example:
263
264 {"class":"TPV","device":"/dev/pts/1",
265 "time":"2005-06-08T10:34:48.283Z","ept":0.005,
266 "lat":46.498293369,"lon":7.567411672,"alt":1343.127,
267 "eph":36.000,"epv":32.321,
268 "track":10.3788,"speed":0.091,"climb":-0.085,"mode":3}
269
270 SKY
271 A SKY object reports a sky view of the GPS satellite positions. If
272 there is no GPS device available, or no skyview has been reported
273 yet, only the "class" field will reliably be present.
274
275 Table 2. SKY object
276 ┌───────────┬─────────┬─────────┬─────────────────────┐
277 │Name │ Always? │ Type │ Description │
278 ├───────────┼─────────┼─────────┼─────────────────────┤
279 │class │ Yes │ string │ Fixed: "SKY" │
280 ├───────────┼─────────┼─────────┼─────────────────────┤
281 │device │ No │ string │ Name of │
282 │ │ │ │ originating │
283 │ │ │ │ device │
284 ├───────────┼─────────┼─────────┼─────────────────────┤
285 │time │ No │ string │ Time/date stamp │
286 │ │ │ │ in ISO8601 │
287 │ │ │ │ format, UTC. May │
288 │ │ │ │ have a │
289 │ │ │ │ fractional part │
290 │ │ │ │ of up to .001sec │
291 │ │ │ │ precision. │
292 ├───────────┼─────────┼─────────┼─────────────────────┤
293 │gdop │ No │ numeric │ Geometric │
294 │ │ │ │ (hyperspherical) │
295 │ │ │ │ dilution of │
296 │ │ │ │ precision, a │
297 │ │ │ │ combination │
298 │ │ │ │ of PDOP and │
299 │ │ │ │ TDOP. A │
300 │ │ │ │ dimensionless │
301 │ │ │ │ factor which │
302 │ │ │ │ should │
303 │ │ │ │ be multiplied by │
304 │ │ │ │ a base UERE │
305 │ │ │ │ to get │
306 │ │ │ │ an error │
307 │ │ │ │ estimate. │
308 ├───────────┼─────────┼─────────┼─────────────────────┤
309 │hdop │ No │ numeric │ Horizontal dilution │
310 │ │ │ │ of precision, a │
311 │ │ │ │ dimensionless │
312 │ │ │ │ factor which should │
313 │ │ │ │ be multiplied by a │
314 │ │ │ │ base UERE to get a │
315 │ │ │ │ circular error │
316 │ │ │ │ estimate. │
317 ├───────────┼─────────┼─────────┼─────────────────────┤
318 │pdop │ No │ numeric │ Position │
319 │ │ │ │ (spherical/3D) │
320 │ │ │ │ dilution of │
321 │ │ │ │ precision, a │
322 │ │ │ │ dimensionless │
323 │ │ │ │ factor which should │
324 │ │ │ │ be multiplied by a │
325 │ │ │ │ base UERE to get an │
326 │ │ │ │ error estimate. │
327 ├───────────┼─────────┼─────────┼─────────────────────┤
328 │tdop │ No │ numeric │ Time dilution of │
329 │ │ │ │ precision, a │
330 │ │ │ │ dimensionless │
331 │ │ │ │ factor which should │
332 │ │ │ │ be multiplied by a │
333 │ │ │ │ base UERE to get an │
334 │ │ │ │ error estimate. │
335 ├───────────┼─────────┼─────────┼─────────────────────┤
336 │vdop │ No │ numeric │ Vertical (altitude) │
337 │ │ │ │ dilution of │
338 │ │ │ │ precision, a │
339 │ │ │ │ dimensionless │
340 │ │ │ │ factor which should │
341 │ │ │ │ be multiplied by a │
342 │ │ │ │ base UERE to get an │
343 │ │ │ │ error estimate. │
344 ├───────────┼─────────┼─────────┼─────────────────────┤
345 │xdop │ No │ numeric │ Longitudinal │
346 │ │ │ │ dilution of │
347 │ │ │ │ precision, a │
348 │ │ │ │ dimensionless │
349 │ │ │ │ factor which should │
350 │ │ │ │ be multiplied by a │
351 │ │ │ │ base UERE to get an │
352 │ │ │ │ error estimate. │
353 ├───────────┼─────────┼─────────┼─────────────────────┤
354 │ydop │ No │ numeric │ Latitudinal │
355 │ │ │ │ dilution of │
356 │ │ │ │ precision, a │
357 │ │ │ │ dimensionless │
358 │ │ │ │ factor which should │
359 │ │ │ │ be multiplied by a │
360 │ │ │ │ base UERE to get an │
361 │ │ │ │ error estimate. │
362 ├───────────┼─────────┼─────────┼─────────────────────┤
363 │satellites │ Yes │ list │ List of satellite │
364 │ │ │ │ objects in skyview │
365 └───────────┴─────────┴─────────┴─────────────────────┘
366 Many devices compute dilution of precision factors but do not
367 include them in their reports. Many that do report DOPs report only
368 HDOP, two-dimensional circular error. gpsd always passes through
369 whatever the device actually reports, then attempts to fill in
370 other DOPs by calculating the appropriate determinants in a
371 covariance matrix based on the satellite view. DOPs may be missing
372 if some of these determinants are singular. It can even happen that
373 the device reports an error estimate in meters when the
374 corresponding DOP is unavailable; some devices use more
375 sophisticated error modeling than the covariance calculation.
376
377 The satellite list objects have the following elements:
378
379 Table 3. Satellite object
380 ┌───────┬─────────┬─────────┬────────────────────┐
381 │Name │ Always? │ Type │ Description │
382 ├───────┼─────────┼─────────┼────────────────────┤
383 │PRN │ Yes │ numeric │ PRN ID of the │
384 │ │ │ │ satellite. 1-63 │
385 │ │ │ │ are GNSS │
386 │ │ │ │ satellites, │
387 │ │ │ │ 64-96 are │
388 │ │ │ │ GLONASS │
389 │ │ │ │ satellites, │
390 │ │ │ │ 100-164 are SBAS │
391 │ │ │ │ satellites │
392 ├───────┼─────────┼─────────┼────────────────────┤
393 │az │ Yes │ numeric │ Azimuth, degrees │
394 │ │ │ │ from true north. │
395 ├───────┼─────────┼─────────┼────────────────────┤
396 │el │ Yes │ numeric │ Elevation in │
397 │ │ │ │ degrees. │
398 ├───────┼─────────┼─────────┼────────────────────┤
399 │ss │ Yes │ numeric │ Signal strength │
400 │ │ │ │ in dB. │
401 ├───────┼─────────┼─────────┼────────────────────┤
402 │used │ Yes │ boolean │ Used in current │
403 │ │ │ │ solution? │
404 │ │ │ │ (SBAS/WAAS/EGNOS │
405 │ │ │ │ satellites may │
406 │ │ │ │ be flagged used │
407 │ │ │ │ if the solution │
408 │ │ │ │ has corrections │
409 │ │ │ │ from them, but │
410 │ │ │ │ not all drivers │
411 │ │ │ │ make this │
412 │ │ │ │ information │
413 │ │ │ │ available.) │
414 ├───────┼─────────┼─────────┼────────────────────┤
415 │gnssid │ No │ numeric │ The GNSS ID, as │
416 │ │ │ │ defined by │
417 │ │ │ │ u-blox, not │
418 │ │ │ │ NMEA. 0=GPS, │
419 │ │ │ │ 2=Galileo, │
420 │ │ │ │ 3=Beidou, │
421 │ │ │ │ 5=QZSS, │
422 │ │ │ │ 6-GLONASS. │
423 ├───────┼─────────┼─────────┼────────────────────┤
424 │svid │ no │ numeric │ The satellite ID │
425 │ │ │ │ within its │
426 │ │ │ │ constellation. As │
427 │ │ │ │ defined │
428 │ │ │ │ by u-blox, │
429 │ │ │ │ not NMEA). │
430 ├───────┼─────────┼─────────┼────────────────────┤
431 │sigid │ no │ numeric │ The signal ID of │
432 │ │ │ │ this signal. As │
433 │ │ │ │ defined by u-blox, │
434 │ │ │ │ not │
435 │ │ │ │ NMEA. See │
436 │ │ │ │ u-blox doc for │
437 │ │ │ │ details. │
438 └───────┴─────────┴─────────┴────────────────────┘
439 Note that satellite objects do not have a "class" field, as they
440 are never shipped outside of a SKY object.
441
442 When the C client library parses a SKY response, it will assert the
443 SATELLITE_SET bit in the top-level set member.
444
445 Here's an example:
446
447 {"class":"SKY","device":"/dev/pts/1",
448 "time":"2005-07-08T11:28:07.114Z",
449 "xdop":1.55,"hdop":1.24,"pdop":1.99,
450 "satellites":[
451 {"PRN":23,"el":6,"az":84,"ss":0,"used":false},
452 {"PRN":28,"el":7,"az":160,"ss":0,"used":false},
453 {"PRN":8,"el":66,"az":189,"ss":44,"used":true},
454 {"PRN":29,"el":13,"az":273,"ss":0,"used":false},
455 {"PRN":10,"el":51,"az":304,"ss":29,"used":true},
456 {"PRN":4,"el":15,"az":199,"ss":36,"used":true},
457 {"PRN":2,"el":34,"az":241,"ss":43,"used":true},
458 {"PRN":27,"el":71,"az":76,"ss":43,"used":true}]}
459
460 GST
461 A GST object is a pseudorange noise report.
462
463 Table 4. GST object
464 ┌───────┬─────────┬─────────┬──────────────────┐
465 │Name │ Always? │ Type │ Description │
466 ├───────┼─────────┼─────────┼──────────────────┤
467 │class │ Yes │ string │ Fixed: "GST" │
468 ├───────┼─────────┼─────────┼──────────────────┤
469 │device │ No │ string │ Name of │
470 │ │ │ │ originating │
471 │ │ │ │ device │
472 ├───────┼─────────┼─────────┼──────────────────┤
473 │time │ No │ string │ Time/date stamp │
474 │ │ │ │ in ISO8601 │
475 │ │ │ │ format, UTC. May │
476 │ │ │ │ have a │
477 │ │ │ │ fractional part │
478 │ │ │ │ of up to .001sec │
479 │ │ │ │ precision. │
480 ├───────┼─────────┼─────────┼──────────────────┤
481 │rms │ No │ numeric │ Value of the │
482 │ │ │ │ standard │
483 │ │ │ │ deviation of the │
484 │ │ │ │ range inputs to │
485 │ │ │ │ the navigation │
486 │ │ │ │ process (range │
487 │ │ │ │ inputs include │
488 │ │ │ │ pseudoranges and │
489 │ │ │ │ DGPS │
490 │ │ │ │ corrections). │
491 ├───────┼─────────┼─────────┼──────────────────┤
492 │major │ No │ numeric │ Standard │
493 │ │ │ │ deviation of │
494 │ │ │ │ semi-major axis │
495 │ │ │ │ of error │
496 │ │ │ │ ellipse, in │
497 │ │ │ │ meters. │
498 ├───────┼─────────┼─────────┼──────────────────┤
499 │minor │ No │ numeric │ Standard │
500 │ │ │ │ deviation of │
501 │ │ │ │ semi-minor axis │
502 │ │ │ │ of error │
503 │ │ │ │ ellipse, in │
504 │ │ │ │ meters. │
505 ├───────┼─────────┼─────────┼──────────────────┤
506 │orient │ No │ numeric │ Orientation of │
507 │ │ │ │ semi-major axis │
508 │ │ │ │ of error │
509 │ │ │ │ ellipse, in │
510 │ │ │ │ degrees from │
511 │ │ │ │ true north. │
512 ├───────┼─────────┼─────────┼──────────────────┤
513 │lat │ No │ numeric │ Standard │
514 │ │ │ │ deviation of │
515 │ │ │ │ latitude error, │
516 │ │ │ │ in meters. │
517 ├───────┼─────────┼─────────┼──────────────────┤
518 │lon │ No │ numeric │ Standard │
519 │ │ │ │ deviation of │
520 │ │ │ │ longitude error, │
521 │ │ │ │ in meters. │
522 ├───────┼─────────┼─────────┼──────────────────┤
523 │alt │ No │ numeric │ Standard │
524 │ │ │ │ deviation of │
525 │ │ │ │ altitude error, │
526 │ │ │ │ in meters. │
527 └───────┴─────────┴─────────┴──────────────────┘
528 Here's an example:
529
530 {"class":"GST","device":"/dev/ttyUSB0",
531 "time":"2010-12-07T10:23:07.096Z","rms":2.440,
532 "major":1.660,"minor":1.120,"orient":68.989,
533 "lat":1.600,"lon":1.200,"alt":2.520}
534
535 ATT
536 An ATT object is a vehicle-attitude report. It is returned by
537 digital-compass and gyroscope sensors; depending on device, it may
538 include: heading, pitch, roll, yaw, gyroscope, and magnetic-field
539 readings. Because such sensors are often bundled as part of
540 marine-navigation systems, the ATT response may also include water
541 depth.
542
543 The "class" and "mode" fields will reliably be present. Others may
544 be reported or not depending on the specific device type.
545
546 Table 5. ATT object
547 ┌─────────┬─────────┬─────────┬──────────────────┐
548 │Name │ Always? │ Type │ Description │
549 ├─────────┼─────────┼─────────┼──────────────────┤
550 │class │ Yes │ string │ Fixed: "ATT" │
551 ├─────────┼─────────┼─────────┼──────────────────┤
552 │device │ Yes │ string │ Name of │
553 │ │ │ │ originating │
554 │ │ │ │ device │
555 ├─────────┼─────────┼─────────┼──────────────────┤
556 │time │ No │ string │ Time/date stamp │
557 │ │ │ │ in ISO8601 │
558 │ │ │ │ format, UTC. May │
559 │ │ │ │ have a │
560 │ │ │ │ fractional part │
561 │ │ │ │ of up to .001sec │
562 │ │ │ │ precision. │
563 ├─────────┼─────────┼─────────┼──────────────────┤
564 │heading │ No │ numeric │ Heading, degrees │
565 │ │ │ │ from true north. │
566 ├─────────┼─────────┼─────────┼──────────────────┤
567 │mag_st │ No │ string │ Magnetometer │
568 │ │ │ │ status. │
569 ├─────────┼─────────┼─────────┼──────────────────┤
570 │pitch │ No │ numeric │ Pitch in │
571 │ │ │ │ degrees. │
572 ├─────────┼─────────┼─────────┼──────────────────┤
573 │pitch_st │ No │ string │ Pitch sensor │
574 │ │ │ │ status. │
575 ├─────────┼─────────┼─────────┼──────────────────┤
576 │yaw │ No │ numeric │ Yaw in degrees │
577 ├─────────┼─────────┼─────────┼──────────────────┤
578 │yaw_st │ No │ string │ Yaw sensor │
579 │ │ │ │ status. │
580 ├─────────┼─────────┼─────────┼──────────────────┤
581 │roll │ No │ numeric │ Roll in degrees. │
582 ├─────────┼─────────┼─────────┼──────────────────┤
583 │roll_st │ No │ string │ Roll sensor │
584 │ │ │ │ status. │
585 ├─────────┼─────────┼─────────┼──────────────────┤
586 │dip │ No │ numeric │ Local magnetic │
587 │ │ │ │ inclination, │
588 │ │ │ │ degrees, │
589 │ │ │ │ positive when │
590 │ │ │ │ the magnetic │
591 │ │ │ │ field points │
592 │ │ │ │ downward (into │
593 │ │ │ │ the Earth). │
594 ├─────────┼─────────┼─────────┼──────────────────┤
595 │mag_len │ No │ numeric │ Scalar magnetic │
596 │ │ │ │ field strength. │
597 ├─────────┼─────────┼─────────┼──────────────────┤
598 │mag_x │ No │ numeric │ X component of │
599 │ │ │ │ magnetic field │
600 │ │ │ │ strength. │
601 ├─────────┼─────────┼─────────┼──────────────────┤
602 │mag_y │ No │ numeric │ Y component of │
603 │ │ │ │ magnetic field │
604 │ │ │ │ strength. │
605 ├─────────┼─────────┼─────────┼──────────────────┤
606 │mag_z │ No │ numeric │ Z component of │
607 │ │ │ │ magnetic field │
608 │ │ │ │ strength. │
609 ├─────────┼─────────┼─────────┼──────────────────┤
610 │acc_len │ No │ numeric │ Scalar │
611 │ │ │ │ acceleration. │
612 ├─────────┼─────────┼─────────┼──────────────────┤
613 │acc_x │ No │ numeric │ X component of │
614 │ │ │ │ acceleration. │
615 ├─────────┼─────────┼─────────┼──────────────────┤
616 │acc_y │ No │ numeric │ Y component of │
617 │ │ │ │ acceleration. │
618 ├─────────┼─────────┼─────────┼──────────────────┤
619 │acc_z │ No │ numeric │ Z component of │
620 │ │ │ │ acceleration. │
621 ├─────────┼─────────┼─────────┼──────────────────┤
622 │gyro_x │ No │ numeric │ X component of │
623 │ │ │ │ acceleration. │
624 ├─────────┼─────────┼─────────┼──────────────────┤
625 │gyro_y │ No │ numeric │ Y component of │
626 │ │ │ │ acceleration. │
627 ├─────────┼─────────┼─────────┼──────────────────┤
628 │depth │ No │ numeric │ Water depth in │
629 │ │ │ │ meters. │
630 ├─────────┼─────────┼─────────┼──────────────────┤
631 │temp │ No │ numeric │ Temperature at │
632 │ │ │ │ sensor, degrees │
633 │ │ │ │ centigrade. │
634 └─────────┴─────────┴─────────┴──────────────────┘
635 The heading, pitch, and roll status codes (if present) vary by
636 device. For the TNT Revolution digital compasses, they are coded as
637 follows:
638
639 Table 6. Device flags
640 ┌─────┬────────────────────────────┐
641 │Code │ Description │
642 ├─────┼────────────────────────────┤
643 │C │ magnetometer calibration │
644 │ │ alarm │
645 ├─────┼────────────────────────────┤
646 │L │ low alarm │
647 ├─────┼────────────────────────────┤
648 │M │ low warning │
649 ├─────┼────────────────────────────┤
650 │N │ normal │
651 ├─────┼────────────────────────────┤
652 │O │ high warning │
653 ├─────┼────────────────────────────┤
654 │P │ high alarm │
655 ├─────┼────────────────────────────┤
656 │V │ magnetometer voltage level │
657 │ │ alarm │
658 └─────┴────────────────────────────┘
659 When the C client library parses a response of this kind, it will
660 assert ATT_IS.
661
662 Here's an example:
663
664 {"class":"ATT","time":1270938096.843,
665 "heading":14223.00,"mag_st":"N",
666 "pitch":169.00,"pitch_st":"N", "roll":-43.00,"roll_st":"N",
667 "dip":13641.000,"mag_x":2454.000}
668
669 And here are the commands:
670
671 ?VERSION;
672 Returns an object with the following attributes:
673
674 Table 7. VERSION object
675 ┌────────────┬─────────┬─────────┬──────────────────┐
676 │Name │ Always? │ Type │ Description │
677 ├────────────┼─────────┼─────────┼──────────────────┤
678 │class │ Yes │ string │ Fixed: "VERSION" │
679 ├────────────┼─────────┼─────────┼──────────────────┤
680 │release │ Yes │ string │ Public release │
681 │ │ │ │ level │
682 ├────────────┼─────────┼─────────┼──────────────────┤
683 │rev │ Yes │ string │ Internal │
684 │ │ │ │ revision-control │
685 │ │ │ │ level. │
686 ├────────────┼─────────┼─────────┼──────────────────┤
687 │proto_major │ Yes │ numeric │ API major │
688 │ │ │ │ revision level. │
689 ├────────────┼─────────┼─────────┼──────────────────┤
690 │proto_minor │ Yes │ numeric │ API minor │
691 │ │ │ │ revision level. │
692 ├────────────┼─────────┼─────────┼──────────────────┤
693 │remote │ No │ string │ URL of the │
694 │ │ │ │ remote daemon │
695 │ │ │ │ reporting this │
696 │ │ │ │ version. If │
697 │ │ │ │ empty, │
698 │ │ │ │ this is the │
699 │ │ │ │ version of the │
700 │ │ │ │ local daemon. │
701 └────────────┴─────────┴─────────┴──────────────────┘
702 The daemon ships a VERSION response to each client when the client
703 first connects to it.
704
705 When the C client library parses a response of this kind, it will
706 assert the VERSION_SET bit in the top-level set member.
707
708 Here's an example:
709
710 {"class":"VERSION","version":"2.40dev",
711 "rev":"06f62e14eae9886cde907dae61c124c53eb1101f",
712 "proto_major":3,"proto_minor":1
713 }
714
715 ?DEVICES;
716 Returns a device list object with the following elements:
717
718 Table 8. DEVICES object
719 ┌────────┬─────────┬────────┬──────────────────┐
720 │Name │ Always? │ Type │ Description │
721 ├────────┼─────────┼────────┼──────────────────┤
722 │class │ Yes │ string │ Fixed: "DEVICES" │
723 ├────────┼─────────┼────────┼──────────────────┤
724 │devices │ Yes │ list │ List of device │
725 │ │ │ │ descriptions │
726 ├────────┼─────────┼────────┼──────────────────┤
727 │remote │ No │ string │ URL of the │
728 │ │ │ │ remote daemon │
729 │ │ │ │ reporting the │
730 │ │ │ │ device set. If │
731 │ │ │ │ empty, │
732 │ │ │ │ this is a │
733 │ │ │ │ DEVICES response │
734 │ │ │ │ from the local │
735 │ │ │ │ daemon. │
736 └────────┴─────────┴────────┴──────────────────┘
737 When the C client library parses a response of this kind, it will
738 assert the DEVICELIST_SET bit in the top-level set member.
739
740 Here's an example:
741
742 {"class"="DEVICES","devices":[
743 {"class":"DEVICE","path":"/dev/pts/1","flags":1,"driver":"SiRF binary"},
744 {"class":"DEVICE","path":"/dev/pts/3","flags":4,"driver":"AIVDM"}]}
745
746 The daemon occasionally ships a bare DEVICE object to the client
747 (that is, one not inside a DEVICES wrapper). The data content of
748 these objects will be described later as a response to the ?DEVICE
749 command.
750
751 ?WATCH;
752 This command sets watcher mode. It also sets or elicits a report of
753 per-subscriber policy and the raw bit. An argument WATCH object
754 changes the subscriber's policy. The response describes the
755 subscriber's policy. The response will also include a DEVICES
756 object.
757
758 A WATCH object has the following elements:
759
760 Table 9. WATCH object
761 ┌────────┬─────────┬─────────┬──────────────────┐
762 │Name │ Always? │ Type │ Description │
763 ├────────┼─────────┼─────────┼──────────────────┤
764 │class │ Yes │ string │ Fixed: "WATCH" │
765 ├────────┼─────────┼─────────┼──────────────────┤
766 │enable │ No │ boolean │ Enable (true) or │
767 │ │ │ │ disable (false) │
768 │ │ │ │ watcher mode. │
769 │ │ │ │ Default is true. │
770 ├────────┼─────────┼─────────┼──────────────────┤
771 │json │ No │ boolean │ Enable (true) or │
772 │ │ │ │ disable (false) │
773 │ │ │ │ dumping of JSON │
774 │ │ │ │ reports. │
775 │ │ │ │ Default is │
776 │ │ │ │ false. │
777 ├────────┼─────────┼─────────┼──────────────────┤
778 │nmea │ No │ boolean │ Enable (true) or │
779 │ │ │ │ disable (false) │
780 │ │ │ │ dumping of │
781 │ │ │ │ binary packets │
782 │ │ │ │ as pseudo-NMEA. │
783 │ │ │ │ Default is │
784 │ │ │ │ false. │
785 ├────────┼─────────┼─────────┼──────────────────┤
786 │raw │ No │ integer │ Controls 'raw' │
787 │ │ │ │ mode. When this │
788 │ │ │ │ attribute is set │
789 │ │ │ │ to 1 for a │
790 │ │ │ │ channel, gpsd │
791 │ │ │ │ reports the │
792 │ │ │ │ unprocessed NMEA │
793 │ │ │ │ or AIVDM data │
794 │ │ │ │ stream from │
795 │ │ │ │ whatever device │
796 │ │ │ │ is attached. │
797 │ │ │ │ Binary GPS │
798 │ │ │ │ packets are │
799 │ │ │ │ hex-dumped. │
800 │ │ │ │ RTCM2 and RTCM3 │
801 │ │ │ │ packets │
802 │ │ │ │ are not dumped │
803 │ │ │ │ in raw mode. │
804 │ │ │ │ When this │
805 │ │ │ │ attribute is set │
806 │ │ │ │ to 2 for a │
807 │ │ │ │ channel that │
808 │ │ │ │ processes binary │
809 │ │ │ │ data, gpsd │
810 │ │ │ │ reports the │
811 │ │ │ │ received data │
812 │ │ │ │ verbatim without │
813 │ │ │ │ hex-dumping. │
814 ├────────┼─────────┼─────────┼──────────────────┤
815 │scaled │ No │ boolean │ If true, apply │
816 │ │ │ │ scaling divisors │
817 │ │ │ │ to output before │
818 │ │ │ │ dumping; default │
819 │ │ │ │ is false. │
820 ├────────┼─────────┼─────────┼──────────────────┤
821 │split24 │ No │ boolean │ If true, │
822 │ │ │ │ aggregate AIS │
823 │ │ │ │ type24 sentence │
824 │ │ │ │ parts. If │
825 │ │ │ │ false, │
826 │ │ │ │ report │
827 │ │ │ │ each part as a │
828 │ │ │ │ separate JSON │
829 │ │ │ │ object, leaving │
830 │ │ │ │ the │
831 │ │ │ │ client │
832 │ │ │ │ to match MMSIs │
833 │ │ │ │ and aggregate. │
834 │ │ │ │ Default is │
835 │ │ │ │ false. │
836 │ │ │ │ Applies only to │
837 │ │ │ │ AIS reports. │
838 ├────────┼─────────┼─────────┼──────────────────┤
839 │pps │ No │ boolean │ If true, emit │
840 │ │ │ │ the TOFF JSON │
841 │ │ │ │ message on each │
842 │ │ │ │ cycle and a PPS │
843 │ │ │ │ JSON message │
844 │ │ │ │ when the device │
845 │ │ │ │ issues 1PPS. │
846 │ │ │ │ Default is │
847 │ │ │ │ false. │
848 ├────────┼─────────┼─────────┼──────────────────┤
849 │device │ No │ string │ If present, │
850 │ │ │ │ enable watching │
851 │ │ │ │ only of the │
852 │ │ │ │ specified device │
853 │ │ │ │ rather than all │
854 │ │ │ │ devices. Useful │
855 │ │ │ │ with raw and │
856 │ │ │ │ NMEA modes in │
857 │ │ │ │ which device │
858 │ │ │ │ responses aren't │
859 │ │ │ │ tagged. Has no │
860 │ │ │ │ effect when used │
861 │ │ │ │ with │
862 │ │ │ │ enable:false. │
863 ├────────┼─────────┼─────────┼──────────────────┤
864 │remote │ No │ string │ URL of the │
865 │ │ │ │ remote daemon │
866 │ │ │ │ reporting the │
867 │ │ │ │ watch set. If │
868 │ │ │ │ empty, │
869 │ │ │ │ this is a WATCH │
870 │ │ │ │ response from │
871 │ │ │ │ the local │
872 │ │ │ │ daemon. │
873 └────────┴─────────┴─────────┴──────────────────┘
874 There is an additional boolean "timing" attribute which is
875 undocumented because that portion of the interface is considered
876 unstable and for developer use only.
877
878 In watcher mode, GPS reports are dumped as TPV and SKY responses.
879 AIS, Subframe and RTCM reporting is described in the next section.
880
881 When the C client library parses a response of this kind, it will
882 assert the POLICY_SET bit in the top-level set member.
883
884 Here's an example:
885
886 {"class":"WATCH", "raw":1,"scaled":true}
887
888 ?POLL;
889 The POLL command requests data from the last-seen fixes on all
890 active GPS devices. Devices must previously have been activated by
891 ?WATCH to be pollable.
892
893 Polling can lead to possibly surprising results when it is used on
894 a device such as an NMEA GPS for which a complete fix has to be
895 accumulated from several sentences. If you poll while those
896 sentences are being emitted, the response will contain the last
897 complete fix data and may be as much as one cycle time (typically 1
898 second) stale.
899
900 The POLL response will contain a timestamped list of TPV objects
901 describing cached data, and a timestamped list of SKY objects
902 describing satellite configuration. If a device has not seen fixes,
903 it will be reported with a mode field of zero.
904
905 Table 10. POLL object
906 ┌───────┬─────────┬────────────┬──────────────────┐
907 │Name │ Always? │ Type │ Description │
908 ├───────┼─────────┼────────────┼──────────────────┤
909 │class │ Yes │ string │ Fixed: "POLL" │
910 ├───────┼─────────┼────────────┼──────────────────┤
911 │time │ Yes │ Numeric │ Timestamp in ISO │
912 │ │ │ │ 8601 format. May │
913 │ │ │ │ have a │
914 │ │ │ │ fractional part │
915 │ │ │ │ of up to .001sec │
916 │ │ │ │ precision. │
917 ├───────┼─────────┼────────────┼──────────────────┤
918 │active │ Yes │ Numeric │ Count of active │
919 │ │ │ │ devices. │
920 ├───────┼─────────┼────────────┼──────────────────┤
921 │tpv │ Yes │ JSON array │ Comma-separated │
922 │ │ │ │ list of TPV │
923 │ │ │ │ objects. │
924 ├───────┼─────────┼────────────┼──────────────────┤
925 │sky │ Yes │ JSON array │ Comma-separated │
926 │ │ │ │ list of SKY │
927 │ │ │ │ objects. │
928 └───────┴─────────┴────────────┴──────────────────┘
929 Here's an example of a POLL response:
930
931 {"class":"POLL","time":"2010-06-04T10:31:00.289Z","active":1,
932 "tpv":[{"class":"TPV","device":"/dev/ttyUSB0",
933 "time":"2010-09-08T13:33:06.095Z",
934 "ept":0.005,"lat":40.035093060,
935 "lon":-75.519748733,"track":99.4319,"speed":0.123,"mode":2}],
936 "sky":[{"class":"SKY","device":"/dev/ttyUSB0",
937 "time":1270517264.240,"hdop":9.20,
938 "satellites":[{"PRN":16,"el":55,"az":42,"ss":36,"used":true},
939 {"PRN":19,"el":25,"az":177,"ss":0,"used":false},
940 {"PRN":7,"el":13,"az":295,"ss":0,"used":false},
941 {"PRN":6,"el":56,"az":135,"ss":32,"used":true},
942 {"PRN":13,"el":47,"az":304,"ss":0,"used":false},
943 {"PRN":23,"el":66,"az":259,"ss":0,"used":false},
944 {"PRN":20,"el":7,"az":226,"ss":0,"used":false},
945 {"PRN":3,"el":52,"az":163,"ss":32,"used":true},
946 {"PRN":31,"el":16,"az":102,"ss":0,"used":false}
947 ]}]}
948
949 Note
950 Client software should not assume the field inventory of the
951 POLL response is fixed for all time. As gpsd collects and
952 caches more data from more sensor types, those data are likely
953 to find their way into this response.
954
955 TOFF
956 This message is emitted on each cycle and reports the offset
957 between the host's clock time and the GPS time at top of second
958 (actually, when the first data for the reporting cycle is
959 received).
960
961 This message exactly mirrors the PPS message except for two
962 details.
963
964 TOFF emits no NTP precision, this is assumed to be -2. See the NTP
965 documentation for their definition of precision.
966
967 The TOFF message reports the GPS time as derived from the GPS
968 serial data stream. The PPS message reports the GPS time as derived
969 from the GPS PPS pulse.
970
971 A TOFF object has the following elements:
972
973 Table 11. TOFF object
974 ┌───────────┬─────────┬─────────┬──────────────────┐
975 │Name │ Always? │ Type │ Description │
976 ├───────────┼─────────┼─────────┼──────────────────┤
977 │class │ Yes │ string │ Fixed: "TOFF" │
978 ├───────────┼─────────┼─────────┼──────────────────┤
979 │device │ Yes │ string │ Name of │
980 │ │ │ │ originating │
981 │ │ │ │ device │
982 ├───────────┼─────────┼─────────┼──────────────────┤
983 │real_sec │ Yes │ numeric │ seconds from the │
984 │ │ │ │ GPS clock │
985 ├───────────┼─────────┼─────────┼──────────────────┤
986 │real_nsec │ Yes │ numeric │ nanoseconds from │
987 │ │ │ │ the GPS clock │
988 ├───────────┼─────────┼─────────┼──────────────────┤
989 │clock_sec │ Yes │ numeric │ seconds from the │
990 │ │ │ │ system clock │
991 ├───────────┼─────────┼─────────┼──────────────────┤
992 │clock_nsec │ Yes │ numeric │ nanoseconds from │
993 │ │ │ │ the system clock │
994 └───────────┴─────────┴─────────┴──────────────────┘
995 This message is emitted once per second to watchers of a device and
996 is intended to report the time stamps of the in-band report of the
997 GPS and seconds as reported by the system clock (which may be
998 NTP-corrected) when the first valid timestamp of the reporting
999 cycle was seen.
1000
1001 The message contains two second/nanosecond pairs: real_sec and
1002 real_nsec contain the time the GPS thinks it was at the start of
1003 the current cycle; clock_sec and clock_nsec contain the time the
1004 system clock thinks it was on receipt of the first timing message
1005 of the cycle. real_nsec is always to nanosecond precision.
1006 clock_nsec is nanosecond precision on most systems.
1007
1008 Here's an example:
1009
1010 {"class":"TOFF","device":"/dev/ttyUSB0",
1011 "real_sec":1330212592, "real_nsec":343182,
1012 "clock_sec":1330212592,"clock_nsec":343184,
1013 "precision":-2}}
1014
1015 PPS
1016 This message is emitted each time the daemon sees a valid PPS
1017 (Pulse Per Second) strobe from a device.
1018
1019 This message exactly mirrors the TOFF message except for two
1020 details.
1021
1022 PPS emits the NTP precision. See the NTP documentation for their
1023 definition of precision.
1024
1025 The TOFF message reports the GPS time as derived from the GPS
1026 serial data stream. The PPS message reports the GPS time as derived
1027 from the GPS PPS pulse.
1028
1029 There are various sources of error in the reported clock times. The
1030 speed of the serial connection between the GPS and the system adds
1031 a delay to start of cycle detection. An even bigger error is added
1032 by the variable computation time inside the GPS. Taken together the
1033 time derived from the start of the GPS cycle can have offsets of 10
1034 millisecond to 700 milliseconds and combined jjitter and wander of
1035 100 to 300 millisecond.
1036
1037 A PPS object has the following elements:
1038
1039 Table 12. PPS object
1040 ┌───────────┬─────────┬─────────┬──────────────────┐
1041 │Name │ Always? │ Type │ Description │
1042 ├───────────┼─────────┼─────────┼──────────────────┤
1043 │class │ Yes │ string │ Fixed: "PPS" │
1044 ├───────────┼─────────┼─────────┼──────────────────┤
1045 │device │ Yes │ string │ Name of │
1046 │ │ │ │ originating │
1047 │ │ │ │ device │
1048 ├───────────┼─────────┼─────────┼──────────────────┤
1049 │real_sec │ Yes │ numeric │ seconds from the │
1050 │ │ │ │ PPS source │
1051 ├───────────┼─────────┼─────────┼──────────────────┤
1052 │real_nsec │ Yes │ numeric │ nanoseconds from │
1053 │ │ │ │ the PPS source │
1054 ├───────────┼─────────┼─────────┼──────────────────┤
1055 │clock_sec │ Yes │ numeric │ seconds from the │
1056 │ │ │ │ system clock │
1057 ├───────────┼─────────┼─────────┼──────────────────┤
1058 │clock_nsec │ Yes │ numeric │ nanoseconds from │
1059 │ │ │ │ the system clock │
1060 ├───────────┼─────────┼─────────┼──────────────────┤
1061 │precision │ Yes │ numeric │ NTP style │
1062 │ │ │ │ estimate of PPS │
1063 │ │ │ │ precision │
1064 └───────────┴─────────┴─────────┴──────────────────┘
1065 This message is emitted once per second to watchers of a device
1066 emitting PPS, and reports the time of the start of the GPS second
1067 (when the 1PPS arrives) and seconds as reported by the system clock
1068 (which may be NTP-corrected) at that moment.
1069
1070 The message contains two second/nanosecond pairs: real_sec and
1071 real_nsec contain the time the GPS thinks it was at the PPS edge;
1072 clock_sec and clock_nsec contain the time the system clock thinks
1073 it was at the PPS edge. real_nsec is always to nanosecond
1074 precision. clock_nsec is nanosecond precision on most systems.
1075
1076 There are various sources of error in the reported clock times. For
1077 PPS delivered via a real serial-line strobe, serial-interrupt
1078 latency plus processing time to the timer call should be bounded
1079 above by about 10 microseconds; that can be reduced to less than 1
1080 microsecond if your kernel supports RFC 2783. USB1.1-to-serial
1081 control-line emulation is limited to about 1 millisecond. seconds.
1082
1083 Here's an example:
1084
1085 {"class":"PPS","device":"/dev/ttyUSB0",
1086 "real_sec":1330212592, "real_nsec":343182,
1087 "clock_sec":1330212592,"clock_nsec":343184,
1088 "precision":-3}
1089
1090 OSC
1091 This message reports the status of a GPS-disciplined oscillator
1092 (GPSDO). The GPS PPS output (which has excellent long-term
1093 stability) is typically used to discipline a local oscillator with
1094 much better short-term stability (such as a rubidium atomic clock).
1095
1096 An OSC object has the following elements:
1097
1098 Table 13. OSC object
1099 ┌────────────┬─────────┬─────────┬──────────────────┐
1100 │Name │ Always? │ Type │ Description │
1101 ├────────────┼─────────┼─────────┼──────────────────┤
1102 │class │ Yes │ string │ Fixed: "OSC" │
1103 ├────────────┼─────────┼─────────┼──────────────────┤
1104 │device │ Yes │ string │ Name of │
1105 │ │ │ │ originating │
1106 │ │ │ │ device. │
1107 ├────────────┼─────────┼─────────┼──────────────────┤
1108 │running │ Yes │ boolean │ If true, the │
1109 │ │ │ │ oscillator is │
1110 │ │ │ │ currently │
1111 │ │ │ │ running. │
1112 │ │ │ │ Oscillators may │
1113 │ │ │ │ require warm-up │
1114 │ │ │ │ time at start of │
1115 │ │ │ │ day. │
1116 ├────────────┼─────────┼─────────┼──────────────────┤
1117 │reference │ Yes │ boolean │ If true, the │
1118 │ │ │ │ oscillator is │
1119 │ │ │ │ receiving a GPS │
1120 │ │ │ │ PPS signal. │
1121 ├────────────┼─────────┼─────────┼──────────────────┤
1122 │disciplined │ Yes │ boolean │ If true, the GPS │
1123 │ │ │ │ PPS signal is │
1124 │ │ │ │ sufficiently │
1125 │ │ │ │ stable and is │
1126 │ │ │ │ being used to │
1127 │ │ │ │ discipline the │
1128 │ │ │ │ local │
1129 │ │ │ │ oscillator. │
1130 ├────────────┼─────────┼─────────┼──────────────────┤
1131 │delta │ Yes │ numeric │ The time │
1132 │ │ │ │ difference (in │
1133 │ │ │ │ nanoseconds) │
1134 │ │ │ │ between the │
1135 │ │ │ │ GPS-disciplined │
1136 │ │ │ │ oscillator PPS │
1137 │ │ │ │ output pulse and │
1138 │ │ │ │ the most recent │
1139 │ │ │ │ GPS PPS input │
1140 │ │ │ │ pulse. │
1141 └────────────┴─────────┴─────────┴──────────────────┘
1142 Here's an example:
1143
1144 {"class":"OSC","running":true,"device":"/dev/ttyUSB0",
1145 "reference":true,"disciplined":true,"delta":67}
1146
1147 ?DEVICE
1148 This command reports (when followed by ';') the state of a device,
1149 or sets (when followed by '=' and a DEVICE object) device-specific
1150 control bits, notably the device's speed and serial mode and the
1151 native-mode bit. The parameter-setting form will be rejected if
1152 more than one client is attached to the channel.
1153
1154 Pay attention to the response, because it is possible for this
1155 command to fail if the GPS does not support a speed-switching
1156 command or only supports some combinations of serial modes. In case
1157 of failure, the daemon and GPS will continue to communicate at the
1158 old speed.
1159
1160 Use the parameter-setting form with caution. On USB and Bluetooth
1161 GPSes it is also possible for serial mode setting to fail either
1162 because the serial adaptor chip does not support non-8N1 modes or
1163 because the device firmware does not properly synchronize the
1164 serial adaptor chip with the UART on the GPS chipset when the speed
1165 changes. These failures can hang your device, possibly requiring a
1166 GPS power cycle or (in extreme cases) physically disconnecting the
1167 NVRAM backup battery.
1168
1169 A DEVICE object has the following elements:
1170
1171 Table 14. DEVICE object
1172 ┌──────────┬──────────────────┬─────────┬────────────────────┐
1173 │Name │ Always? │ Type │ Description │
1174 ├──────────┼──────────────────┼─────────┼────────────────────┤
1175 │class │ Yes │ string │ Fixed: "DEVICE" │
1176 ├──────────┼──────────────────┼─────────┼────────────────────┤
1177 │path │ No │ string │ Name the device │
1178 │ │ │ │ for which the │
1179 │ │ │ │ control bits are │
1180 │ │ │ │ being reported, │
1181 │ │ │ │ or for which │
1182 │ │ │ │ they are to be │
1183 │ │ │ │ applied. This │
1184 │ │ │ │ attribute │
1185 │ │ │ │ may be omitted │
1186 │ │ │ │ only when there │
1187 │ │ │ │ is exactly one │
1188 │ │ │ │ subscribed │
1189 │ │ │ │ channel. │
1190 ├──────────┼──────────────────┼─────────┼────────────────────┤
1191 │activated │ No │ string │ Time the device │
1192 │ │ │ │ was activated as │
1193 │ │ │ │ an ISO8601 │
1194 │ │ │ │ timestamp. │
1195 │ │ │ │ If the device is │
1196 │ │ │ │ inactive this │
1197 │ │ │ │ attribute is │
1198 │ │ │ │ absent. │
1199 ├──────────┼──────────────────┼─────────┼────────────────────┤
1200 │flags │ No │ integer │ Bit vector of │
1201 │ │ │ │ property flags. │
1202 │ │ │ │ Currently defined │
1203 │ │ │ │ flags are: │
1204 │ │ │ │ describe │
1205 │ │ │ │ packet types seen │
1206 │ │ │ │ so far (GPS, │
1207 │ │ │ │ RTCM2, RTCM3, │
1208 │ │ │ │ AIS). Won't be │
1209 │ │ │ │ reported if empty, │
1210 │ │ │ │ e.g. before gpsd │
1211 │ │ │ │ has seen │
1212 │ │ │ │ identifiable │
1213 │ │ │ │ packets from the │
1214 │ │ │ │ device. │
1215 ├──────────┼──────────────────┼─────────┼────────────────────┤
1216 │driver │ No │ string │ GPSD's name for │
1217 │ │ │ │ the device driver │
1218 │ │ │ │ type. Won't be │
1219 │ │ │ │ reported before │
1220 │ │ │ │ gpsd has seen │
1221 │ │ │ │ identifiable │
1222 │ │ │ │ packets from the │
1223 │ │ │ │ device. │
1224 ├──────────┼──────────────────┼─────────┼────────────────────┤
1225 │subtype │ When the daemon │ string │ Whatever version │
1226 │ │ sees a delayed │ │ information the │
1227 │ │ response to a │ │ device returned. │
1228 │ │ probe for │ │ │
1229 │ │ subtype or │ │ │
1230 │ │ firmware-version │ │ │
1231 │ │ information. │ │ │
1232 ├──────────┼──────────────────┼─────────┼────────────────────┤
1233 │bps │ No │ integer │ Device speed in │
1234 │ │ │ │ bits per second. │
1235 ├──────────┼──────────────────┼─────────┼────────────────────┤
1236 │parity │ No │ string │ N, O or E for no │
1237 │ │ │ │ parity, odd, or │
1238 │ │ │ │ even. │
1239 ├──────────┼──────────────────┼─────────┼────────────────────┤
1240 │stopbits │ Yes │ string │ Stop bits (1 or │
1241 │ │ │ │ 2). │
1242 ├──────────┼──────────────────┼─────────┼────────────────────┤
1243 │native │ No │ integer │ 0 means NMEA mode │
1244 │ │ │ │ and 1 means │
1245 │ │ │ │ alternate mode │
1246 │ │ │ │ (binary if it has │
1247 │ │ │ │ one, for SiRF and │
1248 │ │ │ │ Evermore chipsets │
1249 │ │ │ │ in particular). │
1250 │ │ │ │ Attempting to set │
1251 │ │ │ │ this mode on a │
1252 │ │ │ │ non-GPS device │
1253 │ │ │ │ will yield an │
1254 │ │ │ │ error. │
1255 ├──────────┼──────────────────┼─────────┼────────────────────┤
1256 │cycle │ No │ real │ Device cycle time │
1257 │ │ │ │ in seconds. │
1258 ├──────────┼──────────────────┼─────────┼────────────────────┤
1259 │mincycle │ No │ real │ Device minimum │
1260 │ │ │ │ cycle time in │
1261 │ │ │ │ seconds. Reported │
1262 │ │ │ │ from ?DEVICE when │
1263 │ │ │ │ (and only when) │
1264 │ │ │ │ the rate is │
1265 │ │ │ │ switchable. It is │
1266 │ │ │ │ read-only and not │
1267 │ │ │ │ settable. │
1268 └──────────┴──────────────────┴─────────┴────────────────────┘
1269 The serial parameters will (bps, parity, stopbits) be omitted in a
1270 response describing a TCP/IP source such as an Ntrip, DGPSIP, or
1271 AIS feed; on a serial device they will always be present.
1272
1273 The contents of the flags field should be interpreted as follows:
1274
1275 Table 15. Device flags
1276 ┌───────────┬───────┬─────────────────────┐
1277 │C #define │ Value │ Description │
1278 ├───────────┼───────┼─────────────────────┤
1279 │SEEN_GPS │ 0x01 │ GPS data has been │
1280 │ │ │ seen on this device │
1281 ├───────────┼───────┼─────────────────────┤
1282 │SEEN_RTCM2 │ 0x02 │ RTCM2 data has been │
1283 │ │ │ seen on this device │
1284 ├───────────┼───────┼─────────────────────┤
1285 │SEEN_RTCM3 │ 0x04 │ RTCM3 data has been │
1286 │ │ │ seen on this device │
1287 ├───────────┼───────┼─────────────────────┤
1288 │SEEN_AIS │ 0x08 │ AIS data has been │
1289 │ │ │ seen on this device │
1290 └───────────┴───────┴─────────────────────┘
1291 When the C client library parses a response of this kind, it will
1292 assert the DEVICE_SET bit in the top-level set member.
1293
1294 Here's an example:
1295
1296 {"class":"DEVICE","bps":4800,"parity":"N","stopbits":1,"native":0}
1297
1298 When a client is in watcher mode, the daemon will ship it DEVICE
1299 notifications when a device is added to the pool or deactivated.
1300
1301 When the C client library parses a response of this kind, it will
1302 assert the DEVICE_SET bit in the top-level set member.
1303
1304 Here's an example:
1305
1306 {"class":"DEVICE","path":"/dev/pts1","activated":0}
1307
1308 The daemon may ship an error object in response to a syntactically
1309 invalid command line or unknown command. It has the following elements:
1310
1311 Table 16. ERROR notification object
1312 ┌────────┬─────────┬────────┬────────────────┐
1313 │Name │ Always? │ Type │ Description │
1314 ├────────┼─────────┼────────┼────────────────┤
1315 │class │ Yes │ string │ Fixed: "ERROR" │
1316 ├────────┼─────────┼────────┼────────────────┤
1317 │message │ Yes │ string │ Textual error │
1318 │ │ │ │ message │
1319 └────────┴─────────┴────────┴────────────────┘
1320
1321 Here's an example:
1322
1323 {"class":"ERROR","message":"Unrecognized request '?FOO'"}
1324
1325 When the C client library parses a response of this kind, it will
1326 assert the ERR_SET bit in the top-level set member.
1327
1329 RTCM-104 is a family of serial protocols used for broadcasting
1330 pseudorange corrections from differential-GPS reference stations. Many
1331 GPS receivers can accept these corrections to improve their reporting
1332 accuracy.
1333
1334 RTCM-104 comes in two major and incompatible flavors, 2.x and 3.x. Each
1335 major flavor has minor (compatible) revisions.
1336
1337 The applicable standard for RTCM Version 2.x is RTCM Recommended
1338 Standards for Differential NAVSTAR GPS Service RTCM Paper 194-93/SC
1339 104-STD. For RTCM 3.1 it is RTCM Paper 177-2006-SC104-STD. Ordering
1340 instructions for both standards are accessible from the website of the
1341 Radio Technical Commission for Maritime Services[1] under
1342 "Publications".
1343
1344 RTCM WIRE TRANSMISSIONS
1345 Differential-GPS correction stations consist of a GPS reference
1346 receiver coupled to a low frequency (LF) transmitter. The GPS reference
1347 receiver is a survey-grade GPS that does GPS carrier tracking and can
1348 work out its own position to a few millimeters. It generates range and
1349 range-rate corrections and encodes them into RTCM104. It ships the
1350 RTCM104 to the LF transmitter over serial rs-232 signal at 100 baud or
1351 200 baud depending on the requirements of the transmitter.
1352
1353 The LF transmitter broadcasts the approximately 300khz radio signal
1354 that differential-GPS radio receivers pick up. Transmitters that are
1355 meant to have a higher range will need to transmit at the slower rate.
1356 The higher the data rate the harder it will be for the remote radio
1357 receiver to receive with a good signal-to-noise ration. (Higher data
1358 rate signals can't be averaged over as long a time frame, hence they
1359 appear noisier.)
1360
1361 RTCM WIRE FORMATS
1362 An RTCM 2.x message consists of a sequence of up to 33 30-bit words.
1363 The 24 most significant bits of each word are data and the six least
1364 significant bits are parity. The parity algorithm used is the same
1365 ISGPS-2000 as that used on GPS satellite downlinks. Each RTCM 2.x
1366 message consists of two header words followed by zero or more data
1367 words, depending upon message type.
1368
1369 An RTCM 3.x message begins with a fixed leader byte 0xD3. That is
1370 followed by six bits of version information and 10 bits of payload
1371 length information. Following that is the payload; following the
1372 payload is a 3-byte checksum of the payload using the Qualcomm CRC-24Q
1373 algorithm.
1374
1375 RTCM2 JSON FORMAT
1376 Each RTCM2 message is dumped as a single JSON object per message, with
1377 the message fields as attributes of that object. Arrays of satellite,
1378 station, and constellation statistics become arrays of JSON
1379 sub-objects. Each sentence will normally also have a "device" field
1380 containing the pathname of the originating device.
1381
1382 All attributes other than the device field are mandatory. Header
1383 attributes are emitted before others.
1384
1385 Header portion
1386 Table 17. SKY object
1387 ┌───────────────┬─────────┬─────────────────────────────┐
1388 │Name │ Type │ │
1389 │ │ │ Description │
1390 ├───────────────┼─────────┼─────────────────────────────┤
1391 │class │ string │ │
1392 │ │ │ Fixed: │
1393 │ │ │ "RTCM2". │
1394 ├───────────────┼─────────┼─────────────────────────────┤
1395 │type │ integer │ │
1396 │ │ │ Message │
1397 │ │ │ type (1-9). │
1398 ├───────────────┼─────────┼─────────────────────────────┤
1399 │station_id │ integer │ │
1400 │ │ │ The id of │
1401 │ │ │ the GPS │
1402 │ │ │ reference │
1403 │ │ │ receiver. │
1404 │ │ │ The LF │
1405 │ │ │ transmitters │
1406 │ │ │ also have │
1407 │ │ │ (different) │
1408 │ │ │ id numbers. │
1409 ├───────────────┼─────────┼─────────────────────────────┤
1410 │zcount │ real │ │
1411 │ │ │ The │
1412 │ │ │ reference │
1413 │ │ │ time of the │
1414 │ │ │ corrections │
1415 │ │ │ in the │
1416 │ │ │ message in │
1417 │ │ │ seconds │
1418 │ │ │ within the │
1419 │ │ │ current │
1420 │ │ │ hour. Note │
1421 │ │ │ that it is │
1422 │ │ │ in GPS time, │
1423 │ │ │ which is │
1424 │ │ │ some seconds │
1425 │ │ │ ahead of UTC │
1426 │ │ │ (see the │
1427 │ │ │ U.S. Naval │
1428 │ │ │ Observatory's │
1429 │ │ │ table of │
1430 │ │ │ leap second │
1431 │ │ │ corrections[2]). │
1432 ├───────────────┼─────────┼─────────────────────────────┤
1433 │seqnum │ integer │ │
1434 │ │ │ Sequence number. │
1435 │ │ │ Only 3 bits │
1436 │ │ │ wide, wraps │
1437 │ │ │ after 7. │
1438 ├───────────────┼─────────┼─────────────────────────────┤
1439 │length │ integer │ │
1440 │ │ │ The number of │
1441 │ │ │ words after the │
1442 │ │ │ header that │
1443 │ │ │ comprise the │
1444 │ │ │ message. │
1445 ├───────────────┼─────────┼─────────────────────────────┤
1446 │station_health │ integer │ │
1447 │ │ │ Station │
1448 │ │ │ transmission │
1449 │ │ │ status. │
1450 │ │ │ Indicates the │
1451 │ │ │ health of the │
1452 │ │ │ beacon as a │
1453 │ │ │ reference │
1454 │ │ │ source. Any │
1455 │ │ │ nonzero value │
1456 │ │ │ means the │
1457 │ │ │ satellite is │
1458 │ │ │ probably │
1459 │ │ │ transmitting bad │
1460 │ │ │ data and should │
1461 │ │ │ not be used in a │
1462 │ │ │ fix. 6 means the │
1463 │ │ │ transmission is │
1464 │ │ │ unmonitored. 7 │
1465 │ │ │ means the │
1466 │ │ │ station is not │
1467 │ │ │ working │
1468 │ │ │ properly. Other │
1469 │ │ │ values are │
1470 │ │ │ defined by the │
1471 │ │ │ beacon operator. │
1472 └───────────────┴─────────┴─────────────────────────────┘
1473
1474 <message type> is one of
1475
1476 1
1477 full corrections - one message containing corrections for all
1478 GPS satellites in view. This is not common.
1479
1480 3
1481 reference station parameters - the position of the reference
1482 station GPS antenna.
1483
1484 4
1485 datum — the datum to which the DGPS data is referred.
1486
1487 5
1488 constellation health — information about the satellites the
1489 beacon can see.
1490
1491 6
1492 null message — just a filler.
1493
1494 7
1495 radio beacon almanac — information about this or other beacons.
1496
1497 9
1498 subset corrections — a message containing corrections for only
1499 a subset of the GPS satellites in view.
1500
1501 16
1502 special message — a text message from the beacon operator.
1503
1504 31
1505 GLONASS subset corrections — a message containing corrections
1506 for a set of the GLONASS satellites in view.
1507
1508 Type 1 and 9: Correction data
1509 One or more satellite objects follow the header for type 1 or type
1510 9 messages. Here is the format:
1511
1512 Table 18. Satellite object
1513 ┌──────┬─────────┬─────────────────────────┐
1514 │Name │ Type │ │
1515 │ │ │ Description │
1516 ├──────┼─────────┼─────────────────────────┤
1517 │ident │ integer │ │
1518 │ │ │ The PRN │
1519 │ │ │ number of │
1520 │ │ │ the │
1521 │ │ │ satellite │
1522 │ │ │ for which │
1523 │ │ │ this is │
1524 │ │ │ correction │
1525 │ │ │ data. │
1526 ├──────┼─────────┼─────────────────────────┤
1527 │udre │ integer │ │
1528 │ │ │ User │
1529 │ │ │ Differential │
1530 │ │ │ Range Error │
1531 │ │ │ (0-3). See │
1532 │ │ │ the table │
1533 │ │ │ following │
1534 │ │ │ for values. │
1535 ├──────┼─────────┼─────────────────────────┤
1536 │iod │ integer │ │
1537 │ │ │ Issue Of │
1538 │ │ │ Data, │
1539 │ │ │ matching the │
1540 │ │ │ IOD for the │
1541 │ │ │ current │
1542 │ │ │ ephemeris of │
1543 │ │ │ this │
1544 │ │ │ satellite, │
1545 │ │ │ as │
1546 │ │ │ transmitted │
1547 │ │ │ by the │
1548 │ │ │ satellite. │
1549 │ │ │ The IOD is a │
1550 │ │ │ unique tag │
1551 │ │ │ that │
1552 │ │ │ identifies │
1553 │ │ │ the │
1554 │ │ │ ephemeris; │
1555 │ │ │ the GPS │
1556 │ │ │ using the │
1557 │ │ │ DGPS │
1558 │ │ │ correction │
1559 │ │ │ and the DGPS │
1560 │ │ │ generating │
1561 │ │ │ the data │
1562 │ │ │ must use the │
1563 │ │ │ same orbital │
1564 │ │ │ positions │
1565 │ │ │ for the │
1566 │ │ │ satellite. │
1567 ├──────┼─────────┼─────────────────────────┤
1568 │prc │ real │ │
1569 │ │ │ The │
1570 │ │ │ pseudorange │
1571 │ │ │ error in │
1572 │ │ │ meters for │
1573 │ │ │ this │
1574 │ │ │ satellite as │
1575 │ │ │ measured by │
1576 │ │ │ the beacon │
1577 │ │ │ reference │
1578 │ │ │ receiver at │
1579 │ │ │ the epoch │
1580 │ │ │ indicated by │
1581 │ │ │ the z_count │
1582 │ │ │ in the │
1583 │ │ │ parent │
1584 │ │ │ record. │
1585 ├──────┼─────────┼─────────────────────────┤
1586 │rrc │ real │ │
1587 │ │ │ The rate of │
1588 │ │ │ change of │
1589 │ │ │ pseudorange │
1590 │ │ │ error in │
1591 │ │ │ meters/sec │
1592 │ │ │ for this │
1593 │ │ │ satellite as │
1594 │ │ │ measured by │
1595 │ │ │ the beacon │
1596 │ │ │ reference │
1597 │ │ │ receiver at │
1598 │ │ │ the epoch │
1599 │ │ │ indicated by │
1600 │ │ │ the z_count │
1601 │ │ │ field in the │
1602 │ │ │ parent │
1603 │ │ │ record. This │
1604 │ │ │ is used to │
1605 │ │ │ calculate │
1606 │ │ │ pseudorange │
1607 │ │ │ errors at │
1608 │ │ │ other │
1609 │ │ │ epochs, if │
1610 │ │ │ required by │
1611 │ │ │ the GPS │
1612 │ │ │ receiver. │
1613 └──────┴─────────┴─────────────────────────┘
1614
1615 User Differential Range Error values are as follows:
1616
1617 Table 19. UDRE values
1618 ┌──┬────────────────────┐
1619 │0 │ 1-sigma error<= 1m │
1620 ├──┼────────────────────┤
1621 │1 │ 1-sigma error<= 4m │
1622 ├──┼────────────────────┤
1623 │2 │ 1-sigma error<= 8m │
1624 ├──┼────────────────────┤
1625 │3 │ 1-sigma error> 8m │
1626 └──┴────────────────────┘
1627
1628 Here's an example:
1629
1630 {"class":"RTCM2","type":1,
1631 "station_id":688,"zcount":843.0,"seqnum":5,"length":19,"station_health":6,
1632 "satellites":[
1633 {"ident":10,"udre":0,"iod":46,"prc":-2.400,"rrc":0.000},
1634 {"ident":13,"udre":0,"iod":94,"prc":-4.420,"rrc":0.000},
1635 {"ident":7,"udre":0,"iod":22,"prc":-5.160,"rrc":0.002},
1636 {"ident":2,"udre":0,"iod":34,"prc":-6.480,"rrc":0.000},
1637 {"ident":4,"udre":0,"iod":47,"prc":-8.860,"rrc":0.000},
1638 {"ident":8,"udre":0,"iod":76,"prc":-7.980,"rrc":0.002},
1639 {"ident":5,"udre":0,"iod":99,"prc":-8.260,"rrc":0.002},
1640 {"ident":23,"udre":0,"iod":81,"prc":-8.060,"rrc":0.000},
1641 {"ident":16,"udre":0,"iod":70,"prc":-11.740,"rrc":0.000},
1642 {"ident":30,"udre":0,"iod":4,"prc":-18.960,"rrc":-0.006},
1643 {"ident":29,"udre":0,"iod":101,"prc":-24.960,"rrc":-0.002}
1644 ]}
1645
1646 Type 3: Reference Station Parameters
1647 Here are the payload members of a type 3 (Reference Station
1648 Parameters) message:
1649
1650 Table 20. Reference Station Parameters
1651 ┌─────┬──────┬────────────────────────┐
1652 │Name │ Type │ │
1653 │ │ │ Description │
1654 ├─────┼──────┼────────────────────────┤
1655 │x │ real │ │
1656 │ │ │ ECEF X │
1657 │ │ │ coordinate. │
1658 ├─────┼──────┼────────────────────────┤
1659 │y │ real │ │
1660 │ │ │ ECEF Y │
1661 │ │ │ coordinate. │
1662 ├─────┼──────┼────────────────────────┤
1663 │z │ real │ │
1664 │ │ │ ECEF Z │
1665 │ │ │ coordinate. │
1666 └─────┴──────┴────────────────────────┘
1667
1668 The coordinates are the position of the station, in meters to two
1669 decimal places, in Earth Centred Earth Fixed coordinates. These are
1670 usually referred to the WGS84 reference frame, but may be referred
1671 to NAD83 in the US (essentially identical to WGS84 for all except
1672 geodesists), or to some other reference frame in other parts of the
1673 world.
1674
1675 An invalid reference message is represented by a type 3 header
1676 without payload fields.
1677
1678 Here's an example:
1679
1680 {"class":"RTCM2","type":3,
1681 "station_id":652,"zcount":1657.2,"seqnum":2,"length":4,"station_health":6,
1682 "x":3878620.92,"y":670281.40,"z":5002093.59
1683 }
1684
1685 Type 4: Datum
1686 Here are the payload members of a type 4 (Datum) message:
1687
1688 Table 21. Datum
1689 ┌───────────┬─────────┬────────────────────────┐
1690 │Name │ Type │ │
1691 │ │ │ Description │
1692 ├───────────┼─────────┼────────────────────────┤
1693 │dgnss_type │ string │ │
1694 │ │ │ Either │
1695 │ │ │ "GPS", │
1696 │ │ │ "GLONASS", │
1697 │ │ │ "GALILEO", │
1698 │ │ │ or │
1699 │ │ │ "UNKNOWN". │
1700 ├───────────┼─────────┼────────────────────────┤
1701 │dat │ integer │ │
1702 │ │ │ 0 or 1 and │
1703 │ │ │ indicates │
1704 │ │ │ the sense │
1705 │ │ │ of the │
1706 │ │ │ offset │
1707 │ │ │ shift given │
1708 │ │ │ by dx, dy, │
1709 │ │ │ dz. dat = 0 │
1710 │ │ │ means that │
1711 │ │ │ the station │
1712 │ │ │ coordinates │
1713 │ │ │ (in the │
1714 │ │ │ reference │
1715 │ │ │ message) │
1716 │ │ │ are │
1717 │ │ │ referred to │
1718 │ │ │ a local │
1719 │ │ │ datum and │
1720 │ │ │ that adding │
1721 │ │ │ dx, dy, dz │
1722 │ │ │ to that │
1723 │ │ │ position │
1724 │ │ │ will render │
1725 │ │ │ it in GNSS │
1726 │ │ │ coordinates │
1727 │ │ │ (WGS84 for │
1728 │ │ │ GPS). If │
1729 │ │ │ dat = 1 │
1730 │ │ │ then the │
1731 │ │ │ ref station │
1732 │ │ │ position is │
1733 │ │ │ in GNSS │
1734 │ │ │ coordinates │
1735 │ │ │ and adding │
1736 │ │ │ dx, dy, dz │
1737 │ │ │ will give │
1738 │ │ │ it referred │
1739 │ │ │ to the │
1740 │ │ │ local │
1741 │ │ │ datum. │
1742 ├───────────┼─────────┼────────────────────────┤
1743 │datum_name │ string │ │
1744 │ │ │ A standard │
1745 │ │ │ name for │
1746 │ │ │ the datum. │
1747 ├───────────┼─────────┼────────────────────────┤
1748 │dx │ real │ │
1749 │ │ │ X offset. │
1750 ├───────────┼─────────┼────────────────────────┤
1751 │dy │ real │ │
1752 │ │ │ Y offset. │
1753 ├───────────┼─────────┼────────────────────────┤
1754 │dz │ real │ │
1755 │ │ │ Z offset. │
1756 └───────────┴─────────┴────────────────────────┘
1757
1758 <dx> <dy> <dz> are offsets to convert from local datum to GNSS
1759 datum or vice versa. These fields are optional.
1760
1761 An invalid datum message is represented by a type 4 header without
1762 payload fields.
1763
1764 Type 5: Constellation Health
1765 One or more of these follow the header for type 5 messages — one
1766 for each satellite.
1767
1768 Here is the format:
1769
1770 Table 22. Constellation health
1771 ┌────────────┬─────────┬──────────────────────────┐
1772 │Name │ Type │ │
1773 │ │ │ Description │
1774 ├────────────┼─────────┼──────────────────────────┤
1775 │ident │ integer │ │
1776 │ │ │ The PRN │
1777 │ │ │ number of │
1778 │ │ │ the │
1779 │ │ │ satellite. │
1780 ├────────────┼─────────┼──────────────────────────┤
1781 │iodl │ bool │ │
1782 │ │ │ True │
1783 │ │ │ indicates │
1784 │ │ │ that this │
1785 │ │ │ information │
1786 │ │ │ relates to │
1787 │ │ │ the │
1788 │ │ │ satellite │
1789 │ │ │ information │
1790 │ │ │ in an │
1791 │ │ │ accompanying │
1792 │ │ │ type 1 or │
1793 │ │ │ type 9 │
1794 │ │ │ message. │
1795 ├────────────┼─────────┼──────────────────────────┤
1796 │health │ integer │ 0 indicates that the │
1797 │ │ │ satellite is healthy. │
1798 │ │ │ Any other value │
1799 │ │ │ indicates a problem │
1800 │ │ │ (coding is not │
1801 │ │ │ known)..PP │
1802 ├────────────┼─────────┼──────────────────────────┤
1803 │snr │ integer │ │
1804 │ │ │ The │
1805 │ │ │ carrier/noise │
1806 │ │ │ ratio of the │
1807 │ │ │ received │
1808 │ │ │ signal in │
1809 │ │ │ the range 25 │
1810 │ │ │ to 55 │
1811 │ │ │ dB(Hz). │
1812 ├────────────┼─────────┼──────────────────────────┤
1813 │health_en │ bool │ │
1814 │ │ │ If set to │
1815 │ │ │ True it │
1816 │ │ │ indicates │
1817 │ │ │ that the │
1818 │ │ │ satellite is │
1819 │ │ │ healthy even │
1820 │ │ │ if the │
1821 │ │ │ satellite │
1822 │ │ │ navigation │
1823 │ │ │ data says it │
1824 │ │ │ is unhealthy. │
1825 ├────────────┼─────────┼──────────────────────────┤
1826 │new_data │ bool │ True indicates that the │
1827 │ │ │ IOD for this satellite │
1828 │ │ │ will │
1829 │ │ │ soon be updated │
1830 │ │ │ in type 1 or 9 │
1831 │ │ │ messages..PP │
1832 ├────────────┼─────────┼──────────────────────────┤
1833 │los_warning │ bool │ │
1834 │ │ │ Line-of-sight │
1835 │ │ │ warning. True │
1836 │ │ │ indicates │
1837 │ │ │ that the │
1838 │ │ │ satellite │
1839 │ │ │ will shortly │
1840 │ │ │ go unhealthy. │
1841 ├────────────┼─────────┼──────────────────────────┤
1842 │tou │ integer │ │
1843 │ │ │ Healthy time │
1844 │ │ │ remaining in │
1845 │ │ │ seconds. │
1846 └────────────┴─────────┴──────────────────────────┘
1847
1848 Type 6: Null
1849 This just indicates a null message. There are no payload fields.
1850
1851 Unknown message
1852 This format is used to dump message words in hexadecimal when the
1853 message type field doesn't match any of the known ones.
1854
1855 Here is the format:
1856
1857 Table 23. Unknown Message
1858 ┌─────┬──────┬────────────────────────┐
1859 │Name │ Type │ │
1860 │ │ │ Description │
1861 ├─────┼──────┼────────────────────────┤
1862 │data │ list │ │
1863 │ │ │ A list of │
1864 │ │ │ strings. │
1865 └─────┴──────┴────────────────────────┘
1866
1867 Each string in the array is a hex literal representing 30 bits of
1868 information, after parity checks and inversion. The high two bits
1869 should be ignored.
1870
1871 Type 7: Radio Beacon Almanac
1872 Here is the format:
1873
1874 Table 24. Contellation health
1875 ┌───────────┬─────────┬───────────────────────────┐
1876 │Name │ Type │ │
1877 │ │ │ Description │
1878 ├───────────┼─────────┼───────────────────────────┤
1879 │lat │ real │ │
1880 │ │ │ Latitude in │
1881 │ │ │ degrees, of │
1882 │ │ │ the LF │
1883 │ │ │ transmitter │
1884 │ │ │ antenna for │
1885 │ │ │ the station │
1886 │ │ │ for which │
1887 │ │ │ this is an │
1888 │ │ │ almanac. │
1889 │ │ │ North is │
1890 │ │ │ positive. │
1891 ├───────────┼─────────┼───────────────────────────┤
1892 │lon │ real │ │
1893 │ │ │ Longitude │
1894 │ │ │ in degrees, │
1895 │ │ │ of the LF │
1896 │ │ │ transmitter │
1897 │ │ │ antenna for │
1898 │ │ │ the station │
1899 │ │ │ for which │
1900 │ │ │ this is an │
1901 │ │ │ almanac. │
1902 │ │ │ East is │
1903 │ │ │ positive. │
1904 ├───────────┼─────────┼───────────────────────────┤
1905 │range │ integer │ Published range of the │
1906 │ │ │ station in km..PP │
1907 ├───────────┼─────────┼───────────────────────────┤
1908 │frequency │ real │ │
1909 │ │ │ Station │
1910 │ │ │ broadcast │
1911 │ │ │ frequency │
1912 │ │ │ in kHz. │
1913 ├───────────┼─────────┼───────────────────────────┤
1914 │health │ integer │ │
1915 │ │ │ <health> is │
1916 │ │ │ the health │
1917 │ │ │ of the │
1918 │ │ │ station for │
1919 │ │ │ which this │
1920 │ │ │ is an │
1921 │ │ │ almanac. If │
1922 │ │ │ it is │
1923 │ │ │ non-zero, │
1924 │ │ │ the station │
1925 │ │ │ is issuing │
1926 │ │ │ suspect │
1927 │ │ │ data and │
1928 │ │ │ should not │
1929 │ │ │ be used for │
1930 │ │ │ fixes. The │
1931 │ │ │ ITU and │
1932 │ │ │ RTCM104 │
1933 │ │ │ standards │
1934 │ │ │ differ │
1935 │ │ │ about the │
1936 │ │ │ mode │
1937 │ │ │ detailed │
1938 │ │ │ interpretation │
1939 │ │ │ of the │
1940 │ │ │ <health> │
1941 │ │ │ field and │
1942 │ │ │ even about │
1943 │ │ │ its bit │
1944 │ │ │ width. │
1945 ├───────────┼─────────┼───────────────────────────┤
1946 │station_id │ integer │ │
1947 │ │ │ The id of the │
1948 │ │ │ transmitter. │
1949 │ │ │ This is not │
1950 │ │ │ the same as │
1951 │ │ │ the reference │
1952 │ │ │ id in the │
1953 │ │ │ header, the │
1954 │ │ │ latter being │
1955 │ │ │ the id of the │
1956 │ │ │ reference │
1957 │ │ │ receiver. │
1958 ├───────────┼─────────┼───────────────────────────┤
1959 │bitrate │ integer │ │
1960 │ │ │ The │
1961 │ │ │ transmitted │
1962 │ │ │ bitrate. │
1963 └───────────┴─────────┴───────────────────────────┘
1964
1965 Here's an example:
1966
1967 {"class":"RTCM2","type":9,"station_id":268,"zcount":252.6,
1968 "seqnum":4,"length":5,"station_health":0,
1969 "satellites":[
1970 {"ident":13,"udre":0,"iod":3,"prc":-25.940,"rrc":0.066},
1971 {"ident":2,"udre":0,"iod":73,"prc":0.920,"rrc":-0.080},
1972 {"ident":8,"udre":0,"iod":22,"prc":23.820,"rrc":0.014}
1973 ]}
1974
1975 Type 13: GPS Time of Week
1976 Here are the payload members of a type 13 (Groumf Tramitter
1977 Parameters) message:
1978
1979 Table 25. Grund Transmitter Parameters
1980 ┌──────────┬─────────┬─────────────────────────┐
1981 │Name │ Type │ │
1982 │ │ │ Description │
1983 ├──────────┼─────────┼─────────────────────────┤
1984 │status │ bool │ │
1985 │ │ │ If True, │
1986 │ │ │ signals │
1987 │ │ │ user to │
1988 │ │ │ expect a │
1989 │ │ │ type 16 │
1990 │ │ │ explanatory │
1991 │ │ │ message │
1992 │ │ │ associated │
1993 │ │ │ with this │
1994 │ │ │ station. │
1995 │ │ │ Probably │
1996 │ │ │ indicates │
1997 │ │ │ some sort │
1998 │ │ │ of unusual │
1999 │ │ │ event. │
2000 ├──────────┼─────────┼─────────────────────────┤
2001 │rangeflag │ bool │ │
2002 │ │ │ If True, │
2003 │ │ │ indicates │
2004 │ │ │ that the │
2005 │ │ │ estimated │
2006 │ │ │ range is │
2007 │ │ │ different │
2008 │ │ │ from that │
2009 │ │ │ found in │
2010 │ │ │ the Type 7 │
2011 │ │ │ message │
2012 │ │ │ (which │
2013 │ │ │ contains │
2014 │ │ │ the │
2015 │ │ │ beacon's │
2016 │ │ │ listed │
2017 │ │ │ range). │
2018 │ │ │ Generally │
2019 │ │ │ indicates a │
2020 │ │ │ range │
2021 │ │ │ reduction │
2022 │ │ │ due to │
2023 │ │ │ causes such │
2024 │ │ │ as poor │
2025 │ │ │ ionospheric │
2026 │ │ │ conditions │
2027 │ │ │ or reduced │
2028 │ │ │ transmission │
2029 │ │ │ power. │
2030 ├──────────┼─────────┼─────────────────────────┤
2031 │lat │ real │ │
2032 │ │ │ Degrees │
2033 │ │ │ latitude, │
2034 │ │ │ signed. │
2035 │ │ │ Positive is │
2036 │ │ │ N, negative │
2037 │ │ │ is S. │
2038 ├──────────┼─────────┼─────────────────────────┤
2039 │lon │ real │ │
2040 │ │ │ Degrees │
2041 │ │ │ longitude, │
2042 │ │ │ signed. │
2043 │ │ │ Positive is │
2044 │ │ │ E, negative │
2045 │ │ │ is W. │
2046 ├──────────┼─────────┼─────────────────────────┤
2047 │range │ integer │ │
2048 │ │ │ Transmission │
2049 │ │ │ range in km │
2050 │ │ │ (1-1024). │
2051 └──────────┴─────────┴─────────────────────────┘
2052
2053 This message type replaces message type 3 (Reference Station
2054 Parameters) in RTCM 2.3.
2055
2056 Type 14: GPS Time of Week
2057 Here are the payload members of a type 14 (GPS Time of Week)
2058 message:
2059
2060 Table 26. Reference Station Parameters
2061 ┌─────────┬─────────┬────────────────────────┐
2062 │Name │ Type │ │
2063 │ │ │ Description │
2064 ├─────────┼─────────┼────────────────────────┤
2065 │week │ integer │ │
2066 │ │ │ GPS week │
2067 │ │ │ (0-123). │
2068 ├─────────┼─────────┼────────────────────────┤
2069 │hour │ integer │ │
2070 │ │ │ Hour of │
2071 │ │ │ week │
2072 │ │ │ (0-167). │
2073 ├─────────┼─────────┼────────────────────────┤
2074 │leapsecs │ integer │ │
2075 │ │ │ Leap │
2076 │ │ │ Seconds │
2077 │ │ │ (0-63). │
2078 └─────────┴─────────┴────────────────────────┘
2079
2080 Here's an example:
2081
2082 {"class":"RTCM2","type":14,"station_id":652,"zcount":1657.2,
2083 "seqnum":3,"length":1,"station_health":6,"week":601,"hour":109,
2084 "leapsecs":15}
2085
2086 Type 16: Special Message
2087 Table 27. Special Message
2088 ┌────────┬────────┬────────────────────────┐
2089 │Name │ Type │ │
2090 │ │ │ Description │
2091 ├────────┼────────┼────────────────────────┤
2092 │message │ string │ │
2093 │ │ │ A text │
2094 │ │ │ message │
2095 │ │ │ sent by the │
2096 │ │ │ beacon │
2097 │ │ │ operator. │
2098 └────────┴────────┴────────────────────────┘
2099
2100 Type 31: Correction data
2101 One or more GLONASS satellite objects follow the header for type 1
2102 or type 9 messages. Here is the format:
2103
2104 Table 28. Satellite object
2105 ┌───────┬──────────┬────────────────────────────────┐
2106 │Name │ Type │ │
2107 │ │ │ Description │
2108 ├───────┼──────────┼────────────────────────────────┤
2109 │ident │ integer │ │
2110 │ │ │ The PRN │
2111 │ │ │ number of │
2112 │ │ │ the │
2113 │ │ │ satellite │
2114 │ │ │ for which │
2115 │ │ │ this is │
2116 │ │ │ correction │
2117 │ │ │ data. │
2118 ├───────┼──────────┼────────────────────────────────┤
2119 │udre │ integer │ │
2120 │ │ │ User │
2121 │ │ │ Differential │
2122 │ │ │ Range Error │
2123 │ │ │ (0-3). See │
2124 │ │ │ the table │
2125 │ │ │ following │
2126 │ │ │ for values. │
2127 ├───────┼──────────┼────────────────────────────────┤
2128 │change │ boolean │ │
2129 │ │ │ Change-of-ephemeris │
2130 │ │ │ bit. │
2131 ├───────┼──────────┼────────────────────────────────┤
2132 │tod │ uinteger │ │
2133 │ │ │ Count of 30-second │
2134 │ │ │ periods since the │
2135 │ │ │ top of the hour. │
2136 ├───────┼──────────┼────────────────────────────────┤
2137 │prc │ real │ │
2138 │ │ │ The pseudorange │
2139 │ │ │ error in meters for │
2140 │ │ │ this satellite as │
2141 │ │ │ measured by the │
2142 │ │ │ beacon reference │
2143 │ │ │ receiver at the │
2144 │ │ │ epoch indicated by │
2145 │ │ │ the z_count in the │
2146 │ │ │ parent record. │
2147 ├───────┼──────────┼────────────────────────────────┤
2148 │rrc │ real │ │
2149 │ │ │ The rate of change │
2150 │ │ │ of pseudorange │
2151 │ │ │ error in meters/sec │
2152 │ │ │ for this satellite │
2153 │ │ │ as measured by the │
2154 │ │ │ beacon reference │
2155 │ │ │ receiver at the │
2156 │ │ │ epoch indicated by │
2157 │ │ │ the z_count field │
2158 │ │ │ in the parent │
2159 │ │ │ record. This is │
2160 │ │ │ used to calculate │
2161 │ │ │ pseudorange errors │
2162 │ │ │ at other epochs, if │
2163 │ │ │ required by the GPS │
2164 │ │ │ receiver. │
2165 └───────┴──────────┴────────────────────────────────┘
2166
2167 Here's an example:
2168
2169 {"class":"RTCM2","type":31,"station_id":652,"zcount":1642.2,
2170 "seqnum":0,"length":14,"station_health":6,
2171 "satellites":[
2172 {"ident":5,"udre":0,"change":false,"tod":0,"prc":132.360,"rrc":0.000},
2173 {"ident":15,"udre":0,"change":false,"tod":0,"prc":134.840,"rrc":0.002},
2174 {"ident":14,"udre":0,"change":false,"tod":0,"prc":141.520,"rrc":0.000},
2175 {"ident":6,"udre":0,"change":false,"tod":0,"prc":127.000,"rrc":0.000},
2176 {"ident":21,"udre":0,"change":false,"tod":0,"prc":128.780,"rrc":0.000},
2177 {"ident":22,"udre":0,"change":false,"tod":0,"prc":125.260,"rrc":0.002},
2178 {"ident":20,"udre":0,"change":false,"tod":0,"prc":117.280,"rrc":-0.004},
2179 {"ident":16,"udre":0,"change":false,"tod":17,"prc":113.460,"rrc":0.018}
2180 ]}
2181
2183 The support for RTCM104v3 dumping is incomplete and buggy. Do not
2184 attempt to use it for production! Anyone interested in it should read
2185 the source code.
2186
2188 AIS support is an extension. It may not be present if your instance of
2189 gpsd has been built with a restricted feature set.
2190
2191 AIS packets are dumped as JSON objects with class "AIS". Each AIS
2192 report object contains a "type" field giving the AIS message type and a
2193 "scaled" field telling whether the remainder of the fields are dumped
2194 in scaled or unscaled form. (These will be emitted before any
2195 type-specific fields.) It will also contain a "device" field naming the
2196 data source. Other fields have names and types as specified in the
2197 AIVDM/AIVDO Protocol Decoding document on the GPSD project website;
2198 each message field table may be directly interpreted as a specification
2199 for the members of the corresponding JSON object type.
2200
2201 By default, certain scaling and conversion operations are performed for
2202 JSON output. Latitudes and longitudes are scaled to decimal degrees
2203 rather than the native AIS unit of 1/10000th of a minute of arc. Ship
2204 (but not air) speeds are scaled to knots rather than tenth-of-knot
2205 units. Rate of turn may appear as "nan" if is unavailable, or as one of
2206 the strings "fastright" or "fastleft" if it is out of the AIS encoding
2207 range; otherwise it is quadratically mapped back to the turn sensor
2208 number in degrees per minute. Vessel draughts are converted to decimal
2209 meters rather than native AIS decimeters. Various other scaling
2210 conversions are described in "AIVDM/AIVDO Protocol Decoding".
2211
2213 Subframe support is always compiled into gpsd but many GPSes do not
2214 output subframe data or the gpsd driver may not support subframes.
2215
2216 Subframe packets are dumped as JSON objects with class "SUBFRAME". Each
2217 subframe report object contains a "frame" field giving the subframe
2218 number, a "tSV" field for the transmitting satellite number, a "TOW17"
2219 field containing the 17 MSBs of the start of the next 12-second message
2220 and a "scaled" field telling whether the remainder of the fields are
2221 dumped in scaled or unscaled form. It will also contain a "device"
2222 field naming the data source. Each SUBFRAME object will have a
2223 sub-object specific to that subframe page type. Those sub-object fields
2224 have names and types similar to those specified in the IS-GPS-200E
2225 document; each message field table may be directly interpreted as a
2226 specification for the members of the corresponding JSON object type.
2227
2229 gpsd(8), libgps(3),
2230
2232 The protocol was designed and documented by Eric S. Raymond.
2233
2235 1. Radio Technical Commission for Maritime Services
2236 http://www.rtcm.org/
2237
2238 2. table of leap second corrections
2239 ftp://maia.usno.navy.mil/ser7/tai-utc.dat
2240
2241
2242
2243The GPSD Project 23 June 2019 GPSD_JSON(5)