Nmea protocol processing source code. Description of the NMEA protocol

I needed to test an application that uses GNSS data over the NMEA protocol. It was due to the fact that I was working on a project for an aircraft navigation program, testing in the air is naturally expensive, driving a car with a GNSS receiver on the ground is not particularly convenient, so I wanted to have NMEA protocol data from supposedly moving equipment on a virtual parallel port while sitting at my desk. At first I was looking for different software, I thought I’d find something suitable, but most are paid and the data emulation controls are not very convenient, although they emulate almost all parameters of the NMEA standard. But I needed something simple that emulated coordinates, speed, basically nothing more, and I needed fairly convenient and logical controls. So I had to write an application of this kind in C#.

Fly_nmea


NMEA (“National Marine Electronics Association”) - the full name is “NMEA 0183” - a text protocol for communication between marine (usually navigation) equipment.
Data is transmitted in the form of sentences. The proposal format is as follows:
$AAAAA[,<данные>]*hh , Where:
$ - sentence start symbol (code 24h);
AAAAA - Five-character address (name) of the offer;
[, <данные>] - list of data fields separated by commas (code 2Сh);
* - checksum sign (code 2Ah);
hh - checksum.

Example sentence:
GGA – GPS location data
Time, place and data related to the observation.
$GPGGA,hhmmss.sss,llll.ll,a,yyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxx*hh

I needed to emulate four lines:

  • GLL – Location Coordinates
  • GSV – Visible Satellites
  • RMC – Recommended minimum data set for GPS and GLONASS
  • GSA - Accuracy degradation factor used for navigation satellites
Emulation is organized in the following order:
  • we set the initial coordinates in the WGS-84 system
  • then we go to a flat projection, for example Mercator (to convert coordinates I used a ready-made library in C#)
  • Knowing the plane coordinates x, y, h, we implement the physics of aircraft motion using variable parameters through a graphical interface, such as: roll, pitch, speed
  • convert flat coordinates to B, L, H coordinates of the WGS-84 system
  • we form a package of NMEA standard messages from the required four lines
  • send them to the virtual parallel port
Fly_nmea + Android Sensor
For more convenient testing, I also adjusted the reception of data from Android sensors (tilt angles). Android sends two lines like:
  • "Angle:\t236.04152\t-1.0\t-3.0"
  • "Acc:\t-0.46309182\t-0.14982383\t-10.56939"
In the emulation application, I accept them and, based on the angles of inclination, change the parameters:
  • Pitch
In the emulation application, you can switch from control through the program interface to Android Sensor.
Fly_nmea connection
To emulate COM ports, the Virtual Serial Ports Emulator is also useful; you will need to configure the connection of two virtual COM ports, for example: COM1<->COM6, and the Fly_nmea program will send data to COM6, and to COM1 a program using the NMEA protocol will receive it.

Conclusion

In general, I spent more time searching for such software, and not finding something that would completely satisfy me, I quickly wrote it myself. In addition to the project I was working on, I also managed to quite successfully connect the emulator to programs that understand the NMEA protocol, such as 2Gis and SAS planet.



FlyNMEA and android sensor (project for transmitting data from sensors via UDP)

NMEA 0183(from " National Marine Electronics Association") - a standard that defines a text protocol for the communication of marine (usually navigation) equipment (or equipment used on trains) among themselves. It became especially popular due to the proliferation of GPS receivers using this standard.

General view of lines in NMEA 0183

  • "$" or "!" (hex 24 or hex 21)
  • 5-letter message ID. The first two letters are the message source identifier, the next three letters are the message format identifier, according to the NMEA 0183 protocol of a certain version.
  • a list of data (letters, numbers and periods) separated by commas. If any data is missing inside lines, commas are still placed (for example, “,”). Some fields at the end lines may be missing altogether.
  • symbol "*".
  • eight-bit XOR - the sum of all characters (including "," and "^") in the line between "$" and "*" converted to two uppercase ASCII characters for the hexadecimal representation of the byte (0–9, A–F) .
  • (hex 0D, hex 0A).

Maximum message length is limited to 82 characters (NMEA 0183 rev 3.0)

The standard describes more than 250 NMEA sequence identifiers. The standard defines data exchange rates at 4800 baud. (For speeds of 38400 baud and higher there is an extended standard NMEA-0183-HS).

The standard allows you to add your own sequence identifiers, which is often used by manufacturers to convey additional information about the operation of the device.

RMC string (special example)

$GPRMC,hhmmss.sss,A,GGMM.MM,P,gggmm.mm,J,v.v, b.b, ddmmyy, x.x, n,m*hh

Field values:

  • "GP" - source identifier; in the example given, this is GPS, “GL” - GLONASS, “GA” - Galileo, “GN” - GLONASS+GPS, etc.
  • "RMC" - "Recommended Minimum sentence C"
  • “hhmmss.sss” - time of fixing the location according to UTC: “hh” - hours, “mm” - minutes, “ss.sss” - seconds. The length of the fractional seconds varies. Leading zeros are not omitted.
  • “A” - status: “A” - data is reliable, “V” - unreliable.
  • "GGMM.MM" - latitude. 2 digits of degrees (“GG”), 2 digits of whole minutes, a period and a fractional part of minutes of variable length. Leading zeros are not omitted.
  • "P" - "N" for northern or "S" for southern latitude.
  • "gggmm.mm" - longitude. 3 digits of degrees (“ggg”), 2 digits of whole minutes, a period and a fractional part of minutes of variable length. Leading zeros are not omitted.
  • "J" - "E" for east or "W" for west longitude.
  • "v.v" is the horizontal component of the speed relative to the ground in knots. Floating point number. Integer and fractional parts of variable length.
  • "b.b" - track angle (velocity direction) in degrees. Floating point number. Integer and fractional parts of variable length. A value of 0 corresponds to movement to the north, 90 to the east, 180 to the south, 270 to the west.
  • "ddmmyy" - date: day of the month, month, last 2 digits of the year (leading zeros are required).
  • “x.x” is the magnetic declination in degrees (often missing), calculated using some model. Floating point number. Integer and fractional parts of variable length.
  • “n” - direction of magnetic declination: to obtain a magnetic course, magnetic declination must be “E” - subtracted, “W” - added to the true course.
  • “m” - mode indicator: “A” - autonomous, “D” - differential, “E” - approximation, “N” - unreliable data (often missing, this field including the comma is missing in older versions of NMEA).
  • "hh" - checksum.
  • - byte is 0x0D.
  • - byte is 0x0A.

RMC string examples

Example 1

$GPRMC,125504.049,A,5542.2389,N,03741.6063,E,0.06,25.82,200906,*17

Field values:

  • 12 hours 55 minutes 4.049 seconds UTC
  • "A" - reliable
  • latitude 55° 42.2389", north
  • longitude 37° 41.6063", east
  • speed 0.06 knots

NMEA (National Marine Electronics Association) 2000 is a data transmission standard for navigation, communications and other information network equipment.

In most cases, NMEA2000 is used in marine applications. This protocol is based on the data transfer protocol CAN(Controller Area Network), used mainly in ship automation.

The National Marine Electronics Association (NMEA) has developed a special protocol to ensure compatibility between marine products from different manufacturers.

Since its inception, the NMEA protocol has undergone several modifications to include new fields and messages. The current version that most receivers support is version 2.3, although a description of the new one has already been published version 3.0.

NMEA messages

NMEA 2000 describes not only the data received from, but also the measurements , , barometers and other navigation devices used on ships. The data exchange interface of most portable GPS receivers is implemented in accordance with the NMEA specification. Most navigation programs that provide real-time data display support and “understand” the NMEA protocol. This data contains the complete navigation measurements of the GPS receiver - position, speed and time.

The complete NMEA message specification is not publicly available and cannot be officially downloaded electronically. Its individual sections, a general description of the NMEA protocol and the most popular messages can be found on the Internet. You can officially purchase NMEA documentation on the website //www.nmea.org/.

Outgoing NMEA messages

All NMEA messages consist of a sequential set of data separated by commas. Each individual message is independent of the others and is completely “complete”. NMEA message includes:

  • title,
  • a set of data represented by ASCII characters,
  • “checksum” field to check the accuracy of the transmitted information.

Heading

Typically, the title consists of five characters. The first two characters determine the type of message, and the remaining three indicate its name. For example, the GPS NMEA header of messages begins with "GP". Messages that are not described in the NMEA specification, but are implemented in GPS receivers according to general rules, are prefixed with a "P" followed by three characters unique to each company. For example, NMEA messages have the prefix "PGRM", Magellan - "PMGN".

Data

Each NMEA message begins with "$", ends with "\n" (line feed) and cannot be longer than 80 characters. All data is contained on one line and separated by commas. The information is presented in the form of ASCII text and does not require special decoding. If the data does not fit into the allocated 80 characters, then it is “split” into several messages. This format allows you to not limit the accuracy and number of characters in individual data fields. For example, the fractional part of a coordinate value can be represented by three or four decimal places, but this should not in any way affect the operation of the software, which extracts the necessary data from the message by field number.

"Checksum" field

At the end of each NMEA The message contains a “checksum” field, separated from the data by the “*” symbol. If necessary, it can be used to verify the integrity and validity of each received message.

Incoming NMEA messages

The NMEA 2000 protocol supports not only outgoing but also incoming messages, with which, for example, you can update or add route waypoints. These messages must be formatted strictly in NMEA format, otherwise they will be ignored.

list of messages

The NMEA protocol describes a large list of different messages, of which there are two dozen that are actively used in navigation equipment. Due to the great popularity and simple presentation of data, the NMEA protocol has found application not only in marine equipment, but also in geodetic, household and aviation GPS receivers.

AAM - Arrival at Waypoint
ALM - Almanac Data
APA – Autopilot data “A”
APB – Autopilot Data “B”
BOD – Bearing to destination
DTM – Datum in Use
GGA – Fixed Solution Information
GLL – Latitude and Longitude Data
GSA - General Satellite Information
GSV – Detailed satellite information
MSK – Transfer of control to base receiver
MSS – Basic Receiver Status
RMA – Recommended Loran Data Set
RMB – Recommended GPS navigation data set
RMC – Recommended Minimum GPS Data Set
RTE – Route information
VTG – Motion and Velocity Vector
WCV – Speed ​​data near waypoint
WPL – Waypoint Data
XTC – Off-Track Error
XTE – Measured Off-Track Error
ZTG – UTC time and remaining time until arrival at destination
ZDA - Date and time

Some of the NMEA messages may contain the same data fields, or completely contain the data of other, smaller NMEA messages.

1. GGA – information about a fixed solution.

The most popular and most used NMEA message provides information about the current fixed solution - horizontal coordinates, altitude value, number of satellites used and solution type.

$GPGGA,123519,4807.038,N,01131.000,E,1.08,0.9,545.4,M,46.9,M,*47 Where:

GGA – NMEA Header

123519 – UTC time 12:35:19

4807.038, N – Latitude, 48 degrees 7.038 minutes north latitude

01131.000, E – Longitude, 11 degrees 31.000 minutes east longitude

1 – solution type*, StandAlone solution

08 – number of satellites used

0.9 – geometric factor, HDOP

545.4, M – altitude above sea level in meters

46.9, M – height of the geoid above the WGS 84 ellipsoid

[empty field] – time elapsed since the last DGPS correction was received. Filled in when DGPS mode is activated

[empty field] – identification number of the base station. Filled in when DGPS mode is activated.

*Solution types:

2. GSA - general information about satellites

This NMEA message contains a list of satellites used in the position calculation and the values ​​of the geometric DOPs that determine the accuracy of the position calculation. DOP parameters are determined by the geometric arrangement of satellites in the sky. The better the satellites are “distributed” in the sky, the lower the DOP and the better the position accuracy. The minimum PDOP value (= 1) corresponds to a situation where one satellite is directly above the user, and the other 3 are evenly distributed around at horizon level. The PDOP value is calculated as the square root of the sum of the squares of HDOP and VDOP.

$GPGSA,A,3,04,05,09,12,24,2.5,1.3,2.1*39 Where:

GSA – NMEA header

A – type of choice between 2D and 3D solutions, Automatic (A-auto, M-manual)

3 – type of solution, 3D solution (1 – no solution, 2 – 2D solution, 3 – 3D solution)

04.05… – PRN codes used in calculating satellite positions (12 fields)

2.5 – spatial geometric factor, PDOP

1.3 – horizontal geometric factor, HDOP

2.1 – vertical geometric factor, VDOP

3. GSV – Detailed information about satellites

This NMEA message contains detailed information for all satellites tracked by the GPS navigator. Based on the 80-character limit, one NMEA message can only transmit data for 4 satellites. Accordingly, 12 satellites require 3 GSV messages. The SNR (Signal to Noise Ration) field contains the values ​​of the levels of navigation signals received from satellites. Theoretically, its value can vary from 0 to 99 and is measured in dB. In fact, the signal level lies in the range of 25 ... 35 dB. It is worth noting here that this parameter is not absolute and is not suitable for comparing the sensitivity of receivers of different models and manufacturers. GPS navigators can use different algorithms for calculating the level of the received signal, which leads to different results with the same degree of sensitivity of the receivers. For each visible GPS satellite, a set of information is transmitted, including signal strength, elevation angle and azimuth of the satellite. The number of these “sets” is determined by the total number of visible satellites, the value of which is transmitted in a separate field.

$GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75 Where:

GSV – NMEA header

2 – number of GSV messages in the package

1 – message number in the package (from 1 to 3)

08 – number of visible satellites

01 – satellite number

40 – elevation angle, in degrees

083 – azimuth in degrees

46 – SNR, signal level

This NMEA message contains the entire set of so-called “PVT” data. "PVT" is a common abbreviation for "position, velocity, time".

$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A Where:

RMC – NMEA header 123419 – UTC time, 12:34:59

A – status (A – active, V – ignore)

NMEA 0183– text communication protocol used in GPS receiving modules. This standard was created for communication of marine navigation equipment. The protocol provides for the transmission of text commands and messages using ASCII characters. Thus, to receive messages, it is enough to use the UART serial interface, while all messages can be transmitted directly to the computer using the COM port, but not forgetting the need to convert signal levels.

The GPS module transmits messages of different formats containing different sets of data: latitude and longitude, speed, heading, time, number of satellites, etc. Messages are transmitted sequentially and are divided into several types; the format of each type of message contains strictly defined information in its fields. Let's take a closer look at the general structure of the messages that the GPS module produces.

$ - every message begins with this symbol

This is followed by an identifier of 5 text characters. The first two letters indicate the type of navigation system, e.g. "GP" - GPS or " GL" - Glonass etc. The next 3 characters are the message format identifier, which completely determines the content of subsequent transmitted data. For example "RMC"- this is the recommended minimum data, which contains information about time and date, latitude and longitude, speed, course and magnetic deviation in degrees (may be missing). Or "GSA", satellite data will be transmitted here. The structure of the main message types will be discussed below.

Then follows «,» - a comma, after which the body of the message immediately follows with various data, which are separated from each other by the same comma. If the transmitted number is not an integer, then the separator between the integer and fractional parts is a dot «.» .

The end of the message body is indicated by the symbol «*» . What follows is the checksum of all the characters contained between “$” and “*”, that is, the entire body of the message, including the data itself and the identifiers at the beginning of the message. The checksum is calculated by XORing all the hexadecimal ASCII codes of the message characters.

And at the very end of each message there must be newline characters

Let's look at the purpose and structure of various message types.

R.M.C.– recommended minimum navigation data. The message contains the minimum required amount of information. This data includes latitude and longitude, date and time, and speed. For many tasks, more is not needed, for example, in the module Quectel L50 I turned off the transmission of all other types of messages, since I absolutely do not need information about satellites and the level of their signals. And receiving unnecessary information requires complicating the program for processing this data. The structure of the message is as follows:

$GPRMC hhmmss.sss,A,ddmm.mmmm,N,ddmm. mmmm , E,v.v.c. c, ddmmyyyy,x.x,n,m*hh

This message contains the following information:

  • GPRMC– GPS satellite system, RMC message identifier
  • hhmmss.sss– time (Greenwich Mean Time), where hh – hours, mm – minutes, ss.sss – seconds
  • A– the data is reliable or V– the data is unreliable. Symbol A the message will be provided that there is reliable reception of signals from satellites necessary for calculating location data. Symbol V will occur when the receiver does not see the satellites or when the number of satellites found is not enough to confidently calculate the coordinates. For example, if you turn on the GPS module somewhere in a panel house and away from the windows, you will most likely see the symbol V in the received message.
  • ddmm.mmmm– latitude, degrees and minutes
  • N or S- north or south. The hemisphere you are in. If you are in Australia it will show S. In Yekaterinburg, my GPS module gives N.
  • ddmm.mmmm– longitude, degrees and minutes
  • E or W– western or eastern hemisphere
  • v.v– speed in knots
  • c. c– heading over the ground in degrees. When moving due north it will be 0 degrees.
  • ddmmyyyy- date
  • x.x– magnetic declination
  • n– direction of magnetic declination. I can’t explain anything about these last two parameters. For example my module GPS Quectel L50 during the reception in the apartment, this data was not shown on the window at all, it was simply skipped.
  • m– navigation mode: N– inaccurate data, A– autonomous, D– differential

Here is an example of an RMC message:

$GPRMC,105954.000,A,3150.6731,N,11711.9399,E,0.00,96.10,250313,A*53

  • GMT 10h 59m 54s
  • A– the data is reliable
  • Latitude 31 degrees and 50.6371 minutes
  • N– northern
  • Longitude 117 degrees 11.9399 minutes
  • E– eastern
  • Speed 0.00 knots
  • Well 96.1 degrees
  • date March 25, 2013
  • Information about magnetic declination none
  • Mode - autonomous
  • Checksum of message characters 0×053

One point needs to be noted here. Latitude and longitude data contain a fractional part of minutes, which does not correspond to the number of “seconds” at all, since it is a decimal fraction. The GPS programs I've tried show the coordinates on the map accurately. But if you enter these numbers into the Google maps search bar, the location on the map will be several kilometers from the actual one. When entering the obtained coordinates in this case, you must divide the fractional part of latitude and longitude by 60 to convert these numbers into “seconds”. When I first connected the Quectel L50 module and entered the obtained latitude and longitude coordinates into the Google maps search bar, I received a position on the map with a significant error; the map indicated a place somewhere in the Uralmash area.

Here are some other message types used in this protocol:

  • VTG- true course direction and ground speed
  • GGA- last location data
  • G.S.A.- data on active satellites
  • GSV- data on visible satellites, their position and numbers, as well as signal strength
  • GLL- latitude, longitude and time data
  • ZDA- time and date information

I did not go into detail about what each message consists of; a link to a document describing the protocol is given at the end of the article. A specific type of GPS module may not transmit all of the data listed. You can disable or enable the transmission of various types of data, and also set the period for their delivery. To configure the module, there are special commands that begin with an identifier $PSRFxxx, Where xxx specifies the type and format of the command, just like in outgoing messages.

For example, the command $PSRF100.0.9600.8.1.0*0C sets the communication protocol and configures the serial port parameters.

  • $PSRF100 – native SIRF protocol command identifier
  • 0 – binary SIRF protocol, 1 – NMEA protocol
  • 9600 – bit/sec speed
  • 8 data bit
  • 1 stop bit
  • 0 – parity check disabled

Team $PSRF103.00.00.02.01*26 configures output parameters for various types of module messages:

  • $PSRF103– SIRF native protocol command identifier
  • then after the decimal point there are two digits that determine the type of custom message: 00 - GGA
    01 - GLL
    02 - GSA
    03 - GSV
    04 - RMC
    05 - VTG
  • the next two digits configure the order in which messages are issued, for example: 00 - periodically
    01 - on request
  • The following numbers set the message period in seconds: 00 = Off (messages are disabled)
    1-255 – interval between messages of this type in seconds
  • then checksum transmission is enabled/disabled in the NMEA message transmitted by the module: 00 – checksum transmission is disabled
    01 – checksum is transmitted
  • after the “*” character, as in the outgoing NMEA message, a checksum and line feed characters are transmitted.

That's all I wanted to briefly outline about the NMEA 0183 protocol and the module control commands on the SIRF chipset. A more detailed decoding of all these messages and commands is given, for example, in the description of the Quectel L50 module protocol, which can be downloaded from the link below.

Description of the NMEA protocol.

Implementation in Garmin and GlobalSat receivers

Introduction

The National Marine Electronics Association (NMEA) has developed a special protocol to maintain compatibility between marine navigation equipment from different manufacturers. This NMEA protocol describes not only data received from GPS receivers, but also measurements from sonars, radars, electronic compasses, barometers and other navigation devices used on marine vessels. The data exchange interface of most portable GPS receivers is implemented in accordance with the NMEA specification. Most navigation programs that provide real-time data display support and “understand” the NMEA protocol. This data contains the complete navigation measurements of the GPS receiver - position, speed and time. All NMEA messages consist of a sequential set of data separated by commas. Each individual message is independent of the others and is completely “complete”. An NMEA message includes a header, a set of data represented by ASCII characters, and a checksum field to check the validity of the transmitted information. The header of standard NMEA messages consists of 5 characters, of which the first two determine the type of message, and the remaining three indicate its name. For example, all GPS NMEA messages are prefixed with "GP". Messages that are not described in the NMEA specification, but are implemented in GPS receivers according to general rules, are prefixed with a "P" followed by three characters unique to each company. For example, Garmin’s “native” NMEA messages have the prefix “PGRM”, Magellan – “PMGN”. Each NMEA message begins with “$”, ends with “\n” (“line feed”) and cannot be longer than 80 characters. All data is contained on one line and separated from each other by commas. The information is presented in the form of ASCII text and does not require special decoding. If the data does not fit into the allocated 80 characters, then it is “split” into several NMEA messages. This format allows you to not limit the accuracy and number of characters in individual data fields. For example, the fractional part of the coordinate value can be represented by 3 or 4 decimal places, but this should not in any way affect the operation of the software, which selects the necessary data from the message by field number. At the end of each NMEA message there is a “checksum” field separated from the data by a “*” character. If necessary, it can be used to verify the integrity and validity of each received message. The NMEA protocol supports not only outgoing, but also incoming messages, with which, for example, you can update or add route waypoints. These messages must be generated in strict accordance with the NMEA format, otherwise they will simply be ignored by the GPS receiver. It is worth noting that not all navigation programs and receiver models support this mode, since they use proprietary protocols of manufacturers - Garmin, Magellan, etc. - to load points and routes. Since its inception, the NMEA protocol has undergone several modifications associated with the addition of new fields and messages. The current version supported by most receivers is version 2.3, although a new version 3.0 has already been published. The complete specification of NMEA messages is not publicly available and cannot be officially downloaded in electronic form. Its individual sections, a general description of the NMEA protocol and the most popular messages can be found on the Internet. You can officially purchase NMEA documentation at http://www.nmea.org/.

list of messages

The NMEA protocol describes a large list of different messages, from which two dozen messages can be identified that are actively used in navigation equipment. Due to the great popularity and simple presentation of data, the NMEA protocol has found application not only in marine equipment, but also in geodetic, household and aviation GPS receivers.

    AAM – Arrival at Waypoint

    ALM - Almanac Data

    APA – Autopilot data “A”

    APB – Autopilot Data “B”

    BOD – Bearing to destination

    DTM – Datum in Use

    GGA – Fixed Solution Information

    GLL – Latitude and Longitude Data

    GSA - General Satellite Information

    GSV – Detailed satellite information

    MSK – Transfer of control to base receiver

    MSS – Basic Receiver Status

    RTE – Route information VTG – Motion and speed vector

    WCV - Speed ​​data near waypoint

    WPL – Waypoint Data

    XTC – Off-Track Error

    XTE – Measured Off-Track Error

    ZTG – UTC time and remaining time until arrival at destination

    ZDA – Date and time.

Some of the NMEA messages may contain the same data fields, or completely contain the data of other, smaller NMEA messages.

GGA - information about a fixed solution.

The most popular and most used NMEA message provides information about the current fixed solution - horizontal coordinates, altitude value, number of satellites used and solution type.

$GPGGA,123519,4807.038,N,01131.000,E,1.08,0.9,545.4,M,46.9,M,*47

GGA – NMEA Header

123519 –UTC time 12:35:19

4807.038, N – Latitude, 48 degrees 7.038 minutes north latitude

01131.000, E – Longitude, 11 degrees 31.000 minutes east longitude

1 - type solution, StandAlone solution

08 – number of satellites used

0.9 – geometric factor, HDOP

545.4, M – altitude above sea level in meters

46.9, M – height of the geoid above the WGS 84 ellipsoid

[empty field] – time elapsed since the last DGPS correction was received. Filled in when DGPS mode is activated

[empty field] – identification number of the base station. Filled in when DGPS mode is activated.

GSA – general information about satellites.

This NMEA message contains a list of satellites used in the position calculation and the values ​​of the geometric DOPs that determine the accuracy of the position calculation. DOP parameters are determined by the geometric arrangement of satellites in the sky. The better the satellites are “distributed” in the sky, the lower the DOP and the better the position accuracy. The minimum PDOP value (= 1) corresponds to a situation where one satellite is directly above the user, and the other 3 are evenly distributed around at horizon level. The PDOP value is calculated as the square root of the sum of the squares of HDOP and VDOP.

$GPGSA,A,3,04,05,09,12,24,2.5,1.3,2.1*39

    GSA – NMEA header

    A – type of choice between 2D and 3D solutions, Automatic (A-auto, M-manual)

    3 – type of solution, 3D solution (1 – no solution, 2 – 2D solution, 3 – 3D solution)

    04.05… - PRN codes used in calculating satellite positions (12 fields)

    2.5 – spatial geometric factor, PDOP

    1.3 – horizontal geometric factor, HDOP

    2.1 – vertical geometric factor, VDOP

GSV - Detailed information about satellites

This NMEA message contains detailed information for all satellites tracked by the GPS navigator. Based on the 80-character limit, one NMEA message can only transmit data for 4 satellites. Accordingly, 12 satellites require 3 GSV messages. The SNR (Signal to Noise Ration) field contains the values ​​of the levels of navigation signals received from satellites. Theoretically, its value can vary from 0 to 99 and is measured in dB. In fact, the signal level lies in the range of 25 ... 35 dB. It is worth noting here that this parameter is not absolute and is not suitable for comparing the sensitivity of receivers of different models and manufacturers. GPS navigators can use different algorithms for calculating the level of the received signal, which leads to different results with the same degree of sensitivity of the receivers. For each visible GPS satellite, a set of information is transmitted, including signal strength, elevation angle and azimuth of the satellite. The number of these “sets” is determined by the total number of visible satellites, the value of which is transmitted in a separate field.

$GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*75

    GSV – NMEA header

    2 – number of GSV messages in the package

    1 – message number in the package (from 1 to 3)

    08 – number of visible satellites

    01 – satellite number

    40 – elevation angle, in degrees

    083 – azimuth in degrees

    46 – SNR, signal level

This NMEA message contains the entire set of so-called “PVT” data. "PVT" is a common abbreviation for "position, velocity, time".

$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A

    RMC – NMEA header

    123419 – UTC time, 12:34:59

    A – status (A – active, V – ignore)

    4807.038,N – Latitude, 48 degrees 07.038 minutes north latitude

    01131.000,E – Longitude, 11 degrees 31.000 minutes east longitude

    022.4 – Speed, in knots

    003.1,W – Magnetic variations

GLL - latitude and longitude data

NMEA message with the latitude and longitude coordinates, and the time at which this solution was calculated.

$GPGLL,4916.45,N,12311.12,W,225444,A,*31

    GLL – NMEA header

    4916.46,N – latitude, 49 degrees 16.45 minutes north latitude

    12311.12,W-longitude, 123 degrees 11.12 minutes west longitude

    225444 – Fixation time in UTC time scale, 22:54:44

BOD - Azimuth to destination

This NMEA message indicates the bearing to a destination in navigation mode.

$GPBOD,045.,T,023.,M,DEST,START*01

    BOD – NMEA header

    045.,T – true direction to the point

    023.,M – magnetic direction to a point

    DEST – endpoint identification number

    START – identification number of the starting point

$GPRMB,A,0.66,L,003,004,4917.24,N,12309.57,W,001.3,052.5,000.5,V*20

    RMB – NMEA header

    A – Data type, (A – active, V – ignore)

    0.66,L – deviation from the track. The parameter is defined in nautical miles. (L – left, R – right)

    003 - starting point identification number

    004 - endpoint identification number

    4917.24,N – latitude value of the end point, 49 degrees 17.24 minutes north latitude

    12309.57,W – longitude value of the end point, 123 degrees 09.57 minutes west longitude

    001.3 – distance to the point, in nautical miles

    000.5 – speed, in knots

    V – arrival information (A – arrival, V – point not yet reached)

RTE – Route information

The NMEA RTE message displays a list of waypoints on the active route. There are two types of RTE messages. In the first case, all route points are displayed. In the second, there is only a list of the remaining points that still need to be visited while moving along the route. Considering that the NMEA protocol has a limitation according to which the message length should not exceed 80 characters, an RTE message can consist of several lines.

$GPRTE,2,1,c,0,W3IWI,DRIVWY,32CEDR,32-29,32BKLD,32-I95,32-US1,BW-32,BW-198*69

    RTE – NMEA header

    2 – total number of messages to display the complete list of data

    1 – message number from the general list

    с – RTE message type (с – complete list of route points, w – list of points that have yet to be visited)

    0 – route identifier

    W3IWI,DRIVWY,.. - list of waypoints

Garmin Features

Garmin receivers support most NMEA messages containing GPS measurements, positions and time - GGA, GLL, GSA, GSV, RMC. As well as navigation messages - RMB, BOD

To display these messages, you need to change the interface in the receiver settings from “Garmin” to “NMEA” and possibly set the desired speed. The same speed must be set in the navigation program in the settings of the serial port to which the navigator is connected.

Unfortunately, receivers with a USB port do not support the NMEA protocol, limiting its settings to only the Garmin protocol.

To display information entering the computer's serial port, you can use a Windows terminal program or one of the navigation programs that supports this feature.

Below is a list of Garmin eMap receiver NMEA messages that are contained within one epoch.

$GPRMC,135412,A,5522.8973,N,03710.1401,E,0.0,0.0,190507,9.3,E,A*1F

$GPRMB,A,,A,A*0B

$GPGGA,135412,5522.8973,N,03710.1401,E,1,04,5.4,205.2,M,15.8,M,*4A

$GPGSA,A,3,08,13,23,25,5.7,5.4,1.0*3C

$GPGSV,3,1,11,02,15,267,00,03,11,085,45,04,05,236,00,08,39,233.00*77

$GPGSV,3,2,11,10,32,308,00,13,63,109,43,16,17,037,00,23,31,111,38*77

$GPGSV,3,3,11,24,09,343,00,25,66,077,44,27,69,229.00*46

$GPGLL,5522.8973,N,03710.1401,E,135412,A,A*43

$GPBOD,T,M,*47

$PGRME,19.1,M,15.2,M,25.3,M*15

$ PGRMZ,673, f,3*19

$ PGRMM, WGS 84*06

In addition to standard NMEA messages, Garmin receivers implement their own set of messages, each of which contains a "GRM" prefix in the header, an "M" or "Z" identifier identifying the data type, and one character for the name.

PGRME – Positioning Error Estimation

$PGRME,15.0,M,45.0,M,25.0,M*1C

    15.0,M – assessment of the horizontal positioning error, in meters

    45.0,M – vertical error estimate, in meters

    25.0,M – equivalent spherical positioning error

PGRMZ – height measurements

$PGRMZ,93,f,3*21

    93,f – height value, in pounds

    3 - position measurement conditions (2 - user-defined height,

    3 – altitude calculated by GPS)

PGRMM – current datum

$PGRMM,NAD27 Canada*2F

    NAD27 Canada – name of the current horizontal datum

Sirf Features

GPS chips from Sirf are used in various GPS navigation equipment, ranging from conventional boards to portable and car GPS navigators. But unlike navigators, they only support NMEA messages related to GPS measurements, position and time calculations - GGA, GLL, GSA, GSV, RMC, VTG, ZDA.

"Sirf" also supports several "incoming" NMEA messages intended for configuration and adjustment of various parameters. In addition, Sirf implements its own binary protocol, which allows you to change significantly more settings. These 5 "incoming" NMEA messages, according to the rules, begin with the prefix $PSFR. All messages contain a fixed set of data and end with the character “\n” (line feed)

To configure the “Sirf” parameters, a special program “SirfTech” is used. NMEA message parameters are configured in a separate menu item.

$GPGGA,100643.000,5522.9036,N,03710.1282,E,1.07,1.6,209.9,M,14.9,M,0000*52

$GPGSA,A,3,31,01,23,20,11,30,14,2.1,1.6,1.4*35

$GPGSV,3,1,12,20,84,187,41,01,49,067,46,23,46,238,45,31,45,073,50*7B

$GPGSV,3,2,12,11,25,194,34,13,16,240,04,15,319,30,17,14,273,21*7A

$GPGSV,3,3,12,30,10,026,33,14,05,063,22,05,04,009,25,25,03,195,*7F

$GPRMC,100643.000,A,5522.9036,N,03710.1282,E,0.16,119.11,200507,*0D

As you can see from the example above, the factory settings contain fewer NMEA messages compared to the Garmin settings. If necessary, this set can be expanded by setting the period in the missing NMEA messages.

$GPGGA,100833.000,5522.9076,N,03710.1270,E,1.07,1.3,222.4,M,14.9,M,0000*53

$GPGLL,5522.9076,N,03710.1270,E,100833.000,A*34

$GPGSA,A,3,31,01,23,20,11,30,17,2.1,1.3,1.6*31

$GPGSV,3,1,12,20,84,180,43,01,49,067,47,23,47,238,45,31,45,072,49*77

$GPGSV,3,2,12,11,24,193,26,13,16,240,26,04,15,319,24,17,13,273,31*78

$GPGSV,3,3,12,30,10,025,26,14,04,064,22,25,04,195,05,04,008,21*7C

$GPRMC,100833.000,A,5522.9076,N,03710.1270,E,0.18,4.86,200507,*00

$GPVTG,4.86,T,M,0.18,N,0.3,K*60

$GPZDA,100834.000,05/20/2007,*5A

PSFR100, PSFR102 – serial port configuration

NMEA message number 100 is used to set port A, message 102 - port B. Message 100 has an additional field that allows you to switch the interface to the binary Sirf protocol.

Accordingly, in the binary protocol there is a command that switches the port back to NMEA format. Before switching to the binary protocol, you need to understand if there is a program that will allow you to restore the NMEA protocol in the future.

$PSRF100.0.9600.8.1.0*0C

$PSRF102.9600.8.1.0*3C

    PSRF100 – NMEA header

    0 – parameter indicating in which mode the protocol was changed (0-Sirf, 1-NMEA)

    9600 – port speed (4800, 9600, 19200, 38400)

    8 – data bits (7, 8)

    1 – stop bits (0,1)

    0 – pairing (0 – none, 1-odd, 2-even)

PSFR101, PSFR104 – initialization of receiver parameters

NMEA messages numbered 101 and 104 are intended to initialize parameters intended for GPS reception. Determining these parameters can speed up the acquisition time of GPS satellites. Message 101 sets the current coordinates in XYZ format, message 104 – in BLH (longitude, latitude) format.

$PSRF101,-2686700,-4304200,3851624,95000,497260,921,12.3*22

$PSRF104.37.3875111.-121.97232.0.95000.237759.922.12.3*3A

    PSRF101 – NMEA header

    37.3875111 – latitude in degrees

    121.97232 – longitude in degrees

    0 – height, in meters

    95000 – clock shift

    237759 – GPS time, in seconds

    922 – GPS week number

    12 – number of channels

    3 – type of data initialization (1 – hot start, 2 – warm start, 3 – data initialization, 4 – cold start with complete data clearing, 8 – cold start with restoration of factory settings)

PSFR103 – NMEA message generation configuration

This NMEA message allows you to set or query the generation period of each "outgoing" NMEA message.

$PSRF103.05.00.01.01*20

    PSRF103 – NMEA header

    05 – message title

    01 – period, in seconds (0-255)

    01 – presence of checksum (0 - yes, 1 - no)

Experiment results

Under conditions of normal satellite visibility, the Garmin eMap receiver produces the following set of NMEA messages:

$GPRMC,104644,A,5522.8965,N,03710.1389,E,0.0,0.0,200507,9.3,E,A*16

$GPRMB,A,,A,A*0B

$GPGGA,104644,5522.8965,N,03710.1389,E,1.07,1.2,186.6,M,15.8,M,*44

$GPGSA,A,3,01,04,13,16,20,23,31,2.1,1.2,1.7*35

$GPGSV,3,1,10,01,34,070,48,04,28,311,40,11,10,190,00,13,32,249,41*7E

$GPGSV,3,2,10,16,11,111,40,20,68,142,50,23,64,247,49,25,21,196.00*70

$GPGSV,3,3,10,30,05,012,00,31,36,055,52*7D

$GPGLL,5522.8965,N,03710.1389,E,104644,A,A*40

$GPBOD,T,M,*47

$PGRME,6.0,M,7.7,M,9.8,M*29

$PGRMZ,612,f,3*1E

$PGRMM,WGS 84*06

$GPRTE,1,1,c,*37

From the analysis of messages it is clear that the receiver is currently tracking 10 (GSV) satellites, of which 7 (GGA) are used in position calculation. The horizontal positioning error is equal to 6 meters (RME), and the solution type indicator is 1 (GGA)

If you create conditions under which the GPS signal will not be received, then the GGA messages will contain “empty” fields, and the decision type indicator will take the value 0 (GGA)

$GPGGA,0.00,M,M,*66

$GPGSA,A,1,,*1E

In "normal" mode, RMB and BOD messages contain empty fields. Once the Road waypoint was selected as the final destination, these fields were populated with data. As follows from the analysis of the message, the distance to the point is 1,620 miles, the azimuth of movement is 6.3 degrees (BOD). At the same time, the azimuth of the BOD and RMB messages differs by 0.1 degree.

$GPRMB,A,0.00,R,Road,5524.501,N,03710.445,E,1.620,6.4,V,A*59

$GPBOD,6.3,T,357.0,M,Road,*74

Once the Home route has been selected for navigation, the RTE message list displays a list of all waypoints on the route. And in the RMB message - identification numbers of the starting and final (next) points of the route.

$GPRTE,1,1,c,HOME,SLOBODA,IERUSALIM,INSTITUT*01

$GPRMB,A,9.99,R,SLOBOD,IERUSAL,5555.237,N,03649.976,E,34.346,340.6,V,A*1F

Conclusion

In most cases, the user does not need, and is not interested in, knowing what data is being transmitted and in what fields. Most navigation programs “parse” NMEA message data and present them in a user-friendly form - graphs, diagrams, tables, etc.

Of particular interest are NMEA messages for users who would like to conduct research on GPS data, calculate estimates of acquired measurements, or analyze the behavior of navigation receivers under various conditions. There are a number of programs that can be used to solve these problems.

But still, the NMEA format is not intended for deep analysis of GPS data, since it does not contain the so-called “raw” measurements - pseudo-ranges, phases, Doppler. Each manufacturer of navigation equipment has its own “open” or “closed” protocol that displays this information

NMEA is a simple and understandable format that not only allows for data exchange between GPS receivers and navigation programs, but also gives users some idea of ​​the principles of operation of satellite navigation equipment.

Attention!

An article from the website " GPS portal"



 

It might be useful to read: