Fix OTA resume, CLI identity, radio persistence, and network sessions
Distinguish OTA read failures from missing blocks and select unique raw-flash checkpoints by MID and target. Keep deferred CLI requests and replies bound to immutable command identity and full authenticated keys. Gate radio mutations on their exact reply delivery, recover coding-rate restoration, and roll back failed Companion preference writes. Preserve accepted low duty cycles across reboot. Retain partial network writes, cancel displaced client operations, and reject malformed or stalled framed input. Add regression and CI coverage, and size-optimize the RAK4631 Ethernet build without dropping features.
This commit is contained in:
1 parent
931cb4928f
commit
a88ced23b6
64 files changed
+3504
-369
No files matched your search
@@ -24,6 +24,15 @@ The first word of a command is case-insensitive, so `set`, `Set`, and `SET`
|
||||
are equivalent, as are `get`, `Get`, and the other command verbs. The case of
|
||||
arguments such as node names, passwords, and keys is left unchanged.
|
||||
|
||||
Repeater retries carrying the same logical request ID and original command
|
||||
bytes reuse the cached result, even when command parsing trims whitespace or
|
||||
splits arguments in place. Changing the timestamp alone does not execute the
|
||||
operation again. Normal authentication and stale-request checks still apply.
|
||||
Deferred commands and host-service replies remain bound to the full authenticated
|
||||
public key, even if permission changes move ACL entries. Removing or revoking
|
||||
the requester cancels pending execution; a running `setperm` can still acknowledge
|
||||
its own completed change to the original sender.
|
||||
|
||||
Use the site search or your browser's Find command with everyday wording such
|
||||
as **tx retries**, **retry attempts**, **serial logging**, or **tx power**.
|
||||
**Search terms** below are alternative wording to help find a command, not
|
||||
@@ -1216,6 +1225,10 @@ settings use a safe effective power without replacing the saved preference.
|
||||
|
||||
**Notes:**
|
||||
- `tempradio` is not saved to preferences and clears on reboot.
|
||||
- On repeaters, remote `tempradio` and `normalradio` wait for their exact reply
|
||||
copies to finish, with at least one transmitted. This also covers the `set`
|
||||
alias, case-insensitive verbs, and client correlation prefixes. Failed replies
|
||||
cancel an unconfirmed temporary handoff; hard lease expiry still takes priority.
|
||||
- `normalradio` cancels pending and active temporary-radio windows, then
|
||||
restores the saved radio tuple after its CLI reply has drained on the
|
||||
current channel. Permanent `radioat` entries are not removed.
|
||||
|
||||
@@ -17,6 +17,11 @@ The full Companion is deliberately not a LoRa OTA destination: it has no
|
||||
firmware staging store, refuses `ota install`, and never advertises its own
|
||||
firmware as an mOTA image.
|
||||
|
||||
Preference changes through the Companion protocol, WebConfig, or USB terminal
|
||||
report a storage error if saving fails, and restore their previous values.
|
||||
Settings that also change GPS or radio power-saving state restore that state;
|
||||
a busy radio rollback remains pending for recovery instead of reporting success.
|
||||
|
||||
| Capability | ESP32 full | nRF52 full |
|
||||
| --- | --- | --- |
|
||||
| USB Binary Companion | Yes | Yes |
|
||||
@@ -399,10 +404,25 @@ message transmissions are not canceled. Queued frames are retained, not a
|
||||
resumable command session, and IP matching is not authentication. Turning WiFi
|
||||
off clears both queues. Stored message history is unaffected.
|
||||
|
||||
Ethernet also retains complete queued frames for the same IP. Unlike WiFi, it
|
||||
has no spare backlog buffer: a different IP cancels the old owner's pending
|
||||
operations and discards its queued frames before the new socket is exposed.
|
||||
This keeps Ethernet's existing four-frame memory limit. On both transports, a
|
||||
live same-IP replacement preserves pending operations; an observed disconnect,
|
||||
disabled transport, or rejected input cancels them. Already queued frames can
|
||||
still be replayed on a same-IP reconnect, but canceled operations are not resumed.
|
||||
|
||||
Partial TCP writes retain the unsent bytes without interleaving later frames.
|
||||
After a reconnect, an incomplete frame restarts from its header; the new TCP
|
||||
connection must not receive only the old connection's trailing bytes.
|
||||
|
||||
Binary WiFi/Ethernet frames must declare 1–176 payload bytes. Illegal lengths
|
||||
close the connection immediately, without waiting for the announced body or
|
||||
executing a truncated command. An incomplete binary header or payload has a
|
||||
five-second deadline once reception starts; reconnect to send a fresh frame.
|
||||
Ethernet raw-line terminal input has no typing deadline, but an overlong line
|
||||
also closes the connection instead of executing its prefix.
|
||||
|
||||
USB Binary output is queued as complete length-prefixed frames. Temporary CDC
|
||||
or UART backpressure pauses the contact stream; a frame may drain through a
|
||||
smaller hardware FIFO in ordered chunks, but its remainder is retained and no
|
||||
|
||||
@@ -399,7 +399,7 @@ There is no separate availability structure. **Block `i` is present <=> `leaves[
|
||||
reopenable store. A hybrid nRF52 transfer is the deliberate exception: its SRAM-backed payload suffix is
|
||||
volatile, so the application refuses to adopt that staged header instead of rebuilding partial progress.
|
||||
|
||||
**Resume (`OtaManager::resumeStaged` + `OtaStore::checkpoint`/`reopen`):** an interrupted fetch resumes from
|
||||
**Resume (`OtaManager::resumeStaged` + `OtaStore::checkpoint`/`reopenFor`):** an interrupted fetch resumes from
|
||||
the staged container after a reboot - re-parse the stored manifest, recompute geometry, count present
|
||||
blocks, continue fetching the holes (or jump straight to COMPLETE). The checkpoint cadence (persist progress
|
||||
every N committed blocks) is runtime-tunable (`ota config checkpoint <N>`, 0 = only finalized containers
|
||||
@@ -410,6 +410,10 @@ package and keeps target `0` as a MID-only wildcard. Stores keep `leaves[]` in R
|
||||
auto-GC, preserving resumable progress. The debug/operator equivalent is `ota dev resume <MID8>`; after a
|
||||
reboot the MID is mandatory, while a no-argument form may only reuse a still-active session MID. It never
|
||||
uses the `nullptr` automatic-adoption path, so a malformed MID or no active MID fails closed.
|
||||
Raw ESP32/nRF52 staging scans every valid header before adoption: address order is not creation order.
|
||||
Explicit resume selects a unique matching MID/target; automatic resume refuses multiple valid headers
|
||||
without erasing them. A leaf-marker read error is never treated as a missing block: reconnectable storage
|
||||
pauses and re-verifies after reconnection, while other storage reports failure and permits an explicit retry.
|
||||
Hybrid nRF52 staging cannot enter this resume path after an application restart, even if its flash prefix
|
||||
still contains metadata; the complete logical container must be fetched again.
|
||||
|
||||
|
||||
@@ -465,6 +465,10 @@ target to match this node and its version to be newer than the running valid End
|
||||
For bring-up/debugging, `ota dev resume <MID8>` performs the same explicit MID-bound re-adoption without
|
||||
starting a new network fetch. After reboot it requires the MID; bare `ota dev resume` is accepted only while
|
||||
an active/requested session MID still exists, and malformed or missing identifiers are rejected.
|
||||
If raw flash contains multiple valid staged headers, automatic resume leaves them untouched rather than
|
||||
guessing which is newest. Specify the intended MID to select its unique checkpoint; ambiguous matches are
|
||||
rejected. Temporary storage read failures no longer consume a download slot indefinitely: host storage
|
||||
pauses for reconnection, while non-reconnectable storage reports a storage error and can be retried.
|
||||
|
||||
Recommended for most people: leave both **off** and update by hand. Use `autoinstall trusted` only once
|
||||
you've added the signer's key (next section) and you trust them to push updates unattended. Automatic
|
||||
|
||||
+15
-2
@@ -59,8 +59,21 @@ on the primary profile by default. Use an OTA-capable build and the usual OTA
|
||||
setup on every participating node; a temporary profile does not add OTA support
|
||||
to firmware built without it.
|
||||
|
||||
New settings take effect after a short reply allowance. Temporary periods and
|
||||
schedules live in RAM and disappear on reboot. Timer expiry also uses monotonic
|
||||
Local settings take effect after a short reply allowance. On repeaters, immediate
|
||||
remote `radio2`/`tempradio2` changes (including `off`) wait until their exact reply
|
||||
copies finish, with at least one successfully transmitted. A reply that cannot
|
||||
be queued or whose copies all fail cancels the change. Queued replies have a
|
||||
five-minute deadline; an already-transmitting copy may finish under the normal
|
||||
radio watchdog. This confirms transmission, not reception by the remote client.
|
||||
|
||||
Permanent remote changes are prepared in an uncommitted file before replying;
|
||||
the saved configuration is replaced only after reply transmission. If that
|
||||
replacement fails, the old channel remains active and the commit retries.
|
||||
Local `get radio2.status` reports this pending state. Roles without the tracked remote
|
||||
reply path require local USB for these immediate secondary-profile changes.
|
||||
|
||||
Temporary periods and schedules live in RAM and disappear on reboot. Waiting
|
||||
for a reply does not extend a temporary lease. Timer expiry also uses monotonic
|
||||
time, so setting the clock backwards cannot extend a temporary session.
|
||||
|
||||
## Repeater, room-server, and sensor replies
|
||||
|
||||
Reference in new issue
Block a user