Apply infrastructure radio changes after a two-second reply handoff

Persist set freq and set radio atomically, then apply through the existing safe radio scheduler without rebooting. Retain the old tuple until the delay and reply handoff finish, including queued room/sensor replies and TX-complete callbacks. End temporary sessions when accepting a permanent change.

Display applied RF settings even when radio2 is off. Share radio validation across immediate and scheduled setters to preserve STM32 Mini flash capacity. Update command documentation, regression coverage, and CI.

Validated production timing, persistence, display, CLI, fleet/reply, RX, sleep and Morse regressions. W12 repeater, room-server and sensor builds pass. Canonical STM32 Mini Repeater passes flash and RAM admission with 448 bytes of flash remaining. Physical W12 RF testing was not performed.
This commit is contained in:
mikecarper committed 2026-10-26 00:38:13 -07:00
1 parent c98684021a
commit 4f76345b67
22 files changed
+414 -67

No files matched your search

+1 -1
View File
@@ -103,7 +103,7 @@ over the normal binary USB, BLE, or TCP connection:
| [`get bootloader.ver`](cli_commands.md#view-the-bootloader-version-nrf52-only) | nRF52 Companion terminal and command `0x42`; unidentifiable metadata returns `unknown` |
| [`get/set sdcard`](test-results/companion_cli_parity_2026-10-23.md#shared-sd-commands) | nRF52 builds with SD OTA storage; maintenance retains OTA and Ethernet ownership guards |
| `erase` | Local terminal and binary command `0x42`; reboot after erasing stored settings |
| `set freq <MHz>` | Local terminal, binary command `0x42`, and authorized LoRa CLI; reboot to apply |
| `set freq <MHz>` | Local terminal, binary command `0x42`, and authorized LoRa CLI; applies automatically (infrastructure waits two seconds and for the reply to drain) |
| [`get public.key`](cli_commands.md#view-this-nodes-public-key) | Companion text terminal and binary command `0x42`; read-only, no private-key export feature required |
| `get prv.key` | Local terminal and binary command `0x42`; requires private key export enabled |
| `get password` | ESP32 WiFi Companion reports management-password status without revealing it; other Companions report no admin password; infrastructure returns its password locally |
+7 -2
View File
@@ -1877,7 +1877,10 @@ existing Companion apps. On dual-radio builds, use `get radio2` and
**Note:** Companion USB, BLE and WebConfig changes apply automatically when
the radio is free. A busy radio keeps the saved target across disconnects.
Infrastructure retains its reboot-to-apply behavior. Companion LoRa CLI waits
Infrastructure saves immediately, waits two seconds, then applies when the radio
is free and its reply has drained. No reboot is needed; a permanent change ends
pending or active TempRadio sessions. The device screen shows the applied radio
settings during the wait. Companion LoRa CLI waits
for the exact reply copies to drain before applying; active TempRadio leases
reject this permanent change.
If RXPS is enabled and the saved minimum
@@ -2065,7 +2068,9 @@ preamble. LoRa OTA treats v1.17.1.5 as that capability boundary.
**Default:** `869.618`
**Note:** Companion local changes apply automatically when the radio is free.
Infrastructure requires a reboot to apply. Companion LoRa CLI applies after
Infrastructure saves immediately and switches after two seconds, once the radio
is free and its reply has drained. No reboot is needed. This ends pending or
active TempRadio sessions. Companion LoRa CLI applies after
its exact reply copies drain; an active TempRadio lease rejects the change.
**Connections:** USB, browser/TCP/Ethernet CLI, Companion binary command
+2 -1
View File
@@ -335,7 +335,8 @@ the same binary CLI command over BLE or USB when TCP is unreachable. Listener
startup failures recover automatically without resetting a healthy client or
the WiFi connection; see [the CLI diagnostics](cli_commands.md#browser-configuration-portal-esp32-repeater-and-room-server).
`set freq <MHz>` works through command `0x42` and authorized LoRa CLI, like
`set radio`; it saves the frequency and requires reboot to apply. See
`set radio`; it saves the frequency and applies automatically when the radio is
free. LoRa CLI waits for its reply to drain before switching. See
[local maintenance commands](terminal_chat_cli.md#local-maintenance-commands)
for role differences and the text-terminal equivalents.
+3 -3
View File
@@ -46,7 +46,6 @@ for the first board and `Bridge-B` for the second, or choose your own names.
set espnow.enabled off
set name Bridge-A
set radio <freq>,<bw>,<sf>,<cr>
reboot
```
Do not type the angle-bracket placeholders literally.
@@ -59,8 +58,9 @@ Do not type the angle-bracket placeholders literally.
| `cr` | Coding-rate value, 5-8. Match that network's setting. |
| `name` | A label to tell the two repeaters apart. It does not pair them. |
**`set radio` requires a reboot to apply.** After reconnecting, `get radio`
shows the saved settings. Use permanent radio settings for this setup;
**`set radio` saves immediately and switches after two seconds, once the radio
is free and the reply has drained.** No reboot is needed. `get radio` shows the
saved settings; the device screen shows the applied settings. Use permanent radio settings for this setup;
`tempradio` sessions expire.
## 3. Configure the ESP-NOW link on both boards
+7 -3
View File
@@ -120,8 +120,10 @@ BLE and TCP use their existing Companion transport framing.
`set freq <MHz>` is available on these local connections and through authorized
LoRa administration, just like `set radio`. It saves the frequency without
changing bandwidth, spreading factor, or coding rate and requires a reboot to
apply. Infrastructure roles also apply the board's transmit-power limit.
changing bandwidth, spreading factor, or coding rate. Infrastructure waits two
seconds and for the radio reply to drain before applying; Companion applies
automatically when the radio is free. No reboot is needed. Infrastructure roles
also apply the board's transmit-power limit.
Commands relayed to another node using `cmd` travel over LoRa and retain the
remote restrictions on local-only maintenance and secret reads. These local
@@ -280,7 +282,9 @@ source, supported build profiles and memory costs.
set freq {frequency}
```
Set the saved LoRa frequency. Example: `set freq 915.8`. Available over local
connections and authorized LoRa CLI; reboot to apply.
connections and authorized LoRa CLI. Infrastructure switches after two seconds
and the reply has drained; Companion applies automatically when the radio is
free. No reboot is needed.
```
set tx {tx-power-dbm}