NMEA Summary

Using NMEA formatted messages, commands can be sent to the μModule to perform actions. After the commands are executed, a response is returned.

sequenceDiagram autonumber Controller->>μModule: Establish UART/USB Connection loop Note left of Controller: Format Command Controller->>μModule: Send NMEA Command Note right of μModule: Process Command μModule->>Controller: Send Response Note left of Controller: Process Response end Controller->>μModule: End Connection

NMEA messages are formatted as follows:

$TYPE,ARGUMENT1,...*[CRC]
  • Each message starts with $
  • Types are 3 to 5 characters and specify an action to perform
  • Arguments are separated by commas and can be of any type, string, float, etc.
  • Messages end with a * and are followed with a CRC value represented by two hexadecimal characters. CRC checks are turned off by default, but two characters still must be passed. Two zeros works for this.

Some example messages to request a conductivity measurement from a μMod-EC device would look like this:

$UFEC,25.0*00
A measurement request and passing the temperature to use for compensation.
$UFEC,10.0,20.0,0.02,1*00
A measurement request using all available parameters for the UFEC type.

A complete listing of types and their parameters can be found in each μModule's respective documentation.

Responses

By default, the response to an NMEA message is an NMEA-formatted response. It will be identified using the same type, UFEC for example, but in place of the arguments used to call it, response information will be sent.

An example UFEC response:

$UFEC,1100,1.1,0*27

Represents a conductivity measurement (UFEC) that measured 1100 microsiemens, or 1.1 millisiemens, and finished with an error code of 0 (no error).

Note the CRC of response messages is always valid, regardless of CRC checks being on or off.

Alternatively, JSON or MsgPack can be chosen for output formats.

{
  "uS": 1100,
  "mS": 1.1,
  "err": 0
}
The above UFEC example would look like this in JSON:
83 a2 75 53 cd 04 4c a2 6d 53 cb 3f f1 99 99 99 99 99 9a a3 65 72 72 00
And in MsgPack (represented here as a stream of hex bytes)