Skip to main content

Nmea Gps

πŸ“‘ NMEA GPS Integration​

πŸ›°οΈ Overview​

MAPS Messaging supports parsing, publishing, and transforming GPS data received in NMEA (National Marine Electronics Association) format. The server can act as a location source and convert raw NMEA sentences into structured JSON.

Configuration for this module is handled via the nmea.yaml file.


βš™οΈ Configuration Reference​

nmea:
format: json
publish: true
serverLocation: true
sentenceForPosition: GPGGA
FieldDescription
formatOutput format: json (parsed structure) or raw (verbatim NMEA sentence).
publishWhether to publish parsed messages to $NMEA topics.
serverLocationUse this NMEA source as the system's location provider.
sentenceForPositionThe sentence type used to extract device/server GPS position.

🧭 Example: If serverLocation: true and sentenceForPosition: GPGGA, the server uses the latest GPGGA sentence to derive its position.


🧾 Supported NMEA Sentences​

The sentences section maps individual NMEA sentence types (e.g., GPGGA, GPRMC) to a structured schema. Each entry defines:

  • A human-readable description
  • A syntax map that describes each field in the sentence by position

🧬 Field Definitions​

Each field within a sentence includes:

  • name: Logical name of the data field
  • type: Data type (e.g., UTCTime, Position, Enum, long, double, Height)
  • param (optional): Enum mappings or special flags
  • repeat (optional): Repetition count for array fields

βœ… Example: GPGGA​

GPGGA:
description: Global Positioning System Fix Data
syntax:
1:
name: time
type: UTCTime
2:
name: latitude
type: Position
3:
name: longitude
type: Position
4:
name: fix_quality
type: Enum
param: '[{"0": "fix not available"}, {"1": "GPS Fix"}, {"2": "Differential GPS fix"}]'
...

πŸ“š Full List of Supported Sentences​

SentenceDescription
GPGGAGPS Fix Data
GPGLLGeographic Position (Lat/Lon)
GPGSAGPS DOP and Active Satellites
GPGSVSatellites in View
GPHDTHeading, True
GPRMCRecommended Minimum Specific GPS/Transit
GPVTGTrack & Speed over Ground
GPZDAUTC Date and Time

Each of these is parsed into structured fields and published if publish: true is set.


πŸ§ͺ Example Output (GPGGA, JSON Format)​

Given a raw sentence:

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

Parsed result:

{
"time": "12:35:19",
"latitude": 48.1173,
"longitude": 11.5167,
"fix_quality": "GPS Fix",
"satellites": 8,
"hdop": 0.9,
"altitude": 545.4,
"height_of_geoid": 46.9
}

βœ… Best Practices​

  • Use json format for structured parsing and integration with applications.
  • Enable publish: true to allow other components or subscribers to access GPS data.
  • Use serverLocation: true for location-aware features (e.g., geo-fencing).
  • Choose a stable sentence like GPGGA or GPRMC for sentenceForPosition.
  • Add only relevant sentences to reduce overhead if parsing all types isn’t needed.