Skip to content

Commit 3f64f8f

Browse files
committed
Transmit OTA version to web config
1 parent d7ef955 commit 3f64f8f

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

Firmware/RTK_Everywhere/States.ino

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void stateUpdate()
101101
if (gnss->configureRover() == false)
102102
{
103103
settings.updateGNSSSettings = true; // On the next boot, update the GNSS receiver
104-
recordSystemSettings(); // Record this state for next POR
104+
recordSystemSettings(); // Record this state for next POR
105105

106106
systemPrintln("Rover config failed");
107107
displayRoverFail(1000);
@@ -234,7 +234,7 @@ void stateUpdate()
234234
else
235235
{
236236
settings.updateGNSSSettings = true; // On the next boot, update the GNSS receiver
237-
recordSystemSettings(); // Record this state for next POR
237+
recordSystemSettings(); // Record this state for next POR
238238

239239
displayBaseFail(1000);
240240
}
@@ -444,9 +444,8 @@ void stateUpdate()
444444
systemPrintln();
445445

446446
parseIncomingSettings();
447-
settings.updateGNSSSettings =
448-
true; // When this profile is loaded next, force system to update GNSS settings.
449-
recordSystemSettings(); // Record these settings to unit
447+
settings.updateGNSSSettings = true; // New settings; update GNSS receiver on next boot
448+
recordSystemSettings(); // Record these settings to unit
450449

451450
// Clear buffer
452451
incomingSettingsSpot = 0;
@@ -458,18 +457,32 @@ void stateUpdate()
458457

459458
#ifdef COMPILE_WIFI
460459
#ifdef COMPILE_AP
461-
// Dynamically update the coordinates on the AP page
460+
// Handle dynamic requests coming from web config page
462461
if (websocketConnected == true)
463462
{
463+
// Update the coordinates on the AP page
464464
if (millis() - lastDynamicDataUpdate > 1000)
465465
{
466466
lastDynamicDataUpdate = millis();
467467
createDynamicDataString(settingsCSV);
468468

469-
// log_d("Sending coordinates: %s", settingsCSV);
470469
sendStringToWebsocket(settingsCSV);
471470
}
471+
472+
// If a firmware version was requested, and obtained, report it back to the web page
473+
if (strlen(otaReportedVersion) > 0)
474+
{
475+
if(settings.debugWebConfig)
476+
systemPrintln("Webconfig: Reporting firmware version");
477+
478+
createFirmwareVersionString(settingsCSV);
479+
480+
sendStringToWebsocket(settingsCSV);
481+
482+
otaReportedVersion[0] = '\0'; //Zero out the reported version
483+
}
472484
}
485+
473486
#endif // COMPILE_AP
474487
#endif // COMPILE_WIFI
475488
}

Firmware/RTK_Everywhere/Tasks.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,6 @@ void buttonCheckTask(void *e)
15791579
// If this platform doesn't have a display, then register the button tap
15801580
if (systemState == STATE_DISPLAY_SETUP || present.display_type == DISPLAY_MAX_NONE)
15811581
{
1582-
Serial.println("Double tap");
15831582
doubleTap = true;
15841583
singleTap = false;
15851584
previousButtonRelease = 0;

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ bool wifiConnect(unsigned long timeout, bool useAPSTAMode, bool *wasInAPmode)
160160

161161
displayWiFiConnect();
162162

163-
// If otaUpdate or otaCheckVersion wants to use WIFI_AP_STA mode
163+
// If otaUpdate wants to use WIFI_AP_STA mode
164164
if (useAPSTAMode && (wasInAPmode != nullptr))
165165
{
166166
*wasInAPmode = (WiFi.getMode() == WIFI_AP);

0 commit comments

Comments
 (0)