Add persistent LoRa OTA speed control and harden timing

Add get/set ota.speed and OTA CLI aliases for factors from 0.05 to 3,
defaulting to the existing pace. Persist the setting independently of the
OTA workspace and apply it to OTA packet pacing, relays, discovery and
adverts while retaining the configured airtime budget.

Preserve physical proof/retry allowances, account for both participating
radio profiles, keep optional deadlines armed across millis rollover, and
exclude intentional pacing from observer stale-packet age. Keep local
verification at its normal rate and retain a valid saved speed if backup
recovery cannot finish. Add documentation and CI regression coverage.

Validation: 1,491 native tests and 26 CLI/integration tests passed. Built
ESP32 full repeater, ESP32 full Companion, nRF52 full Companion and STM32
USB Companion successfully, including their memory/size checks.
This commit is contained in:
mikecarper committed 2026-09-15 06:16:29 -07:00
1 parent a07f39c6dd
commit b2f2b5bf02
22 files changed
+1032 -36

No files matched your search

+23
View File
@@ -177,6 +177,29 @@ See [LoRa CLI host service](host_cli_service.md) for the complete
---
### LoRa OTA speed
```text
get ota.speed
set ota.speed <0.05..3>
```
`1` preserves the current OTA timing. Values below `1` slow OTA traffic;
values above `1` shorten adjustable delays. For example, `0.5` doubles those
delays and `3` divides them by three. Decimal values such as `.05` work.
`ota config speed <factor>` is an equivalent setter, and `ota config` shows
the value. The setting is saved and can be changed during a transfer.
Apply it on the source, destination, and relays. It controls all LoRa OTA
packet types on both profiles, relay timing, discovery, and OTA adverts.
Slower settings extend recovery waits and space queued OTA packets while
allowing ordinary traffic through. Faster settings retain the physical retry
allowance and the configured airtime budget, so throughput is not guaranteed
to rise in direct proportion. Proof turnaround keeps its physical allowance.
Ordinary messages, node adverts, and local staged-image verification keep their
timing. Available in OTA-enabled builds for all roles, including Companions.
See the [OTA guide](ota_user_guide.md#adjust-lora-ota-speed).
### Start or stop an Over-The-Air (OTA) firmware update
**Search terms:** WiFi OTA, wireless firmware update, OTA uploader, update firmware.
+7
View File
@@ -457,6 +457,13 @@ Monitor the transfer:
ota status
```
To adjust LoRa OTA pacing, use `get ota.speed` and `set ota.speed <0.05..3>` on
the source, destination, and OTA relays. `1` preserves the existing timing;
lower values slow OTA down, and higher values shorten adjustable delays.
This saved setting covers both profiles and OTA adverts as well as the transfer.
It does not change radio modulation or the configured airtime budget. See
[LoRa OTA speed](ota_user_guide.md#adjust-lora-ota-speed) for details.
For a powered bench update where restart-resume is not needed, `ota config checkpoint 0` on the destination
removes periodic progress writes. It is a smaller optimization than selecting the correct hop count and it
trades away persisted mid-download resume; restore the previous checkpoint cadence afterward.
+46
View File
@@ -380,6 +380,52 @@ complete target inventory, storage layouts, and safety contract.
---
## Adjust LoRa OTA speed
Use one saved speed factor for this node's LoRa OTA traffic:
```text
get ota.speed
set ota.speed 0.5
set ota.speed .05
set ota.speed 3
set ota.speed 1
```
The range is **0.05 through 3**, including decimals. **1 is the existing timing**.
At `0.5`, adjustable OTA delays are twice as long; at `0.05`, they are twenty
times as long. At `3`, adjustable delays are divided by three. Actual transfer
speed also depends on packet airtime, the configured airtime budget, relays,
and packet loss; `3` does not guarantee three times the throughput.
The factor covers OTA requests and responses (catalog, manifest, leaves, DATA,
and proofs), OTA relay delays, discovery jitter, and automatic OTA adverts.
Below `1`, the transmit queue also spaces out **every OTA packet**, including
both profile copies, while letting ordinary messages run. Recovery waits grow
for slower transfers; faster settings retain the existing retry allowance so
they do not retry before a physical response train can finish. The radio's
frequency, bandwidth, SF, coding rate, preamble, and airtime budget stay as set.
The proof turnaround allowance also keeps its existing physical minimum.
Dual-profile timing accounts for the participating profiles and reply copies;
it does not vary with the scanner's current visit. Deliberate slow pacing is
excluded from observer builds' stale-packet age, while congestion still ages
queued packets normally.
Set the same factor on the **source, destination, and OTA relays**. It is a
local setting, not a value negotiated with peers. A slow source paired with a
receiver at `1` can cause unnecessary retries. The setting takes effect during
an active session, survives reboot and temporary-radio expiry, and applies to
OTA on either radio profile. `set ota.speed 1` restores the previous pace.
Ordinary chat, node adverts, and USB/WiFi source transfers keep their timing.
Local verification of a staged image and leaf comparisons keep their normal
maintenance rate even when LoRa pacing is slow.
`ota config speed 0.5` is an equivalent setter. `ota config speed` and
`ota speed` read the current factor; the `ota config` summary also includes it.
The setting is available on OTA-enabled repeaters, rooms, sensors, Companions,
and seeder-only builds. Its separate `/ota_speed` settings file preserves the
existing preference layouts and does not need an active OTA workspace.
## Optional: let it update automatically
By default your node only *discovers* updates - it won't download or install on its own. If you want more