Skip to content

Commit abbaa41

Browse files
committed
Correctly handle L-Band restart if RTK Fix is lost
1 parent 97e3482 commit abbaa41

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ bool externalPowerConnected = false; // Goes true when a high voltage is seen on
678678
// This is to allow SparkFun_WebServer_ESP32_W5500 to have _exclusive_ access to WiFi, SPI and Interrupts.
679679
bool configureViaEthernet = false;
680680

681-
unsigned long lbandStartTimer = 0; // Monitors the ZED during L-Band reception if a fix takes too long
681+
unsigned long lbandTimeFloatStarted = 0; // Monitors the ZED during L-Band reception if a fix takes too long
682682
int lbandRestarts = 0;
683683
unsigned long lbandTimeToFix = 0;
684684
unsigned long lbandLastReport = 0;

Firmware/RTK_Surveyor/States.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ void updateSystemState()
152152
updateAccuracyLEDs();
153153

154154
if (carrSoln == 1) // RTK Float
155+
{
156+
lbandTimeFloatStarted = millis(); //Restart timer for L-Band. Don't immediately reset ZED to achieve fix.
155157
changeState(STATE_ROVER_RTK_FLOAT);
158+
}
156159
else if (carrSoln == 2) // RTK Fix
157160
changeState(STATE_ROVER_RTK_FIX);
158161
}
@@ -174,7 +177,10 @@ void updateSystemState()
174177
if (carrSoln == 0) // No RTK
175178
changeState(STATE_ROVER_FIX);
176179
if (carrSoln == 1) // RTK Float
180+
{
181+
lbandTimeFloatStarted = millis(); //Restart timer for L-Band. Don't immediately reset ZED to achieve fix.
177182
changeState(STATE_ROVER_RTK_FLOAT);
183+
}
178184
}
179185
break;
180186

Firmware/RTK_Surveyor/menuPP.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,6 @@ void beginLBand()
10381038

10391039
i2cLBand.softwareResetGNSSOnly(); // Do a restart
10401040

1041-
lbandStartTimer = millis();
1042-
10431041
log_d("L-Band online");
10441042

10451043
online.lband = true;
@@ -1224,16 +1222,17 @@ void updateLBand()
12241222
{
12251223
lbandLastReport = millis();
12261224
log_d("ZED restarts: %d Time remaining before L-Band forced restart: %ds", lbandRestarts,
1227-
settings.lbandFixTimeout_seconds - ((millis() - lbandStartTimer) / 1000));
1225+
settings.lbandFixTimeout_seconds - ((millis() - lbandTimeFloatStarted) / 1000));
12281226
}
12291227

12301228
if (settings.lbandFixTimeout_seconds > 0)
12311229
{
1232-
if ((millis() - lbandStartTimer) > (settings.lbandFixTimeout_seconds * 1000L))
1230+
if ((millis() - lbandTimeFloatStarted) > (settings.lbandFixTimeout_seconds * 1000L))
12331231
{
1234-
lbandStartTimer = millis(); // Reset timer
12351232
lbandRestarts++;
12361233

1234+
lbandTimeFloatStarted = millis(); //Restart timer for L-Band. Don't immediately reset ZED to achieve fix.
1235+
12371236
// Hotstart ZED to try to get RTK lock
12381237
theGNSS.softwareResetGNSSOnly();
12391238

0 commit comments

Comments
 (0)