Skip to content

Conversation

@tristan-huber
Copy link

Changes parsing for RMC messages to that time values are still reported even if there is not a GPS fix. This is particularly relevant for GPS cards which have a battery included and maintain an RTC clock onboard, eg: the adafruit Ultimate GPS v3.

Note there is a logical change in _parse_rmc which means lat/lon values won't be returned when there's no fix. Prior version could conceivably have allowed this, but I believe that lat/lon/speed values are never provided without a fix in practice.

"dcdcscC",
# 1 - _RMC
"scdcdcffsDCC",
"scDCDCFFsDCC",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One q: what does this change do?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya! as I recall this change is to ensure that _RMC sentences with missing location data will still get parsed and returned in case they contain other data, eg: datetime.

This string format is interpreted in _parse_data below and generally capital letters indicate an optional value and lowcase indicate a required value. (rereading the code now, this is clearly the case for c vs C but I'm uncertain if the changes to d and f are strictly necessary).

This string in particular corresponds to the RMC format (ie: table 1-11 in this pdf: https://cdn.sparkfun.com/assets/a/3/2/f/a/NMEA_Reference_Manual-Rev2.1-Dec07.pdf ). The changed characters mark latitude, N/S indicator, longitude, E/W indicator and speed+heading as optional values. These values are all absent if the chip has no GPS fix. But other values (eg: UTC time indicated by the first s) may still be present if the chip has an onboard battery clock. And in such a case a partial sentence can now be returned.

@dhalbert
Copy link
Contributor

@tristan-huber See https://forums.adafruit.com/viewtopic.php?t=219946: a user asked for the same thing as your pull request. I asked they try your new code, but they had some issues. Could you take a look and possibly reply? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants