Merge branch 'feat/ota-branch-switch' into merge/ota-branch-into-observer-firmware-dev
# Conflicts: # examples/simple_repeater/MyMesh.cpp
This commit is contained in:
commit
ebd562e2c8
8 files changed
+162
-8
No files matched your search
@@ -1821,7 +1821,7 @@ void MyMesh::loop() {
|
||||
setBridgeState(true);
|
||||
otaAlert(bridge->isRunning() ? "OTA aborted: MQTT stop unclean, bridge resumed"
|
||||
: "OTA aborted: MQTT stop unproven, bridge resumes when it completes");
|
||||
} else if (!_cli.getBoard()->otaFromManifest(ota_resolve_base(_prefs.ota_channel), getFirmwareVer(), false, ota_reply)) {
|
||||
} else if (!_cli.getBoard()->otaFromManifest(ota_resolve_base(_ota_update_channel), getFirmwareVer(), false, ota_reply)) {
|
||||
Serial.print("OTA: aborted, resuming bridge - "); Serial.println(ota_reply);
|
||||
char ota_alert_msg[160];
|
||||
snprintf(ota_alert_msg, sizeof(ota_alert_msg), "OTA aborted: %s", ota_reply);
|
||||
|
||||
@@ -126,6 +126,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks
|
||||
CayenneLPP telemetry;
|
||||
unsigned long set_radio_at, revert_radio_at;
|
||||
unsigned long _ota_update_at = 0; // deferred `ota update` fire time (0 = none scheduled)
|
||||
uint8_t _ota_update_channel = 0; // channel `ota update` checked; a later `ota branch` cannot retarget it
|
||||
float pending_freq;
|
||||
float pending_bw;
|
||||
uint8_t pending_sf;
|
||||
@@ -480,6 +481,7 @@ public:
|
||||
bool beginDeferredOtaUpdate() override {
|
||||
_ota_update_at = millis() + 2500;
|
||||
if (_ota_update_at == 0) _ota_update_at = 1; // 0 means "none"
|
||||
_ota_update_channel = _prefs.ota_channel;
|
||||
#if defined(WITH_MQTT_BRIDGE)
|
||||
// Broadcast START now, while the loop still runs (the 2.5 s reply window):
|
||||
// the deferred flash blocks the loop and, on success, reboots — so a start
|
||||
|
||||
@@ -1690,7 +1690,7 @@ void MyMesh::loop() {
|
||||
}
|
||||
|
||||
char ota_reply[160];
|
||||
if (may_flash && !_cli.getBoard()->otaFromManifest(ota_resolve_base(_prefs.ota_channel), getFirmwareVer(), false, ota_reply)) {
|
||||
if (may_flash && !_cli.getBoard()->otaFromManifest(ota_resolve_base(_ota_update_channel), getFirmwareVer(), false, ota_reply)) {
|
||||
Serial.print("OTA: aborted - "); Serial.println(ota_reply);
|
||||
may_flash = false;
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks
|
||||
TransportKey default_scope;
|
||||
unsigned long set_radio_at, revert_radio_at;
|
||||
unsigned long _ota_update_at = 0; // deferred `ota update` fire time (0 = none scheduled)
|
||||
uint8_t _ota_update_channel = 0; // channel `ota update` checked; a later `ota branch` cannot retarget it
|
||||
float pending_freq;
|
||||
float pending_bw;
|
||||
uint8_t pending_sf;
|
||||
@@ -476,6 +477,7 @@ public:
|
||||
bool beginDeferredOtaUpdate() override {
|
||||
_ota_update_at = millis() + 2500;
|
||||
if (_ota_update_at == 0) _ota_update_at = 1; // 0 means "none"
|
||||
_ota_update_channel = _prefs.ota_channel;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user