Skip to content

Commit 204fb9b

Browse files
committed
Allow RC firmware
Fix #393
1 parent 2442fff commit 204fb9b

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,6 @@ bool GNSS_LG290P::enableRTCMBase()
551551
bool response = true;
552552
bool enableMSM = false; // Goes true if we need to enable MSM output reporting
553553

554-
Serial.println("\r\n Enabling RTCM");
555-
556554
for (int messageNumber = 0; messageNumber < MAX_LG290P_RTCM_MSG; messageNumber++)
557555
{
558556
// Setting RTCM-1005 must have only the rate

Firmware/RTK_Everywhere/menuFirmware.ino

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,9 @@ bool otaCheckVersion(char *versionAvailable, uint8_t versionAvailableLength)
461461
// Call getVersion after original inquiry
462462
String otaVersion = ota.GetVersion();
463463
otaVersion.toCharArray(versionAvailable, versionAvailableLength);
464+
465+
if (settings.debugFirmwareUpdate)
466+
systemPrintf("Reported version available: %s\r\n", versionAvailable);
464467
}
465468
else if (response == ESP32OTAPull::HTTP_FAILED)
466469
{
@@ -809,7 +812,9 @@ void otaUpdateStop()
809812
if (otaState != OTA_STATE_OFF)
810813
{
811814
// Stop network
812-
systemPrintln("Firmware update releasing network request");
815+
if (settings.debugFirmwareUpdate)
816+
systemPrintln("Firmware update releasing network request");
817+
813818
online.otaFirmwareUpdate = false;
814819

815820
otaRequestFirmwareUpdate = false; // Let the network know we no longer need it
@@ -882,34 +887,36 @@ void otaUpdate()
882887
if (settings.debugFirmwareUpdate)
883888
systemPrintln("Firmware update checking SparkFun released firmware version");
884889

885-
// Only update to production firmware, disable release candidates
886-
enableRCFirmware = 0;
890+
// If we are using auto updates, only update to production firmware, disable release candidates
891+
if (settings.enableAutoFirmwareUpdate)
892+
enableRCFirmware = 0;
887893

888894
// Get firmware version from server
889895
otaReportedVersion[0] = 0;
890896
if (otaCheckVersion(otaReportedVersion, sizeof(otaReportedVersion)))
891897
{
892-
// If we are doing just a version check, set version number, turn off network request and stop machine
893-
if (otaRequestFirmwareVersionCheck == true)
894-
{
895-
otaRequestFirmwareVersionCheck = false;
896-
otaUpdateStop();
897-
return;
898-
}
899-
900898
// Create a string of the unit's current firmware version
901899
char currentVersion[21];
902900
getFirmwareVersion(currentVersion, sizeof(currentVersion), enableRCFirmware);
903901

904-
// If we are doing a scheduled automatic update or a manually requested update, continue through the
905-
// state machine
906-
907902
// We got a version number, now determine if it's newer or not
903+
// Allow update if locally compiled developer version
908904
if ((isReportedVersionNewer(otaReportedVersion, &currentVersion[1]) == true) ||
909905
(currentVersion[0] == 'd') || (FIRMWARE_VERSION_MAJOR == 99))
910906
{
911-
// Allow update if locally compiled developer version
912907
systemPrintf("Version Check: New firmware version available: %s\r\n", otaReportedVersion);
908+
909+
// If we are doing just a version check, set version number, turn off network request and stop
910+
// machine
911+
if (otaRequestFirmwareVersionCheck == true)
912+
{
913+
otaRequestFirmwareVersionCheck = false;
914+
otaUpdateStop();
915+
return;
916+
}
917+
918+
// If we are doing a scheduled automatic update or a manually requested update, continue through the
919+
// state machine
913920
otaSetState(OTA_STATE_UPDATE_FIRMWARE);
914921
}
915922
else

0 commit comments

Comments
 (0)