RTK RTCM3 Packet Forwarder

I’m looking for a code snippet on how to receive complete RTCM3 packets over I2C on the base so that I can relay those packets over packet radio (or UDP) from base to rover using Arduino. I’ve looked through the examples in the UBlox_GNSS_Arduino_Rev3 library but can’t find exactly what I’m looking for. I can see how to relay a fixed number of bytes, but not an intact RTCM3 packet. Can I acquire the raw RTCM3 packet within a callback, etc.? I have the F9P. Thanks.

You’d have to fetch and accumulate blobs of data from the I2C interface, and then demux the RTCM3 packets from the stream.
A relatively simple pull-down buffering method should suffice.

Hi CarlS (@carlsunderman ),

We have a I2C-Serial pass-through example which will allow you to read all data from the module over I2C. This line is the critical one which reads data from the i2cUartRingBuffer. The actual Serial writing happens here. If you were to pass that data into the SparkFun Extensible Message Parser (SEMP), it would parse all incoming NMEA/UBX/RTCM data for you and allow you to extract complete, CRC-checked RTCM packets. The RTCM_Test example gets you most of the way there. You would need to modify it to accept the byte(s) from I2C instead - i.e. replace these lines.

I hope this helps,
Paul

1 Like

Clive1, The RPiPICO_UBLOX_I2C_RTCM3_DEMUX sketch works great on the base side! Thanks, just what I was looking for. I’m able to send and receive the RTCM3 messages over the radio (ESP-NOW). But, I’m having trouble with the rover entering RTK mode. I’m sending the i2c data to the default address (0x42) with your function ubx_send_i2c. Ive opened the i2c port to receive RTCM3 messages in ucenter. Is there anything else I need to do related to ubx_send_i2c or the ucenter configuration for the rover to recognize the messages? The base is going into TIME mode.

The I2C interface should be able to receive RTCM3 packet input by default.
You can perhaps monitor/confirm reception/processing via UBX-RXM-RTCM and UBX-MON-MSGPP
You should see 1005, 107x, 108x, 109x, 1230 messages.
We’ve had a few discussions on the uBlox Forum with regard to RTCM3 via I2C, and it should be viable. Had it work on STM32 and assorted Arduino platforms.

You can also monitor the far end of the radio link, and insure the integrity of the RTCM3 packets before stuffing them into the Rover.
The receiver can handle fractured packets, as long as all the pieces arrive, in-order, and now extraneous bytes are added. Data to the receiver can be interleaved at a packet level.