Skip to content

Commit 6de54d8

Browse files
authored
Merge pull request #688 from sparkfun/PostcardSurveyBaseFail
Fix Survey in for LG290P v<=3.0
2 parents 998cdc7 + e89d36e commit 6de54d8

File tree

4 files changed

+27
-20
lines changed

4 files changed

+27
-20
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ void mqttClientValidateTables() {}
154154
void httpClientPrintStatus() {}
155155
void httpClientUpdate() {}
156156
void httpClientValidateTables() {}
157-
bool pointPerfectServiceUsesKeys() {return(false);}
158157

159158
#endif // COMPILE_HTTP_CLIENT
160159

@@ -175,6 +174,7 @@ void stopWebServer() {}
175174
void webServerStop() {}
176175
void webServerUpdate() {}
177176
void webServerVerifyTables() {}
177+
void wifiSettingsClone() {}
178178

179179
#endif // COMPILE_AP
180180

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,17 @@ bool GNSS_LG290P::configureBase()
389389
return (false);
390390
}
391391

392-
if (settings.gnssConfiguredBase)
392+
// If the device is set to Survey-In, we must allow the device to be configured.
393+
// Otherwise PQMTEPE (estimated position error) is never populated, so the survey
394+
// never starts (Waiting for Horz Accuracy < 2.00m...)
395+
if (settings.fixedBase == false) //Not a fixed base = Survey-in
393396
{
394-
if (settings.debugGnss)
395-
systemPrintln("Skipping LG290P Base configuration");
396-
return true;
397+
if (settings.gnssConfiguredBase)
398+
{
399+
if (settings.debugGnss)
400+
systemPrintln("Skipping LG290P Base configuration");
401+
return true;
402+
}
397403
}
398404

399405
bool response = true;
@@ -630,12 +636,10 @@ bool GNSS_LG290P::enableNMEA()
630636
if (lg290pFirmwareVersion >= 4)
631637
// Enable this message, at this rate, on this port
632638
response &=
633-
_lg290p->setMessageRateOnPort(lgMessagesNMEA[messageNumber].msgTextName,
634-
msgRate, portNumber);
639+
_lg290p->setMessageRateOnPort(lgMessagesNMEA[messageNumber].msgTextName, msgRate, portNumber);
635640
else
636641
// Enable this message, at this rate
637-
response &= _lg290p->setMessageRate(lgMessagesNMEA[messageNumber].msgTextName,
638-
msgRate);
642+
response &= _lg290p->setMessageRate(lgMessagesNMEA[messageNumber].msgTextName, msgRate);
639643
if (response == false && settings.debugGnss)
640644
systemPrintf("Enable NMEA failed at messageNumber %d %s.\r\n", messageNumber,
641645
lgMessagesNMEA[messageNumber].msgTextName);
@@ -2015,7 +2019,7 @@ bool GNSS_LG290P::setElevation(uint8_t elevationDegrees)
20152019
{
20162020
// Present on >= v05
20172021
if (lg290pFirmwareVersion >= 5)
2018-
return(_lg290p->setElevationAngle(elevationDegrees));
2022+
return (_lg290p->setElevationAngle(elevationDegrees));
20192023

20202024
// Because we call this during module setup we rely on a positive result
20212025
return true;
@@ -2049,7 +2053,7 @@ bool GNSS_LG290P::setMinCnoRadio(uint8_t cnoValue)
20492053
{
20502054
// Present on >= v05
20512055
if (lg290pFirmwareVersion >= 5)
2052-
return(_lg290p->setCNR((float)cnoValue)); // 0.0 to 99.0
2056+
return (_lg290p->setCNR((float)cnoValue)); // 0.0 to 99.0
20532057

20542058
// Because we call this during module setup we rely on a positive result
20552059
return true;

Firmware/RTK_Everywhere/HTTP_Client.ino

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ HTTP_Client.ino
1010
1111
------------------------------------------------------------------------------*/
1212

13+
ZtpResponse ztpResponse =
14+
ZTP_NOT_STARTED; // Used in menuPP. This is the overall result of the ZTP process of testing multiple tokens
15+
1316
#ifdef COMPILE_HTTP_CLIENT
1417

1518
//----------------------------------------
@@ -46,9 +49,6 @@ const char *const httpClientStateName[] = {
4649

4750
const int httpClientStateNameEntries = sizeof(httpClientStateName) / sizeof(httpClientStateName[0]);
4851

49-
ZtpResponse ztpResponse =
50-
ZTP_NOT_STARTED; // Used in menuPP. This is the overall result of the ZTP process of testing multiple tokens
51-
5252
//----------------------------------------
5353
// Locals
5454
//----------------------------------------
@@ -527,10 +527,12 @@ void httpClientUpdate()
527527
// If this is the first time this device has connected to ThingStream, they
528528
// will not be present and we need to retry
529529
// httpClientConnectLimitReached will prevent excessive retries
530-
if (((const char *)((*jsonZtp)["certificate"]) == nullptr) || ((const char *)((*jsonZtp)["privateKey"]) == nullptr))
530+
if (((const char *)((*jsonZtp)["certificate"]) == nullptr) ||
531+
((const char *)((*jsonZtp)["privateKey"]) == nullptr))
531532
{
532533
systemPrintln("ERROR - certificate or privateKey not found!\r\n");
533-
httpClientRestart(); // Try again - allow time for ThingStream to finish activating the device on plan
534+
httpClientRestart(); // Try again - allow time for ThingStream to finish activating the device
535+
// on plan
534536
break;
535537
}
536538

@@ -561,8 +563,8 @@ void httpClientUpdate()
561563
// Note: from the ZTP documentation:
562564
// ["subscriptions"][0] will contain the key distribution topic
563565
// But, assuming the key distribution topic is always ["subscriptions"][0] is potentially
564-
// brittle. It is safer to check the "description" contains "key distribution topic". If we are on
565-
// an IP-only plan, the path will be /pp/ubx/0236/ip If we are on a L-Band-only or L-Band+IP
566+
// brittle. It is safer to check the "description" contains "key distribution topic". If we are
567+
// on an IP-only plan, the path will be /pp/ubx/0236/ip If we are on a L-Band-only or L-Band+IP
566568
// plan, the path will be /pp/ubx/0236/Lb These 0236 key distribution topics provide the keys in
567569
// UBX format, ready to be pushed to a ZED. There are also /pp/key/ip and /pp/key/Lb topics
568570
// which provide the keys in JSON format - but we don't use those.
@@ -634,7 +636,8 @@ void httpClientUpdate()
634636
if ((const char *)((*jsonZtp)["rtcmCredentials"]["endpoint"]) == nullptr)
635637
{
636638
systemPrintln("ERROR - rtcmCredentials not found!\r\n");
637-
httpClientRestart(); // Try again - allow time for ThingStream to finish activating the device on plan
639+
httpClientRestart(); // Try again - allow time for ThingStream to finish activating the device
640+
// on plan
638641
break;
639642
}
640643

Firmware/RTK_Everywhere/support.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ void verifyTables()
726726
correctionVerifyTables();
727727
webServerVerifyTables();
728728
pointPerfectVerifyTables();
729-
wifi.verifyTables();
729+
wifiVerifyTables();
730730

731731
if (CORR_NUM >= (int)('x' - 'a'))
732732
reportFatalError("Too many correction sources");

0 commit comments

Comments
 (0)