README: the experimental -ota images (admin-pushed firmware update) and the public tools/

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-13 16:52:49 +01:00
1 parent 287b562c47
commit 51e733e500
1 file changed
+74
+74
View File
@@ -176,10 +176,46 @@ Nový uzel po nahrání nastav v konzoli: `set name <jméno>`,
startu (výchozí v upstreamu) a tyhle buildy jsou na ostré CZ frekvenci: na
stole bez antény dej `set repeat off`, dokud není na místě.
### Experimentální: aktualizace firmwaru od admina (`*-ota`)
Každý nRF52 build s textovou konzolí (repeater, observer, room server,
senzor) je v releasu ještě jednou jako **experimentální** `*-ota` /
`*-observer-ota`. Ten umí přijmout nový firmware od admina příkazy `fw …`:
v USB nebo BLE konzoli, nebo **přes mesh jako vzdálené admin CLI**. Bez změny
bootloaderu a bez druhé banky: uzel si balíček uloží do volné flash,
zkontroluje ho celý (podpis, hashe, nanečisto provedená delta) a přepíše se
až na `fw apply`, rutinou běžící z RAM. Když během přepisu vypadne napájení,
zůstane v bootloaderu a vrátí se přes USB/BLE DFU.
* V releasu je ke každému `*-ota` obrazu plný balíček
`<deska>_<role>-ota-<release>.mcfw` (jen přes USB/BLE) a delta
`….from-<starší release>.mcfw` od každého drženého předchozího releasu,
typicky jednotky kB.
* **Přes mesh uzel přijme jen deltu, a nikdy ne starší verzi, než má** –
vynucuje to uzel, ne nástroj. Plný obraz nebo návrat ke starší verzi jen
lokálně (`fw apply downgrade`). `fw apply` čeká na baterii ≥ 3,8 V, pokud
uzel neběží z USB.
* Balíčky i `SHA256SUMS` jsou podepsané klíčem `meshcore-ota@tth-pub`
a `*-ota` obraz jiný podpis nepřijme. Ověření stažených souborů:
`ssh-keygen -Y verify -f tools/ota_allowed_signers -I meshcore-ota@tth-pub
-n meshcore-ota -s SHA256SUMS.sig < SHA256SUMS`. Vlastní build s vlastním
klíčem: `[ota] pubkey` v `platformio.local.ini`.
* První `*-ota` obraz se nahraje obyčejně (viz výše), další už jako delta.
Nástroje: `tools/ota_push.py` (USB), `tools/ota_mesh_push.py` (přes mesh
skrz companion; potřebuje pythonovou knihovnu `meshcore`, admin heslo bere
z `[secrets] admin_pw` v `platformio.local.ini`), `tools/ota_pack.py info`.
Postup a čísla: [docs/ota-admin.md](docs/ota-admin.md).
* **Experimentální**: vyzkoušeno na XIAO na lavici přes USB i přes mesh
(1 hop). Vadný nový firmware nemá kam se vrátit (není druhá banka) – nový
release nejdřív na jednom uzlu na dosah. Stojí ~10 kB RAM navíc.
### Sestavení
* Razítko verze v každém nRF52 envu (`v1.18.0-tth<sha>`, `+` = neuklizený
strom), základní verze z upstreamového tagu (`tools/build_version.py`).
* `tools/`: nástroje na uzly – konzole (USB, BLE), flashování, testy na
lavici, diagnostika ([tools/README.md](tools/README.md)). Desky podle jména
bere z lokálního configu mimo repo (`tools/config.example.ini`).
* `hardware/cavity-box`: parametrická krabička pro dutinový filtr na stožár.
---
@@ -359,10 +395,48 @@ After flashing a new node, set it up in the console: `set name <name>`,
first boot (upstream default) and these builds are on the live CZ frequency:
on a desk without its antenna, `set repeat off` until it is in place.
### Experimental: firmware update pushed by the admin (`*-ota`)
Every nRF52 build with a text console (repeater, observer, room server,
sensor) is in the release once more as an **experimental** `*-ota` /
`*-observer-ota` image. It takes a new firmware from its admin with the
`fw …` commands: on the USB or BLE console, or **over the mesh as remote admin
CLI**. No bootloader change, no second bank: the node stores the package in
free flash, checks all of it (signature, hashes, the delta applied dry) and
rewrites itself only on `fw apply`, from a routine running in RAM. A power
cut during the rewrite leaves it in the bootloader, back via USB/BLE DFU.
* Each `*-ota` image comes with a full package
`<board>_<role>-ota-<release>.mcfw` (USB/BLE only) and a delta
`….from-<earlier release>.mcfw` from every kept earlier release, typically
a few kB.
* **Over the mesh a node takes only a delta, and never an older version than
it runs** -- enforced by the node, not by the tool. A full image or a step
back only locally (`fw apply downgrade`). `fw apply` wants the battery at
3.8 V or more unless the node runs on USB.
* Packages and `SHA256SUMS` are signed by `meshcore-ota@tth-pub`, and an
`*-ota` image accepts no other signature. Checking the downloads:
`ssh-keygen -Y verify -f tools/ota_allowed_signers -I meshcore-ota@tth-pub
-n meshcore-ota -s SHA256SUMS.sig < SHA256SUMS`. Your own build with your own
key: `[ota] pubkey` in `platformio.local.ini`.
* The first `*-ota` image is flashed the usual way (above), later ones go as
deltas. Tools: `tools/ota_push.py` (USB), `tools/ota_mesh_push.py` (over the
mesh through a companion; needs the `meshcore` Python library, takes the
admin password from `[secrets] admin_pw` in `platformio.local.ini`),
`tools/ota_pack.py info`. How it works and bench numbers:
[docs/ota-admin.md](docs/ota-admin.md).
* **Experimental**: tried on XIAO boards on the bench over USB and over the
mesh (1 hop). A bad new firmware has nothing to fall back to (no second
bank) -- try a new release on one node within reach first. Costs ~10 kB of
RAM.
### Build
* Version stamping in every nRF52 env (`v1.18.0-tth<sha>`, `+` = dirty tree),
base version from the upstream tag (`tools/build_version.py`).
* `tools/`: host tools for the nodes -- consoles (USB, BLE), flashing, bench
tests, diagnostics ([tools/README.md](tools/README.md)). Board names come
from a local config outside the repo (`tools/config.example.ini`).
* `hardware/cavity-box`: parametric enclosure for a cavity filter on a mast.
---