Debian Codegraph @

Docs/Serial/nmeafaq.txt

raw
1 One place to find this document is at:
2
3 ftp://sundae.triumf.ca/pub/peter/nmeafaq.txt
4
5 ---------------------------------------------------------------------------
6
7
8 The NMEA FAQ
9 Version 6.1 Sept. 15, 1997
10 (NMEA URL updated)
11
12 Additions, corrections, and comments should be emailed to the author,
13 Peter Bennett [email protected]
14
15 Contents:
16
17 1. What is NMEA?
18 1.1 What is an NMEA Standard
19 1.2 NMEA Address
20
21 2. Electrical Interface
22
23 3. NMEA-0180 and NMEA-0182
24 3.1 Simple Format
25 3.2 Complex Format
26
27 4. NMEA-0183
28
29 4.1 General Sentence Format
30 4.2 Sentences sent by specific equipment
31 4.3 Sample Sentences Dissected
32 4.3.1 Standard Sentences
33 4.3.2 Garmin Proprietary Sentences
34
35 5. RS-232 connections
36
37 6. Troubleshooting
38
39 7. About the author
40 7.1 Acknowledgements
41
42 1. What is NMEA?
43
44 The National Marine Electronics Association is dedicated to the
45 education and advancement of the marine electronics industry and
46 the market which it serves.
47
48 It is a non-profit association composed of manufacturers,
49 distributors, dealers, educational institutions, and others
50 interested in peripheral marine electronics occupations
51 (quoted from a promo in "NMEA News")
52
53
54 1.1 What is an NMEA standard?
55
56 For the purposes of this article, an NMEA standard defines an
57 electrical interface and data protocol for communications
58 between marine instrumentation. (They may also have standards
59 for other things.)
60
61 1.2 NMEA Address
62
63 P.O. Box 3435
64 New Bern NC, 28564-3435
65 U.S.A.
66 Phone: 919-638-2626
67 Fax: 919-638-4885
68 email: [email protected]
69 web page: http://www4.coastalnet.com/nmea/default.html
70
71
72 2. Electrical Interface
73
74 These standards allow a single "talker", and several "listeners"
75 on one circuit. The recommended interconnect wiring is a
76 shielded twisted pair, with the shield grounded only at the
77 talker. The standards do not specify the use of any particular
78 connector.
79
80
81 The NMEA-0180 and 0182 standards say that the talker output may
82 be RS-232, or from a TTL buffer, capable of delivering 10 mA at
83 4 V. A sample circuit shows an open collector TTL buffer with a
84 680 ohm resistor to +12 V, and a diode to prevent the output
85 voltage from rising above +5.7 V.
86
87 NMEA-0183 accepts this, but recommends that the talker output
88 comply with EIA-422. This is a differential system, having two
89 signal lines, A and B. The voltages on the "A" line correspond
90 to those on the older TTL single wire, while the "B" voltages
91 are reversed (while "A" is at +5, "B" is at ground, and vice
92 versa)
93
94 In either case, the recommended receive circuit uses an
95 opto-isolator with suitable protection circuitry. The input
96 should be isolated from the receiver's ground.
97
98 In practice, the single wire, or the EIA-422 "A" wire may be
99 directly connected to a computer's RS-232 input.
100
101
102
103 3. NMEA-0180 and NMEA 0182
104
105 NMEA-0180 and 0182 are very limited, and just deal with
106 communcations from a Loran-C (or other navigation receiver,
107 although the standards specifically mention Loran), and an
108 autopilot.
109
110 From the information I have, it appears that 0180 and 0182 are
111 identical. I suspect that equipment claiming to use NMEA-0180
112 will use the "simple" format described below, while those using
113 NMEA-0182 will use the "complex" format. (but this is really
114 just a guess... corrections??)
115
116 3.1 "Simple" data format
117
118 The simple format consists of a single data byte transmitted at
119 intervals of 0.8 to 5 seconds, at 1200 baud with odd parity.
120 Bits 5 - 0 give the cross-track error in units of 0.1 uS or 0.01
121 nautical mile. The error is given in offset binary, with a
122 count of 1 representing full scale right error, 32 (hex 20) for
123 on course, and 63 (hex 3f) full scale left error. Bit 6 is a 1
124 if the data is valid, and bit 7 is 0 to indicate the simple
125 data format.
126
127 3.2 "Complex" data format
128
129 The complex format consists of a data block of 37 bytes of
130 (mostly) readable ASCII text giving cross-track error, bearing
131 to waypoint, present Lat/Long, and a binary status byte. The
132 data block shall be sent at intervals of 2 to 8 sec. All bytes
133 in the complex format have bit 7 = 1 to distinguish them from
134 the simple format. It is permissible for a sending device to
135 send both simple and complex data, and even to send a "simple"
136 data byte in the middle of a "complex" data block.
137
138 Byte Data
139 1 $
140 2 M | device
141 3 P | address
142
143 4 K = kilometres | cross track
144 N = nautical miles | error
145 U = microseconds | units
146
147 5 - 8 0 - 9 or . cross track error value
148 9 L or R cross track error position
149
150 10 T or M True or Magnetic bearing
151 11 - 13 0 - 9 bearing to next waypoint
152
153 14 - 23 12D34'56"N or present latitude
154 12D34.56'N
155 24 - 34 123D45'56"W or present longitude
156 123D45.67"W
157
158 35 non-ASCII status byte
159 bit 0 = 1 for manual cycle lock
160 1 = 1 low SNR
161 2 = 1 cycle jump
162 3 = 1 blink
163 4 = 1 arrival alarm
164 5 = 1 discontinuity of TDs
165 6 = 1 always
166 36 "NUL" character (hex 80)(reserved status byte)
167 37 "ETX" character (hex 83)
168 Any unavailable data is filled with "NUL" bytes.
169
170
171 4. NMEA-0183
172
173 4.1 General Sentence Format
174
175 Under the NMEA-0183 standard, all characters used are printable
176 ASCII text (plus carriage return and line feed). NMEA-0183 data
177 is sent at 4800 baud.
178
179 The data is transmitted in the form of "sentences". Each
180 sentence starts with a "$", a two letter "talker ID", a three
181 letter "sentence ID", followed by a number of data fields
182 separated by commas, and terminated by an optional checksum, and
183 a carriage return/line feed. A sentence may contain up to 82
184 characters including the "$" and CR/LF.
185
186 If data for a field is not available, the field is simply
187 omitted, but the commas that would delimit it are still sent,
188 with no space between them.
189
190 Since some fields are variable width, or may be omitted as
191 above, the receiver should locate desired data fields by
192 counting commas, rather than by character position within the
193 sentence.
194
195 The optional checksum field consists of a "*" and two hex digits
196 representing the exclusive OR of all characters between, but not
197 including, the "$" and "*". A checksum is required on some
198 sentences.
199
200 The standard allows individual manufacturers to define
201 proprietary sentence formats. These sentences start with "$P",
202 then a 3 letter manufacturer ID, followed by whatever data the
203 manufacturer wishes, following the general format of the
204 standard sentences.
205
206 Some common talker IDs are:
207 GP Global Positioning System receiver
208 LC Loran-C receiver
209 OM Omega Navigation receiver
210 II Integrated Instrumentation
211 (eg. AutoHelm Seatalk system)
212
213 4.2 Sentences sent by specific equipment
214
215 This section lists the sentence types used by various equipment.
216 The format and data included in each sentence type is given in
217 section 4.3.
218
219 Eagle AccuNav
220 Standard: RMB, RMC, GLL, APB
221 Proprietary: PSLIB
222 It also pretends it's a Loran, sending LCGLL, as well as GPGLL
223
224 Garmin GPS-38, NMEA-0183 V. 1.5 mode
225 Standard: GLL, RMB, RMC, WPL, BOD, XTE, VTG, BWC
226 Proprietary: PGRMM (map datum), PGRMZ (altitude), PSLIB (dgps ctrl)
227
228 Garmin GPS-38, NMEA-0183 V. 2.0 mode
229 Standard: GLL, RMB, RMC, WPL, BOD, GSA, GSV, RTE, GGA
230 Proprietary: PGRME (estimated error), PGRMM, PGRMZ, PSLIB
231
232 Garmin GPS-45 (and probably GPS-40 and GPS-90)
233 Standard: BOD, GLL, RTE, RMB, RMC, GGA, GSA, GSV
234 Proprietary: PGRME, PGRMM, PGRMZ
235
236 Garmin GPS-65 (and probably GPS-75)
237 Standard: BWC, GLL, RMB, RMC, R00, WPL, XTE, VTG
238 Proprietary: PGRMM, PGRMZ, PSLIB
239
240 Magellan Trailblazer
241 Standard: APB, BWC, GGA, GLL, RMB, RMC, VTG
242 Trimble Ensign XL
243 Standard: APA, BWC, BWR, GGA, GLL, RMB
244
245 Trimble Flightmate Pro and Scoutmaster
246 Standard: APA, APB, BWC, GGA, GLL, GSA, GSV, RMB, RMC,
247 VTG, WCV, XTE, ZTC
248
249 Autohelm Seatalk
250 Autohelm Seatalk is a proprietary bus for communications
251 between various intruments. Some of the instruments can act
252 as NMEA-0183 talkers or listeners. Data received from an
253 external NMEA-0183 device will, if Seatalk understands the
254 sentence, be re-transmitted, but not necessarily in the same
255 sentence type.
256
257 The specific sentences sent will depend on the data
258 available on the Seatalk bus (i.e. sentences containing wind
259 speed and direction will only be sent if the system includes
260 a wind instrument)
261
262 Seatalk output:
263 Standard: APB, BPI, BWC, VWR, VHW, DBT, GLL, HDM, HDT, HCS,
264 MTW, VTG
265
266 Seatalk input:
267 Standard: APA, APB, RMB, XTE, XTR, BPI, BWR, BWC, BER,
268 BEC,WDR, WDC, BOD, WCV, VHW, VWR, DBT
269
270
271 4.3 Sample Sentences Dissected
272 4.3.1 Standard Sentences
273
274 A talker typically sends a group of sentences at intervals
275 determined by the unit's update rate, but generally not more
276 often than once per second.
277
278 Characters following the "*" are a checksum. Checksums are
279 optional for most sentences, according to the standard.
280
281 APB - Autopilot format B
282 APB,A,A,0.10,R,N,V,V,011,M,DEST,011,M,011,M
283 A Loran-C blink/SNR warning
284 A Loran-C cycle warning
285 0.10 cross-track error distance
286 R steer Right to correct (or L for Left)
287 N cross-track error units - nautical miles
288 V arrival alarm - circle
289 V arrival alarm - perpendicular
290 011,M magnetic bearing, origin to destination
291 DEST destination waypoint ID
292 011,M magnetic bearing, present position to destination
293 011,M magnetic heading to steer
294 (bearings could be given in True as 033,T)
295 (note: some pilots, Roberston in particular, misinterpret "bearing
296 from origin to destination" as "bearing from present position to
297 destination". This apparently results in poor performance if the
298 boat is sufficiently off-course that the two bearings are
299 different.)
300
301 BOD - Bearing - origin to destination waypoint
302 BOD,045.,T,023.,M,DEST,START
303 045.,T bearing 045 True from "START" to "DEST"
304 023.,M breaing 023 Magnetic from "START" to "DEST"
305 DEST destination waypoint ID
306 START origin waypoint ID
307
308 BWC - Bearing and distance to waypoint - great circle
309 BWC,225444,4917.24,N,12309.57,W,051.9,T,031.6,M,001.3,N,004*29
310 225444 UTC time of fix 22:54:44
311 4917.24,N Latitude of waypoint
312 12309.57,W Longitude of waypoint
313 051.9,T Bearing to waypoint, degrees true
314 031.6,M Bearing to waypoint, degrees magnetic
315 001.3,N Distance to waypoint, Nautical miles
316 004 Waypoint ID
317
318 BWR - Bearing and distance to waypoint - rhumb line
319 (format same as BWC)
320
321 DBT - Depth below transducer
322 DBT,0017.6,f,0005.4,M
323 0017.6,f 17.6 feet
324 0005.4,M 5.4 Metres
325
326 GGA - Global Positioning System Fix Data
327 GGA,123519,4807.038,N,01131.324,E,1,08,0.9,545.4,M,46.9,M, , *42
328 123519 Fix taken at 12:35:19 UTC
329 4807.038,N Latitude 48 deg 07.038' N
330 01131.324,E Longitude 11 deg 31.324' E
331 1 Fix quality: 0 = invalid
332 1 = GPS fix
333 2 = DGPS fix
334 08 Number of satellites being tracked
335 0.9 Horizontal dilution of position
336 545.4,M Altitude, Metres, above mean sea level
337 46.9,M Height of geoid (mean sea level) above WGS84
338 ellipsoid
339 (empty field) time in seconds since last DGPS update
340 (empty field) DGPS station ID number
341
342 GLL - Geographic position, Latitude and Longitude
343 GLL,4916.45,N,12311.12,W,225444,A
344 4916.46,N Latitude 49 deg. 16.45 min. North
345 12311.12,W Longitude 123 deg. 11.12 min. West
346 225444 Fix taken at 22:54:44 UTC
347 A Data valid
348 (Garmin 65 does not include time and status)
349
350 GSA - GPS DOP and active satellites
351 GSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39
352 A Auto selection of 2D or 3D fix (M = manual)
353 3 3D fix
354 04,05... PRNs of satellites used for fix (space for 12)
355 2.5 PDOP (dilution of precision)
356 1.3 Horizontal dilution of precision (HDOP)
357 2.1 Vertical dilution of precision (VDOP)
358 DOP is an indication of the effect of satellite geometry on
359 the accuracy of the fix.
360
361 GSV - Satellites in view
362 GSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75
363 2 Number of sentences for full data
364 1 sentence 1 of 2
365 08 Number of satellites in view
366 01 Satellite PRN number
367 40 Elevation, degrees
368 083 Azimuth, degrees
369 46 Signal strength - higher is better
370 <repeat for up to 4 satellites per sentence>
371 There my be up to three GSV sentences in a data packet
372
373 HDM - Heading, Magnetic
374 HDM,235.,M
375 HDM Heading, Magnetic
376 235.,M Heading 235 deg. Magnetic
377 (HDG, which includes deviation and variation, is recommended
378 instead)
379
380 HSC - Command heading to steer
381 HSC,258.,T,236.,M
382 258.,T 258 deg. True
383 236.,M 136 deg. Magnetic
384
385 MTW - Water temperature, Celcius
386 MTW,11.,C
387 11.,C 11 deg. C
388
389 R00 - List of waypoint IDs in currently active route
390 R00,MINST,CHATN,CHAT1,CHATW,CHATM,CHATE,003,004,005,006,007,,,*05
391 (This sentence is produced by a Garmin 65, but is not listed
392 in Version 2.0 of the standard. The standard lists RTE for
393 this purpose.)
394
395 RMB - Recommended minimum navigation information (sent by nav.
396 receiver when a destination waypoint is active)
397 RMB,A,0.66,L,003,004,4917.24,N,12309.57,W,001.3,052.5,000.5,V*0B
398 A Data status A = OK, V = warning
399 0.66,L Cross-track error (nautical miles, 9.9 max.),
400 steer Left to correct (or R = right)
401 003 Origin waypoint ID
402 004 Destination waypoint ID
403 4917.24,N Destination waypoint latitude 49 deg. 17.24 min. N
404 12309.57,W Destination waypoint longitude 123 deg. 09.57 min. W
405 001.3 Range to destination, nautical miles
406 052.5 True bearing to destination
407 000.5 Velocity towards destination, knots
408 V Arrival alarm A = arrived, V = not arrived
409 *0B mandatory checksum
410
411 RMC - Recommended minimum specific GPS/Transit data
412 RMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68
413 225446 Time of fix 22:54:46 UTC
414 A Navigation receiver warning A = OK, V = warning
415 4916.45,N Latitude 49 deg. 16.45 min North
416 12311.12,W Longitude 123 deg. 11.12 min West
417 000.5 Speed over ground, Knots
418 054.7 Course Made Good, True
419 191194 Date of fix 19 November 1994
420 020.3,E Magnetic variation 20.3 deg East
421 *68 mandatory checksum
422
423 RTE - Waypoints in active route
424 RTE,2,1,c,0,W3IWI,DRIVWY,32CEDR,32-29,32BKLD,32-I95,32-US1,BW-32,BW-198*69
425 2 two sentences for full data
426 1 this is sentence 1 of 2
427 c c = complete list of waypoints in this route
428 w = first listed waypoint is start of current leg
429 0 Route identifier
430 W3IWI... Waypoint identifiers
431
432 VHW - Water speed and heading
433 VHW,259.,T,237.,M,05.00,N,09.26,K
434 259.,T Heading 259 deg. True
435 237.,M Heading 237 deg. Magnetic
436 05.00,N Speed 5 knots through the water
437 09.26,K Speed 9.26 KPH
438
439 VWR - Relative wind direction and speed
440 VWR,148.,L,02.4,N,01.2,M,04.4,K
441 148.,L Wind from 148 deg Left of bow
442 02.4,N Speed 2.4 Knots
443 01.2,M 1.2 Metres/Sec
444 04.4,K Speed 4.4 Kilometers/Hr
445
446 VTG - Track made good and ground speed
447 VTG,054.7,T,034.4,M,005.5,N,010.2,K
448 054.7,T True track made good
449 034.4,M Magnetic track made good
450 005.5,N Ground speed, knots
451 010.2,K Ground speed, Kilometers per hour
452
453 WCV - Waypoint Closure Velocity
454 WDC - Distance to Waypoint
455 WDR - Waypoint Distance, Rhumb Line
456
457 WPL - waypoint location
458 WPL,4917.16,N,12310.64,W,003*65
459 4917.16,N Latitude of waypoint
460 12310.64,W Longitude of waypoint
461 003 Waypoint ID
462 When a route is active, this sentence is sent once for each
463 waypoint in the route, in sequence. When all waypoints have
464 been reported, GPR00 is sent in the next data set. In any
465 group of sentences, only one WPL sentence, or an R00
466 sentence, will be sent.
467
468 XTE - Cross track error, measured
469 XTE,A,A,0.67,L,N
470 A General warning flag V = warning
471 (Loran-C Blink or SNR warning)
472 A Not used for GPS (Loran-C cycle lock flag)
473 0.67 cross track error distance
474 L Steer left to correct error (or R for right)
475 N Distance units - Nautical miles
476
477 XTR - Cross-Track Error - Dead Reckoning
478 XTR,0.67,L,N
479 0.67 cross track error distance
480 L Steer left to correct error (or R for right)
481 N Distance units - Nautical miles
482
483
484 4.3.2 Proprietary Sentences
485
486 The following are Garmin proprietary sentences. "P" denotes
487 proprietary, "GRM" is Garmin's manufacturer code, and "M" or "Z"
488 indicates the specific sentence type.
489
490 $PGRME,15.0,M,45.0,M,25.0,M*22
491 15.0,M Estimated horizontal position error in metres (HPE)
492 45.0,M Estimated vertical error (VPE) in metres
493 25.0,M Overall spherical equivalent position error
494
495 $PGRMZ,93,f,3*21
496 93,f Altitude in feet
497 3 Position fix dimensions 2 = user altitude
498 3 = GPS altitude
499 This sentence shows in feet, regardless of units shown on the display.
500
501 $PGRMM,NAD27 Canada*2F
502 Currently active horizontal datum
503
504 Proprietary sentences to control a Starlink differential beacon
505 receiver. (I assume Garmin's DBR is made by Starlink)
506 $PSLIB,,,J*22
507 $PSLIB,,,K*23
508 These two sentences are normally sent together in each group
509 of sentences from the GPS.
510 The three fields are: Frequency, bit Rate, Request Type. The
511 value in the third field may be:
512 J = status request
513 K = configuration request
514 blank = tuning message
515
516 When the GPS receiver is set to change the DBR frequency or
517 baud rate, the "J" sentence is replaced (just once) by (for
518 example): $PSLIB,320.0,200*59 to set the DBR to 320 KHz, 200
519 baud.
520
521 5. RS-232 connections
522
523 Although this is not really related to NMEA, many people want to
524 connect a GPS to a computer, so need to know about the RS-232
525 serial ports on a computer.
526
527 The RS-232 standard defines two classes of devices that may
528 communicate using RS-232 serial data - Data Terminal Equipment
529 (DTE), and Data Communication Equipment (DCE). Computers and
530 terminals are considered DTE, while modems are DCE. The
531 standard defines pinouts for DTE and DCE such that a "straight
532 through" cable (pin 2 to pin 2, 3 to 3, etc) can be used between
533 a DTE and DCE. To connect two DTEs together, you need a "null
534 modem" cable, that swaps pins between the two ends (eg. pin 2 to
535 3, 3 to 2). Unfortunately, there is sometimes disagreement
536 whether a certain device is DTE or DCE, hence my standard RS-232
537 disclaimer:
538 if it doesn't work, swap pins 2 and 3!
539
540 The standard RS-232 connector is a 25 conductor DB-25, although
541 many PCs (and some other equipment) now use a 9 pin DE-9 (often
542 incorrectly called DB-9)
543
544 Serial Port Connections
545 Computer (DTE) Modem
546 DB-25 DE-9 Signal Direction DB-25
547 2 3 Tx Data -> 2
548 3 2 Rx Data <- 3
549 4 7 Request to send -> 4
550 5 8 Clear to send <- 5
551 6 6 Data Set Ready <- 6
552 7 5 signal ground 7
553 8 1 Data CarrierDetect <- 8
554 20 4 Data Terminal Ready -> 20
555 22 9 Ring Indicator <- 22
556
557 For NMEA-0183 interfacing, we are only concerned with Rx Data,
558 signal ground (and possibly Tx Data, if we want the computer to
559 talk to the GPS)
560
561 NMEA-0183 data is sent at 4800 baud.
562
563 6. Troubleshooting
564
565 First check that the talker (usually GPS or Loran) can send
566 NMEA-0183, and determine what sentences it sends. Also, verify
567 that the listener understands NMEA-0183, and that it understands
568 the sentences the talker is sending. In some cases the same
569 information may be sent in two or more different sentences. If
570 the talker and listener don't both use the same sentences, there
571 will be no communication. It may be possible to change the
572 sentences sent by the talker, to match those understood by the
573 listener.
574
575 Next, check that the talker is indeed set to send NMEA-0183
576 data. Some talkers may have provision to send NMEA-0180 or
577 0182, or some proprietary format.
578
579 A computer, using any convenient terminal program (Telix,
580 Procomm, Windows Terminal, etc.) set to 4800 baud, can be used
581 to monitor the NMEA data, and confirm what sentences are sent,
582 and that the data is in the correct format.
583 Verify that the wiring is correct - that the talker data output
584 is connected to the listener data input, and that a signal
585 ground line is connected between the two pieces of equipment.
586
587 If you have multiple listeners connected to a single talker, you
588 may be overloading the talker port. Try connecting only one
589 listener at a time.
590
591 On any NMEA-0183 circuit, there can _only_ be one talker. If
592 you must have more than one talker, and one of the talker
593 devices can also act as a listener, you may be able to connect
594 things "in series", so a talker-only output is connected to a
595 listener/talker input, and the listener/talker output is
596 connected to other listeners. However, some listener/talker
597 devices may reformat the data, or only pass data they
598 understand. (The Autohelm Seatalk system does this, and claims
599 the data as it's own, starting all output sentences with "$II".)
600
601 Particularly with older equipment, the equipment may claim to
602 comply with NMEA-0183, but in fact have an error in the data
603 format. (My Kings 8001 Loran-C claims to send an APB sentence,
604 but gets some of the fields in the wrong order, so my autopilot
605 can't understand it.) This sort of problem can be verified by
606 capturing the NMEA-0183 data on a computer, and comparing the
607 data formats with those given above.
608
609
610 7. About the author
611
612 This FAQ was written by:
613 Peter Bennett
614 [email protected]
615
616 I have an FTP site containing this file, a GPS FAQ, and other
617 NMEA information files and PC programs for capturing and
618 displaying NMEA data, and related things:
619
620 ftp://sundae.triumf.ca/pub/peter/index.html
621 This site is mirrored in Germany at:
622 ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
623
624 7.1 Acknowlegments
625
626 I would like to thank the following for their contributions
627 or corrections to this document:
628 Tom Clark, [email protected]
629 Bob Shearer, [email protected]
630 David Steckler, [email protected]
631 Karl Olmstead, [email protected]
632 Dave Wells, KD6TO, [email protected]
633 Mike Morrow, [email protected]
634
635
636