Utility Mill

NMEA_sentence_checksum

Calculates the checksum of an NMEA sentence (GPS data)


Output


Instructions / Discussion

This comes from a Python Cookbook recipe by Alan Holt

Calculate the checksum for NMEA sentence from a GPS device. An NMEA sentence comprises a number of comma separated fields followed by a checksum (in hex) after a "". An example of NMEA sentence with a correct checksum (of 0x76) is: GPGSV,3,3,10,26,37,134,00,29,25,136,0076"

The checksum function is passed an NMEA sentence and returns the NMEA data, the checksum that was appended to the sentence when it was generated and the locally calculated checksum. A NMEA sentence may be read directly from a GPS device and therefore could contain a newline at the end. If so, this is removed. The example above verifies an NMEA sentence by comparing the two checksums returned by the checksum function. The example sentence has been corrupted, resulting in error message.

Utility Mill is another wonderful Blended Technologies project.

copyright, owned and operated by Blended Technologies LLC.

Powered by Python and the ineffable Web.py