NMEA Protocol
NMEA 0183 is the standard communication protocol used by virtually all GNSS receivers to transmit position, satellite, and accuracy data. When you connect an external receiver to Mapit GIS (via Bluetooth on Android, or TCP/IP on either platform), the receiver sends a continuous stream of NMEA sentences over the serial link.
What Is NMEA?
NMEA stands for National Marine Electronics Association. The NMEA 0183 standard defines a text-based protocol where each message (called a sentence) is a single line of ASCII text:
$GPGGA,120000.00,5133.82,N,00042.24,W,1,08,0.9,45.4,M,47.0,M,,*47
Every sentence follows the same structure:
| Part | Example | Description |
|---|---|---|
| Start | $ | Every sentence begins with a dollar sign |
| Talker ID | GP | Identifies the satellite system (GP = GPS, GL = GLONASS, GA = Galileo, GB/BD = BeiDou, GN = multi-GNSS) |
| Sentence type | GGA | Three-letter code identifying the data format |
| Data fields | 120000.00,5133.82,... | Comma-separated values |
| Checksum | *47 | XOR of all bytes between $ and *, encoded as two hex digits |
| Terminator | \r\n | Carriage return and line feed |
The talker ID tells you which satellite constellation produced the data:
| Talker ID | Constellation |
|---|---|
GP | GPS (USA) |
GL | GLONASS (Russia) |
GA | Galileo (Europe) |
GB / BD | BeiDou (China) |
QZ | QZSS (Japan) |
GN | Multi-GNSS (combined solution) |
Supported Sentence Types
Mapit GIS parses the following NMEA sentence types. The NMEA parser (NmeaParser) processes each incoming line, validates the format, and extracts the relevant data fields.
GGA - Global Positioning System Fix Data
The most important sentence for surveying. GGA provides the core position fix including coordinates, altitude, fix quality, satellite count, and accuracy.
| Field | Data |
|---|---|
| UTC time | Hours, minutes, seconds |
| Latitude / Longitude | Degrees and decimal minutes |
| Fix quality | 0 = Invalid, 1 = GPS, 2 = DGPS, 3 = PPS, 4 = RTK Fixed, 5 = RTK Float, 6 = Dead reckoning, 7 = Manual, 8 = Simulation |
| Satellites in use | Number of satellites contributing to the fix |
| HDOP | Horizontal dilution of precision |
| Altitude (MSL) | Height above mean sea level in metres |
| Geoid separation | Difference between the WGS 84 ellipsoid and mean sea level in metres |
| DGPS age | Seconds since last differential correction |
| DGPS station ID | Reference station identifier |
Supported talker IDs: GPGGA, GNGGA
RMC - Recommended Minimum Navigation Data
Provides position, speed, and bearing. Used as a fallback when GGA is not available.
| Field | Data |
|---|---|
| UTC time and date | Full timestamp |
| Status | A = Active (valid fix), V = Void (no fix) |
| Latitude / Longitude | Position |
| Speed over ground | In knots (converted to m/s internally) |
| Track angle | True bearing in degrees |
Supported talker IDs: GPRMC, GNRMC
GSA - GNSS DOP and Active Satellites
Reports the dilution of precision values and which satellites are being used in the position solution.
| Field | Data |
|---|---|
| Mode | A = Automatic, M = Manual |
| Fix type | 1 = No fix, 2 = 2D fix, 3 = 3D fix |
| Satellite PRNs | Up to 12 satellite identifiers used in the fix |
| PDOP | Position dilution of precision |
| HDOP | Horizontal dilution of precision |
| VDOP | Vertical dilution of precision |
NMEA 4.10+ receivers include a system ID field (field 19) to distinguish constellations.
Supported talker IDs: GPGSA, GNGSA, GLGSA, QZGSA, BDGSA, GBGSA
GSV - GNSS Satellites in View
Provides detailed information about each visible satellite - used to populate the sky plot and signal bar chart in the GPS Info sheet.
| Field | Data |
|---|---|
| Satellites in view | Total count for this constellation |
| Satellite PRN | Identifier |
| Elevation | Degrees above horizon (0-90) |
| Azimuth | Degrees from true north (0-360) |
| SNR | Signal-to-noise ratio in dB-Hz (0-99) |
Each GSV sentence carries data for up to 4 satellites, with multiple sentences forming a complete set.
Supported talker IDs: GPGSV, GLGSV, GAGSV, QZGSV, BDGSV, GBGSV
GST - GNSS Pseudorange Error Statistics
Provides statistical accuracy estimates. This is the primary source of RMS accuracy values displayed in the GPS Info sheet.
| Field | Data |
|---|---|
| RMS | Root mean square of pseudorange residuals |
| Semi-major / semi-minor error | Error ellipse axes in metres |
| Orientation | Error ellipse rotation in degrees |
| Latitude 1-sigma error | Standard deviation in metres |
| Longitude 1-sigma error | Standard deviation in metres |
| Height 1-sigma error | Standard deviation in metres |
From these values, the app computes:
- HRMS = sqrt(lat_error^2 + lon_error^2)
- VRMS = height_error
- 3D RMS = sqrt(lat_error^2 + lon_error^2 + height_error^2)
VTG - Course Over Ground and Ground Speed
Used internally to advance the NMEA state machine, marking the end of a sentence sequence.
Supported talker IDs: GPVTG, GNVTG
GLL - Geographic Position
Provides latitude and longitude with UTC time. Used only when neither GGA nor RMC is available in the receiver's output.
Supported talker IDs: GPGLL, GNGLL
GNS - GNSS Fix Data
A multi-GNSS equivalent of GGA that includes a mode indicator per constellation. Updates the NMEA state accordingly.
PNVGSDP - Proprietary Accuracy Sentence
A proprietary sentence (NovAtel-compatible) providing standard deviations for latitude, longitude, and height, plus a fix mode character:
| Mode | Meaning |
|---|---|
A | Autonomous |
D | Differential |
F | RTK Float |
R | RTK Fixed |
E | Dead reckoning |
N | No fix |
Sentence Priority
The parser uses a state machine to avoid mixing data from different fix epochs. When multiple sentence types provide overlapping data, this priority applies:
- GGA - preferred for position and fix quality
- RMC - used if GGA is absent (provides speed and bearing not in GGA)
- GLL - last resort for position only
Checksum Validation
Each NMEA sentence ends with a two-character hex checksum preceded by *. The checksum is computed by XOR-ing all bytes between $ and *:
$GPGGA,120000,...*47
↑ XOR these ↑
The parser verifies the checksum format but is pragmatic about validation - sentences with minor formatting issues are still processed to maximise compatibility with the wide variety of GNSS receivers on the market.