mtz8302 / AOG_GPS_ESP32

DUAL or SINGLE GPS bridge between AgOpenGPS an GPS receiver. Works with 2 UBlox to calculate heading+roll. Corrects and filters. ESP32 + Arduino MEGA
GNU General Public License v3.0
35 stars 18 forks source link

RelPosNED message too long on F9P startup #13

Open benreu opened 3 months ago

benreu commented 3 months ago

In doing some F9P stress/consistency testing, I discovered the RelPosNED F9P is sending a message that is too long when starting up and it doesn't have a stable position yet. I am checking for bad checksum and wrong length on both NavPVT and RelPosNED.

A sample of the code I added to Line 141

if (UBXDigit2 > (108)) {
  UBXDigit2 = 0;
  UBXLength2 = 100;
  diagnostics.wrongLengthRelPosNEDCount += 1;
  saveDiagnostics();
}

The RelPosNED wrong length is the only one making problems, for about 200 messages. Since the count is being saved - to load on power up, it would be nice to ignore or fix the bootup wrong length messages. Any ideas?

benreu commented 3 months ago

I think I found it. A new UBX message should be started when the length is correct whether the heading is valid or not. Line 130 should start the new UBX message with

UBXDigit2 = 0;
UBXLength2 = 100;

And it should be removed from Line 98-99.