void setup()
{
Serial.begin(115200);
while(!Serial.available());//Wait until we see the serial port
Serial.println(F("NTRIP testing"));
//Wire.begin(); //Start I2C
Serial1.begin(115200);
while (myGNSS.begin(Serial1) == false) //Connect to the Ublox module using Serial port
{
Serial.println(F("u-blox GPS not detected at Serial1. Please check wiring."));
delay(2000);
}
Serial.println(F("u-blox module connected"));
uint8_t ok = myGNSS.setUART1Output(COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3);//setI2COutput(COM_TYPE_UBX | COM_TYPE_NMEA);//Set the UART1 port to output both NMEA and UBX messages
if (ok) Serial.println(F("setUART1Output"));
if (ok) ok = myGNSS.setPortInput(COM_PORT_UART1 , COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3); //COM_PORT_I2C//Be sure RTCM3 input is enabled. UBX + RTCM3 is not a valid state.
if (ok) Serial.println(F("setPortInput"));
if (ok) ok = myGNSS.setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED); // Set the differential mode - ambiguities are fixed whenever possible
if (ok) Serial.println(F("setDGNSSConfiguration"));
if (ok) ok = myGNSS.setNavigationFrequency(1); //Set output in Hz.
if (ok) Serial.println(F("setNavigationFrequency"));
// Set the Main Talker ID to "GP". The NMEA GGA messages will be GPGGA instead of GNGGA
if (ok) ok = myGNSS.setMainTalkerID(SFE_UBLOX_MAIN_TALKER_ID_GP);
if (ok) Serial.println(F("setMainTalkerID"));
if (ok) ok = myGNSS.setNMEAGPGGAcallbackPtr(&pushGPGGA); // Set up the callback for GPGGA
if (ok) Serial.println(F("setNMEAGPGGAcallbackPtr"));
if (ok) ok = myGNSS.enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_UART1, 10); //COM_PORT_I2C Tell the module to output GGA every 10 seconds
if (ok) Serial.println(F("enableNMEAMessage"));
#ifdef RTCMCheckOK
if (ok) ok = myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_UART1, 1); // UBLOX_CFG_MSGOUT_UBX_RXM_COR_I2C//Enable UBX-RXM-COR messages on I2C
if (ok) Serial.println(F("setVal8"));
#endif
if (ok) ok = myGNSS.setAutoPVTcallbackPtr(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata so we can watch the carrier solution go to fixed
if (ok) Serial.println(F("setAutoPVTcallbackPtr"));
#ifdef RTCMCheckOK
if (ok) ok = myGNSS.setRXMCORcallbackPtr(&printRXMCOR); // Print the contents of UBX-RXM-COR messages so we can check if the PMP data is being decrypted successfully
if (ok) Serial.println(F("setRXMCORcallbackPtr"));
#endif
//myGNSS.saveConfiguration(VAL_CFG_SUBSEC_IOPORT | VAL_CFG_SUBSEC_MSGCONF); //Optional: Save the ioPort and message settings to NVM
Serial.print(F("GNSS: configuration "));
Serial.println(OK(ok));
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
So I am checking to make sure every configuration is being accepted by the F9R.
When RTCMCheckOK is defined the following is failing:
if (ok) ok = myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_UART1, 1); // UBLOX_CFG_MSGOUT_UBX_RXM_COR_I2C//Enable UBX-RXM-COR messages on I2C
if (ok) Serial.println(F("setVal8"));
I know this because the “setVal8” is not being printed but “enableNMEAMessage” is.
If RTCMCheckOK is not defined then all the enable conditions are set and “GNSS: configuration → OK” is printed.
Any thoughts as to why “myGNSS.setVal8(UBLOX_CFG_MSGOUT_UBX_RXM_COR_UART1, 1)” is failing?
Thanks
Bruce