[Sorting] GPS data packet Parsing

Source: Internet
Author: User

GPS data packet Parsing

After GPS power-on, data in a certain format will be returned at a certain time. The data format is:
$ Information type. The characters starting with '$' are x, and X ', the information type is followed by data separated by commas.
The complete data of a row is as follows:
$ Gprs mc, 080655.00, A, 4546.40891, N, 12639.65641, E, 1.045, 328.42, 170809, A * 60

Information type:
Gpgsv: Visible satellite information
Gpgll: Location Information
Uplmc: Minimum recommended positioning information
Gpvtg: Ground speed information
Gpgga: GPS Positioning Information
Gpgsa: current satellite information

minimum position information of GPRS Mc
data details: $ gprs mc, <1>, <2>, <3>, <4>, <5>, <6>, <7>, <8>, <9>, <10>, <11>, <12> * hh
<1> UTC time, hhmmss (hour/minute/second) format
<2> Location status, A = valid location, V = Invalid location
<3> latitude ddmm. mmmm (degree) format (the preceding 0 will also be transmitted)
<4> latitude hemisphere N (northern hemisphere) or S (Southern Hemisphere)
<5> longitude dddmm. mmmm (degree) format (the preceding 0 will also be transmitted)
<6> longitude hemisphere E (eastern longitude) or W (Western longitude)
<7> ground speed (000.0 ~ Section 999.9, the preceding 0 will also be transmitted)
<8> ground heading (000.0 ~ 359.9 degrees, with zhenbei as the reference, the previous 0 will also be transmitted)
<9> UTC date, ddmmyy (day-month-year) format
<10> magnetic angle (000.0 ~ 180.0 degrees, the front 0 will also be transmitted)
<11> magnetic angle direction, E (East) or W (West)
<12> mode indication (output in nmea01833.00 only, a = self-locating, D = differential, E = estimation, n = Invalid Data)

resolution content:
1. time, which is Greenwich Mean Time (UTC). We need to convert it to Beijing time (BTC). The difference between BTC and UTC is 8 hours, add 8 hours based on the time.
2. location status. Before receiving valid data, this bit is 'V', and the subsequent data is empty. After receiving valid data, this bit is 'A ', data is available only later.
3. latitude, which needs to be converted to the degree/second format. Calculation Method: If the received latitude is: 4546.40891
4546.40891/100 = 45.4640891, 45 degrees can be directly read, 4546.40891-45*100 = 46.40891, you can directly read 46 points
46.40891-46 = 0.40891*60 = 24.5346 read 24 seconds, so the latitude is: 45 degrees 46 minutes 24 seconds.
4. north-south latitude, which has two kinds of values: 'n' (north latitude) and's (south latitude)
5. the longitude calculation method is the same as the latitude calculation method
6. the east longitude, which has two values: 'E' (east longitude) and 'w' (west longitude)
7. speed. When the speed value is in the ocean, the unit is the festival. to convert it into a kilometer/, multiply the obtained rate by 1.85 according to: 1 sea = 1.85 kilometers.
8. Heading refers to the deviation from the normal north angle
9. date, which is accurate and does not need to be converted

Gpgga GPS positioning data
Data details: $ gpgga, <1>, <2>, <3>, <4>, <5>, <6>, <7>, <8>, <9>, M, <10>, M, <11>, <12> * XX <CR> <LF>
$ Gpgga: Start Guide and statement format description (this sentence is GPS positioning data );
<1> UTC time, in the format of hhmmss. Sss;
<2> latitude, in the format of ddmm. Mmmm (the first digit is zero and will also be transmitted );
<3> latitude hemisphere, N or S (north or south latitude)
<4> longitude, in the format of dddmm. Mmmm (the first zero point will also be transmitted );
<5> longitude hemisphere, E or W (eastern longitude or Western longitude)
<6> positioning quality indication, 0 = positioning is invalid, 1 = positioning is valid;
<7> Number of satellites used, from 00 to 12 (the first zero will also be transmitted)
<8> horizontal accuracy: 0.5 to 99.9
<9> the height of the antenna from sea level.-9999.9 to 9999.9 M indicates the unit meter.
<10> (-9999.9 to 9999.9 m) indicates the unit meter.
<11> Differential GPS data period (RTCMSC-104), finally set the number of seconds transmitted by RTCM
<12> differential reference base station number, ranging from 0000 to 1023 (the first 0 will also be transmitted ).

Resolution content: 9th, 10 fields, sea level height and geolevel height, in meters

Gpvtg ground speed information
$ Gpvtg, <1>, T, <2>, M, <3>, N, <4>, K, <5> * hh
<1> ground heading based on North X (000 ~ 359 degrees, the previous 0 will also be transmitted)
<2> ground heading (000 ~ 359 degrees, the previous 0 will also be transmitted)
<3> ground speed (000.0 ~ Section 999.9, the previous 0 will also be transmitted)
<4> ground speed (0000.0 ~ 1851.8 km/hour, the front 0 will also be transmitted)
<5> mode indication (output only in nmea0183 3.00, A = self-locating, D = differential, E = estimation, n = Invalid Data)

Gpgsv Visible satellite status

example: $ gpgsv, 33,240, 36,074, 21,078, 36,313, 42*78
Standard Format: $ gpgsv, (1), (2), (3), (4), (5), (6), (7 ),... (4), (5), (6), (7) * hh (CR) (LF)
meaning of each part:
(1) total number of GSV statement messages; 2;
(2) Current GSV statement No.: 1;
(3) Total number of visible satellites: 08;
(4) the PRN code (Pseudo-Random Noise Code) can also be considered as a satellite number
(5) elevation (00 ~ 90 degrees): 33 degrees;
(6) azimuth (000 ~ 359 degrees): 240 degrees;
(7) signal-to-noise ratio (00 ~ 99db): 45db (the information of satellites 10, 16, and 17 are followed in sequence); * sum verification domain; hh sum verification number: 78; (CR) (LF) Press enter, line feed.
Note: each statement can contain up to four satellite information. Each satellite has four data items, namely:
(4)-Satellite Number, (5) -elevation, (6)-azimuth, (7)-signal-to-noise ratio.
example:
$ gpgsv, 82,023, 62,285, 62,123, 59,229, 28*70
each statement contains four parts, for example, the first part is "24, 82, 023,40", and the second part is ", 32.
the first word of each part is PRC, and the second word is the satellite elevation, followed by the azimuth and signal strength.
the most important indicator in this statement is signal-to-noise ratio (SNR ).
This value indicates the satellite signal reception rate. We know that a satellite emits signals at the same intensity, but it will inevitably encounter obstacles such as trees and walls during transmission, which affects signal recognition.
the typical SNR value ranges from 0 to 50, where 50 indicates a very good signal. (SNR can reach 99 ).

Current gpgsa satellite information
Example: $ gpgsa, A, 40.4, 20, 19, 13, 24.4, 32.2 * 0a

Field 0: $ gpgsa, statement ID, indicating the current satellite information of gps dop and active satellites (GSA)
Field 1: positioning mode, a = Automatic manual 2D/3d, M = manual 2D/3D
Field 2: positioning type, 1 = undetermined, 2 = 2D, 3 = 3D
Field 3: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 1st channel (00) (0 if the number of leading digits is insufficient)
Field 4: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 2nd channel (00) (0 if the number of leading digits is insufficient)
Field 5: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 3rd channel (00) (0 if the number of leading digits is insufficient)
Field 6: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 4th channel (00) (0 if the number of leading digits is insufficient)
Field 7: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 5th channel (00) (0 if the number of leading digits is insufficient)
Field 8: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 6th channel (00) (0 if the number of leading digits is insufficient)
Field 9: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 7th channel (00) (0 if the number of leading digits is insufficient)
Field 10: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 8th channel (00) (0 if the number of leading digits is insufficient)
Field 11: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 9th channel (00) (0 if the number of leading digits is insufficient)
Field 12: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 10th channel (00) (0 if the number of leading digits is insufficient)
Field 13: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 11th channel (00) (0 if the number of leading digits is insufficient)
Field 14: PRN code (Pseudo-Random Noise Code), number of the satellite PRN code used by the 12th channel (00) (0 if the number of leading digits is insufficient)
Field 15: pdop comprehensive position precision factor (0.5-99.9)
Field 16: hdop horizontal precision factor (0.5-99.9)
Field 17: vdop vertical precision factor (0.5-99.9)
Field 18: Check Value

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.