-
Notifications
You must be signed in to change notification settings - Fork 318
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
Malformed NMEA sentence causes dataloss #128
Comments
The parser performs a rudimentary check for valid checksum sentence source and sentence name, then proceeds to parse and assign values as it moves through the sentences, simply assuming the data is valid. You are correct it will fail if the GPS sends bogus data. The current library is close to the memory limits for use in an UNO, so any further checks should probably be made with those limits in mind. |
It's malformed but has a correct checksum, that's really strange. Any idea why the module is doing that? |
I do not know why the module produce such sentences, but the incorrect parsing causes a lot of headaches. I produce GPX file from various fitness sensors and from the GPS data. The library parse() method indicates a successful fix after such a sentence, hence my code makes a new element with the now invalid date for up to 3 seconds (after that incident only GGA sentences were produced, i.e., no valid date for 3 seconds. I still think that checking for sentence correctness is a necessary requirement for any decent parser. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
We could at least count the fields and make sure the sentence has the proper amount, that shouldn't add too much overhead. |
I also receive sentences like this: |
Of course I myself will look into a bugfix, or a more robust parser code eventually, but currently I am overwhelmed with my daytime job :/ |
I hope employing a proper transaction semantic (i.e., parse data into temporary variables and only committing to the members of the GPS class instance when the parse is complete and scucessful) would help w/o significant memory increase. I have an UNO clone so I will try to validate on an Uno when I will have a fix. |
What speed are you using for the GPS serial and what is your GPS update rate? The overlapping sentences can be caused by a mismatch with those. |
parse() calls check() before proceeding, fails if check not passed. check() does only rudimentary name, source, checksum right now. An option for check could be parsing in a dummy instance, then testing (some of) the results of the parsing for validity. |
9600, 1HZ, EGNOS enabled
|
|
I am developing a fitness-datalogger using nrF52840 Feather and UltimateGPS Featherwing. The GPS module and/or the serial erratically sends malformed NMEA sentence, which causes data loss.
An example of such a sentence:
$GPRMC,181536.000,A,5936.79K,D*3A
Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE
nrf52840 Express Feather
Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
VERSION HERE
n/a
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): LIST REPRO STEPS BELOW
Try to parse "$GPRMC,181536.000,A,5936.79K,D*3A" with the library.
This is a malformed NMEA sentence (field count is invalid), and as such it should have been discarded entirely. However, the parse() method partially parses it, causing (the earlier established) GPS date info to became invalid (setting the GPS date to the bogus 2000-00-00 date).
This requirement is true for any decent GPS parser, IMHO: the effect of the unseccesful parsing attempt of any invalid NMEA sentence shall leave all stateful data members of the GPS instance unchanged
#bug
The text was updated successfully, but these errors were encountered: