Unable to get GPS data via bluetooth

Errors and crash analysis for GPS-Connector App
Fehlermeldungen und Abstürze zur GPS-Connector App
Antworten
vgwit
Beiträge: 2
Registriert: Mi 6. Dez 2023, 13:44

Unable to get GPS data via bluetooth

Beitrag von vgwit »

Hello,

I'm trying to get GPS connector working and receive GPGGA packets via bluetooth but without success.
First I've checked it in simulation mode and it works. Then I've picked up a GPGGA string from simulation nmea log

$GPGGA,150834.00,4151.0000000,N,01230.0000000,E,4,16,0.6,516.042,M,45.729,M,1.0,1020*47

and sent it via file input. And it works again. But if I send exactly the same string via bluetooth it does not work. I've looked in debug log and found strings like:

[04.12.2023 22:20:25.330] [E] [TID:508651232432] [0220::NMEAString.cpp] [analyse()] ERR_NMEA_CHECKSUM: 0x47:GPGGA,150834.00,4151.0000000,N,01230.0000000,E,4,16,0.6,516.042,M,45.729,M,1.0,1020*00

I guess that 0x47 is checksum calculated by the app but 00 is checksum it sees in incoming packets. BUT terminal window shows *47 at the string end.
What is wrong? Why the app sees 00 at the end?

Thanks.
Volodymyr.
Mazuch
Administrator
Beiträge: 32
Registriert: Mi 11. Nov 2020, 17:54
Kontaktdaten:

Re: Unable to get GPS data via bluetooth

Beitrag von Mazuch »

Hi Volodymyr,
[04.12.2023 22:20:25.330] [E] [TID:508651232432] [0220::NMEAString.cpp] [analyse()] ERR_NMEA_CHECKSUM: 0x47:GPGGA,150834.00,4151.0000000,N,01230.0000000,E,4,16,0.6,516.042,M,45.729,M,1.0,1020*00
Yes - as you guessed 0x47 is the expected checksum, but the app sees "*00". (see message)
So - for whatever reason - zero is send via bluetooth.

Please check your send algorithm again ... and also very important.
You have to end the NMEA string by "\r\n" - but i guess you do.

Btw. you can also save the received NMEA data to a file, see terminal page in the app.
This should show the same problem - wrong checksum.

Best regards,
Markus
There is no code so big, twisted, or complex that maintenance can't make it worse. (Gerald M. Weinberg)
vgwit
Beiträge: 2
Registriert: Mi 6. Dez 2023, 13:44

Re: Unable to get GPS data via bluetooth

Beitrag von vgwit »

Hi Markus,

thank you for your reply.
My mistake was I sent checksum as a hex code instead of two ascii codes.

BR,
Volodymyr
Antworten