@@ -516,16 +516,19 @@ bool GNSS_ZED::configureBase()
516516
517517 // Assume we are changing from Rover to Base, request any additional config changes
518518
519- gnssConfigure (GNSS_CONFIG_FIX_RATE);
520- gnssConfigure (GNSS_CONFIG_MESSAGE_RATE_NMEA);
521- gnssConfigure (GNSS_CONFIG_MESSAGE_RATE_RTCM_BASE);
522-
523519 bool response = true ;
524520
525521 if (settings.fixedBase == false )
526522 {
527523 // If we are doing a Survey-In (temporary) style Base, change to Rover Mode so our location can settle
524+ // Base config resumes at the end of startSurveyIn()
528525 response &= _zed->setVal8 (UBLOX_CFG_TMODE_MODE, 0 ); // Change to Rover Mode
526+ gnssConfigure (GNSS_CONFIG_FIX_RATE);
527+ gnssConfigure (GNSS_CONFIG_MESSAGE_RATE_RTCM_ROVER);
528+ }
529+ else
530+ {
531+ // If we are doing a Fixed Base, config occurs in fixedBaseStart()
529532 }
530533
531534 if (response == false )
@@ -633,7 +636,6 @@ bool GNSS_ZED::configureRover()
633636 bool response = true ;
634637
635638 gnssConfigure (GNSS_CONFIG_FIX_RATE);
636- gnssConfigure (GNSS_CONFIG_MESSAGE_RATE_NMEA);
637639 gnssConfigure (GNSS_CONFIG_MESSAGE_RATE_RTCM_ROVER);
638640
639641 response &= _zed->setVal8 (UBLOX_CFG_TMODE_MODE, 0 ); // Switch to Rover mode
@@ -824,6 +826,10 @@ bool GNSS_ZED::fixedBaseStart()
824826 response &= _zed->sendCfgValset ();
825827 }
826828
829+ // Now that the module is set to base mode, complete the base config.
830+ gnssConfigure (GNSS_CONFIG_FIX_RATE);
831+ gnssConfigure (GNSS_CONFIG_MESSAGE_RATE_RTCM_BASE);
832+
827833 return (response);
828834}
829835
@@ -1210,7 +1216,7 @@ int GNSS_ZED::getSurveyInObservationTime()
12101216 if (online.gnss == false )
12111217 return (0 );
12121218
1213- if (gnssConfigureComplete () == false )
1219+ if (gnssConfigureComplete () == false )
12141220 return (0 );
12151221
12161222 // Use a local static so we don't have to request these values multiple times (ZED takes many ms to respond
@@ -2228,18 +2234,18 @@ bool GNSS_ZED::setMessagesNMEA()
22282234 measurementFrequency = 0.2 ; // 0.2Hz * 5 = 1 measurement every 5 seconds
22292235 if (settings.debugGnssConfig )
22302236 systemPrintf (" Adjusting GGA setting to %f\r\n " , measurementFrequency);
2231- _zed->setVal8 (UBLOX_CFG_MSGOUT_NMEA_ID_GGA_I2C , measurementFrequency,
2232- VAL_LAYER_ALL); // Enable GGA over I2C . Tell the module to output GGA every second
2237+ response &= _zed->setVal8 (UBLOX_CFG_MSGOUT_NMEA_ID_GGA_UART1 , measurementFrequency,
2238+ VAL_LAYER_ALL); // Enable GGA over UART1 . Tell the module to output GGA every second
22332239 }
22342240 }
22352241
22362242 // Configure the callback for GGA as needed
22372243 if (settings.enableNtripClient == true && settings.ntripClient_TransmitGGA == true )
2238- _zed->setNMEAGPGGAcallbackPtr (&zedPushGPGGA);
2244+ response &= _zed->setNMEAGPGGAcallbackPtr (&zedPushGPGGA);
22392245 else
2240- _zed->setNMEAGPGGAcallbackPtr (nullptr );
2246+ response &= _zed->setNMEAGPGGAcallbackPtr (nullptr );
22412247
2242- return (success );
2248+ return (response );
22432249}
22442250
22452251// ----------------------------------------
@@ -2382,8 +2388,13 @@ bool GNSS_ZED::setRate(double secondsBetweenSolutions)
23822388 if (online.gnss == false )
23832389 return (false );
23842390
2385- if (gnss->gnssInBaseSurveyInMode () || gnss->gnssInBaseFixedMode ())
2386- secondsBetweenSolutions = 1 ; // In Base mode we force 1Hz
2391+ // In Base mode we force 1Hz, and avoid overwriting the setting
2392+ bool baseOverride = false ;
2393+ if (gnssInBaseSurveyInMode () || gnssInBaseFixedMode ())
2394+ {
2395+ baseOverride = true ;
2396+ secondsBetweenSolutions = 1 ;
2397+ }
23872398
23882399 // If we have more than an hour between readings, increase mesaurementRate to near max of 65,535
23892400 if (secondsBetweenSolutions > 3600.0 )
@@ -2435,7 +2446,8 @@ bool GNSS_ZED::setRate(double secondsBetweenSolutions)
24352446 // If we successfully set rates, only then record to settings
24362447 if (response)
24372448 {
2438- settings.measurementRateMs = secondsBetweenSolutions * 1000 ;
2449+ if (baseOverride == false )
2450+ settings.measurementRateMs = secondsBetweenSolutions * 1000 ;
24392451 }
24402452 else
24412453 {
@@ -2732,6 +2744,13 @@ bool GNSS_ZED::surveyInStart()
27322744 return (false ); // Reset of survey failed
27332745 }
27342746
2747+ // The ZED-F9P starts a Survey-in in Rover mode to allow the location fix to settle.
2748+ // Once settle is complete, the survey starts.
2749+ // Here we change the fix rate and enable RTCM messages for base mode.
2750+ // Essentially completing the Base configuration.
2751+ gnssConfigure (GNSS_CONFIG_FIX_RATE);
2752+ gnssConfigure (GNSS_CONFIG_MESSAGE_RATE_RTCM_BASE);
2753+
27352754 return (true );
27362755}
27372756
0 commit comments