1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is Copyright (c) 2010 by the GPSD project
BSD terms apply: see the file COPYING in the distribution root for details.
-->
<!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id='rtcm104.5'>
<refentryinfo><date>27 Aug 2009</date></refentryinfo>
<refmeta>
<refentrytitle>rtcm-104</refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo class="source">The GPSD Project</refmiscinfo>
<refmiscinfo class="manual">GPSD Documentation</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>rtcm-104</refname>
<refpurpose>RTCM-104 dump format emitted by GPSD tools</refpurpose>
</refnamediv>
<refsect1 id='overview'><title>OVERVIEW</title>
<para>RTCM-104 is a family of serial protocols used for broadcasting pseudorange
corrections from differential-GPS reference stations. This manual
page describes some aspects of the RTCM protocol, mainly in order to
explain the RTCM-104 dump formats emitted by
<citerefentry><refentrytitle>gpsdecode</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
It describes that dump format completely.</para>
<para>RTCM-104 comes in two major and incompatible flavors, 2.x and
3.x. Each major flavor has minor (compatible) revisions.</para>
<para>The applicable standard for RTCM Version 2.x is <citetitle>RTCM
Recommended Standards for Differential NAVSTAR GPS Service</citetitle>
RTCM Paper 194-93/SC 104-STD. For RTCM 3.1 it is <citetitle>RTCM Paper
177-2006-SC104-STD</citetitle>. Ordering instructions for both
standards are accessible from the website of the <ulink
url='http://www.rtcm.org/'>Radio Technical Commission for Maritime
Services</ulink> under "Publications".</para>
</refsect1>
<refsect1 id='wire-format'><title>RTCM WIRE TRANSMISSIONS</title>
<para>Differential-GPS correction stations consist of a GPS reference
receiver coupled to a low frequency (LF) transmitter. The GPS
reference receiver is a survey-grade GPS that does GPS carrier
tracking and can work out its own position to a few millimeters. It
generates range and range-rate corrections and encodes them into
RTCM104. It ships the RTCM104 to the LF transmitter over serial rs-232
signal at 100 baud or 200 baud depending on the requirements of the
transmitter.</para>
<para>The LF transmitter broadcasts the the approximately 300khz radio
signal that differential-GPS radio receivers pick up. Transmitters
that are meant to have a higher range will need to transmit at the
slower rate. The higher the data rate the harder it will be for the
remote radio receiver to receive with a good signal-to-noise ration.
(Higher data rate signals can't be averaged over as long a time frame,
hence they appear noisier.)</para>
</refsect1>
<refsect1 id='rtcm-wire-format'><title>RTCM WIRE FORMATS</title>
<para>An RTCM 2.x message consists of a sequence of up to 33 30-bit
words. The 24 most significant bits of each word are data and the six
least significant bits are parity. The parity algorithm used is the
same ISGPS-2000 as that used on GPS satellite downlinks. Each RTCM
2.x message consists of two header words followed by zero or more data
words, depending upon message type.</para>
<para>An RTCM 3.x message begins with a fixed leader byte 0xD3. That
is followed by six bits of version information and 10 bits of payload
length information. Following that is the payload; following the
payload is a 3-byte checksum of the payload using the Qualcomm CRC-24Q
algorithm.</para>
</refsect1>
<refsect1 id='sager-dump-format2'><title>SAGER RTCM2 DUMP FORMAT</title>
<para>For each message, the header is listed first, followed by zero
or more lines containing the specific data for that message, followed
by a trailing sentinel line containing a single dot. The general format is a
line beginning with a capital letter, followed by a tab, followed by
the fields of the message separated by tabs, terminated by a
newline.</para>
<refsect2><title>Header message (H)</title>
<literallayout>
H <message type> <reference station id> <modified z_count> <sequence number>
<message length> <station health> [T <useful length>]
</literallayout>
<para>Here is an example:</para>
<informalexample><literallayout>
H 9 268 249.6 1 5 0
S 13 0 3 249.6 -26.120 0.068
S 2 0 73 249.6 1.220 -0.080
S 8 0 22 249.6 23.760 0.030
.
</literallayout></informalexample>
<para><message type> is one of</para>
<variablelist>
<varlistentry>
<term>1</term>
<listitem><para>full corrections - one message containing corrections for
all satellites in view. This is not common.</para></listitem>
</varlistentry>
<varlistentry>
<term>3</term>
<listitem><para>reference station parameters - the position of the
reference station GPS antenna.</para></listitem>
</varlistentry>
<varlistentry>
<term>4</term>
<listitem><para>datum — the datum to which the DGPS data is
referred.</para></listitem>
</varlistentry>
<varlistentry>
<term>5</term>
<listitem><para>constellation health — information about the
satellites the beacon can see</para></listitem>
</varlistentry>
<varlistentry>
<term>6</term>
<listitem><para>null message — just a filler.</para></listitem>
</varlistentry>
<varlistentry>
<term>7</term>
<listitem><para>radio beacon almanac — information about this or other beacons.</para></listitem>
</varlistentry>
<varlistentry>
<term>9</term>
<listitem><para>subset corrections — a message containing corrections
for only a subset of the satellites in view.</para></listitem>
</varlistentry>
<varlistentry>
<term>16</term>
<listitem><para>special message — a text message from the beacon
operator.</para></listitem>
</varlistentry>
</variablelist>
<para><reference station id> is the id of the GPS reference receiver. The
LF transmitters also have (different) id numbers.</para>
<para><modified z_count> is the reference time of the
corrections in the message in seconds within the current hour. Note
that it is in GPS time, which is some seconds ahead of UTC (see the
U.S. Naval Observatory's <ulink
url="ftp://maia.usno.navy.mil/ser7/tai-utc.dat">table of leap second
corrections</ulink>).</para>
<para><sequence no> is a number which increments, modulo 8, for each
message transmitted.</para>
<para><message length> is the number of words after the header that
comprise the message.</para>
<para><station health> indicates the health of the beacon as a
reference source. Any nonzero value means the satellite is probably
transmitting bad data and should not be used in a fix. 6 means the
transmission is unmonitored. 7 means the station is not working
properly. Other values are defined by the beacon operator.
</para>
<para>If the message contains a parity error after the header but before
the end of the message, then the extra fields [T <useful length>]
are appended to indicate a truncated message.</para>
<para>Here is an example:</para>
<informalexample><literallayout>
H 9 687 331.8 1 5 0 T 4
</literallayout></informalexample>
<para><useful length> indicates the number of useful words before the
parity error. Depending on the message type, useful information
may still be extracted.</para>
</refsect2>
<refsect2><title>Correction data (S)</title>
<para>One or more of these follow the header for type 1 or type 9
messages. Here is the format:</para>
<literallayout>
S <satellite> <udre> <iod> <modified z_count> <range error>
<range error rate>
</literallayout>
<para>Here is an example:</para>
<informalexample><literallayout>
S 7 0 199 331.8 -12.160 0.288
</literallayout></informalexample>
<para><satellite> is the PRN number of the satellite for which this is
correction data.</para>
<para><udre> is User Differential Range Error with the following
values:</para>
<literallayout>
0 1-sigma error <= 1m
1 1-sigma error <= 4m
2 1-sigma error <= 8m
3 1-sigma error > 8m
</literallayout>
<para><iod> is Issue Of Data, matching the IOD for the current
ephemeris of this satellite, as transmitted by the satellite. The IOD
is a unique tag that identifies the ephemeris; the GPS using the DGPS
correction and the DGPS generating the data must use the same orbital
positions for the satellite.</para>
<para><modified z_count> is just a copy of the same field from
the header.</para>
<para><range error> is the pseudorange error in meters for this satellite
as measured by the beacon reference receiver at the epoch indicated
by <modified z_count></para>
<para><range error rate> is the rate of change of pseudorange error in
meters/sec for this satellite as measured by the beacon reference
receiver at the epoch indicated by <modified z_count>. This is
used to calculate pseudorange errors at other epochs, if
required by the GPS receiver.</para>
</refsect2>
<refsect2><title>Reference Station Parameters (R)</title>
<para>Here is the format:</para>
<literallayout>
R <X-coordinate> <Y-coordinate> <Z-coordinate>
</literallayout>
<para>Here is an example:</para>
<informalexample><literallayout>
R 3746729.40 -5086.23 5144450.67
</literallayout></informalexample>
<para>The coordinates are the position of the station, in meters to two
decimal places, in Earth Centred Earth Fixed coordinates.
These are usually referred to the WGS84 reference frame, but may
be referred to NAD83 in the US (essentially identical to WGS84 for
all except geodesists), or to some other reference frame in other
parts of the world.</para>
</refsect2>
<refsect2><title>Datum (D)</title>
<para>Here is the format:</para>
<literallayout>
D <dgnss type> <dat> <datum name> [ <dx> <dy> <dz> ]
</literallayout>
<para>Here is an (artificial) example:</para>
<informalexample><literallayout>
D GPS 0 ABC12 25.8 30.5 33.0
</literallayout></informalexample>
<para><dgnss type> is either GPS or GLONASS.</para>
<para><dat> is 0 or 1 and indicates the sense of the offset
shift given by dx, dy, dz. dat = 0 means that the station coordinates
(in the reference message) are referred to a local datum and that
adding dx, dy, dz to that position will render it in GNSS coordinates
(WGS84 for GPS). If dat = 1 then the ref station position is in GNSS
coordinates and adding dx, dy, dz will give it referred to the local
datum.</para>
<para><datum name> is a standard name for the datum.</para>
<para><dx> <dy> <dz> are offsets to convert from
local datum to GNSS datum or vice versa. These fields are
optional.</para>
</refsect2>
<refsect2><title>Constellation Health (C)</title>
<para>One or more of these follow the header for type 5 messages — one
for each satellite.</para>
<para>Here is the format:</para>
<literallayout>
C <sat> <iodl> <health> <snr> <hlth en> <new data> <los warning>
<time to unhealthy>
</literallayout>
<para>Here is an example:</para>
<informalexample><literallayout>
C 29 0 0 53 0 0 0 0
</literallayout></informalexample>
<para><sat> is the PRN number of the satellite.</para>
<para><iodl> is 1 bit. 0 indicates that this information relates to the
satellite information in an accompanying type 1 or type 9 message.</para>
<para><health> 0 indicates that the satellite is healthy. Any other value
indicates a problem (coding is not known).</para>
<para><snr> gives the carrier/noise ratio of the received signal in the
range 25 to 55 dB(Hz).</para>
<para><health en> is 1 bit. If set to 1 it indicates that the
satellite is healthy even if the satellite navigation data says it is
unhealthy.</para>
<para><new data> is 1 bit. a 1 indicates that the IOD for this
satellite will soon be updated in type 1 or 9 messages.</para>
<para><los warning> is 1 bit. a 1 indicates that the satellite
will shortly go unhealthy. The healthy time remaining is given in the
<time to unhealthy> field.</para>
</refsect2>
<refsect2><title>Radio Beacon Almanac (A)</title>
<para>Here is the format:</para>
<literallayout>
A <latitude> <longitude> <range> <frequency> <health> <station id>
<bitrate>
</literallayout>
<para>Here is an example:</para>
<informalexample><literallayout>
A 54.1176 -0.0714 100 302.5 0 447 2
</literallayout></informalexample>
<para><latitude> and <longitude> give the position, in
degrees, of the LF transmitter antenna for the station for which this
is an almanac. North and East are positive.</para>
<para><range> is the published range of the station in km.</para>
<para><frequency> is the broadcast frequency in kHz.</para>
<para><health> is the health of the station for which this is an
almanac. If it is non-zero, the station is issuing suspect data and
should not be used for fixes. The ITU and RTCM104 standards differ
about the mode detailed interpretation of
the <health> field and even about its bit width.
<!--
From itu p.9 just under the type7 msg figure:
*** Radiobeacon health:
00 (0) Radiobeacon operation normal
01 (1) No integrity monitor operating
10 (2) No information available
11 (3) Do not use this radiobeacon
RTCM104, in the other hand, makes it 3 bits wide.
The Sager documentation said health has the same meaning as in the header.
but this cannot be true unless the field is 3 bits wide.
-->
</para>
<para><station id> is the id of the transmitter. This is not the same
as the reference id in the header, the latter being the id of
the reference receiver.
<!-- John Sager noted: "However I know of at least one station
that gets it wrong." --></para>
<para><bitrate> indicates the transmitted bitrate.</para>
</refsect2>
<refsect2><title>Special Message (T)</title>
<para>Here is the format:</para>
<literallayout>
T <text>
</literallayout>
<para>Here is an example:</para>
<informalexample><literallayout>
T THLS TRIAL SERVICE
</literallayout></informalexample>
<para><text> is just a text message sent by the beacon operator.</para>
</refsect2>
<refsect2><title>Null (N)</title>
<para>This just indicates a null message. There are no fields.</para>
</refsect2>
<refsect2><title>Unknown message (U)</title>
<!-- The Sager decoder didn't have this -->
<para>This is used to dump message words in hexadecimal when the
message type field doesn't match any of the known ones.</para>
<para>Here is the format:</para>
<literallayout>
U <hex-literal>
</literallayout>
<para>Here is an example:</para>
<informalexample><literallayout>
U 0x76423055
</literallayout></informalexample>
<para>The <hex-literal> will represent 32 bits of information,
after parity checks and inversion. The high two bits should be
ignored.</para>
</refsect2>
<refsect2><title>Null (N)</title>
<para>This just indicates a null message. There are no fields.</para>
</refsect2>
<!--
Decoder Status Messages (M)
format:
M <type>: <information>
examples:
M state change: NO_SYNC -> WORD_SYNCING
M sync_bit: 5
<type> indicates textually the type of message. There are
only the two types shown above.
<information>
For <type> = state change it describes the internal state
transition of the decoder when it changes state as a result
of the incoming data.
For <type> = sync_bit this indicates the bit position in the
serial data stream which is a word boundary.
-->
</refsect1>
<refsect1 id='json-dump-format2'><title>JSON RTCM2 DUMP FORMAT</title>
<para>Fields are dumped in the order and with the conversions
described above, except that they are wrapped in a single JSON
object per message and appear as attributes of that object. Arrays of
satellite, station, and constellation statistics become arrays of
JSON sub-objects.</para>
<para>(One exception: The zcount field included in the Sager-format
per-satellite reports in type 1 and 9 messages is omitted from the
JSON version, as it is redundant with the zcount attribute of the
parent object.)</para>
</refsect1>
<refsect1 id='dump-format3'><title>RTCM3 DUMP FORMAT</title>
<para>The support for RTCM104v3 dumping is still incomplete and
buggy. Anyone interested in it should read the source code.</para>
</refsect1>
<refsect1 id='see_also'><title>SEE ALSO</title>
<para>
<citerefentry><refentrytitle>gpsd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gps</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgps</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>libgpsd</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsprof</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>gpsfake</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
</refsect1>
<refsect1 id='compatibility'><title>COMPATIBILITY NOTE</title>
<para>In versions of the RTCM2 dump format prior to gpsd 2.28, there was
no trailing sentinel line after each stanza of the Sager-format dump.</para>
</refsect1>
<refsect1 id='maintainer'><title>AUTHOR</title>
<para>Much of the portion of this text describing RTCM2 was originally
written by John Sager <email>john.sager@btinternet.com</email> in
association with his RTCM2 decoder. Other material comes from the GPSD
project. There is a project page for <application>gpsd</application>
<ulink url="http://gpsd.berlios.de/">here</ulink>.</para>
</refsect1>
</refentry>
|