-
Notifications
You must be signed in to change notification settings - Fork 44
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
UBX checksum is incorrect #27
Comments
Found it! Class props take 10 bytes, not 8 thus Class ID gets overwritten. Easy fix:
|
It fixed checksum issue, but now data makes no sense - like weird year on incorrect Lat/Lon Probably another offset somewhere |
Because 2 bytes for HeaderClass is needed for proper offset in memory mapping Now everything looks good |
Hello @RomanTheLegend , since the NavPvt was tested with u-blox, it could be that the module you have has a different offset – what GPS module you are using, and what protocol document you are referring to in the first message? |
According to UBlox documents:
What I've noticed in reality that 2 bytes of class ID are not taken into account when
UbxGps.h
calculates checksum, thus any NAV-PVT message is never considered validFor example, this packet (without 2 checksum bytes at the end):
The valid checksum would be
CK_A = 0xD9
andCK_B = 0x71
Meanwhile the library expects
CK_A = 0xC0
andCK_B = 0x16
And fails because it got
CK_A = 0x11
If you exclude 2 bytes for class (
[0x01,0x07]
) then calculated checksum matches i.e. a checksum forwould indeed be
CK_A = 0xC0
andCK_B = 0x16
Basically, checksum is calculated for packet size 4 bytes shorter than it actually is (2 bytes for Class ID and 2 bytes for packet size field which is in Int16 Little Endian format -
[0x54,0x00]
)I need a help with fixing this code because without UART debugger playing with byte offsets by printing strings to serial is a nightmare :)
The text was updated successfully, but these errors were encountered: