Date: Sun, 24 Aug 2003 19:40:29 -0500 From: Gordon Burditt <gordon@hammy.lonestar.org> To: freebsd-mobile@freebsd.org Subject: Re: Bluetooth GPS Message-ID: <E19r5PJ-00049J-HN@hammy.lonestar.org> In-Reply-To: <biaujm$rr7$1@FreeBSD.csie.NCTU.edu.tw>
next in thread | previous in thread | raw e-mail | index | archive | help
>I see, so there must be some higher-level protocol. I'm wondering if >there's a standard for it.. > >There's some NMEA 0183 V2.2 Standard mentioned: >http://cgi.ebay.de/ws/eBayISAPI.dll?ViewItem&item=3042535254&category=23381 > >OK, here it is: >http://www.nmea.org/pub/0183/ A NMEA sentence is an ASCII line terminated by cr-lf. It starts with a '$', followed by a bunch of comma-separated fields, followed by an asterisk, followed by a 2-digit hex checksum, followed by a carriage return, followed by a line feed. A GPS keeps spitting these out with updated information. Mine is a USB device that converts RS232 to USB. It is recognized by FreeBSD as a ugen device, but I can still use it just reading stuff out of the device. The first field describes what's in the rest of it. Fields other than the first may be null, that is, no characters between the commas. Some sample GPS output (blank lines inserted at roughly second boundaries). Yours may vary as to which sentences are generated. Trailing CR's deleted for posting. $PRWIZCH,01,2,28,7,08,7,31,7,13,7,02,2,10,2,03,7,07,0,11,2,27,7,00,0*4C $GPGGA,011013,3240.1042,N,09727.3699,W,1,06,0.84,207.3,M,-23.5,M,,*4B $GPGSA,A,3,28,08,31,13,03,27,,,,,,,1.54,0.84,1.30*08 $GPGSV,3,1,11,27,69,348,37,31,55,060,43,13,46,191,38,08,42,319,41*7B $GPGSV,3,2,11,28,29,268,32,03,23,045,31,01,22,169,00,11,19,137,26*73 $GPGSV,3,3,11,02,10,067,00,07,02,212,00,10,02,299,00*4E $GPRMC,011013,A,3240.1042,N,09727.3699,W,0.165,168.8,230803,5.6,E*66 $PRWIZCH,01,2,28,7,08,7,31,7,13,7,02,2,10,2,03,7,07,0,11,2,27,7,00,0*4C $GPGGA,011014,3240.1042,N,09727.3700,W,1,06,0.84,207.4,M,-23.5,M,,*4A $GPGSA,A,3,28,08,31,13,03,27,,,,,,,1.54,0.84,1.30*08 $GPRMC,011014,A,3240.1042,N,09727.3700,W,0.040,269.0,230803,5.6,E*6C $PRWIZCH,01,2,28,7,08,7,31,7,13,7,02,2,10,2,03,7,07,0,11,2,27,7,00,0*4C $GPGGA,011015,3240.1041,N,09727.3700,W,1,06,0.84,207.5,M,-23.5,M,,*49 $GPGSA,A,3,28,08,31,13,03,27,,,,,,,1.54,0.84,1.30*08 $GPGSV,3,1,11,27,69,348,35,31,55,060,41,13,46,191,37,08,42,319,40*75 $GPGSV,3,2,11,28,29,268,30,03,23,045,30,01,22,169,00,11,19,137,26*70 $GPGSV,3,3,11,02,10,067,00,07,02,212,00,10,02,299,00*4E $GPRMC,011015,A,3240.1041,N,09727.3700,W,0.092,156.9,230803,5.6,E*67 $PRWIZCH,01,2,28,7,08,7,31,7,13,7,02,2,10,2,03,7,07,0,11,2,27,7,00,0*4C $GPGGA,011016,3240.1041,N,09727.3700,W,1,06,0.84,207.5,M,-23.5,M,,*4A $GPGSA,A,3,28,08,31,13,03,27,,,,,,,1.54,0.84,1.30*08 $GPRMC,011016,A,3240.1041,N,09727.3700,W,0.209,23.1,230803,5.6,E*5F $PRWIZCH,01,2,28,7,08,7,31,7,13,7,02,2,10,2,03,7,07,0,11,2,27,7,00,0*4C $GPGGA,011017,3240.1042,N,09727.3699,W,1,06,0.84,207.7,M,-23.5,M,,*4B $GPGSA,A,3,28,08,31,13,03,27,,,,,,,1.55,0.84,1.30*09 $GPGSV,3,1,11,27,69,348,35,31,55,059,41,13,45,191,37,08,42,320,39*78 $GPGSV,3,2,11,28,29,268,31,03,23,045,31,01,22,169,00,11,19,136,27*70 $GPGSV,3,3,11,02,10,067,00,07,02,213,00,10,01,298,00*4D $GPRMC,011017,A,3240.1042,N,09727.3699,W,0.346,63.6,230803,5.6,E*55 $PRWIZCH,01,2,28,7,08,7,31,7,13,7,02,2,10,2,03,7,07,0,11,2,27,7,00,0*4C $GPGGA,011018,3240.1042,N,09727.3699,W,1,06,0.84,208.0,M,-23.5,M,,*4C $GPGSA,A,3,28,08,31,13,03,27,,,,,,,1.55,0.84,1.30*09 $GPRMC,011018,A,3240.1042,N,09727.3699,W,0.114,77.1,230803,5.6,E*5D $GPGGA,011016,3240.1041,N,09727.3700,W,1,06,0.84,207.5,M,-23.5,M,,*4A GPGGA is one of the more useful outputs. Field 1: GPGGA Field 2: Time, in form HHMMSS, in UTC. Field 3: Latitude, in degrees, minutes, and fractional minutes. Format DDMM.MMMM or DMM.MMMM . There may be any number of digits after the decimal point. 3240.1041 = 32 degrees, 40.1041 minutes. Field 4: Latitude direction (N or S) Field 5: Longitude, in degrees, minutes, and fractional minutes. Format DDDMM.MMMM or DDMM.MMMM or DMM.MMMM . There may be any number of digits after the decimal point. 09727.3700 = 97 degrees, 27.3700 minutes. Field 6: Longitude direction (E or W) Field 10: Altitude Field 11: Altitude units (M = meters) $GPRMC,011018,A,3240.1042,N,09727.3699,W,0.114,77.1,230803,5.6,E*5D GPRMC is another useful one. Field 1: GPRMC Field 2: Time, in form HHMMSS, in UTC Field 3: Fix valid (A = yes, V = no) Field 4: Latitude, in degrees, minutes, and fractional minutes. Format DDMM.MMMM or DMM.MMMM . There may be any number of digits after the decimal point. 3240.1041 = 32 degrees, 40.1041 minutes. Field 5: Latitude direction (N or S) Field 6: Longitude, in degrees, minutes, and fractional minutes. Format DDDMM.MMMM or DDMM.MMMM or DMM.MMMM . There may be any number of digits after the decimal point. 09727.3700 = 97 degrees, 27.3700 minutes. Field 7: Longitude direction (E or W) Field 8: Speed, in knots Field 9: Compass heading, in degrees Field 10: Date, in form DDMMYY (Note that the date goes with the time in UTC). 230803 = Aug 23, 2003 Field 11 & 12: magnetic deviation from true north (degrees), and direction (E or W). The types beginning with GP are standard. PRWIZCH is a private manufacturer's sentence (P) by Rockwell (RWI), and ZCH here gives info about which receiver (of 12) is tuned to which satellite. GPGSA tells about satellites being actively used. They are numbered 1-32, and some of them don't actually exist. I think there's actually 28 in service at the moment. GPGSV tells about satellites in view (4 to a sentence, and since there are usually more than 4 satellites in view, the above shows them in 1 of 3, 2 of 3, and 3 of 3 variants). A satellite in view is theoretically above the horizon, but may be unusable for many reasons, such as being obstructed by buildings or mountains, too much noise, too low on the horizon, etc. When the GPS has had time to find its satellites, satellites in view is typically 7-12. Gordon L. Burditt
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E19r5PJ-00049J-HN>