Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adafruit_GPS::parse is not robust to certain strings #1

Open
bkobkobko opened this issue Mar 23, 2016 · 1 comment
Open

Adafruit_GPS::parse is not robust to certain strings #1

bkobkobko opened this issue Mar 23, 2016 · 1 comment

Comments

@bkobkobko
Copy link

In the parse function, there is a test for the char 4 from the end to make sure it is a '' followed by a checksum test if it is a '', but the alternative, when there is not a '*' does not do an early return with false.

An input string that starts with "$GPGGA" or "$GPRMC" but does not have a '*' at the end will cause the code to attempt to parse an illegal string.

A better approach might be to have an early return with false if there is no '*' character four from the end.

The original Adafruit library also has this problem of course.

See this particle community discussion for more details:

https://community.particle.io/t/default-example-for-asset-tracker-gps-prints-erratic-nmea-sentences-to-serial/21356

@jmccorm
Copy link

jmccorm commented Mar 23, 2016

The Adafruit_GPS library is significantly bugged, yet it seems to operate despite those bugs because it accidentally bypasses a checksum in certain situations. That allows just a minority of messages to make it through, but enough to make the library look like it is working. Some of the problems are in the parser, some of the problems are in the routine which reads from the GPS and assembles together a string.

We ended up with lots of good stuff in that thread. I wanted to thank you, bkokobko, for asking those questions which pushed me to gather more information which gave us a better understanding of the problem. Also thanks for bringing in Hypnopompia who poured his experience and expertise into this.

I'm hoping that you or he can take over from here. My employer greatly values my ability to dive in and debug something which I (and my coworkers) don't understand. But I'm not a programmer and I have to hand this over to those who are more capable than I to drive this forward.

I'm think I'm going to be really happy with a far more robust GPS library in my hot little hands. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants