1GPSD_JSON(5)                  GPSD Documentation                  GPSD_JSON(5)
2
3
4

NAME

6       gpsd_json - gpsd request/response protocol
7

OVERVIEW

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       check in their code for the expected major and minor protocol versions.
18
19       The GPSD protocol is built on top of JSON, JavaScript Object Notation,
20       as specified in [RFC-7159]: The JavaScript Object Notation (JSON) Data
21       Interchange Format. Similar to ECMA 404.
22
23       GPSD’s use of JSON is restricted in some ways that make parsing it in
24       fixed-extent languages (such as C) easier.
25
26       A request line is introduced by "?" and may include multiple commands.
27       Commands begin with a command identifier, followed either by a
28       terminating ';' or by an equal sign "=" and a JSON object treated as an
29       argument. Any ';' or newline indication (either LF or CR-LF) after the
30       end of a command is ignored. All request lines must be composed of
31       US-ASCII characters and may be no more than 80 characters in length,
32       exclusive of the trailing newline.
33
34       Responses are single JSON objects that have a "class" attribute the
35       value of which is the object type . Object types include, but are not
36       limited to: "TPV", "SKY", "DEVICE", and "ERROR". Objects are sent both
37       in response to commands, and periodically as gpsd sends reports. Each
38       object is terminated by a carriage return and a new line (CR-NL).
39
40       The order of JSON attributes within a response object is never
41       significant, and you may specify command attributes in any order.
42       Responses never contain the special JSON value null; instead,
43       attributes with empty or undefined values are omitted. The length limit
44       for responses and reports is currently 10240 characters, including the
45       trailing CR-NL. Longer responses will be truncated, so client code must
46       be prepared for the possibility of invalid JSON fragments.
47
48       The default maximum message length is set by GPS_JSON_RESPONSE_MAX in
49       include/gpsd_json.h. at compile time.
50
51       In JSON reports, if an attribute is present only if the parent
52       attribute is present or has a particular range, then the parent
53       attribute is emitted first.
54
55       There is one constraint on the order in which attributes will be
56       omitted. If an optional attribute is present only when a parent
57       attribute has a specified value or range of values, the parent
58       attribute will be emitted first to make parsing easier.
59
60       The next subsection section documents the core GPSD protocol.
61       Extensions are documented in the following subsections. The extensions
62       may not be supported in your gpsd instance if it has been compiled with
63       a restricted feature set.
64
65       The protocol was designed and documented by Eric S. Raymond.
66

CORE PROTOCOL RESPONSES

68       Here are the core-protocol responses.
69
70   TPV
71       A TPV object is a time-position-velocity report. The "class" and "mode"
72       fields will reliably be present. When "mode" is 0 (Unknown) there is
73       likely no usable data in the sentence. The remaining fields are
74       optional, their presence depends on what data the GNSS receiver has
75       sent, and what gpsd may calculate from that data.
76
77       A TPV object will usually be sent at least once for every measurement
78       epoch as determined by the "time" field. Unless the receiver has a
79       solid fix, and knows the current leap second, the time may be random.
80
81       Multiple TPV objects are often sent per epoch. When the receiver
82       dribbles data to gpsd, then gpsd has no choice but to dribble it to the
83       client in multiple TPV messages.
84
85       The optional "status" field (aka fix type), is a modifier (adjective)
86       to mode. It is not a replacement for, or superset of, the "mode" field.
87       It is almost, but not quite, the same as the NMEA 4.x xxGGA GPS Quality
88       Indicator Values. Many GNSS receivers do not supply it. Those that do
89       interpret the specification in various incompatible ways. To save space
90       in the output, and avoid confusion, the JSON never includes status
91       values of 0 or 1.
92
93       All error estimates (epc, epd, epe, eph, ept, epv, epx, epy) are
94       guessed to be 95% confidence, may also be 50%, one sigma, or two sigma
95       confidence. Many GNSS receivers do not specify a confidence level. None
96       specify how the value is calculated. Use error estimates with caution,
97       and only as relative "goodness" indicators. If the GPS reports a value
98       to gpsd, then gpsd will report that value. Otherwise gpsd will try to
99       compute the value from the skyview.
100
101       See the file include/gps.h, especially struct gps_data_t, for expanded
102       notes on the items and values in the TPV message.
103
104       Table 1. TPV object
105       ┌────────────┬─────────┬─────────┬──────────────────┐
106       │            │         │         │                  │
107       │Name        │ Always? │ Type    │ Description      │
108       ├────────────┼─────────┼─────────┼──────────────────┤
109       │            │         │         │                  │
110       │class       │ Yes     │ string  │ Fixed: "TPV"     │
111       ├────────────┼─────────┼─────────┼──────────────────┤
112       │            │         │         │                  │
113       │device      │ No      │ string  │ Name of the      │
114       │            │         │         │ originating      │
115       │            │         │         │ device.          │
116       ├────────────┼─────────┼─────────┼──────────────────┤
117       │            │         │         │                  │
118       │mode        │ Yes     │ numeric │ NMEA mode:       │
119       │            │         │         │ 0=unknown,       │
120       │            │         │         │ 1=no fix,        │
121       │            │         │         │ 2=2D,            │
122       │            │         │         │ 3=3D.            │
123       ├────────────┼─────────┼─────────┼──────────────────┤
124       │            │         │         │                  │
125       │status      │ No      │ numeric │ GPS fix status:  │
126       │            │         │         │ 0=Unknown,       │
127       │            │         │         │ 1=Normal,        │
128       │            │         │         │ 2=DGPS,          │
129       │            │         │         │ 3=RTK Fixed,     │
130       │            │         │         │ 4=RTK Floating,  │
131       │            │         │         │ 5=DR,            │
132       │            │         │         │ 6=GNSSDR,        │
133       │            │         │         │ 7=Time           │
134       │            │         │         │ (surveyed),      │
135       │            │         │         │ 8=Simulated,     │
136       │            │         │         │ 9=P(Y)           │
137       ├────────────┼─────────┼─────────┼──────────────────┤
138       │            │         │         │                  │
139       │time        │ No      │ string  │ Time/date stamp  │
140       │            │         │         │ in ISO8601       │
141       │            │         │         │ format, UTC. May │
142       │            │         │         │ have a           │
143       │            │         │         │ fractional part  │
144       │            │         │         │ of up to .001sec │
145       │            │         │         │ precision. May   │
146       │            │         │         │ be absent if the │
147       │            │         │         │ mode is not 2D   │
148       │            │         │         │ or 3D. May be    │
149       │            │         │         │ present, but     │
150       │            │         │         │ invalid, if      │
151       │            │         │         │ there is no fix. │
152       │            │         │         │ Verify 3         │
153       │            │         │         │ consecutive 3D   │
154       │            │         │         │ fixes before     │
155       │            │         │         │ believing it is  │
156       │            │         │         │ UTC. Even then   │
157       │            │         │         │ it may be off by │
158       │            │         │         │ several seconds  │
159       │            │         │         │ until the        │
160       │            │         │         │ current leap     │
161       │            │         │         │ seconds is       │
162       │            │         │         │ known.           │
163       ├────────────┼─────────┼─────────┼──────────────────┤
164       │            │         │         │                  │
165       │altHAE      │ No      │ numeric │ Altitude, height │
166       │            │         │         │ above ellipsoid, │
167       │            │         │         │ in meters.       │
168       │            │         │         │ Probably WGS84.  │
169       ├────────────┼─────────┼─────────┼──────────────────┤
170       │            │         │         │                  │
171       │altMSL      │ No      │ numeric │ MSL Altitude in  │
172       │            │         │         │ meters. The      │
173       │            │         │         │ geoid used is    │
174       │            │         │         │ rarely specified │
175       │            │         │         │ and is often     │
176       │            │         │         │ inaccurate. See  │
177       │            │         │         │ the comments     │
178       │            │         │         │ below on         │
179       │            │         │         │ geoidSep. altMSL │
180       │            │         │         │ is altHAE minus  │
181       │            │         │         │ geoidSep.        │
182       ├────────────┼─────────┼─────────┼──────────────────┤
183       │            │         │         │                  │
184       │alt         │ No      │ numeric │ Deprecated.      │
185       │            │         │         │ Undefined. Use   │
186       │            │         │         │ altHAE or        │
187       │            │         │         │ altMSL.          │
188       ├────────────┼─────────┼─────────┼──────────────────┤
189       │            │         │         │                  │
190       │climb       │ No      │ numeric │ Climb (positive) │
191       │            │         │         │ or sink          │
192       │            │         │         │ (negative) rate, │
193       │            │         │         │ meters per       │
194       │            │         │         │ second.          │
195       ├────────────┼─────────┼─────────┼──────────────────┤
196       │            │         │         │                  │
197       │datum       │ No      │ string  │ Current datum.   │
198       │            │         │         │ Hopefully WGS84. │
199       ├────────────┼─────────┼─────────┼──────────────────┤
200       │            │         │         │                  │
201       │depth       │ No      │ numeric │ Depth in meters. │
202       │            │         │         │ Probably depth   │
203       │            │         │         │ below the        │
204       │            │         │         │ keel...          │
205       ├────────────┼─────────┼─────────┼──────────────────┤
206       │            │         │         │                  │
207       │dgpsAge     │ No      │ numeric │ Age of DGPS      │
208       │            │         │         │ data. In seconds │
209       ├────────────┼─────────┼─────────┼──────────────────┤
210       │            │         │         │                  │
211       │dgpsSta     │ No      │ numeric │ Station of DGPS  │
212       │            │         │         │ data.            │
213       ├────────────┼─────────┼─────────┼──────────────────┤
214       │            │         │         │                  │
215       │epc         │ No      │ numeric │ Estimated climb  │
216       │            │         │         │ error in meters  │
217       │            │         │         │ per second.      │
218       │            │         │         │ Certainty        │
219       │            │         │         │ unknown.         │
220       ├────────────┼─────────┼─────────┼──────────────────┤
221       │            │         │         │                  │
222       │epd         │ No      │ numeric │ Estimated track  │
223       │            │         │         │ (direction)      │
224       │            │         │         │ error in         │
225       │            │         │         │ degrees.         │
226       │            │         │         │ Certainty        │
227       │            │         │         │ unknown.         │
228       ├────────────┼─────────┼─────────┼──────────────────┤
229       │            │         │         │                  │
230       │eph         │ No      │ numeric │ Estimated        │
231       │            │         │         │ horizontal       │
232       │            │         │         │ Position (2D)    │
233       │            │         │         │ Error in meters. │
234       │            │         │         │ Also known as    │
235       │            │         │         │ Estimated        │
236       │            │         │         │ Position Error   │
237       │            │         │         │ (epe). Certainty │
238       │            │         │         │ unknown.         │
239       ├────────────┼─────────┼─────────┼──────────────────┤
240       │            │         │         │                  │
241       │eps         │ No      │ numeric │ Estimated speed  │
242       │            │         │         │ error in meters  │
243       │            │         │         │ per second.      │
244       │            │         │         │ Certainty        │
245       │            │         │         │ unknown.         │
246       ├────────────┼─────────┼─────────┼──────────────────┤
247       │            │         │         │                  │
248       │ept         │ No      │ numeric │ Estimated time   │
249       │            │         │         │ stamp error in   │
250       │            │         │         │ seconds.         │
251       │            │         │         │ Certainty        │
252       │            │         │         │ unknown.         │
253       ├────────────┼─────────┼─────────┼──────────────────┤
254       │            │         │         │                  │
255       │epx         │ No      │ numeric │ Longitude error  │
256       │            │         │         │ estimate in      │
257       │            │         │         │ meters.          │
258       │            │         │         │ Certainty        │
259       │            │         │         │ unknown.         │
260       ├────────────┼─────────┼─────────┼──────────────────┤
261       │            │         │         │                  │
262       │epy         │ No      │ numeric │ Latitude error   │
263       │            │         │         │ estimate in      │
264       │            │         │         │ meters.          │
265       │            │         │         │ Certainty        │
266       │            │         │         │ unknown.         │
267       ├────────────┼─────────┼─────────┼──────────────────┤
268       │            │         │         │                  │
269       │epv         │ No      │ numeric │ Estimated        │
270       │            │         │         │ vertical error   │
271       │            │         │         │ in meters.       │
272       │            │         │         │ Certainty        │
273       │            │         │         │ unknown.         │
274       ├────────────┼─────────┼─────────┼──────────────────┤
275       │            │         │         │                  │
276       │geoidSep    │ No      │ numeric │ Geoid separation │
277       │            │         │         │ is the           │
278       │            │         │         │ difference       │
279       │            │         │         │ between the      │
280       │            │         │         │ WGS84 reference  │
281       │            │         │         │ ellipsoid and    │
282       │            │         │         │ the geoid (Mean  │
283       │            │         │         │ Sea Level) in    │
284       │            │         │         │ meters. Almost   │
285       │            │         │         │ no GNSS receiver │
286       │            │         │         │ specifies how    │
287       │            │         │         │ they compute     │
288       │            │         │         │ their geoid.     │
289       │            │         │         │ gpsd             
290       │            │         │         │ interpolates the │
291       │            │         │         │ geoid from a 5x5 │
292       │            │         │         │ degree table of  │
293       │            │         │         │ EGM2008 values   │
294       │            │         │         │ when the         │
295       │            │         │         │ receiver does    │
296       │            │         │         │ not supply a     │
297       │            │         │         │ geoid            │
298       │            │         │         │ separation. The  │
299       │            │         │         │ gpsd computed    │
300       │            │         │         │ geoidSep is      │
301       │            │         │         │ usually within   │
302       │            │         │         │ one meter of the │
303       │            │         │         │ "true" value,    │
304       │            │         │         │ but can be off   │
305       │            │         │         │ as much as 12    │
306       │            │         │         │ meters.          │
307       ├────────────┼─────────┼─────────┼──────────────────┤
308       │            │         │         │                  │
309       │lat         │ No      │ numeric │ Latitude in      │
310       │            │         │         │ degrees: +/-     │
311       │            │         │         │ signifies        │
312       │            │         │         │ North/South.     │
313       ├────────────┼─────────┼─────────┼──────────────────┤
314       │            │         │         │                  │
315       │leapseconds │ No      │ integer │ Current leap     │
316       │            │         │         │ seconds.         │
317       ├────────────┼─────────┼─────────┼──────────────────┤
318       │            │         │         │                  │
319       │lon         │ No      │ numeric │ Longitude in     │
320       │            │         │         │ degrees: +/-     │
321       │            │         │         │ signifies        │
322       │            │         │         │ East/West.       │
323       ├────────────┼─────────┼─────────┼──────────────────┤
324       │            │         │         │                  │
325       │track       │ No      │ numeric │ Course over      │
326       │            │         │         │ ground, degrees  │
327       │            │         │         │ from true north. │
328       ├────────────┼─────────┼─────────┼──────────────────┤
329       │            │         │         │                  │
330       │magtrack    │ No      │ numeric │ Course over      │
331       │            │         │         │ ground, degrees  │
332       │            │         │         │ magnetic.        │
333       ├────────────┼─────────┼─────────┼──────────────────┤
334       │            │         │         │                  │
335       │magvar      │ No      │ numeric │ Magnetic         │
336       │            │         │         │ variation,       │
337       │            │         │         │ degrees. Also    │
338       │            │         │         │ known as the     │
339       │            │         │         │ magnetic         │
340       │            │         │         │ declination (the │
341       │            │         │         │ direction of the │
342       │            │         │         │ horizontal       │
343       │            │         │         │ component of the │
344       │            │         │         │ magnetic field   │
345       │            │         │         │ measured         │
346       │            │         │         │ clockwise from   │
347       │            │         │         │ north) in        │
348       │            │         │         │ degrees,         │
349       │            │         │         │ Positive is West │
350       │            │         │         │ variation.       │
351       │            │         │         │ Negative is East │
352       │            │         │         │ variation.       │
353       ├────────────┼─────────┼─────────┼──────────────────┤
354       │            │         │         │                  │
355       │speed       │ No      │ numeric │ Speed over       │
356       │            │         │         │ ground, meters   │
357       │            │         │         │ per second.      │
358       ├────────────┼─────────┼─────────┼──────────────────┤
359       │            │         │         │                  │
360       │ecefx       │ No      │ numeric │ ECEF X position  │
361       │            │         │         │ in meters.       │
362       ├────────────┼─────────┼─────────┼──────────────────┤
363       │            │         │         │                  │
364       │ecefy       │ No      │ numeric │ ECEF Y position  │
365       │            │         │         │ in meters.       │
366       ├────────────┼─────────┼─────────┼──────────────────┤
367       │            │         │         │                  │
368       │ecefz       │ No      │ numeric │ ECEF Z position  │
369       │            │         │         │ in meters.       │
370       ├────────────┼─────────┼─────────┼──────────────────┤
371       │            │         │         │                  │
372       │ecefpAcc    │ No      │ numeric │ ECEF position    │
373       │            │         │         │ error in meters. │
374       │            │         │         │ Certainty        │
375       │            │         │         │ unknown.         │
376       ├────────────┼─────────┼─────────┼──────────────────┤
377       │            │         │         │                  │
378       │ecefvx      │ No      │ numeric │ ECEF X velocity  │
379       │            │         │         │ in meters per    │
380       │            │         │         │ second.          │
381       ├────────────┼─────────┼─────────┼──────────────────┤
382       │            │         │         │                  │
383       │ecefvy      │ No      │ numeric │ ECEF Y velocity  │
384       │            │         │         │ in meters per    │
385       │            │         │         │ second.          │
386       ├────────────┼─────────┼─────────┼──────────────────┤
387       │            │         │         │                  │
388       │ecefvz      │ No      │ numeric │ ECEF Z velocity  │
389       │            │         │         │ in meters per    │
390       │            │         │         │ second.          │
391       ├────────────┼─────────┼─────────┼──────────────────┤
392       │            │         │         │                  │
393       │ecefvAcc    │ No      │ numeric │ ECEF velocity    │
394       │            │         │         │ error in meters  │
395       │            │         │         │ per second.      │
396       │            │         │         │ Certainty        │
397       │            │         │         │ unknown.         │
398       ├────────────┼─────────┼─────────┼──────────────────┤
399       │            │         │         │                  │
400       │sep         │ No      │ numeric │ Estimated        │
401       │            │         │         │ Spherical (3D)   │
402       │            │         │         │ Position Error   │
403       │            │         │         │ in meters.       │
404       │            │         │         │ Guessed to be    │
405       │            │         │         │ 95% confidence,  │
406       │            │         │         │ but many GNSS    │
407       │            │         │         │ receivers do not │
408       │            │         │         │ specify, so      │
409       │            │         │         │ certainty        │
410       │            │         │         │ unknown.         │
411       ├────────────┼─────────┼─────────┼──────────────────┤
412       │            │         │         │                  │
413       │relD        │ No      │ numeric │ Down component   │
414       │            │         │         │ of relative      │
415       │            │         │         │ position vector  │
416       │            │         │         │ in meters.       │
417       ├────────────┼─────────┼─────────┼──────────────────┤
418       │            │         │         │                  │
419       │relE        │ No      │ numeric │ East component   │
420       │            │         │         │ of relative      │
421       │            │         │         │ position vector  │
422       │            │         │         │ in meters.       │
423       ├────────────┼─────────┼─────────┼──────────────────┤
424       │            │         │         │                  │
425       │relN        │ No      │ numeric │ North component  │
426       │            │         │         │ of relative      │
427       │            │         │         │ position vector  │
428       │            │         │         │ in meters.       │
429       ├────────────┼─────────┼─────────┼──────────────────┤
430       │            │         │         │                  │
431       │velD        │ No      │ numeric │ Down velocity    │
432       │            │         │         │ component in     │
433       │            │         │         │ meters.          │
434       ├────────────┼─────────┼─────────┼──────────────────┤
435       │            │         │         │                  │
436       │velE        │ No      │ numeric │ East velocity    │
437       │            │         │         │ component in     │
438       │            │         │         │ meters.          │
439       ├────────────┼─────────┼─────────┼──────────────────┤
440       │            │         │         │                  │
441       │velN        │ No      │ numeric │ North velocity   │
442       │            │         │         │ component in     │
443       │            │         │         │ meters.          │
444       ├────────────┼─────────┼─────────┼──────────────────┤
445       │            │         │         │                  │
446       │wanglem     │ No      │ numeric │ Wind angle       │
447       │            │         │         │ magnetic in      │
448       │            │         │         │ degrees.         │
449       ├────────────┼─────────┼─────────┼──────────────────┤
450       │            │         │         │                  │
451       │wangler     │ No      │ numeric │ Wind angle       │
452       │            │         │         │ relative in      │
453       │            │         │         │ degrees.         │
454       ├────────────┼─────────┼─────────┼──────────────────┤
455       │            │         │         │                  │
456       │wanglet     │ No      │ numeric │ Wind angle true  │
457       │            │         │         │ in degrees.      │
458       ├────────────┼─────────┼─────────┼──────────────────┤
459       │            │         │         │                  │
460       │wspeedr     │ No      │ numeric │ Wind speed       │
461       │            │         │         │ relative in      │
462       │            │         │         │ meters per       │
463       │            │         │         │ second.          │
464       ├────────────┼─────────┼─────────┼──────────────────┤
465       │            │         │         │                  │
466       │wspeedt     │ No      │ numeric │ Wind speed true  │
467       │            │         │         │ in meters per    │
468       │            │         │         │ second.          │
469       ├────────────┼─────────┼─────────┼──────────────────┤
470       │            │         │         │                  │
471       │wtemp       │ No      │ numeric │ Water            │
472       │            │         │         │ temperature in   │
473       │            │         │         │ degrees Celsius. │
474       └────────────┴─────────┴─────────┴──────────────────┘
475
476       When the C client library parses a response of this kind, it will
477       assert validity bits in the top-level set member for each field
478       received; see gps.h for bitmask names and values.
479
480       Invalid or unknown floating-point values will be set to NAN. Always
481       check floating point values with isfinite() before use. isnan() is not
482       sufficient.
483
484       Here’s an example TPV sentence:
485
486           {"class":"TPV","device":"/dev/pts/1",
487               "time":"2005-06-08T10:34:48.283Z","ept":0.005,
488               "lat":46.498293369,"lon":7.567411672,"alt":1343.127,
489               "eph":36.000,"epv":32.321,
490               "track":10.3788,"speed":0.091,"climb":-0.085,"mode":3}
491
492   SKY
493       A SKY object reports a sky view of the GPS satellite positions. If
494       there is no GPS device available, or no skyview has been reported yet,
495       only the "class" field will reliably be present.
496
497       Table 2. SKY object
498       ┌───────────┬─────────┬─────────┬──────────────────┐
499       │           │         │         │                  │
500       │Name       │ Always? │ Type    │ Description      │
501       ├───────────┼─────────┼─────────┼──────────────────┤
502       │           │         │         │                  │
503       │class      │ Yes     │ string  │ Fixed: "SKY"     │
504       ├───────────┼─────────┼─────────┼──────────────────┤
505       │           │         │         │                  │
506       │device     │ No      │ string  │ Name of          │
507       │           │         │         │ originating      │
508       │           │         │         │ device           │
509       ├───────────┼─────────┼─────────┼──────────────────┤
510       │           │         │         │                  │
511       │nSat       │ No      │ numeric │ Number of        │
512       │           │         │         │ satellite        │
513       │           │         │         │ objects in       │
514       │           │         │         │ "satellites"     │
515       │           │         │         │ array.           │
516       ├───────────┼─────────┼─────────┼──────────────────┤
517       │           │         │         │                  │
518       │gdop       │ No      │ numeric │ Geometric        │
519       │           │         │         │ (hyperspherical) │
520       │           │         │         │ dilution of      │
521       │           │         │         │ precision, a     │
522       │           │         │         │ combination of   │
523       │           │         │         │ PDOP and TDOP. A │
524       │           │         │         │ dimensionless    │
525       │           │         │         │ factor which     │
526       │           │         │         │ should be        │
527       │           │         │         │ multiplied by a  │
528       │           │         │         │ base UERE to get │
529       │           │         │         │ an error         │
530       │           │         │         │ estimate.        │
531       ├───────────┼─────────┼─────────┼──────────────────┤
532       │           │         │         │                  │
533       │hdop       │ No      │ numeric │ Horizontal       │
534       │           │         │         │ dilution of      │
535       │           │         │         │ precision, a     │
536       │           │         │         │ dimensionless    │
537       │           │         │         │ factor which     │
538       │           │         │         │ should be        │
539       │           │         │         │ multiplied by a  │
540       │           │         │         │ base UERE to get │
541       │           │         │         │ a circular error │
542       │           │         │         │ estimate.        │
543       ├───────────┼─────────┼─────────┼──────────────────┤
544       │           │         │         │                  │
545       │pdop       │ No      │ numeric │ Position         │
546       │           │         │         │ (spherical/3D)   │
547       │           │         │         │ dilution of      │
548       │           │         │         │ precision, a     │
549       │           │         │         │ dimensionless    │
550       │           │         │         │ factor which     │
551       │           │         │         │ should be        │
552       │           │         │         │ multiplied by a  │
553       │           │         │         │ base UERE to get │
554       │           │         │         │ an error         │
555       │           │         │         │ estimate.        │
556       ├───────────┼─────────┼─────────┼──────────────────┤
557       │           │         │         │                  │
558       │prRes      │ No      │ numeric │ Pseudorange      │
559       │           │         │         │ residue in       │
560       │           │         │         │ meters.          │
561       ├───────────┼─────────┼─────────┼──────────────────┤
562       │           │         │         │                  │
563       │qual       │ No      │ numeric │ Quality          │
564       │           │         │         │ Indicator        │
565       │           │         │         │ 0=no signal      │
566       │           │         │         │ 1=searching      │
567       │           │         │         │ signal           │
568       │           │         │         │ 2=signal         │
569       │           │         │         │ acquired         │
570       │           │         │         │ 3=signal         │
571       │           │         │         │ detected but     │
572       │           │         │         │ unusable         │
573       │           │         │         │ 4=code locked    │
574       │           │         │         │ and time         │
575       │           │         │         │ synchronized     │
576       │           │         │         │ 5, 6, 7=code and │
577       │           │         │         │ carrier locked   │
578       │           │         │         │ and time         │
579       │           │         │         │ synchronized     │
580       ├───────────┼─────────┼─────────┼──────────────────┤
581       │           │         │         │                  │
582       │satellites │ No      │ list    │ List of          │
583       │           │         │         │ satellite        │
584       │           │         │         │ objects in       │
585       │           │         │         │ skyview          │
586       ├───────────┼─────────┼─────────┼──────────────────┤
587       │           │         │         │                  │
588       │tdop       │ No      │ numeric │ Time dilution of │
589       │           │         │         │ precision, a     │
590       │           │         │         │ dimensionless    │
591       │           │         │         │ factor which     │
592       │           │         │         │ should be        │
593       │           │         │         │ multiplied by a  │
594       │           │         │         │ base UERE to get │
595       │           │         │         │ an error         │
596       │           │         │         │ estimate.        │
597       ├───────────┼─────────┼─────────┼──────────────────┤
598       │           │         │         │                  │
599       │time       │ No      │ string  │ Time/date stamp  │
600       │           │         │         │ in ISO8601       │
601       │           │         │         │ format, UTC. May │
602       │           │         │         │ have a           │
603       │           │         │         │ fractional part  │
604       │           │         │         │ of up to .001sec │
605       │           │         │         │ precision.       │
606       ├───────────┼─────────┼─────────┼──────────────────┤
607       │           │         │         │                  │
608       │uSat       │ No      │ numeric │ Number of        │
609       │           │         │         │ satellites used  │
610       │           │         │         │ in navigation    │
611       │           │         │         │ solution.        │
612       ├───────────┼─────────┼─────────┼──────────────────┤
613       │           │         │         │                  │
614       │vdop       │ No      │ numeric │ Vertical         │
615       │           │         │         │ (altitude)       │
616       │           │         │         │ dilution of      │
617       │           │         │         │ precision, a     │
618       │           │         │         │ dimensionless    │
619       │           │         │         │ factor which     │
620       │           │         │         │ should be        │
621       │           │         │         │ multiplied by a  │
622       │           │         │         │ base UERE to get │
623       │           │         │         │ an error         │
624       │           │         │         │ estimate.        │
625       ├───────────┼─────────┼─────────┼──────────────────┤
626       │           │         │         │                  │
627       │xdop       │ No      │ numeric │ Longitudinal     │
628       │           │         │         │ dilution of      │
629       │           │         │         │ precision, a     │
630       │           │         │         │ dimensionless    │
631       │           │         │         │ factor which     │
632       │           │         │         │ should be        │
633       │           │         │         │ multiplied by a  │
634       │           │         │         │ base UERE to get │
635       │           │         │         │ an error         │
636       │           │         │         │ estimate.        │
637       ├───────────┼─────────┼─────────┼──────────────────┤
638       │           │         │         │                  │
639       │ydop       │ No      │ numeric │ Latitudinal      │
640       │           │         │         │ dilution of      │
641       │           │         │         │ precision, a     │
642       │           │         │         │ dimensionless    │
643       │           │         │         │ factor which     │
644       │           │         │         │ should be        │
645       │           │         │         │ multiplied by a  │
646       │           │         │         │ base UERE to get │
647       │           │         │         │ an error         │
648       │           │         │         │ estimate.        │
649       └───────────┴─────────┴─────────┴──────────────────┘
650
651       Many devices compute dilution of precision factors but do not include
652       them in their reports. Many that do report DOPs report only HDOP,
653       two-dimensional circular error. gpsd always passes through whatever the
654       device reports, then attempts to fill in other DOPs by calculating the
655       appropriate determinants in a covariance matrix based on the satellite
656       view. DOPs may be missing if some of these determinants are singular.
657       It can even happen that the device reports an error estimate in meters
658       when the corresponding DOP is unavailable; some devices use more
659       sophisticated error modeling than the covariance calculation.
660
661       The satellite list objects have the following elements:
662
663       Table 3. Satellite object
664       ┌───────┬─────────┬─────────┬──────────────────┐
665       │       │         │         │                  │
666       │Name   │ Always? │ Type    │ Description      │
667       ├───────┼─────────┼─────────┼──────────────────┤
668       │       │         │         │                  │
669       │PRN    │ Yes     │ numeric │ PRN ID of the    │
670       │       │         │         │ satellite. 1-63  │
671       │       │         │         │ are GNSS         │
672       │       │         │         │ satellites,      │
673       │       │         │         │ 64-96 are        │
674       │       │         │         │ GLONASS          │
675       │       │         │         │ satellites,      │
676       │       │         │         │ 100-164 are SBAS │
677       │       │         │         │ satellites       │
678       ├───────┼─────────┼─────────┼──────────────────┤
679       │       │         │         │                  │
680       │az     │ No      │ numeric │ Azimuth, degrees │
681       │       │         │         │ from true north. │
682       ├───────┼─────────┼─────────┼──────────────────┤
683       │       │         │         │                  │
684       │el     │ No      │ numeric │ Elevation in     │
685       │       │         │         │ degrees.         │
686       ├───────┼─────────┼─────────┼──────────────────┤
687       │       │         │         │                  │
688       │ss     │ No      │ numeric │ Signal to Noise  │
689       │       │         │         │ ratio in dBHz.   │
690       ├───────┼─────────┼─────────┼──────────────────┤
691       │       │         │         │                  │
692       │used   │ Yes     │ boolean │ Used in current  │
693       │       │         │         │ solution?        │
694       │       │         │         │ (SBAS/WAAS/EGNOS │
695       │       │         │         │ satellites may   │
696       │       │         │         │ be flagged used  │
697       │       │         │         │ if the solution  │
698       │       │         │         │ has corrections  │
699       │       │         │         │ from them, but   │
700       │       │         │         │ not all drivers  │
701       │       │         │         │ make this        │
702       │       │         │         │ information      │
703       │       │         │         │ available.)      │
704       ├───────┼─────────┼─────────┼──────────────────┤
705       │       │         │         │                  │
706       │gnssid │ No      │ numeric │ The GNSS ID, as  │
707       │       │         │         │ defined by       │
708       │       │         │         │ u-blox, not      │
709       │       │         │         │ NMEA. 0=GPS,     │
710       │       │         │         │ 2=Galileo,       │
711       │       │         │         │ 3=Beidou,        │
712       │       │         │         │ 5=QZSS,          │
713       │       │         │         │ 6-GLONASS.       │
714       ├───────┼─────────┼─────────┼──────────────────┤
715       │       │         │         │                  │
716       │svid   │ No      │ numeric │ The satellite ID │
717       │       │         │         │ within its       │
718       │       │         │         │ constellation.   │
719       │       │         │         │ As defined by    │
720       │       │         │         │ u-blox, not      │
721       │       │         │         │ NMEA).           │
722       ├───────┼─────────┼─────────┼──────────────────┤
723       │       │         │         │                  │
724       │sigid  │ No      │ numeric │ The signal ID of │
725       │       │         │         │ this signal. As  │
726       │       │         │         │ defined by       │
727       │       │         │         │ u-blox, not      │
728       │       │         │         │ NMEA. See u-blox │
729       │       │         │         │ doc for details. │
730       ├───────┼─────────┼─────────┼──────────────────┤
731       │       │         │         │                  │
732       │freqid │ No      │ numeric │ For GLONASS      │
733       │       │         │         │ satellites only: │
734       │       │         │         │ the frequency ID │
735       │       │         │         │ of the signal.   │
736       │       │         │         │ As defined by    │
737       │       │         │         │ u-blox, range 0  │
738       │       │         │         │ to 13. The       │
739       │       │         │         │ freqid is the    │
740       │       │         │         │ frequency slot   │
741       │       │         │         │ plus 7.          │
742       ├───────┼─────────┼─────────┼──────────────────┤
743       │       │         │         │                  │
744       │health │ No      │ numeric │ The health of    │
745       │       │         │         │ this satellite.  │
746       │       │         │         │ 0 is unknown, 1  │
747       │       │         │         │ is OK, and 2 is  │
748       │       │         │         │ unhealthy.       │
749       └───────┴─────────┴─────────┴──────────────────┘
750
751       Note that satellite objects do not have a "class" field, as they are
752       never shipped outside of a SKY object.
753
754       When the C client library parses a SKY response, it will assert the
755       SATELLITE_SET bit in the top-level set member.
756
757       Here’s an example:
758
759           {"class":"SKY","device":"/dev/pts/1",
760               "time":"2005-07-08T11:28:07.114Z",
761               "xdop":1.55,"hdop":1.24,"pdop":1.99,
762               "satellites":[
763                   {"PRN":23,"el":6,"az":84,"ss":0,"used":false},
764                   {"PRN":28,"el":7,"az":160,"ss":0,"used":false},
765                   {"PRN":8,"el":66,"az":189,"ss":44,"used":true},
766                   {"PRN":29,"el":13,"az":273,"ss":0,"used":false},
767                   {"PRN":10,"el":51,"az":304,"ss":29,"used":true},
768                   {"PRN":4,"el":15,"az":199,"ss":36,"used":true},
769                   {"PRN":2,"el":34,"az":241,"ss":43,"used":true},
770                   {"PRN":27,"el":71,"az":76,"ss":43,"used":true}]}
771
772   GST
773       A GST object is a pseudorange noise report.
774
775       Table 4. GST object
776       ┌───────┬─────────┬─────────┬──────────────────┐
777       │       │         │         │                  │
778       │Name   │ Always? │ Type    │ Description      │
779       ├───────┼─────────┼─────────┼──────────────────┤
780       │       │         │         │                  │
781       │class  │ Yes     │ string  │ Fixed: "GST"     │
782       ├───────┼─────────┼─────────┼──────────────────┤
783       │       │         │         │                  │
784       │device │ No      │ string  │ Name of          │
785       │       │         │         │ originating      │
786       │       │         │         │ device           │
787       ├───────┼─────────┼─────────┼──────────────────┤
788       │       │         │         │                  │
789       │time   │ No      │ string  │ Time/date stamp  │
790       │       │         │         │ in ISO8601       │
791       │       │         │         │ format, UTC. May │
792       │       │         │         │ have a           │
793       │       │         │         │ fractional part  │
794       │       │         │         │ of up to .001sec │
795       │       │         │         │ precision.       │
796       ├───────┼─────────┼─────────┼──────────────────┤
797       │       │         │         │                  │
798       │rms    │ No      │ numeric │ Value of the     │
799       │       │         │         │ standard         │
800       │       │         │         │ deviation of the │
801       │       │         │         │ range inputs to  │
802       │       │         │         │ the navigation   │
803       │       │         │         │ process (range   │
804       │       │         │         │ inputs include   │
805       │       │         │         │ pseudoranges and │
806       │       │         │         │ DGPS             │
807       │       │         │         │ corrections).    │
808       ├───────┼─────────┼─────────┼──────────────────┤
809       │       │         │         │                  │
810       │major  │ No      │ numeric │ Standard         │
811       │       │         │         │ deviation of     │
812       │       │         │         │ semi-major axis  │
813       │       │         │         │ of error         │
814       │       │         │         │ ellipse, in      │
815       │       │         │         │ meters.          │
816       ├───────┼─────────┼─────────┼──────────────────┤
817       │       │         │         │                  │
818       │minor  │ No      │ numeric │ Standard         │
819       │       │         │         │ deviation of     │
820       │       │         │         │ semi-minor axis  │
821       │       │         │         │ of error         │
822       │       │         │         │ ellipse, in      │
823       │       │         │         │ meters.          │
824       ├───────┼─────────┼─────────┼──────────────────┤
825       │       │         │         │                  │
826       │orient │ No      │ numeric │ Orientation of   │
827       │       │         │         │ semi-major axis  │
828       │       │         │         │ of error         │
829       │       │         │         │ ellipse, in      │
830       │       │         │         │ degrees from     │
831       │       │         │         │ true north.      │
832       ├───────┼─────────┼─────────┼──────────────────┤
833       │       │         │         │                  │
834       │lat    │ No      │ numeric │ Standard         │
835       │       │         │         │ deviation of     │
836       │       │         │         │ latitude error,  │
837       │       │         │         │ in meters.       │
838       ├───────┼─────────┼─────────┼──────────────────┤
839       │       │         │         │                  │
840       │lon    │ No      │ numeric │ Standard         │
841       │       │         │         │ deviation of     │
842       │       │         │         │ longitude error, │
843       │       │         │         │ in meters.       │
844       ├───────┼─────────┼─────────┼──────────────────┤
845       │       │         │         │                  │
846       │alt    │ No      │ numeric │ Standard         │
847       │       │         │         │ deviation of     │
848       │       │         │         │ altitude error,  │
849       │       │         │         │ in meters.       │
850       └───────┴─────────┴─────────┴──────────────────┘
851
852       Here’s an example:
853
854           {"class":"GST","device":"/dev/ttyUSB0",
855                   "time":"2010-12-07T10:23:07.096Z","rms":2.440,
856                   "major":1.660,"minor":1.120,"orient":68.989,
857                   "lat":1.600,"lon":1.200,"alt":2.520}
858
859   ATT
860       An ATT object is a vehicle-attitude report. It is returned by
861       digital-compass and gyroscope sensors; depending on device, it may
862       include: heading, pitch, roll, yaw, gyroscope, and magnetic-field
863       readings. Because such sensors are often bundled as part of
864       marine-navigation systems, the ATT response may also include water
865       depth.
866
867       The "class" and "mode" fields will reliably be present. Others may be
868       reported or not depending on the specific device type.
869
870       The ATT object is synchronous to the GNSS epoch. Some devices report
871       attitude information with arbitrary, even out of order, time scales.
872       gpsd reports those in an IMU object. The ATT and IMU objects have the
873       same fields, but IMU objects are output as soon as possible. Some
874       devices output both types with arbitrary interleaving.
875
876       Table 5. ATT object
877       ┌─────────┬─────────┬─────────┬──────────────────┐
878       │         │         │         │                  │
879       │Name     │ Always? │ Type    │ Description      │
880       ├─────────┼─────────┼─────────┼──────────────────┤
881       │         │         │         │                  │
882       │class    │ Yes     │ string  │ Fixed: "ATT"     │
883       ├─────────┼─────────┼─────────┼──────────────────┤
884       │         │         │         │                  │
885       │device   │ Yes     │ string  │ Name of          │
886       │         │         │         │ originating      │
887       │         │         │         │ device           │
888       ├─────────┼─────────┼─────────┼──────────────────┤
889       │         │         │         │                  │
890       │time     │ No      │ string  │ Time/date stamp  │
891       │         │         │         │ in ISO8601       │
892       │         │         │         │ format, UTC. May │
893       │         │         │         │ have a           │
894       │         │         │         │ fractional part  │
895       │         │         │         │ of up to .001sec │
896       │         │         │         │ precision.       │
897       ├─────────┼─────────┼─────────┼──────────────────┤
898       │         │         │         │                  │
899       │timeTag  │ No      │ string  │ Arbitrary time   │
900       │         │         │         │ tag of           │
901       │         │         │         │ measurement.     │
902       ├─────────┼─────────┼─────────┼──────────────────┤
903       │         │         │         │                  │
904       │heading  │ No      │ numeric │ Heading, degrees │
905       │         │         │         │ from true north. │
906       ├─────────┼─────────┼─────────┼──────────────────┤
907       │         │         │         │                  │
908       │mag_st   │ No      │ string  │ Magnetometer     │
909       │         │         │         │ status.          │
910       ├─────────┼─────────┼─────────┼──────────────────┤
911       │         │         │         │                  │
912       │mheading │ No      │ numeric │ Heading, degrees │
913       │         │         │         │ from magnetic    │
914       │         │         │         │ north.           │
915       ├─────────┼─────────┼─────────┼──────────────────┤
916       │         │         │         │                  │
917       │pitch    │ No      │ numeric │ Pitch in         │
918       │         │         │         │ degrees.         │
919       ├─────────┼─────────┼─────────┼──────────────────┤
920       │         │         │         │                  │
921       │pitch_st │ No      │ string  │ Pitch sensor     │
922       │         │         │         │ status.          │
923       ├─────────┼─────────┼─────────┼──────────────────┤
924       │         │         │         │                  │
925       │rot      │ No      │ numeric │ Rate of Turn in  │
926       │         │         │         │ dgrees per       │
927       │         │         │         │ minute.          │
928       ├─────────┼─────────┼─────────┼──────────────────┤
929       │         │         │         │                  │
930       │yaw      │ No      │ numeric │ Yaw in degrees   │
931       ├─────────┼─────────┼─────────┼──────────────────┤
932       │         │         │         │                  │
933       │yaw_st   │ No      │ string  │ Yaw sensor       │
934       │         │         │         │ status.          │
935       ├─────────┼─────────┼─────────┼──────────────────┤
936       │         │         │         │                  │
937       │roll     │ No      │ numeric │ Roll in degrees. │
938       ├─────────┼─────────┼─────────┼──────────────────┤
939       │         │         │         │                  │
940       │roll_st  │ No      │ string  │ Roll sensor      │
941       │         │         │         │ status.          │
942       ├─────────┼─────────┼─────────┼──────────────────┤
943       │         │         │         │                  │
944       │dip      │ No      │ numeric │ Local magnetic   │
945       │         │         │         │ inclination,     │
946       │         │         │         │ degrees,         │
947       │         │         │         │ positive when    │
948       │         │         │         │ the magnetic     │
949       │         │         │         │ field points     │
950       │         │         │         │ downward (into   │
951       │         │         │         │ the Earth).      │
952       ├─────────┼─────────┼─────────┼──────────────────┤
953       │         │         │         │                  │
954       │mag_len  │ No      │ numeric │ Scalar magnetic  │
955       │         │         │         │ field strength.  │
956       ├─────────┼─────────┼─────────┼──────────────────┤
957       │         │         │         │                  │
958       │mag_x    │ No      │ numeric │ X component of   │
959       │         │         │         │ magnetic field   │
960       │         │         │         │ strength.        │
961       ├─────────┼─────────┼─────────┼──────────────────┤
962       │         │         │         │                  │
963       │mag_y    │ No      │ numeric │ Y component of   │
964       │         │         │         │ magnetic field   │
965       │         │         │         │ strength.        │
966       ├─────────┼─────────┼─────────┼──────────────────┤
967       │         │         │         │                  │
968       │mag_z    │ No      │ numeric │ Z component of   │
969       │         │         │         │ magnetic field   │
970       │         │         │         │ strength.        │
971       ├─────────┼─────────┼─────────┼──────────────────┤
972       │         │         │         │                  │
973       │acc_len  │ No      │ numeric │ Scalar           │
974       │         │         │         │ acceleration.    │
975       ├─────────┼─────────┼─────────┼──────────────────┤
976       │         │         │         │                  │
977       │acc_x    │ No      │ numeric │ X component of   │
978       │         │         │         │ acceleration     │
979       │         │         │         │ (m/s^2).         │
980       ├─────────┼─────────┼─────────┼──────────────────┤
981       │         │         │         │                  │
982       │acc_y    │ No      │ numeric │ Y component of   │
983       │         │         │         │ acceleration     │
984       │         │         │         │ (m/s^2).         │
985       ├─────────┼─────────┼─────────┼──────────────────┤
986       │         │         │         │                  │
987       │acc_z    │ No      │ numeric │ Z component of   │
988       │         │         │         │ acceleration     │
989       │         │         │         │ (m/s^2).         │
990       ├─────────┼─────────┼─────────┼──────────────────┤
991       │         │         │         │                  │
992       │gyro_x   │ No      │ numeric │ X component of   │
993       │         │         │         │ angular rate     │
994       │         │         │         │ (deg/s)          │
995       ├─────────┼─────────┼─────────┼──────────────────┤
996       │         │         │         │                  │
997       │gyro_y   │ No      │ numeric │ Y component of   │
998       │         │         │         │ angular rate     │
999       │         │         │         │ (deg/s)          │
1000       ├─────────┼─────────┼─────────┼──────────────────┤
1001       │         │         │         │                  │
1002       │gyro_z   │ No      │ numeric │ Z component of   │
1003       │         │         │         │ angular rate     │
1004       │         │         │         │ (deg/s)          │
1005       ├─────────┼─────────┼─────────┼──────────────────┤
1006       │         │         │         │                  │
1007       │depth    │ No      │ numeric │ Water depth in   │
1008       │         │         │         │ meters.          │
1009       ├─────────┼─────────┼─────────┼──────────────────┤
1010       │         │         │         │                  │
1011       │temp     │ No      │ numeric │ Temperature at   │
1012       │         │         │         │ the sensor,      │
1013       │         │         │         │ degrees          │
1014       │         │         │         │ centigrade.      │
1015       └─────────┴─────────┴─────────┴──────────────────┘
1016
1017       The heading, pitch, and roll status codes (if present) vary by device.
1018       For the TNT Revolution digital compasses, they are coded as follows:
1019
1020       Table 6. Device flags
1021       ┌─────┬────────────────────────────┐
1022       │     │                            │
1023       │Code │ Description                │
1024       ├─────┼────────────────────────────┤
1025       │     │                            │
1026       │C    │ magnetometer calibration   │
1027       │     │ alarm                      │
1028       ├─────┼────────────────────────────┤
1029       │     │                            │
1030       │L    │ low alarm                  │
1031       ├─────┼────────────────────────────┤
1032       │     │                            │
1033       │M    │ low warning                │
1034       ├─────┼────────────────────────────┤
1035       │     │                            │
1036       │N    │ normal                     │
1037       ├─────┼────────────────────────────┤
1038       │     │                            │
1039       │O    │ high warning               │
1040       ├─────┼────────────────────────────┤
1041       │     │                            │
1042       │P    │ high alarm                 │
1043       ├─────┼────────────────────────────┤
1044       │     │                            │
1045       │V    │ magnetometer voltage level │
1046       │     │ alarm                      │
1047       └─────┴────────────────────────────┘
1048
1049       When the C client library parses a response of this kind, it will
1050       assert ATT_IS.
1051
1052       Here’s an example:
1053
1054           {"class":"ATT","time":1270938096.843,
1055               "heading":14223.00,"mag_st":"N",
1056               "pitch":169.00,"pitch_st":"N", "roll":-43.00,"roll_st":"N",
1057               "dip":13641.000,"mag_x":2454.000}
1058
1059   IMU
1060       The IMU object is asynchronous to the GNSS epoch. It is reported with
1061       arbitrary, even out of order, time scales.
1062
1063       The ATT and IMU objects have the same fields, but IMU objects are
1064       output as soon as possible.
1065
1066       Seee the ATT onject description for field details.
1067
1068   TOFF
1069       This message is emitted on each cycle and reports the offset between
1070       the host’s clock time and the GPS time at top of the second (actually,
1071       when the first data for the reporting cycle is received).
1072
1073       This message exactly mirrors the PPS message.
1074
1075       The TOFF message reports the GPS time as derived from the GPS serial
1076       data stream. The PPS message reports the GPS time as derived from the
1077       GPS PPS pulse.
1078
1079       A TOFF object has the following elements:
1080
1081       Table 7. TOFF object
1082       ┌───────────┬─────────┬─────────┬──────────────────┐
1083       │           │         │         │                  │
1084       │Name       │ Always? │ Type    │ Description      │
1085       ├───────────┼─────────┼─────────┼──────────────────┤
1086       │           │         │         │                  │
1087       │class      │ Yes     │ string  │ Fixed: "TOFF"    │
1088       ├───────────┼─────────┼─────────┼──────────────────┤
1089       │           │         │         │                  │
1090       │device     │ Yes     │ string  │ Name of the      │
1091       │           │         │         │ originating      │
1092       │           │         │         │ device           │
1093       ├───────────┼─────────┼─────────┼──────────────────┤
1094       │           │         │         │                  │
1095       │real_sec   │ Yes     │ numeric │ seconds from the │
1096       │           │         │         │ GPS clock        │
1097       ├───────────┼─────────┼─────────┼──────────────────┤
1098       │           │         │         │                  │
1099       │real_nsec  │ Yes     │ numeric │ nanoseconds from │
1100       │           │         │         │ the GPS clock    │
1101       ├───────────┼─────────┼─────────┼──────────────────┤
1102       │           │         │         │                  │
1103       │clock_sec  │ Yes     │ numeric │ seconds from the │
1104       │           │         │         │ system clock     │
1105       ├───────────┼─────────┼─────────┼──────────────────┤
1106       │           │         │         │                  │
1107       │clock_nsec │ Yes     │ numeric │ nanoseconds from │
1108       │           │         │         │ the system clock │
1109       └───────────┴─────────┴─────────┴──────────────────┘
1110
1111       This message is emitted once per second to watchers of a device and is
1112       intended to report the timestamps of the in-band report of the GPS and
1113       seconds as reported by the system clock (which may be NTP-corrected)
1114       when the first valid time stamp of the reporting cycle was seen.
1115
1116       The message contains two second/nanosecond pairs: real_sec and
1117       real_nsec contain the time the GPS thinks it was at the start of the
1118       current cycle; clock_sec and clock_nsec contain the time the system
1119       clock thinks it was on receipt of the first timing message of the
1120       cycle. real_nsec is always to nanosecond precision. clock_nsec is
1121       nanosecond precision on most systems.
1122
1123       Here’s an example:
1124
1125           {"class":"TOFF","device":"/dev/ttyUSB0",
1126                "real_sec":1330212592, "real_nsec":343182,
1127                "clock_sec":1330212592,"clock_nsec":343184,
1128                "precision":-2}
1129
1130   PPS
1131       This message is emitted each time the daemon sees a valid PPS (Pulse
1132       Per Second) strobe from a device.
1133
1134       This message exactly mirrors the TOFF message.
1135
1136       The TOFF message reports the GPS time as derived from the GPS serial
1137       data stream. The PPS message reports the GPS time as derived from the
1138       GPS PPS pulse.
1139
1140       There are various sources of error in the reported clock times. The
1141       speed of the serial connection between the GPS and the system adds a
1142       delay to the start of cycle detection. An even bigger error is added by
1143       the variable computation time inside the GPS. Taken together the time
1144       derived from the start of the GPS cycle can have offsets of 10
1145       milliseconds to 700 milliseconds and combined jitter and wander of 100
1146       to 300 milliseconds.
1147
1148       See the NTP documentation for their definition of precision.
1149
1150       A PPS object has the following elements:
1151
1152       Table 8. PPS object
1153       ┌───────────┬─────────┬─────────┬──────────────────┐
1154       │           │         │         │                  │
1155       │Name       │ Always? │ Type    │ Description      │
1156       ├───────────┼─────────┼─────────┼──────────────────┤
1157       │           │         │         │                  │
1158       │class      │ Yes     │ string  │ Fixed: "PPS"     │
1159       ├───────────┼─────────┼─────────┼──────────────────┤
1160       │           │         │         │                  │
1161       │device     │ Yes     │ string  │ Name of the      │
1162       │           │         │         │ originating      │
1163       │           │         │         │ device           │
1164       ├───────────┼─────────┼─────────┼──────────────────┤
1165       │           │         │         │                  │
1166       │real_sec   │ Yes     │ numeric │ seconds from the │
1167       │           │         │         │ PPS source       │
1168       ├───────────┼─────────┼─────────┼──────────────────┤
1169       │           │         │         │                  │
1170       │real_nsec  │ Yes     │ numeric │ nanoseconds from │
1171       │           │         │         │ the PPS source   │
1172       ├───────────┼─────────┼─────────┼──────────────────┤
1173       │           │         │         │                  │
1174       │clock_sec  │ Yes     │ numeric │ seconds from the │
1175       │           │         │         │ system clock     │
1176       ├───────────┼─────────┼─────────┼──────────────────┤
1177       │           │         │         │                  │
1178       │clock_nsec │ Yes     │ numeric │ nanoseconds from │
1179       │           │         │         │ the system clock │
1180       ├───────────┼─────────┼─────────┼──────────────────┤
1181       │           │         │         │                  │
1182       │precision  │ Yes     │ numeric │ NTP style        │
1183       │           │         │         │ estimate of PPS  │
1184       │           │         │         │ precision        │
1185       ├───────────┼─────────┼─────────┼──────────────────┤
1186       │           │         │         │                  │
1187       │shm        │ Yes     │ string  │ shm key of this  │
1188       │           │         │         │ PPS              │
1189       ├───────────┼─────────┼─────────┼──────────────────┤
1190       │           │         │         │                  │
1191       │qErr       │ No      │ numeric │ Quantization     │
1192       │           │         │         │ error of the     │
1193       │           │         │         │ PPS, in          │
1194       │           │         │         │ picoseconds.     │
1195       │           │         │         │ Sometimes called │
1196       │           │         │         │ the "sawtooth"   │
1197       │           │         │         │ error.           │
1198       └───────────┴─────────┴─────────┴──────────────────┘
1199
1200       This message is emitted once per second to watchers of a device
1201       emitting PPS, and reports the time of the start of the GPS second (when
1202       the 1PPS arrives) and seconds as reported by the system clock (which
1203       may be NTP-corrected) at that moment.
1204
1205       The message contains two second/nanosecond pairs: real_sec and
1206       real_nsec contain the time the GPS thinks it was at the PPS edge;
1207       clock_sec and clock_nsec contain the time the system clock thinks it
1208       was at the PPS edge. real_nsec is always to nanosecond precision.
1209       clock_nsec is nanosecond precision on most systems.
1210
1211       There are various sources of error in the reported clock times. For PPS
1212       delivered via a real serial-line strobe, serial-interrupt latency plus
1213       processing time to the timer call should be bounded above by about 10
1214       microseconds; that can be reduced to less than 1 microsecond if your
1215       kernel supports [RFC-2783]. USB1.1-to-serial control-line emulation is
1216       limited to about 1 millisecond. seconds.
1217
1218       Here’s an example:
1219
1220           {"class":"PPS","device":"/dev/ttyUSB0",
1221                "real_sec":1330212592, "real_nsec":343182,
1222                "clock_sec":1330212592,"clock_nsec":343184,
1223                "precision":-3}
1224
1225   OSC
1226       This message reports the status of a GPS-disciplined oscillator
1227       (GPSDO). The GPS PPS output (which has excellent long-term stability)
1228       is typically used to discipline a local oscillator with much better
1229       short-term stability (such as a rubidium atomic clock).
1230
1231       An OSC object has the following elements:
1232
1233       Table 9. OSC object
1234       ┌────────────┬─────────┬─────────┬──────────────────┐
1235       │            │         │         │                  │
1236       │Name        │ Always? │ Type    │ Description      │
1237       ├────────────┼─────────┼─────────┼──────────────────┤
1238       │            │         │         │                  │
1239       │class       │ Yes     │ string  │ Fixed: "OSC"     │
1240       ├────────────┼─────────┼─────────┼──────────────────┤
1241       │            │         │         │                  │
1242       │device      │ Yes     │ string  │ Name of the      │
1243       │            │         │         │ originating      │
1244       │            │         │         │ device.          │
1245       ├────────────┼─────────┼─────────┼──────────────────┤
1246       │            │         │         │                  │
1247       │running     │ Yes     │ boolean │ If true, the     │
1248       │            │         │         │ oscillator is    │
1249       │            │         │         │ currently        │
1250       │            │         │         │ running.         │
1251       │            │         │         │ Oscillators may  │
1252       │            │         │         │ require warm-up  │
1253       │            │         │         │ time at the      │
1254       │            │         │         │ start of the     │
1255       │            │         │         │ day.             │
1256       ├────────────┼─────────┼─────────┼──────────────────┤
1257       │            │         │         │                  │
1258       │reference   │ Yes     │ boolean │ If true, the     │
1259       │            │         │         │ oscillator is    │
1260       │            │         │         │ receiving a GPS  │
1261       │            │         │         │ PPS signal.      │
1262       ├────────────┼─────────┼─────────┼──────────────────┤
1263       │            │         │         │                  │
1264       │disciplined │ Yes     │ boolean │ If true, the GPS │
1265       │            │         │         │ PPS signal is    │
1266       │            │         │         │ sufficiently     │
1267       │            │         │         │ stable and is    │
1268       │            │         │         │ being used to    │
1269       │            │         │         │ discipline the   │
1270       │            │         │         │ local            │
1271       │            │         │         │ oscillator.      │
1272       ├────────────┼─────────┼─────────┼──────────────────┤
1273       │            │         │         │                  │
1274       │delta       │ Yes     │ numeric │ The time         │
1275       │            │         │         │ difference (in   │
1276       │            │         │         │ nanoseconds)     │
1277       │            │         │         │ between the      │
1278       │            │         │         │ GPS-disciplined  │
1279       │            │         │         │ oscillator PPS   │
1280       │            │         │         │ output pulse and │
1281       │            │         │         │ the most recent  │
1282       │            │         │         │ GPS PPS input    │
1283       │            │         │         │ pulse.           │
1284       └────────────┴─────────┴─────────┴──────────────────┘
1285
1286       Here’s an example:
1287
1288           {"class":"OSC","running":true,"device":"/dev/ttyUSB0",
1289               "reference":true,"disciplined":true,"delta":67}
1290

CORE PROTOCOL COMMANDS

1292       And here are the commands you can send to gpsd.
1293
1294   ?VERSION;
1295       Returns an object with the following attributes:
1296
1297       Table 10. VERSION object
1298       ┌────────────┬─────────┬─────────┬──────────────────┐
1299       │            │         │         │                  │
1300       │Name        │ Always? │ Type    │ Description      │
1301       ├────────────┼─────────┼─────────┼──────────────────┤
1302       │            │         │         │                  │
1303       │class       │ Yes     │ string  │ Fixed: "VERSION" │
1304       ├────────────┼─────────┼─────────┼──────────────────┤
1305       │            │         │         │                  │
1306       │release     │ Yes     │ string  │ Public release   │
1307       │            │         │         │ level            │
1308       ├────────────┼─────────┼─────────┼──────────────────┤
1309       │            │         │         │                  │
1310       │rev         │ Yes     │ string  │ Internal         │
1311       │            │         │         │ revision-control │
1312       │            │         │         │ level.           │
1313       ├────────────┼─────────┼─────────┼──────────────────┤
1314       │            │         │         │                  │
1315       │proto_major │ Yes     │ numeric │ API major        │
1316       │            │         │         │ revision level.  │
1317       ├────────────┼─────────┼─────────┼──────────────────┤
1318       │            │         │         │                  │
1319       │proto_minor │ Yes     │ numeric │ API minor        │
1320       │            │         │         │ revision level.  │
1321       ├────────────┼─────────┼─────────┼──────────────────┤
1322       │            │         │         │                  │
1323       │remote      │ No      │ string  │ URL of the       │
1324       │            │         │         │ remote daemon    │
1325       │            │         │         │ reporting this   │
1326       │            │         │         │ version. If      │
1327       │            │         │         │ empty, this is   │
1328       │            │         │         │ the version of   │
1329       │            │         │         │ the local        │
1330       │            │         │         │ daemon.          │
1331       └────────────┴─────────┴─────────┴──────────────────┘
1332
1333       The daemon ships a VERSION response to each client when the client
1334       first connects to it.
1335
1336       When the C client library parses a response of this kind, it will
1337       assert the VERSION_SET bit in the top-level set member.
1338
1339       Here’s an example:
1340
1341           {"class":"VERSION","version":"2.40dev",
1342               "rev":"06f62e14eae9886cde907dae61c124c53eb1101f",
1343               "proto_major":3,"proto_minor":1
1344           }
1345
1346   ?DEVICES;
1347       Returns a device list object with the following elements:
1348
1349       Table 11. DEVICES object
1350       ┌────────┬─────────┬────────┬──────────────────┐
1351       │        │         │        │                  │
1352       │Name    │ Always? │ Type   │ Description      │
1353       ├────────┼─────────┼────────┼──────────────────┤
1354       │        │         │        │                  │
1355       │class   │ Yes     │ string │ Fixed: "DEVICES" │
1356       ├────────┼─────────┼────────┼──────────────────┤
1357       │        │         │        │                  │
1358       │devices │ Yes     │ list   │ List of device   │
1359       │        │         │        │ descriptions     │
1360       ├────────┼─────────┼────────┼──────────────────┤
1361       │        │         │        │                  │
1362       │remote  │ No      │ string │ URL of the       │
1363       │        │         │        │ remote daemon    │
1364       │        │         │        │ reporting the    │
1365       │        │         │        │ device set. If   │
1366       │        │         │        │ empty, this is a │
1367       │        │         │        │ DEVICES response │
1368       │        │         │        │ from the local   │
1369       │        │         │        │ daemon.          │
1370       └────────┴─────────┴────────┴──────────────────┘
1371
1372       When the C client library parses a response of this kind, it will
1373       assert the DEVICELIST_SET bit in the top-level set member.
1374
1375       Here’s an example:
1376
1377           {"class"="DEVICES","devices":[
1378               {"class":"DEVICE","path":"/dev/pts/1","flags":1,"driver":"SiRF binary"},
1379               {"class":"DEVICE","path":"/dev/pts/3","flags":4,"driver":"AIVDM"}]}
1380
1381       The daemon occasionally ships a bare DEVICE object to the client (that
1382       is, one not inside a DEVICES wrapper). The data content of these
1383       objects will be described later as a response to the ?DEVICE command.
1384
1385   ?WATCH;
1386       This command sets watcher mode. It also sets or elicits a report of
1387       per-subscriber policy and the raw bit. An argument WATCH object changes
1388       the subscriber’s policy. The response describes the subscriber’s
1389       policy. The response will also include a DEVICES object.
1390
1391       A WATCH object has the following elements:
1392
1393       Table 12. WATCH object
1394       ┌────────┬─────────┬─────────┬──────────────────┐
1395       │        │         │         │                  │
1396       │Name    │ Always? │ Type    │ Description      │
1397       ├────────┼─────────┼─────────┼──────────────────┤
1398       │        │         │         │                  │
1399       │class   │ Yes     │ string  │ Fixed: "WATCH"   │
1400       ├────────┼─────────┼─────────┼──────────────────┤
1401       │        │         │         │                  │
1402       │enable  │ No      │ boolean │ Enable (true) or │
1403       │        │         │         │ disable (false)  │
1404       │        │         │         │ watcher mode.    │
1405       │        │         │         │ Default is true. │
1406       ├────────┼─────────┼─────────┼──────────────────┤
1407       │        │         │         │                  │
1408       │json    │ No      │ boolean │ Enable (true) or │
1409       │        │         │         │ disable (false)  │
1410       │        │         │         │ dumping of JSON  │
1411       │        │         │         │ reports. Default │
1412       │        │         │         │ is false.        │
1413       ├────────┼─────────┼─────────┼──────────────────┤
1414       │        │         │         │                  │
1415       │nmea    │ No      │ boolean │ Enable (true) or │
1416       │        │         │         │ disable (false)  │
1417       │        │         │         │ dumping of       │
1418       │        │         │         │ binary packets   │
1419       │        │         │         │ as pseudo-NMEA.  │
1420       │        │         │         │ Default is       │
1421       │        │         │         │ false.           │
1422       ├────────┼─────────┼─────────┼──────────────────┤
1423       │        │         │         │                  │
1424       │raw     │ No      │ integer │ Controls 'raw'   │
1425       │        │         │         │ mode. When this  │
1426       │        │         │         │ attribute is set │
1427       │        │         │         │ to 1 for a       │
1428       │        │         │         │ channel, gpsd    
1429       │        │         │         │ reports the      │
1430       │        │         │         │ unprocessed NMEA │
1431       │        │         │         │ or AIVDM data    │
1432       │        │         │         │ stream from      │
1433       │        │         │         │ whatever device  │
1434       │        │         │         │ is attached.     │
1435       │        │         │         │ Binary GPS       │
1436       │        │         │         │ packets are      │
1437       │        │         │         │ hex-dumped.      │
1438       │        │         │         │ RTCM2 and RTCM3  │
1439       │        │         │         │ packets are not  │
1440       │        │         │         │ dumped in raw    │
1441       │        │         │         │ mode. When this  │
1442       │        │         │         │ attribute is set │
1443       │        │         │         │ to 2 for a       │
1444       │        │         │         │ channel that     │
1445       │        │         │         │ processes binary │
1446       │        │         │         │ data, gpsd       
1447       │        │         │         │ reports the      │
1448       │        │         │         │ received data    │
1449       │        │         │         │ verbatim without │
1450       │        │         │         │ hex-dumping.     │
1451       ├────────┼─────────┼─────────┼──────────────────┤
1452       │        │         │         │                  │
1453       │scaled  │ No      │ boolean │ If true, apply   │
1454       │        │         │         │ scaling divisors │
1455       │        │         │         │ to output before │
1456       │        │         │         │ dumping; default │
1457       │        │         │         │ is false.        │
1458       ├────────┼─────────┼─────────┼──────────────────┤
1459       │        │         │         │                  │
1460       │split24 │ No      │ boolean │ If true,         │
1461       │        │         │         │ aggregate AIS    │
1462       │        │         │         │ type24 sentence  │
1463       │        │         │         │ parts. If false, │
1464       │        │         │         │ report each part │
1465       │        │         │         │ as a separate    │
1466       │        │         │         │ JSON object,     │
1467       │        │         │         │ leaving the      │
1468       │        │         │         │ client to match  │
1469       │        │         │         │ MMSIs and        │
1470       │        │         │         │ aggregate.       │
1471       │        │         │         │ Default is       │
1472       │        │         │         │ false. Applies   │
1473       │        │         │         │ only to AIS      │
1474       │        │         │         │ reports.         │
1475       ├────────┼─────────┼─────────┼──────────────────┤
1476       │        │         │         │                  │
1477       │pps     │ No      │ boolean │ If true, emit    │
1478       │        │         │         │ the TOFF JSON    │
1479       │        │         │         │ message on each  │
1480       │        │         │         │ cycle and a PPS  │
1481       │        │         │         │ JSON message     │
1482       │        │         │         │ when the device  │
1483       │        │         │         │ issues 1PPS.     │
1484       │        │         │         │ Default is       │
1485       │        │         │         │ false.           │
1486       ├────────┼─────────┼─────────┼──────────────────┤
1487       │        │         │         │                  │
1488       │device  │ No      │ string  │ If present,      │
1489       │        │         │         │ enable watching  │
1490       │        │         │         │ only of the      │
1491       │        │         │         │ specified device │
1492       │        │         │         │ rather than all  │
1493       │        │         │         │ devices. Useful  │
1494       │        │         │         │ with raw and     │
1495       │        │         │         │ NMEA modes in    │
1496       │        │         │         │ which device     │
1497       │        │         │         │ responses aren’t │
1498       │        │         │         │ tagged. Has no   │
1499       │        │         │         │ effect when used │
1500       │        │         │         │ with             │
1501       │        │         │         │ enable:false.    │
1502       ├────────┼─────────┼─────────┼──────────────────┤
1503       │        │         │         │                  │
1504       │remote  │ No      │ string  │ URL of the       │
1505       │        │         │         │ remote daemon    │
1506       │        │         │         │ reporting the    │
1507       │        │         │         │ watch set. If    │
1508       │        │         │         │ empty, this is a │
1509       │        │         │         │ WATCH response   │
1510       │        │         │         │ from the local   │
1511       │        │         │         │ daemon.          │
1512       └────────┴─────────┴─────────┴──────────────────┘
1513
1514       There is an additional boolean "timing" attribute which is undocumented
1515       because that portion of the interface is considered unstable and for
1516       developer use only.
1517
1518       In watcher mode, GPS reports are dumped as TPV and SKY responses. AIS,
1519       Subframe and RTCM reporting is described in the next section.
1520
1521       When the C client library parses a response of this kind, it will
1522       assert the POLICY_SET bit in the top-level set member.
1523
1524       Here’s an example:
1525
1526           {"class":"WATCH", "raw":1,"scaled":true}
1527
1528   ?POLL;
1529       The POLL command requests data from the last-seen fixes on all active
1530       GPS devices. Devices must previously have been activated by ?WATCH to
1531       be pollable.
1532
1533       Polling can lead to possibly surprising results when it is used on a
1534       device such as an NMEA GPS for which a complete fix has to be
1535       accumulated from several sentences. If you poll while those sentences
1536       are being emitted, the response will contain only the fix data
1537       collected so far in the current epoch. It may be as much as one cycle
1538       time (typically 1 second) stale.
1539
1540       The POLL response will contain a timestamped list of TPV objects
1541       describing cached data, and a timestamped list of SKY objects
1542       describing satellite configuration. If a device has not seen fixes, it
1543       will be reported with a mode field of zero.
1544
1545       Table 13. POLL object
1546       ┌───────┬─────────┬────────────┬──────────────────┐
1547       │       │         │            │                  │
1548       │Name   │ Always? │ Type       │ Description      │
1549       ├───────┼─────────┼────────────┼──────────────────┤
1550       │       │         │            │                  │
1551       │class  │ Yes     │ string     │ Fixed: "POLL"    │
1552       ├───────┼─────────┼────────────┼──────────────────┤
1553       │       │         │            │                  │
1554       │time   │ Yes     │ Numeric    │ Timestamp in ISO │
1555       │       │         │            │ 8601 format. May │
1556       │       │         │            │ have a           │
1557       │       │         │            │ fractional part  │
1558       │       │         │            │ of up to .001sec │
1559       │       │         │            │ precision.       │
1560       ├───────┼─────────┼────────────┼──────────────────┤
1561       │       │         │            │                  │
1562       │active │ Yes     │ Numeric    │ Count of active  │
1563       │       │         │            │ devices.         │
1564       ├───────┼─────────┼────────────┼──────────────────┤
1565       │       │         │            │                  │
1566       │tpv    │ Yes     │ JSON array │ Comma-separated  │
1567       │       │         │            │ list of TPV      │
1568       │       │         │            │ objects.         │
1569       ├───────┼─────────┼────────────┼──────────────────┤
1570       │       │         │            │                  │
1571       │sky    │ Yes     │ JSON array │ Comma-separated  │
1572       │       │         │            │ list of SKY      │
1573       │       │         │            │ objects.         │
1574       └───────┴─────────┴────────────┴──────────────────┘
1575
1576       Here’s an example of a POLL response:
1577
1578           {"class":"POLL","time":"2010-06-04T10:31:00.289Z","active":1,
1579               "tpv":[{"class":"TPV","device":"/dev/ttyUSB0",
1580                       "time":"2010-09-08T13:33:06.095Z",
1581                       "ept":0.005,"lat":40.035093060,
1582                       "lon":-75.519748733,"track":99.4319,"speed":0.123,"mode":2}],
1583               "sky":[{"class":"SKY","device":"/dev/ttyUSB0",
1584                       "time":1270517264.240,"hdop":9.20,
1585                       "satellites":[{"PRN":16,"el":55,"az":42,"ss":36,"used":true},
1586                                     {"PRN":19,"el":25,"az":177,"ss":0,"used":false},
1587                                     {"PRN":7,"el":13,"az":295,"ss":0,"used":false},
1588                                     {"PRN":6,"el":56,"az":135,"ss":32,"used":true},
1589                                     {"PRN":13,"el":47,"az":304,"ss":0,"used":false},
1590                                     {"PRN":23,"el":66,"az":259,"ss":0,"used":false},
1591                                     {"PRN":20,"el":7,"az":226,"ss":0,"used":false},
1592                                     {"PRN":3,"el":52,"az":163,"ss":32,"used":true},
1593                                     {"PRN":31,"el":16,"az":102,"ss":0,"used":false}
1594           ]}]}
1595
1596           Note
1597           Client software should not assume the field inventory of the POLL
1598           response is fixed for all time. As gpsd collects and caches more
1599           data from more sensor types, those data are likely to find their
1600           way into this response.
1601
1602   ?DEVICE; ?DEVICE=
1603       This command reports (when followed by ';') the state of a device, or
1604       sets (when followed by '=' and a DEVICE object) device-specific control
1605       bits, notably the device’s speed and serial mode and the native-mode
1606       bit. The parameter-setting form will be rejected if more than one
1607       client is attached to the channel and a device path is not specified.
1608
1609       Pay attention to the response, because it is possible for this command
1610       to fail if the GPS does not support a command or only supports some
1611       combinations of modes. In case of failure, the daemon and GPS will
1612       continue to communicate at the old speed.
1613
1614       Use the parameter-setting form with caution. On USB and Bluetooth GPSes
1615       it is also possible for serial mode setting to fail either because the
1616       serial adaptor chip does not support non-8N1 modes or because the
1617       device firmware does not properly synchronize the serial adaptor chip
1618       with the UART on the GPS chipset when the speed changes. These failures
1619       can hang your device, possibly requiring a GPS power cycle or (in
1620       extreme cases) physically disconnecting the NVRAM backup battery.
1621
1622       A DEVICE object has the following elements:
1623
1624       Table 14. DEVICE object
1625       ┌──────────┬─────────┬─────────┬──────────────────┐
1626       │          │         │         │                  │
1627       │Name      │ Always? │ Type    │ Description      │
1628       ├──────────┼─────────┼─────────┼──────────────────┤
1629       │          │         │         │                  │
1630       │class     │ Yes     │ string  │ Fixed: "DEVICE"  │
1631       ├──────────┼─────────┼─────────┼──────────────────┤
1632       │          │         │         │                  │
1633       │activated │ No      │ string  │ Time the device  │
1634       │          │         │         │ was activated as │
1635       │          │         │         │ an ISO8601 time  │
1636       │          │         │         │ stamp. If the    │
1637       │          │         │         │ device is        │
1638       │          │         │         │ inactive this    │
1639       │          │         │         │ attribute is     │
1640       │          │         │         │ absent.          │
1641       ├──────────┼─────────┼─────────┼──────────────────┤
1642       │          │         │         │                  │
1643       │bps       │ No      │ integer │ Device speed in  │
1644       │          │         │         │ bits per second. │
1645       ├──────────┼─────────┼─────────┼──────────────────┤
1646       │          │         │         │                  │
1647       │cycle     │ No      │ real    │ Device cycle     │
1648       │          │         │         │ time in seconds. │
1649       ├──────────┼─────────┼─────────┼──────────────────┤
1650       │          │         │         │                  │
1651       │driver    │ No      │ string  │ GPSD’s name for  │
1652       │          │         │         │ the device       │
1653       │          │         │         │ driver type.     │
1654       │          │         │         │ Won’t be         │
1655       │          │         │         │ reported before  │
1656       │          │         │         │ gpsd has seen    │
1657       │          │         │         │ identifiable     │
1658       │          │         │         │ packets from the │
1659       │          │         │         │ device.          │
1660       ├──────────┼─────────┼─────────┼──────────────────┤
1661       │          │         │         │                  │
1662       │flags     │ No      │ integer │ Bit vector of    │
1663       │          │         │         │ property flags.  │
1664       │          │         │         │ Currently        │
1665       │          │         │         │ defined flags    │
1666       │          │         │         │ are: describe    │
1667       │          │         │         │ packet types     │
1668       │          │         │         │ seen so far      │
1669       │          │         │         │ (GPS, RTCM2,     │
1670       │          │         │         │ RTCM3, AIS).     │
1671       │          │         │         │ Won’t be         │
1672       │          │         │         │ reported if      │
1673       │          │         │         │ empty, e.g.      │
1674       │          │         │         │ before gpsd has  │
1675       │          │         │         │ seen             │
1676       │          │         │         │ identifiable     │
1677       │          │         │         │ packets from the │
1678       │          │         │         │ device.          │
1679       ├──────────┼─────────┼─────────┼──────────────────┤
1680       │          │         │         │                  │
1681       │hexdata   │ No      │ string  │ Data, in bare    │
1682       │          │         │         │ hexadecimal, to  │
1683       │          │         │         │ send to the GNSS │
1684       │          │         │         │ receiver.        │
1685       ├──────────┼─────────┼─────────┼──────────────────┤
1686       │          │         │         │                  │
1687       │mincycle  │ No      │ real    │ Device minimum   │
1688       │          │         │         │ cycle time in    │
1689       │          │         │         │ seconds.         │
1690       │          │         │         │ Reported from    │
1691       │          │         │         │ ?DEVICE when     │
1692       │          │         │         │ (and only when)  │
1693       │          │         │         │ the rate is      │
1694       │          │         │         │ switchable. It   │
1695       │          │         │         │ is read-only and │
1696       │          │         │         │ not settable.    │
1697       ├──────────┼─────────┼─────────┼──────────────────┤
1698       │          │         │         │                  │
1699       │native    │ No      │ integer │ 0 means NMEA     │
1700       │          │         │         │ mode and 1 means │
1701       │          │         │         │ alternate mode   │
1702       │          │         │         │ (binary if it    │
1703       │          │         │         │ has one, for     │
1704       │          │         │         │ SiRF and         │
1705       │          │         │         │ Evermore         │
1706       │          │         │         │ chipsets in      │
1707       │          │         │         │ particular).     │
1708       │          │         │         │ Attempting to    │
1709       │          │         │         │ set this mode on │
1710       │          │         │         │ a non-GPS device │
1711       │          │         │         │ will yield an    │
1712       │          │         │         │ error.           │
1713       ├──────────┼─────────┼─────────┼──────────────────┤
1714       │          │         │         │                  │
1715       │parity    │ No      │ string  │ N, O or E for no │
1716       │          │         │         │ parity, odd, or  │
1717       │          │         │         │ even.            │
1718       ├──────────┼─────────┼─────────┼──────────────────┤
1719       │          │         │         │                  │
1720       │path      │ No      │ string  │ Name the device  │
1721       │          │         │         │ for which the    │
1722       │          │         │         │ control bits are │
1723       │          │         │         │ being reported,  │
1724       │          │         │         │ or for which     │
1725       │          │         │         │ they are to be   │
1726       │          │         │         │ applied. This    │
1727       │          │         │         │ attribute may be │
1728       │          │         │         │ omitted only     │
1729       │          │         │         │ when there is    │
1730       │          │         │         │ exactly one      │
1731       │          │         │         │ subscribed       │
1732       │          │         │         │ channel.         │
1733       ├──────────┼─────────┼─────────┼──────────────────┤
1734       │          │         │         │                  │
1735       │readonly  │ No      │ boolean │ True if device   │
1736       │          │         │         │ is read-only.    │
1737       ├──────────┼─────────┼─────────┼──────────────────┤
1738       │          │         │         │                  │
1739       │stopbits  │ Yes     │ string  │ Stop bits (1 or  │
1740       │          │         │         │ 2).              │
1741       ├──────────┼─────────┼─────────┼──────────────────┤
1742       │          │         │         │                  │
1743       │subtype   │ No      │ string  │ Whatever version │
1744       │          │         │         │ information the  │
1745       │          │         │         │ device driver    │
1746       │          │         │         │ returned.        │
1747       ├──────────┼─────────┼─────────┼──────────────────┤
1748       │          │         │         │                  │
1749       │subtype1  │ No      │ string  │ More version     │
1750       │          │         │         │ information the  │
1751       │          │         │         │ device driver    │
1752       │          │         │         │ returned.        │
1753       └──────────┴─────────┴─────────┴──────────────────┘
1754
1755       The serial parameters will (bps, parity, stopbits) be omitted in a
1756       response describing a TCP/IP source such as an Ntrip, DGPSIP, or AIS
1757       feed; on a serial device they will always be present.
1758
1759       The contents of the flags field should be interpreted as follows:
1760
1761       Table 15. Device flags
1762       ┌───────────┬───────┬─────────────────────┐
1763       │           │       │                     │
1764       │C #define  │ Value │ Description         │
1765       ├───────────┼───────┼─────────────────────┤
1766       │           │       │                     │
1767       │SEEN_GPS   │ 0x01  │ GPS data has been   │
1768       │           │       │ seen on this device │
1769       ├───────────┼───────┼─────────────────────┤
1770       │           │       │                     │
1771       │SEEN_RTCM2 │ 0x02  │ RTCM2 data has been │
1772       │           │       │ seen on this device │
1773       ├───────────┼───────┼─────────────────────┤
1774       │           │       │                     │
1775       │SEEN_RTCM3 │ 0x04  │ RTCM3 data has been │
1776       │           │       │ seen on this device │
1777       ├───────────┼───────┼─────────────────────┤
1778       │           │       │                     │
1779       │SEEN_AIS   │ 0x08  │ AIS data has been   │
1780       │           │       │ seen on this device │
1781       └───────────┴───────┴─────────────────────┘
1782
1783       When the C client library parses a response of this kind, it will
1784       assert the DEVICE_SET bit in the top-level set member.
1785
1786       Here’s an example:
1787
1788           {"class":"DEVICE","bps":4800,"parity":"N","stopbits":1,"native":0}
1789
1790       When a client is in watcher mode, the daemon will ship it DEVICE
1791       notifications when a device is added to the pool or deactivated.
1792
1793       When the C client library parses a response of this kind, it will
1794       assert the DEVICE_SET bit in the top-level set member.
1795
1796   Examples
1797       A notice of a deactivated device:
1798
1799           {"class":"DEVICE","path":"/dev/pts1","activated":0}
1800
1801       A send a u-blox receiver at /dev/ttyUSB2 a request for a UBX-MON-VER
1802       message:
1803
1804           ?DEVICE={"path":"/dev/ttyUSB2","hexdata":"b5620a0400000e34"}
1805
1806       The gpsd daemon will respond with an ACK on success:
1807
1808           {"class":"ACK"}
1809
1810   ERROR
1811       The daemon may ship an error object in response to a syntactically
1812       invalid command line or unknown command. It has the following elements:
1813
1814       Table 16. ERROR notification object
1815       ┌────────┬─────────┬────────┬────────────────┐
1816       │        │         │        │                │
1817       │Name    │ Always? │ Type   │ Description    │
1818       ├────────┼─────────┼────────┼────────────────┤
1819       │        │         │        │                │
1820       │class   │ Yes     │ string │ Fixed: "ERROR" │
1821       ├────────┼─────────┼────────┼────────────────┤
1822       │        │         │        │                │
1823       │message │ Yes     │ string │ Textual error  │
1824       │        │         │        │ message        │
1825       └────────┴─────────┴────────┴────────────────┘
1826
1827       Here’s an example:
1828
1829           {"class":"ERROR","message":"Unrecognized request '?FOO'"}
1830
1831       When the C client library parses a response of this kind, it will
1832       assert the ERR_SET bit in the top-level set member.
1833

RTCM2

1835       RTCM-104 is a family of serial protocols used for broadcasting
1836       pseudorange corrections from differential-GPS reference stations. Many
1837       GPS receivers can accept these corrections to improve their reporting
1838       accuracy.
1839
1840       RTCM-104 comes in two major and incompatible flavors, 2.x and 3.x. Each
1841       major flavor has minor (compatible) revisions.
1842
1843       The applicable standard for RTCM Version 2.x is RTCM Recommended
1844       Standards for Differential NAVSTAR GPS Service RTCM Paper 194-93/SC
1845       104-STD. For RTCM 3.1 it is RTCM Paper 177-2006-SC104-STD. Ordering
1846       instructions for both standards are accessible from the website of the
1847       Radio Technical Commission for Maritime Services
1848       <https://www.rtcm.org/> under "Publications".
1849
1850   RTCM WIRE TRANSMISSIONS
1851       Differential-GPS correction stations consist of a GPS reference
1852       receiver coupled to a low frequency (LF) transmitter. The GPS reference
1853       receiver is a survey-grade GPS that does GPS carrier tracking and can
1854       work out its position to a few millimeters. It generates range and
1855       range-rate corrections and encodes them into RTCM104. It ships the
1856       RTCM104 to the LF transmitter over serial rs-232 signal at 100 baud or
1857       200 baud depending on the requirements of the transmitter.
1858
1859       The LF transmitter broadcasts the approximately 300khz radio signal
1860       that differential-GPS radio receivers pick up. Transmitters that are
1861       meant to have a higher range will need to transmit at a slower rate.
1862       The higher the data rate the harder it will be for the remote radio
1863       receiver to receive with a good signal-to-noise ration. (Higher data
1864       rate signals can’t be averaged over as long a time frame, hence they
1865       appear noisier.)
1866
1867   RTCM WIRE FORMATS
1868       An RTCM 2.x message consists of a sequence of up to 33 30-bit words.
1869       The 24 most significant bits of each word are data and the six least
1870       significant bits are parity. The parity algorithm used is the same
1871       ISGPS-2000 as that used on GPS satellite downlinks. Each RTCM 2.x
1872       message consists of two header words followed by zero or more data
1873       words, depending upon the message type.
1874
1875       An RTCM 3.x message begins with a fixed leader byte 0xD3. That is
1876       followed by six bits of version information and 10 bits of payload
1877       length information. Following that is the payload; following the
1878       payload is a 3-byte checksum of the payload using the Qualcomm CRC-24Q
1879       algorithm.
1880
1881   RTCM2 JSON FORMAT
1882       Each RTCM2 message is dumped as a single JSON object per message, with
1883       the message fields as attributes of that object. Arrays of satellite,
1884       station, and constellation statistics become arrays of JSON
1885       sub-objects. Each sentence will normally also have a "device" field
1886       containing the pathname of the originating device.
1887
1888       All attributes other than the device field are mandatory. Header
1889       attributes are emitted before others.
1890
1891   Header portion
1892       Table 17. SKY object
1893       ┌───────────────┬─────────┬─────────────────────────────────────────────┐
1894       │               │         │                                             │
1895       │Name           │ Type    │ Description                                 │
1896       ├───────────────┼─────────┼─────────────────────────────────────────────┤
1897       │               │         │                                             │
1898       │class          │ string  │ Fixed: "RTCM2".                             │
1899       ├───────────────┼─────────┼─────────────────────────────────────────────┤
1900       │               │         │                                             │
1901       │type           │ integer │ Message type (1-9).                         │
1902       ├───────────────┼─────────┼─────────────────────────────────────────────┤
1903       │               │         │                                             │
1904       │station_id     │ integer │ The id of the GPS                           │
1905       │               │         │ reference receiver.                         │
1906       │               │         │ The LF transmitters                         │
1907       │               │         │ also have                                   │
1908       │               │         │ (different) id                              │
1909       │               │         │ numbers.                                    │
1910       ├───────────────┼─────────┼─────────────────────────────────────────────┤
1911       │               │         │                                             │
1912       │zcount         │ real    │ The reference time                          │
1913       │               │         │ of the corrections                          │
1914       │               │         │ in the message in                           │
1915       │               │         │ seconds within the                          │
1916       │               │         │ current hour. Note                          │
1917       │               │         │ that it is in GPS                           │
1918       │               │         │ time, which is some                         │
1919       │               │         │ seconds ahead of                            │
1920       │               │         │ UTC (see the U.S.                           │
1921       │               │         │ Naval Observatory’s                         │
1922       │               │         │ table of leap                               │
1923       │               │         │ second                                      │
1924       │               │         │ <ftp://maia.usno.navy.mil/ser7/tai-utc.dat> │
1925       │               │         │ corrections" ).                             │
1926       ├───────────────┼─────────┼─────────────────────────────────────────────┤
1927       │               │         │                                             │
1928       │seqnum         │ integer │ Sequence number. Only 3 bits wide, wraps    │
1929       │               │         │ after 7.                                    │
1930       ├───────────────┼─────────┼─────────────────────────────────────────────┤
1931       │               │         │                                             │
1932       │length         │ integer │ The number of words after the header that   │
1933       │               │         │ comprise the message.                       │
1934       ├───────────────┼─────────┼─────────────────────────────────────────────┤
1935       │               │         │                                             │
1936       │station_health │ integer │ Station transmission status. Indicates the  │
1937       │               │         │ health of the beacon as a reference source. │
1938       │               │         │ Any nonzero value means the satellite is    │
1939       │               │         │ probably transmitting bad data and should   │
1940       │               │         │ not be used in a fix. 6 means the           │
1941       │               │         │ transmission is unmonitored. 7 means the    │
1942       │               │         │ station is not working properly. Other      │
1943       │               │         │ values are defined by the beacon operator.  │
1944       └───────────────┴─────────┴─────────────────────────────────────────────┘
1945
1946       <message type> is one of
1947
1948       1
1949           full corrections — one message containing corrections for all GPS
1950           satellites in view. This is not common.
1951
1952       3
1953           reference station parameters — the position of the reference
1954           station GPS antenna.
1955
1956       4
1957           datum — the datum to which the DGPS data is referred.
1958
1959       5
1960           constellation health — information about the satellites the beacon
1961           can see.
1962
1963       6
1964           null message — just a filler.
1965
1966       7
1967           radio beacon almanac — information about this or other beacons.
1968
1969       9
1970           subset corrections — a message containing corrections for only a
1971           subset of the GPS satellites in view.
1972
1973       16
1974           special message — a text message from the beacon operator.
1975
1976       31
1977           GLONASS subset corrections — a message containing corrections for a
1978           set of the GLONASS satellites in view.
1979
1980   Type 1 and 9: Correction data
1981       One or more satellite objects follow the header for type 1 or type 9
1982       messages. Here is the format:
1983
1984       Table 18. Satellite object
1985       ┌──────┬─────────┬─────────────────────┐
1986       │      │         │                     │
1987       │Name  │ Type    │ Description         │
1988       ├──────┼─────────┼─────────────────────┤
1989       │      │         │                     │
1990       │ident │ integer │ The PRN number of   │
1991       │      │         │ the satellite for   │
1992       │      │         │ which this is       │
1993       │      │         │ correction data.    │
1994       ├──────┼─────────┼─────────────────────┤
1995       │      │         │                     │
1996       │udre  │ integer │ User Differential   │
1997       │      │         │ Range Error (0-3).  │
1998       │      │         │ See the table       │
1999       │      │         │ following for       │
2000       │      │         │ values.             │
2001       ├──────┼─────────┼─────────────────────┤
2002       │      │         │                     │
2003       │iod   │ integer │ Issue Of Data,      │
2004       │      │         │ matching the IOD    │
2005       │      │         │ for the current     │
2006       │      │         │ ephemeris of this   │
2007       │      │         │ satellite, as       │
2008       │      │         │ transmitted by the  │
2009       │      │         │ satellite. The IOD  │
2010       │      │         │ is a unique tag     │
2011       │      │         │ that identifies the │
2012       │      │         │ ephemeris; the GPS  │
2013       │      │         │ using the DGPS      │
2014       │      │         │ correction and the  │
2015       │      │         │ DGPS generating the │
2016       │      │         │ data must use the   │
2017       │      │         │ same orbital        │
2018       │      │         │ positions for the   │
2019       │      │         │ satellite.          │
2020       ├──────┼─────────┼─────────────────────┤
2021       │      │         │                     │
2022       │prc   │ real    │ The pseudorange     │
2023       │      │         │ error in meters for │
2024       │      │         │ this satellite as   │
2025       │      │         │ measured by the     │
2026       │      │         │ beacon reference    │
2027       │      │         │ receiver at the     │
2028       │      │         │ epoch indicated by  │
2029       │      │         │ the z_count in the  │
2030       │      │         │ parent record.      │
2031       ├──────┼─────────┼─────────────────────┤
2032       │      │         │                     │
2033       │rrc   │ real    │ The rate of change  │
2034       │      │         │ of pseudorange      │
2035       │      │         │ error in meters/sec │
2036       │      │         │ for this satellite  │
2037       │      │         │ as measured by the  │
2038       │      │         │ beacon reference    │
2039       │      │         │ receiver at the     │
2040       │      │         │ epoch indicated by  │
2041       │      │         │ the z_count field   │
2042       │      │         │ in the parent       │
2043       │      │         │ record. This is     │
2044       │      │         │ used to calculate   │
2045       │      │         │ pseudorange errors  │
2046       │      │         │ at other epochs, if │
2047       │      │         │ required by the GPS │
2048       │      │         │ receiver.           │
2049       └──────┴─────────┴─────────────────────┘
2050
2051       User Differential Range Error values are as follows:
2052
2053       Table 19. UDRE values
2054       ┌──┬─────────────────────┐
2055       │  │                     │
2056       │0 │ 1-sigma error ⇐ 1 m │
2057       ├──┼─────────────────────┤
2058       │  │                     │
2059       │1 │ 1-sigma error ⇐ 4 m │
2060       ├──┼─────────────────────┤
2061       │  │                     │
2062       │2 │ 1-sigma error ⇐ 8 m │
2063       ├──┼─────────────────────┤
2064       │  │                     │
2065       │3 │ 1-sigma error > 8 m │
2066       └──┴─────────────────────┘
2067
2068       Here’s an example:
2069
2070           {"class":"RTCM2","type":1,
2071               "station_id":688,"zcount":843.0,"seqnum":5,"length":19,"station_health":6,
2072               "satellites":[
2073                   {"ident":10,"udre":0,"iod":46,"prc":-2.400,"rrc":0.000},
2074                   {"ident":13,"udre":0,"iod":94,"prc":-4.420,"rrc":0.000},
2075                   {"ident":7,"udre":0,"iod":22,"prc":-5.160,"rrc":0.002},
2076                   {"ident":2,"udre":0,"iod":34,"prc":-6.480,"rrc":0.000},
2077                   {"ident":4,"udre":0,"iod":47,"prc":-8.860,"rrc":0.000},
2078                   {"ident":8,"udre":0,"iod":76,"prc":-7.980,"rrc":0.002},
2079                   {"ident":5,"udre":0,"iod":99,"prc":-8.260,"rrc":0.002},
2080                   {"ident":23,"udre":0,"iod":81,"prc":-8.060,"rrc":0.000},
2081                   {"ident":16,"udre":0,"iod":70,"prc":-11.740,"rrc":0.000},
2082                   {"ident":30,"udre":0,"iod":4,"prc":-18.960,"rrc":-0.006},
2083                   {"ident":29,"udre":0,"iod":101,"prc":-24.960,"rrc":-0.002}
2084           ]}
2085
2086   Type 3: Reference Station Parameters
2087       Here are the payload members of a type 3 (Reference Station Parameters)
2088       message:
2089
2090       Table 20. Reference Station Parameters
2091       ┌─────┬──────┬────────────────────┐
2092       │     │      │                    │
2093       │Name │ Type │ Description        │
2094       ├─────┼──────┼────────────────────┤
2095       │     │      │                    │
2096       │x    │ real │ ECEF X coordinate. │
2097       ├─────┼──────┼────────────────────┤
2098       │     │      │                    │
2099       │y    │ real │ ECEF Y coordinate. │
2100       ├─────┼──────┼────────────────────┤
2101       │     │      │                    │
2102       │z    │ real │ ECEF Z coordinate. │
2103       └─────┴──────┴────────────────────┘
2104
2105       The coordinates are the position of the station, in meters to two
2106       decimal places, in Earth Centred Earth Fixed coordinates. These are
2107       usually referred to the WGS84 reference frame, but may be referred to
2108       NAD83 in the US (essentially identical to WGS84 for all except
2109       geodesists), or some other reference frame in other parts of the world.
2110
2111       An invalid reference message is represented by a type 3 header without
2112       payload fields.
2113
2114       Here’s an example:
2115
2116           {"class":"RTCM2","type":3,
2117               "station_id":652,"zcount":1657.2,"seqnum":2,"length":4,"station_health":6,
2118               "x":3878620.92,"y":670281.40,"z":5002093.59
2119           }
2120
2121   Type 4: Datum
2122       Here are the payload members of a type 4 (Datum) message:
2123
2124       Table 21. Datum
2125       ┌───────────┬─────────┬─────────────────────┐
2126       │           │         │                     │
2127       │Name       │ Type    │ Description         │
2128       ├───────────┼─────────┼─────────────────────┤
2129       │           │         │                     │
2130       │dgnss_type │ string  │ Either "GPS",       │
2131       │           │         │ "GLONASS",          │
2132       │           │         │ "GALILEO", or       │
2133       │           │         │ "UNKNOWN".          │
2134       ├───────────┼─────────┼─────────────────────┤
2135       │           │         │                     │
2136       │dat        │ integer │ 0 or 1 and          │
2137       │           │         │ indicates the sense │
2138       │           │         │ of the offset shift │
2139       │           │         │ given by dx, dy,    │
2140       │           │         │ dz. dat = 0 means   │
2141       │           │         │ that the station    │
2142       │           │         │ coordinates (in the │
2143       │           │         │ reference message)  │
2144       │           │         │ are referred to a   │
2145       │           │         │ local datum and     │
2146       │           │         │ that adding dx, dy, │
2147       │           │         │ dz to that position │
2148       │           │         │ will render it in   │
2149       │           │         │ GNSS coordinates    │
2150       │           │         │ (WGS84 for GPS). If │
2151       │           │         │ dat = 1 then the    │
2152       │           │         │ ref station         │
2153       │           │         │ position is in GNSS │
2154       │           │         │ coordinates and     │
2155       │           │         │ adding dx, dy, dz   │
2156       │           │         │ will give it        │
2157       │           │         │ referred to the     │
2158       │           │         │ local datum.        │
2159       ├───────────┼─────────┼─────────────────────┤
2160       │           │         │                     │
2161       │datum_name │ string  │ A standard name for │
2162       │           │         │ the datum.          │
2163       ├───────────┼─────────┼─────────────────────┤
2164       │           │         │                     │
2165       │dx         │ real    │ X offset.           │
2166       ├───────────┼─────────┼─────────────────────┤
2167       │           │         │                     │
2168       │dy         │ real    │ Y offset.           │
2169       ├───────────┼─────────┼─────────────────────┤
2170       │           │         │                     │
2171       │dz         │ real    │ Z offset.           │
2172       └───────────┴─────────┴─────────────────────┘
2173
2174       <dx> <dy> <dz> are offsets to convert from local datum to GNSS datum or
2175       vice versa. These fields are optional.
2176
2177       An invalid datum message is represented by a type 4 header without
2178       payload fields.
2179
2180   Type 5: Constellation Health
2181       One or more of these follow the header for type 5 messages — one for
2182       each satellite.
2183
2184       Here is the format:
2185
2186       Table 22. Constellation health
2187       ┌────────────┬─────────┬─────────────────────┐
2188       │            │         │                     │
2189       │Name        │ Type    │ Description         │
2190       ├────────────┼─────────┼─────────────────────┤
2191       │            │         │                     │
2192       │ident       │ integer │ The PRN number of   │
2193       │            │         │ the satellite.      │
2194       ├────────────┼─────────┼─────────────────────┤
2195       │            │         │                     │
2196       │iodl        │ bool    │ True indicates that │
2197       │            │         │ this information    │
2198       │            │         │ relates to the      │
2199       │            │         │ satellite           │
2200       │            │         │ information in an   │
2201       │            │         │ accompanying type 1 │
2202       │            │         │ or type 9 message.  │
2203       ├────────────┼─────────┼─────────────────────┤
2204       │            │         │                     │
2205       │health      │ integer │ 0 indicates that    │
2206       │            │         │ the satellite is    │
2207       │            │         │ healthy. Any other  │
2208       │            │         │ value indicates a   │
2209       │            │         │ problem (coding is  │
2210       │            │         │ not known).         │
2211       ├────────────┼─────────┼─────────────────────┤
2212       │            │         │                     │
2213       │snr         │ integer │ The carrier/noise   │
2214       │            │         │ ratio of the        │
2215       │            │         │ received signal in  │
2216       │            │         │ the range 25 to 55  │
2217       │            │         │ dB(Hz).             │
2218       ├────────────┼─────────┼─────────────────────┤
2219       │            │         │                     │
2220       │health_en   │ bool    │ If set to True it   │
2221       │            │         │ indicates that the  │
2222       │            │         │ satellite is        │
2223       │            │         │ healthy even if the │
2224       │            │         │ satellite           │
2225       │            │         │ navigation data     │
2226       │            │         │ says it is          │
2227       │            │         │ unhealthy.          │
2228       ├────────────┼─────────┼─────────────────────┤
2229       │            │         │                     │
2230       │new_data    │ bool    │ True indicates that │
2231       │            │         │ the IOD for this    │
2232       │            │         │ satellite will soon │
2233       │            │         │ be updated in type  │
2234       │            │         │ 1 or 9 messages.    │
2235       ├────────────┼─────────┼─────────────────────┤
2236       │            │         │                     │
2237       │los_warning │ bool    │ Line-of-sight       │
2238       │            │         │ warning. True       │
2239       │            │         │ indicates that the  │
2240       │            │         │ satellite will      │
2241       │            │         │ shortly go          │
2242       │            │         │ unhealthy.          │
2243       ├────────────┼─────────┼─────────────────────┤
2244       │            │         │                     │
2245       │tou         │ integer │ Healthy time        │
2246       │            │         │ remaining in        │
2247       │            │         │ seconds.            │
2248       └────────────┴─────────┴─────────────────────┘
2249
2250   Type 6: Null
2251       This just indicates a null message. There are no payload fields.
2252
2253   Unknown message
2254       This format is used to dump message words in hexadecimal when the
2255       message type field doesn’t match any of the known ones.
2256
2257       Here is the format:
2258
2259       Table 23. Unknown Message
2260       ┌─────┬──────┬────────────────────┐
2261       │     │      │                    │
2262       │Name │ Type │ Description        │
2263       ├─────┼──────┼────────────────────┤
2264       │     │      │                    │
2265       │data │ list │ A list of strings. │
2266       └─────┴──────┴────────────────────┘
2267
2268       Each string in the array is a hex literal representing 30 bits of
2269       information, after parity checks and inversion. The high two bits
2270       should be ignored.
2271
2272   Type 7: Radio Beacon Almanac
2273       Here is the format:
2274
2275       Table 24. Constellation health
2276       ┌───────────┬─────────┬─────────────────────┐
2277       │           │         │                     │
2278       │Name       │ Type    │ Description         │
2279       ├───────────┼─────────┼─────────────────────┤
2280       │           │         │                     │
2281       │lat        │ real    │ Latitude in         │
2282       │           │         │ degrees, of the LF  │
2283       │           │         │ transmitter antenna │
2284       │           │         │ for the station for │
2285       │           │         │ which this is an    │
2286       │           │         │ almanac. North is   │
2287       │           │         │ positive.           │
2288       ├───────────┼─────────┼─────────────────────┤
2289       │           │         │                     │
2290       │lon        │ real    │ Longitude in        │
2291       │           │         │ degrees, of the LF  │
2292       │           │         │ transmitter antenna │
2293       │           │         │ for the station for │
2294       │           │         │ which this is an    │
2295       │           │         │ almanac. East is    │
2296       │           │         │ positive.           │
2297       ├───────────┼─────────┼─────────────────────┤
2298       │           │         │                     │
2299       │range      │ integer │ Published range of  │
2300       │           │         │ the station in km.  │
2301       ├───────────┼─────────┼─────────────────────┤
2302       │           │         │                     │
2303       │frequency  │ real    │ Station broadcast   │
2304       │           │         │ frequency in kHz.   │
2305       ├───────────┼─────────┼─────────────────────┤
2306       │           │         │                     │
2307       │health     │ integer │ <health> is the     │
2308       │           │         │ health of the       │
2309       │           │         │ station for which   │
2310       │           │         │ this is an almanac. │
2311       │           │         │ If it is non-zero,  │
2312       │           │         │ the station is      │
2313       │           │         │ issuing suspect     │
2314       │           │         │ data and should not │
2315       │           │         │ be used for fixes.  │
2316       │           │         │ The ITU and RTCM104 │
2317       │           │         │ standards differ    │
2318       │           │         │ about the mode      │
2319       │           │         │ detailed            │
2320       │           │         │ interpretation of   │
2321       │           │         │ the <health> field  │
2322       │           │         │ and even about its  │
2323       │           │         │ bit width.          │
2324       ├───────────┼─────────┼─────────────────────┤
2325       │           │         │                     │
2326       │station_id │ integer │ The id of the       │
2327       │           │         │ transmitter. This   │
2328       │           │         │ is not the same as  │
2329       │           │         │ the reference id in │
2330       │           │         │ the header, the     │
2331       │           │         │ latter being the id │
2332       │           │         │ of the reference    │
2333       │           │         │ receiver.           │
2334       ├───────────┼─────────┼─────────────────────┤
2335       │           │         │                     │
2336       │bitrate    │ integer │ The transmitted     │
2337       │           │         │ bitrate.            │
2338       └───────────┴─────────┴─────────────────────┘
2339
2340       Here’s an example:
2341
2342           {"class":"RTCM2","type":9,"station_id":268,"zcount":252.6,
2343                   "seqnum":4,"length":5,"station_health":0,
2344                   "satellites":[
2345                       {"ident":13,"udre":0,"iod":3,"prc":-25.940,"rrc":0.066},
2346                       {"ident":2,"udre":0,"iod":73,"prc":0.920,"rrc":-0.080},
2347                       {"ident":8,"udre":0,"iod":22,"prc":23.820,"rrc":0.014}
2348           ]}
2349
2350   Type 13: GPS Time of Week
2351       Here are the payload members of a type 13 (Groumf Tramitter Parameters)
2352       message:
2353
2354       Table 25. Ground Transmitter Parameters
2355       ┌──────────┬─────────┬─────────────────────┐
2356       │          │         │                     │
2357       │Name      │ Type    │ Description         │
2358       ├──────────┼─────────┼─────────────────────┤
2359       │          │         │                     │
2360       │status    │ bool    │ If True, signals    │
2361       │          │         │ user to expect a    │
2362       │          │         │ type 16 explanatory │
2363       │          │         │ message associated  │
2364       │          │         │ with this station.  │
2365       │          │         │ Probably indicates  │
2366       │          │         │ some sort of        │
2367       │          │         │ unusual event.      │
2368       ├──────────┼─────────┼─────────────────────┤
2369       │          │         │                     │
2370       │rangeflag │ bool    │ If True, indicates  │
2371       │          │         │ that the estimated  │
2372       │          │         │ range is different  │
2373       │          │         │ from that found in  │
2374       │          │         │ the type 7 message  │
2375       │          │         │ (which contains the │
2376       │          │         │ beacon’s listed     │
2377       │          │         │ range). Generally   │
2378       │          │         │ indicates a range   │
2379       │          │         │ reduction due to    │
2380       │          │         │ causes such as poor │
2381       │          │         │ ionospheric         │
2382       │          │         │ conditions or       │
2383       │          │         │ reduced             │
2384       │          │         │ transmission power. │
2385       ├──────────┼─────────┼─────────────────────┤
2386       │          │         │                     │
2387       │lat       │ real    │ Degrees latitude,   │
2388       │          │         │ signed. Positive is │
2389       │          │         │ N, negative is S.   │
2390       ├──────────┼─────────┼─────────────────────┤
2391       │          │         │                     │
2392       │lon       │ real    │ Degrees longitude,  │
2393       │          │         │ signed. Positive is │
2394       │          │         │ E, negative is W.   │
2395       ├──────────┼─────────┼─────────────────────┤
2396       │          │         │                     │
2397       │range     │ integer │ Transmission range  │
2398       │          │         │ in km (1-1024).     │
2399       └──────────┴─────────┴─────────────────────┘
2400
2401       This message type replaces message type 3 (Reference Station
2402       Parameters) in RTCM 2.3.
2403
2404   Type 14: GPS Time of Week
2405       Here are the payload members of a type 14 (GPS Time of Week) message:
2406
2407       Table 26. Reference Station Parameters
2408       ┌─────────┬─────────┬───────────────────┐
2409       │         │         │                   │
2410       │Name     │ Type    │ Description       │
2411       ├─────────┼─────────┼───────────────────┤
2412       │         │         │                   │
2413       │week     │ integer │ GPS week (0-123). │
2414       ├─────────┼─────────┼───────────────────┤
2415       │         │         │                   │
2416       │hour     │ integer │ Hour of week      │
2417       │         │         │ (0-167).          │
2418       ├─────────┼─────────┼───────────────────┤
2419       │         │         │                   │
2420       │leapsecs │ integer │ Leap Seconds      │
2421       │         │         │ (0-63).           │
2422       └─────────┴─────────┴───────────────────┘
2423
2424       Here’s an example:
2425
2426           {"class":"RTCM2","type":14,"station_id":652,"zcount":1657.2,
2427                   "seqnum":3,"length":1,"station_health":6,"week":601,"hour":109,
2428                   "leapsecs":15}
2429
2430   Type 16: Special Message
2431       Table 27. Special Message
2432       ┌────────┬────────┬─────────────────────┐
2433       │        │        │                     │
2434       │Name    │ Type   │ Description         │
2435       ├────────┼────────┼─────────────────────┤
2436       │        │        │                     │
2437       │message │ string │ A text message sent │
2438       │        │        │ by the beacon       │
2439       │        │        │ operator.           │
2440       └────────┴────────┴─────────────────────┘
2441
2442   Type 31: Correction data
2443       One or more GLONASS satellite objects follow the header for type 1 or
2444       type 9 messages. Here is the format:
2445
2446       Table 28. Satellite object
2447       ┌───────┬──────────┬─────────────────────┐
2448       │       │          │                     │
2449       │Name   │ Type     │ Description         │
2450       ├───────┼──────────┼─────────────────────┤
2451       │       │          │                     │
2452       │ident  │ integer  │ The PRN number of   │
2453       │       │          │ the satellite for   │
2454       │       │          │ which this is       │
2455       │       │          │ correction data.    │
2456       ├───────┼──────────┼─────────────────────┤
2457       │       │          │                     │
2458       │udre   │ integer  │ User Differential   │
2459       │       │          │ Range Error (0-3).  │
2460       │       │          │ See the table       │
2461       │       │          │ following for       │
2462       │       │          │ values.             │
2463       ├───────┼──────────┼─────────────────────┤
2464       │       │          │                     │
2465       │change │ boolean  │ Change-of-ephemeris │
2466       │       │          │ bit.                │
2467       ├───────┼──────────┼─────────────────────┤
2468       │       │          │                     │
2469       │tod    │ uinteger │ Count of 30-second  │
2470       │       │          │ periods since the   │
2471       │       │          │ top of the hour.    │
2472       ├───────┼──────────┼─────────────────────┤
2473       │       │          │                     │
2474       │prc    │ real     │ The pseudorange     │
2475       │       │          │ error in meters for │
2476       │       │          │ this satellite as   │
2477       │       │          │ measured by the     │
2478       │       │          │ beacon reference    │
2479       │       │          │ receiver at the     │
2480       │       │          │ epoch indicated by  │
2481       │       │          │ the z_count in the  │
2482       │       │          │ parent record.      │
2483       ├───────┼──────────┼─────────────────────┤
2484       │       │          │                     │
2485       │rrc    │ real     │ The rate of change  │
2486       │       │          │ of pseudorange      │
2487       │       │          │ error in meters/sec │
2488       │       │          │ for this satellite  │
2489       │       │          │ as measured by the  │
2490       │       │          │ beacon reference    │
2491       │       │          │ receiver at the     │
2492       │       │          │ epoch indicated by  │
2493       │       │          │ the z_count field   │
2494       │       │          │ in the parent       │
2495       │       │          │ record. This is     │
2496       │       │          │ used to calculate   │
2497       │       │          │ pseudorange errors  │
2498       │       │          │ at other epochs, if │
2499       │       │          │ required by the GPS │
2500       │       │          │ receiver.           │
2501       └───────┴──────────┴─────────────────────┘
2502
2503       Here’s an example:
2504
2505           {"class":"RTCM2","type":31,"station_id":652,"zcount":1642.2,
2506               "seqnum":0,"length":14,"station_health":6,
2507               "satellites":[
2508                   {"ident":5,"udre":0,"change":false,"tod":0,"prc":132.360,"rrc":0.000},
2509                   {"ident":15,"udre":0,"change":false,"tod":0,"prc":134.840,"rrc":0.002},
2510                   {"ident":14,"udre":0,"change":false,"tod":0,"prc":141.520,"rrc":0.000},
2511                   {"ident":6,"udre":0,"change":false,"tod":0,"prc":127.000,"rrc":0.000},
2512                   {"ident":21,"udre":0,"change":false,"tod":0,"prc":128.780,"rrc":0.000},
2513                   {"ident":22,"udre":0,"change":false,"tod":0,"prc":125.260,"rrc":0.002},
2514                   {"ident":20,"udre":0,"change":false,"tod":0,"prc":117.280,"rrc":-0.004},
2515                   {"ident":16,"udre":0,"change":false,"tod":17,"prc":113.460,"rrc":0.018}
2516           ]}
2517

RTCM3 DUMP FORMAT

2519       The support for RTCM104v3 dumping is incomplete and buggy. Do not
2520       attempt to use it for production! Anyone interested in it should read
2521       the source code.
2522

AIS DUMP FORMATS

2524       AIS support is an extension. It may not be present if your instance of
2525       gpsd has been built with a restricted feature set.
2526
2527       AIS packets are dumped as JSON objects with class "AIS". Each AIS
2528       report object contains a "type" field giving the AIS message type and a
2529       "scaled" field telling whether the remainder of the fields are dumped
2530       in scaled or unscaled form. (These will be emitted before any
2531       type-specific fields.) It will also contain a "device" field naming the
2532       data source. Other fields have names and types as specified in the
2533       AIVDM/AIVDO Protocol Decoding document on the GPSD project website;
2534       each message field table may be directly interpreted as a specification
2535       for the members of the corresponding JSON object type.
2536
2537       By default, certain scaling and conversion operations are performed for
2538       JSON output. Latitudes and longitudes are scaled to decimal degrees
2539       rather than the native AIS unit of 1/10000th of a minute of arc. Ship
2540       (but not air) speeds are scaled to knots rather than tenth-of-knot
2541       units. Rate of turn may appear as "nan" if is unavailable, or as one of
2542       the strings "fastright" or "fastleft" if it is out of the AIS encoding
2543       range; otherwise it is quadratically mapped back to the turn sensor
2544       number in degrees per minute. Vessel draughts are converted to decimal
2545       meters rather than native AIS decimeters. Various other scaling
2546       conversions are described in "AIVDM/AIVDO Protocol Decoding".
2547

SUBFRAME DUMP FORMATS

2549       Subframe support is always compiled into gpsd but many GPSes do not
2550       output subframe data or the gpsd driver may not support subframes.
2551
2552       Subframe packets are dumped as JSON objects with class "SUBFRAME". Each
2553       subframe report object contains a "frame" field giving the subframe
2554       number, a "tSV" field for the transmitting satellite number, a "TOW17"
2555       field containing the 17 MSBs of the start of the next 12-second message
2556       and a "scaled" field telling whether the remainder of the fields are
2557       dumped in scaled or unscaled form. It will also contain a "device"
2558       field naming the data source. Each SUBFRAME object will have a
2559       sub-object specific to that subframe page type. Those sub-object fields
2560       have names and types similar to those specified in the IS-GPS-200
2561       document; each message field table may be directly interpreted as a
2562       specification for the members of the corresponding JSON object type.
2563
2564       Table 29. SUBFRAME object
2565       ┌───────┬─────────┬─────────┬──────────────────┐
2566       │       │         │         │                  │
2567       │Name   │ Always? │ Type    │ Description      │
2568       ├───────┼─────────┼─────────┼──────────────────┤
2569       │       │         │         │                  │
2570       │class  │ Yes     │ string  │ Fixed:           │
2571       │       │         │         │ "SUBFRAME"       │
2572       ├───────┼─────────┼─────────┼──────────────────┤
2573       │       │         │         │                  │
2574       │device │ Yes     │ string  │ Name of the      │
2575       │       │         │         │ originating      │
2576       │       │         │         │ device.          │
2577       ├───────┼─────────┼─────────┼──────────────────┤
2578       │       │         │         │                  │
2579       │gnssId │ Yes     │ integer │ Constellation of │
2580       │       │         │         │ transmitting     │
2581       │       │         │         │ satellite        │
2582       ├───────┼─────────┼─────────┼──────────────────┤
2583       │       │         │         │                  │
2584       │tSV    │ Yes     │ integer │ ID of            │
2585       │       │         │         │ transmitting     │
2586       │       │         │         │ satellite (Not   │
2587       │       │         │         │ PRN)             │
2588       ├───────┼─────────┼─────────┼──────────────────┤
2589       │       │         │         │                  │
2590       │TOW17  │ No      │ integer │ Type 17 bits of  │
2591       │       │         │         │ the next GPS     │
2592       │       │         │         │ Time Of Week     │
2593       ├───────┼─────────┼─────────┼──────────────────┤
2594       │       │         │         │                  │
2595       │frame  │ No      │ integer │ Frame number     │
2596       ├───────┼─────────┼─────────┼──────────────────┤
2597       │       │         │         │                  │
2598       │scaled │ Yes     │ boolean │ True is values   │
2599       │       │         │         │ scaled           │
2600       └───────┴─────────┴─────────┴──────────────────┘
2601

READING

2603       Reading the raw JSON can be tedious. You can pretty print, and
2604       colorize, your JSON with [jq] to make reading easier. Using jq ito
2605       pretty pring a JSON file can be as simple as:
2606
2607           $ jq . GPSD.json
2608
2609       To grab 10 seconds of live gpsd JSON, and pretty print it:
2610
2611           $ gpspipe -w -x 10 | jq .
2612
2613       If you only want to see the TPV messages:
2614
2615           $ gpspipe -w -x 10 | fgrep TPV | jq .
2616

SEE ALSO

2618       gpsd(8), libgps(3), libgpsmm(3), jq(1)
2619

RESOURCES

2621       Project web site: https://gpsd.io/
2622
2623        [RFC 2783]: https://datatracker.ietf.org/doc/html/rfc2783
2624       Pulse-Per-Second API for UNIX-like Operating Systems
2625
2626        [RFC 7159]: https://datatracker.ietf.org/doc/html/rfc7159
2627       The JavaScript Object Notation (JSON) Data Interchange Format
2628
2629        [jq]: https://github.com/stedolan/jq
2630

COPYING

2632       This file is Copyright 2013 by the GPSD project
2633       SPDX-License-Identifier: BSD-2-clause
2634

AUTHOR

2636       Eric S. Raymond
2637
2638
2639
2640GPSD, Version 3.25                2023-01-10                      GPSD_JSON(5)
Impressum