sparkfun/SparkFun_u-blox_GNSS_v3

RTCM over UART

Closed this issue · 3 comments

Hello,

I am trying to send over UART RTCM data. Unfortunately, only defective packages arrive at the ZED-F9P. I checked this with the u-center. Here is the command: gnss_serial.pushRawData(data, counter, false);

When I send the same data over I2C, the transfer works fine. gnss_i2c.pushRawData(data, counter, false);

The UART is set correctly because other commands work fine. I suspect that the pushRawData function for UART is not working properly. Please check this...

Thanks very much!

Best regards
Michael

Hi Michael (@forstner-m),

Sincere thanks for reporting this!

It looks like a simple dumb mistake...

The Serial version of pushRawData attempts to push all of the data in one go:

ok = writeBytes(dataBytes, numDataBytes) == numDataBytes;

Except writeBytes accepts a maximum of 255 bytes (uint8_t) and NTRIP data can be much larger than that:

uint8_t SfeSerial::writeBytes(uint8_t *dataToWrite, uint8_t length)

I'll investigate, fix and test tomorrow...

Very best wishes,
Paul

Hi Michael,

I now have a fix for this. The fix is to split serial pushRawData into small chunks and call checkUbloxSerial between chunks to avoid data loss. If you are pushing a large amount of data, previously any data received during the push could have been lost - if it overflowed the microcontroller's internal RX buffer. Calling checkUbloxSerial between chunks prevents this.

I will be releasing version 3.0.15 of the library in a few minutes. Please test it when you have time.

In your code, please call gnss_serial.pushRawData(data, counter); or gnss_serial.pushRawData(data, counter, true);

Best wishes,
Paul

Hello Paul,

thank you for the implementation. The function is working. In the next days I will write you new features.

Best regards,
Michael