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

Wrong checksum calculator for NMEA1083 AIS/GPS (AIVDM / G) #134

Open
YannPara opened this issue Aug 14, 2022 · 2 comments
Open

Wrong checksum calculator for NMEA1083 AIS/GPS (AIVDM / G) #134

YannPara opened this issue Aug 14, 2022 · 2 comments

Comments

@YannPara
Copy link

Hello,
I think it's may have an error in checksum computation for NMEA sentence (or I use wrong your API).

Describe the bug
When decode AIS+GPS stream with Marine-API, find >95% of "Invalid data" output (but streams is decode with error<1% on others software).

To Reproduce
Sentence sample : !AIVDM,1,1,,A,133sfv002POVWD0Je4sMA:a@00S?,0*3F
Compute CRC with Marine-api : 7A
Compute CRC with online decoder (links at bottom) & other software : 3F

Sentence sample : !AIVDM,1,1,,A,13IWB67P00wdI9pKF>atlww>2@G4,0*4F
Compute CRC with Marine-api : 0F
Compute CRC with online decoder (links at bottom) & other software : 4F

For test I use directly net.sf.marineapi.nmea.sentence.SentenceValidator "public static boolean isValid(String nmea)"

Sometime compute is good, like in this sample :
!AIVDM,1,1,,B,1CI7wSg000woG1rK3DMh0q3D00RV,0*6D

Configuration :
OS: WIN11
JDK OpenJDK 17.0.3.v202205015-1416
Marine-API version 0.11.0

Additional context
Online checkSum validator N°1
Online checkSum validator N°2
Online checkSum validator N°3

** Fast fix before API-update **
Remove all characters after * before parsing, so validator skip checksum control, but real invalid data can pass.

** Better fix before API-update **
Remove all characters after * before parsing, outside API checksum validor, if OK, pass data (with no CRC) to API.

Best regards,

ktuukkan added a commit that referenced this issue Aug 16, 2022
@ktuukkan
Copy link
Owner

ktuukkan commented Aug 16, 2022

Hi @YannPara, thanks for reporting!

I added some unit tests for the samples you provided, but seems I wasn't able to reproduce the mentioned incorrect sums.

Check the commit da775b2 and corresponding build, tests and sentence validation are passing with given sentences. Please see if I misunderstood the issue?

That said, I didn't run the tests against v0.11 yet, so this might have already been fixed in the latest snapshot.

@ktuukkan
Copy link
Owner

@YannPara Checked also against v0.11 tag, but still wasn't able to reproduce the issue.

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