Skip to content

Commit 43ba79e

Browse files
committed
Enable RTCM over I2C only in base mode.
1 parent bf0fc9c commit 43ba79e

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

Firmware/RTK_Surveyor/Base.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ bool configureUbloxModuleBase()
3434
}
3535
}
3636

37+
#define OUTPUT_SETTING 14
38+
39+
//Turn on RTCM so that we can harvest RTCM over I2C and send out over WiFi
40+
//This is easier than parsing over UART because the library handles the frame detection
41+
getPortSettings(COM_PORT_I2C); //Load the settingPayload with this port's settings
42+
if (settingPayload[OUTPUT_SETTING] != (COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3))
43+
response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); //Set the I2C port to output UBX (config), and RTCM3 (casting)
44+
//response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3); //Not a valid state. Goes to UBX+NMEA+RTCM3 -
45+
3746
//In base mode the Surveyor should output RTCM over UART2 and I2C ports:
3847
//(Primary) UART2 in case the Surveyor is connected via radio to rover
3948
//(Optional) I2C in case user wants base to connect to WiFi and NTRIP Serve to Caster

Firmware/RTK_Surveyor/Rover.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ bool configureUbloxModuleRover()
2424
Serial.println(F("setDynamicModel failed"));
2525
}
2626

27+
#define OUTPUT_SETTING 14
28+
29+
//Turn off all traffic except UBX to reduce I2C bus errors and ESP32 resets as much as possible
30+
getPortSettings(COM_PORT_I2C); //Load the settingPayload with this port's settings
31+
if (settingPayload[OUTPUT_SETTING] != (COM_TYPE_UBX))
32+
response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX); //Set the I2C port to output UBX (config)
33+
//response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3); //Not a valid state. Goes to UBX+I2C+ RTCM3 - Set the I2C port to output UBX (config), and RTCM3 (casting)
34+
2735
//RTCM is only available on ZED-F9P modules
2836
if (zedModuleType == PLATFORM_F9P)
2937
{

Firmware/RTK_Surveyor/System.ino

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,6 @@ bool configureUbloxModule()
196196
if (settingPayload[INPUT_SETTING] != COM_TYPE_RTCM3)
197197
response &= i2cGNSS.setPortInput(COM_PORT_UART2, COM_TYPE_RTCM3); //Set the UART2 to input RTCM
198198

199-
//Turn on RTCM over I2C port so that we can harvest RTCM over I2C and send out over WiFi
200-
//This is easier than parsing over UART because the library handles the frame detection
201-
getPortSettings(COM_PORT_I2C); //Load the settingPayload with this port's settings
202-
if (settingPayload[OUTPUT_SETTING] != (COM_TYPE_UBX))
203-
response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX); //Set the I2C port to output UBX (config)
204-
//response &= i2cGNSS.setPortOutput(COM_PORT_I2C, COM_TYPE_UBX | COM_TYPE_RTCM3); //Not a valid state. Goes to UBX+I2C+ RTCM3 - Set the I2C port to output UBX (config), and RTCM3 (casting)
205-
206199
if (settingPayload[INPUT_SETTING] != COM_TYPE_UBX)
207200
response &= i2cGNSS.setPortInput(COM_PORT_I2C, COM_TYPE_UBX); //Set the I2C port to input UBX only
208201

0 commit comments

Comments
 (0)