Harden and qualify compact RAK3401 OTA updates
This commit is contained in:
1 parent
47993d178e
commit
dc4a8808c0
22 files changed
+2156
-277
No files matched your search
@@ -289,6 +289,17 @@ Return to Binary mode with:
|
||||
Closing the USB data connection also resets the port to Binary mode. A
|
||||
different baud rate, including 57600, does not select ASCII mode.
|
||||
|
||||
On an ESP32 Full Companion built with `OTA_FOLDER_SERIAL`, `motatool` can keep
|
||||
that terminal session open as an mOTA folder source when WiFi is unavailable:
|
||||
|
||||
```sh
|
||||
motatool serve --serial /dev/ttyACM0 --companion-terminal --dir ./motas -v
|
||||
```
|
||||
|
||||
The explicit flag is required because an ESP32 Companion starts the same USB
|
||||
port in binary Companion mode. TCP port 5001 remains the preferred unattended
|
||||
source transport.
|
||||
|
||||
## nRF52 USB mOTA mode
|
||||
|
||||
The nRF52 full target has a third, exclusive USB mode for the host folder.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Scripted LoRa OTA from start to finish
|
||||
|
||||
The dedicated [RAK3401 chain report](rak3401_mota_chain.md) records the
|
||||
physical failure of the withdrawn 26-step migration and the corrected
|
||||
v1.17.01 test candidate. Its runner blocks the withdrawn chain and requires an
|
||||
explicit lab-only gate for the corrected chain until physical testing passes.
|
||||
physical failures of withdrawn migrations and the physically qualified compact
|
||||
nine-step replacement. Its runner blocks the withdrawn chains and pins every
|
||||
accepted bridge image by SHA-256.
|
||||
|
||||
[`tools/lora_ota/lora_ota.sh`](https://github.com/mikecarper/MeshCore/blob/keymindCascade/tools/lora_ota/lora_ota.sh) and
|
||||
[`tools/lora_ota/lora_ota.ps1`](https://github.com/mikecarper/MeshCore/blob/keymindCascade/tools/lora_ota/lora_ota.ps1) automate a
|
||||
@@ -51,7 +51,9 @@ The USB ASCII switch (`+++MESHCORE-TERM-START`) is the local control path, not
|
||||
the mOTA data framing. On an nRF52 full Companion, the script uses that mode
|
||||
briefly for `ota status` and TempRadio commands. It then closes the CLI and
|
||||
starts `motatool`, whose existing `ota folder on` preamble switches the same
|
||||
USB port into exclusive mOTA mode. BLE remains available during that mode.
|
||||
USB port into exclusive mOTA mode. On an ESP32 Full Companion with serial
|
||||
folder support, `motatool --companion-terminal` keeps the ASCII session open
|
||||
while the same link carries framed folder requests. BLE remains available.
|
||||
|
||||
## Destination requirements
|
||||
|
||||
@@ -383,6 +385,10 @@ Useful controls:
|
||||
before every `ota install` transmission and refuses installation unless the
|
||||
destination reports `> off`. Use it for nRF52 chains whose bootloader cannot
|
||||
service an application watchdog inherited across reset.
|
||||
- Managed `--relay` nodes have their original `rxdelay` and `txdelay` captured
|
||||
in the work directory. During transfer the runner verifies `rxdelay 0` and
|
||||
an airtime-scaled `txdelay 0.3` (override with `--relay-txdelay`), then
|
||||
restores both values before the relay leaves TempRadio.
|
||||
- `--work-dir PATH` chooses a new, non-existent work directory.
|
||||
- `--meshcli PATH` and `--motatool PATH` select binaries not on `PATH`.
|
||||
|
||||
|
||||
+17
-1
@@ -552,7 +552,8 @@ This keeps each active transfer as one transmitter and one receiver while still
|
||||
repeaters between them and persistent archive nodes to improve future availability.
|
||||
|
||||
TempRadio is treated as a private maintenance network. Active transfer packets use priority 0, bypass the
|
||||
public-flood receive holdoff and relay jitter, and do not schedule generic flood retries. The bounded serving
|
||||
public-flood receive holdoff, retain the relay role's airtime-scaled transmit collision window, and do not
|
||||
schedule generic flood retries. The bounded serving
|
||||
queue admits at most two DATA/PROOF packets ahead of the radio while preserving at least four free packet-pool
|
||||
entries. CAD remains enabled to arbitrate the half-duplex channel, but its busy retry is scaled to one-quarter
|
||||
of a packet airtime and clamped to 5-50 ms instead of the ordinary 120-360 ms cadence. Discovery traffic keeps
|
||||
@@ -662,6 +663,21 @@ MotaDesc wire (38 B): mid[4] target_id(4) fw_version(4) codec(1) flags(1)
|
||||
status: 0 = OK, non-zero = error (out of range / past EOF).
|
||||
```
|
||||
|
||||
`SerialMotaSource` splits logical reads into replies of at most 192 payload
|
||||
bytes. A manifest's leaf table can exceed 256 bytes and payload blocks are
|
||||
normally 1 KiB; requesting either in one transaction can overrun common USB
|
||||
CDC/UART receive rings even though the host successfully wrote the complete
|
||||
reply. Chunking is internal to the transport and does not change `OP_READ` or
|
||||
the `MotaSource` random-access contract.
|
||||
|
||||
Manifest fragments are retained as bounded response jobs and admitted one at
|
||||
a time. Their source-side gap follows the active maximum packet airtime and
|
||||
dispatcher duty spacing, clamped to 100-1000 ms. The 100 ms floor protects
|
||||
fast radios' TX-to-RX turnaround; the cap keeps the receiver's one-second
|
||||
manifest progress/retry observation responsive. Relay collision delay is a
|
||||
separate setting: active OTA floods honor the relay role's configured
|
||||
`txdelay`, and the deployment runner temporarily uses `0.3` on managed relays.
|
||||
|
||||
**What to plug into `--serial`.** Use the USB serial console of an OTA-enabled MeshCore node built with
|
||||
`OTA_FOLDER_SERIAL`. The node must have a working LoRa radio plus an
|
||||
`ota folder on` command; that command confirms it can host and advertise the folder. A **KISS modem will not
|
||||
|
||||
+253
-160
@@ -1,28 +1,24 @@
|
||||
# RAK3401 1W repeater LoRa update chain
|
||||
# RAK3401 1W repeater compact LoRa update chain
|
||||
|
||||
> Status: accelerated release candidate. All 30 exact transitions passed
|
||||
> independent offline reconstruction, container verification, and stable
|
||||
> bootloader simulation. The byte-identical first bridge and the superseded
|
||||
> 29-step baseline completed physical RAK3401 testing; the new complete 30-step
|
||||
> byte sequence still needs its final full-chain hardware qualification.
|
||||
> Status: physically qualified on 19-Aug-2026. All nine exact transitions
|
||||
> completed on a deployed RAK3401 1W with its existing bootloader, using a
|
||||
> Heltec V4 source at 909.950 MHz / 500 kHz / SF5 / CR5. Every post-boot EndF
|
||||
> hash matched. The same files also pass independent reconstruction, container
|
||||
> verification, and both deployed Preview 6 and current OTAFIX simulators.
|
||||
|
||||
The release is
|
||||
[`rak3401-mota-v1.16.07-c1caa5ad-to-v1.17.01-c96bdd6e`](https://github.com/mikecarper/MeshCore/releases/tag/rak3401-mota-v1.16.07-c1caa5ad-to-v1.17.01-c96bdd6e).
|
||||
Use this asset:
|
||||
|
||||
```text
|
||||
RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.01-8c5262c6.zip
|
||||
RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.1.02-e742333a.zip
|
||||
```
|
||||
|
||||
- ZIP SHA-256: `b2781e02460b200a7c37bfae352bad81618716e550d1d042dca8aa29bfc73c29`
|
||||
- inner `SHA256SUMS.txt` SHA-256: `1f7add658ae5771451cd66a0e5c58a5e461983c1b36029ef480093ae5d5f1020`
|
||||
- endpoint image SHA-256: `a08b5791419410c760f31c26bb45c77d776eb7bbf68fde656e19bcd616a6227d`
|
||||
- endpoint EndF body hash: `3DD88C3DD7B8A35B`
|
||||
- ZIP SHA-256: `9f80eef191b88833bf4d2e4fea559cf5233ca53f9266ba310d447f37fa445f3a`
|
||||
- inner `SHA256SUMS.txt` SHA-256: `73d96e23237896a3e342fe736be12d94087a813bf09ad609fb55330bbe586055`
|
||||
- endpoint image SHA-256: `2784e4b645bc3dc198de0b8b18d3d7369cd02eca61cd71c46a51b61854da5345`
|
||||
- endpoint EndF body hash: `4BB1526BF647547D`
|
||||
|
||||
The superseded 29-step v1.17.01 release, earlier v1.17.01 candidates, and the
|
||||
v1.17.02 chain remain useful only for provenance or diagnosis. The runner
|
||||
recognizes their hashes and refuses live installation before opening a device
|
||||
or reading a password.
|
||||
Until that asset is uploaded to the release tag pinned by the runner, pass its
|
||||
local path with `--bundle`.
|
||||
|
||||
## Exact destination
|
||||
|
||||
@@ -33,111 +29,88 @@ target:
|
||||
- hardware: `RAK_3401`
|
||||
- role: `RAK_3401_repeater_lora_ota_no_external_sensors`
|
||||
- start: `v1.16.7.0-c1caa5ad`, EndF `71F4026CBE4B8B74`
|
||||
- endpoint: `v1.17.01-halo-keymind-cascade-dev-8c5262c6`, EndF `3DD88C3DD7B8A35B`
|
||||
- endpoint source: MeshCore `e742333a0ee393b0d55d2414f25b28f2f67e1ea1`
|
||||
- endpoint label: `v1.17.1.02-halo-keymind-cascade-dev-e742333a`
|
||||
- endpoint packed version: `0x01110102` (EndF tools render this as `1.17.1.2`)
|
||||
- deployment target key: `63d8df6387eaffd2e25db7d2a8ad967a65202182a48d681d7e7a9260f917280d`
|
||||
|
||||
Do not use the chain on another target ID, hardware family, starting image, or
|
||||
firmware body hash. The runner checks all four.
|
||||
|
||||
## Validation and speed design
|
||||
## Why the old bootloader works
|
||||
|
||||
The direct physical baseline used:
|
||||
The deployed bootloader is not changed and no package uses the newer expanded
|
||||
`0xED000` ceiling. Each package remains bottom-aligned below the old
|
||||
bootloader's `0xD4000` scan ceiling. Its detools workspace is page-aligned and
|
||||
must satisfy:
|
||||
|
||||
- a Heltec V4.3 OLED 2 MB Full Companion on `/dev/ttyACM0`;
|
||||
- the same Full Companion at `192.168.1.51`, with mOTA seeding on TCP `5001`
|
||||
and its local OTA/TempRadio console on TCP `5002`;
|
||||
- Full Companion key
|
||||
`8ce031bc322f3cf77376eeacfe8800b30d8c5dfe927f3636d801f3455a2dd4cf`;
|
||||
- one direct RF link to `RAK3401 1W Repeater`;
|
||||
- temporary radio `909.950 MHz`, `500 kHz`, `SF5`, `CR5`;
|
||||
- all 29 packages in the now-superseded `cd824765` chain.
|
||||
```text
|
||||
0x26000 + inplace_memory <= staged_package_start < 0xD4000
|
||||
```
|
||||
|
||||
The baseline started at `2026-08-14T01:50:24Z` and reached its endpoint at
|
||||
`2026-08-14T06:41:36Z`. This ZIP preserves that 29-row record as
|
||||
`PHYSICAL-BASELINE-cd824765.jsonl`; it does not claim those rows describe the
|
||||
new bridge bytes.
|
||||
The old bootloader already reads and validates that encoded detools geometry
|
||||
before its first destructive write. The previous application receiver was the
|
||||
limiting part: it reserved a fixed `0x98000` workspace before accepting a
|
||||
download. Step 1 therefore remains byte-for-byte identical to the physically
|
||||
passed 89,844-byte package. Step 2 is a 46,363-byte fixed-workspace package
|
||||
that installs the compatibility receiver. Later receivers stage above the
|
||||
real EndF image extent and let the bootloader enforce each package's selected
|
||||
workspace.
|
||||
|
||||
All 30 new containers were freshly generated. Every delta was reconstructed
|
||||
with both zero-filled and `0xFF`-filled workspaces, verified independently by
|
||||
`motatool`, and exercised by the stable OTAFIX apply simulator. The largest
|
||||
package is the byte-identical, physically passed step 1 at 89,844 bytes, which
|
||||
leaves 268 bytes of the fixed 90,112-byte staging region. Step 2 is the earliest
|
||||
safe place for the terminal-consumption backport: adding it directly to step 1
|
||||
would exceed that staging limit. Step 26 remains an intentional compiler-layout
|
||||
bridge.
|
||||
An exhaustive search tested every page-aligned workspace relevant to a route
|
||||
shorter than nine packages: 9,430 candidate geometries across 272 possible
|
||||
layer-skipping edges. None fit. The 61 edges on the shortest-path graph were
|
||||
then swept across another 2,296 workspace choices; 840 nine-package routes
|
||||
were compared by total transfer size. The selected route is the byte-minimum
|
||||
shortest route:
|
||||
|
||||
The speedup keeps 1 KiB logical blocks. Firmware currently accepts at most 1
|
||||
KiB, and larger logical blocks would still fragment into the same roughly
|
||||
160-byte LoRa packets while increasing the amount at risk when a block must be
|
||||
retried. Instead, one request can open an adaptive flight of multiple 1 KiB
|
||||
blocks. It begins at one block, grows through two and three to four after clean
|
||||
flights, and reduces the width after missing data or proofs. Retry timing is
|
||||
derived from actual LoRa airtime and path length. Active transfer packets use
|
||||
primary priority; periodic discovery remains background traffic.
|
||||
| Step | From | To | Workspace | Package | Margin |
|
||||
|---:|---|---|---:|---:|---:|
|
||||
| 1 | 1.16.7.0 | 1.16.7.9 | `0x98000` | 89,844 | 0 |
|
||||
| 2 | 1.16.7.9 | 1.16.7.10 | `0x98000` | 46,363 | 40,960 |
|
||||
| 3 | 1.16.7.10 | 1.16.8.7 | `0x91000` | 106,030 | 12,288 |
|
||||
| 4 | 1.16.8.7 | 1.16.9.105 | `0x89000` | 149,927 | 0 |
|
||||
| 5 | 1.16.9.105 | 1.16.9.110 | `0x8E000` | 111,307 | 16,384 |
|
||||
| 6 | 1.16.9.110 | 1.16.9.111 | `0x8D000` | 70,679 | 61,440 |
|
||||
| 7 | 1.16.9.111 | 1.16.9.116 | `0x89000` | 143,441 | 4,096 |
|
||||
| 8 | 1.16.9.116 | 1.16.9.118 | `0x81000` | 98,188 | 86,016 |
|
||||
| 9 | 1.16.9.118 | 1.17.1.02 | `0x7D000` | 186,385 | 12,288 |
|
||||
|
||||
Step 1 installs the guarded rescue command, the four-block adaptive requester,
|
||||
and primary transfer priority. The starting firmware still requests step 1
|
||||
serially. Step 2 installs terminal OTA bulk-packet consumption in the target,
|
||||
so the echo/dispatch reduction takes effect for transfers 3 through 30. A
|
||||
direct endpoint comparison confirmed the intended behavior: the older target
|
||||
needed 147 host block reads for a 48-block package and reported ready after
|
||||
267 seconds; the current target needed 82 reads for a larger 68-block package
|
||||
and reported ready after 98 seconds. These differently sized transfers are a
|
||||
protocol comparison, not a formal throughput benchmark.
|
||||
Total mOTA transfer data is 1,002,164 bytes. `ROUTE.json`, `CHAIN.csv`, and
|
||||
`validation-results.json` in the bundle pin the exact geometry and image hash
|
||||
for every transition.
|
||||
|
||||
## Host requirements
|
||||
|
||||
Install:
|
||||
Install Python 3.9 or newer, `meshcli` 1.6.0 or newer, the current `motatool`,
|
||||
and an OTA-enabled Full Companion or repeater that can seed mOTA files.
|
||||
|
||||
- Python 3.9 or newer;
|
||||
- `meshcli` 1.6.0 or newer;
|
||||
- the current `motatool`;
|
||||
- a Full Companion or OTA-enabled repeater that can seed mOTA files.
|
||||
|
||||
The runner maintains one persistent controller connection. It logs into the
|
||||
destination once, keeps that authenticated radio-node session across
|
||||
application reboots, and does not treat a silent packet as lost
|
||||
authentication. The source seeder reconnects for each isolated package but
|
||||
does not need remote-admin login.
|
||||
|
||||
## Verify the release offline
|
||||
## Verify offline
|
||||
|
||||
No password or device is needed:
|
||||
|
||||
```bash
|
||||
python3 tools/lora_ota/rak3401_mota_chain.py \
|
||||
--bundle /path/to/RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.01-8c5262c6.zip \
|
||||
--bundle /path/to/RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.1.02-e742333a.zip \
|
||||
--work-dir ./rak3401-mota-chain-work \
|
||||
--motatool /path/to/motatool \
|
||||
--verify-only
|
||||
```
|
||||
|
||||
When `--bundle` is omitted, the runner downloads the pinned release asset. It
|
||||
checks the outer ZIP hash, complete inner checksum coverage, all 30 manifests,
|
||||
chain continuity, audited image anchors, final recovery image, and every mOTA
|
||||
container with `motatool`.
|
||||
The runner checks the outer ZIP, complete inner checksum coverage, all nine
|
||||
manifests, continuity, image anchors, final recovery image, and every container
|
||||
with `motatool`.
|
||||
|
||||
Offline verification does not need `--accept-test-candidate`. Live preflight or
|
||||
installation does: the flag explicitly acknowledges that the exact 30-step
|
||||
sequence has exhaustive offline validation but not yet a complete physical run.
|
||||
## Direct recoverable bench run
|
||||
|
||||
## Direct recoverable bench run: BW500/SF5
|
||||
|
||||
Restore the test RAK locally with the ZIP's
|
||||
`recovery/test-start/RAK3401-test-start-v1.16.7-c1caa5ad.uf2`. Before starting,
|
||||
require start version `1.16.7.0`, body hash `71F4026CBE4B8B74`, target
|
||||
`2FA509C1`, hardware `RAK_3401`, and OTAFIX mOTA ABI 2 with codec 2. The live
|
||||
runner queries `get bootloader.ver`, reports the installed version, and then
|
||||
uses `ota self` to verify those apply capabilities before changing any radio
|
||||
or watchdog setting.
|
||||
|
||||
For the tested direct topology:
|
||||
Restore the test start locally with
|
||||
`recovery/test-start/RAK3401-test-start-v1.16.7-c1caa5ad.uf2`, then run:
|
||||
|
||||
```bash
|
||||
export MESHCORE_ADMIN_PASSWORD='password'
|
||||
|
||||
python3 tools/lora_ota/rak3401_mota_chain.py \
|
||||
--bundle /path/to/RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.01-8c5262c6.zip \
|
||||
--bundle /path/to/RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.1.02-e742333a.zip \
|
||||
--work-dir ./rak3401-mota-chain-work \
|
||||
--controller-serial /dev/ttyACM0 \
|
||||
--source-tcp 192.168.1.51:5001 \
|
||||
@@ -147,33 +120,179 @@ python3 tools/lora_ota/rak3401_mota_chain.py \
|
||||
--temp-radio 909.950,500,5,5,120 \
|
||||
--ota-hops 1 \
|
||||
--motatool /path/to/motatool \
|
||||
--accept-test-candidate \
|
||||
--yes
|
||||
```
|
||||
|
||||
BW500 is for the controlled direct bench setup. Confirm that the selected
|
||||
frequency and bandwidth are legal at the test location.
|
||||
Keep the work directory. Rerunning the same command resumes only when the live
|
||||
EndF body hash matches an exact chain node. Never manually skip a package.
|
||||
|
||||
Keep the work directory. Each package gets an isolated attempt directory, and
|
||||
each exact transition is appended to `progress.jsonl`. After a host or RF
|
||||
interruption, rerun the identical command with the same work directory. The
|
||||
runner resumes only when the live body hash matches the recorded chain; never
|
||||
manually skip to a package.
|
||||
## Manual operation
|
||||
|
||||
## Live deployment with two intermediate relays: BW250/SF5
|
||||
The pinned runner is the safer method. If it cannot be used, follow every
|
||||
check below and keep a written copy of each original setting. Do not skip a
|
||||
step even when a later package appears in `ota ls`.
|
||||
|
||||
For the intended private TempRadio deployment, use BW250/SF5 and two
|
||||
intermediate relays. List relays from the destination side toward the
|
||||
controller: farthest first, nearest last. With two relays there are three RF
|
||||
links, so use `--ota-hops 3`.
|
||||
|
||||
Run a non-mutating preflight first:
|
||||
### 1. Verify and extract the asset
|
||||
|
||||
```bash
|
||||
export MESHCORE_ADMIN_PASSWORD='your-destination-and-relay-password'
|
||||
sha256sum RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.1.02-e742333a.zip
|
||||
unzip RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.1.02-e742333a.zip
|
||||
cd RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.1.02-e742333a
|
||||
sha256sum -c SHA256SUMS.txt
|
||||
for package in motas/*.mota; do motatool verify "$package" || exit 1; done
|
||||
```
|
||||
|
||||
The outer hash must be `9f80eef191b88833bf4d2e4fea559cf5233ca53f9266ba310d447f37fa445f3a`.
|
||||
Do not continue after any checksum or verification error.
|
||||
|
||||
### 2. Record and prepare the destination
|
||||
|
||||
Before changing anything, save the complete replies from:
|
||||
|
||||
```text
|
||||
ver
|
||||
ota self
|
||||
get bootloader.ver
|
||||
get system.watchdog
|
||||
get radio.rxps
|
||||
powersaving
|
||||
get rxdelay
|
||||
ota config
|
||||
```
|
||||
|
||||
The starting `ota self` hash must be `71F4026CBE4B8B74`, the target must be
|
||||
`2FA509C1`, and the hardware must be `RAK_3401`. Disable the nRF52 system
|
||||
watchdog before the chain:
|
||||
|
||||
```text
|
||||
set system.watchdog off
|
||||
```
|
||||
|
||||
The hardware watchdog cannot stop immediately. The RAK will reset once within
|
||||
about 60 seconds. Reconnect, wait at least 90 seconds from the command, and
|
||||
require `get system.watchdog` to report `> off` before continuing.
|
||||
|
||||
For a direct bench link, apply these temporary transfer guardrails to the RAK
|
||||
after every bridge reboot:
|
||||
|
||||
```text
|
||||
powersaving off
|
||||
set radio.rxps off
|
||||
set rxdelay 0
|
||||
ota config hops 1
|
||||
tempradio 909.950,500,5,5,120
|
||||
```
|
||||
|
||||
`powersaving off` is an isolation guardrail, not the fix for the observed
|
||||
failure. The actual source failure was an oversized USB CDC reply; current
|
||||
firmware splits those reads. Some historical bridge builds may report RXPS as
|
||||
unsupported while already operating continuously. Verify the reported state
|
||||
and do not substitute a normal reboot for the one-time watchdog reset.
|
||||
|
||||
Put the source on the identical TempRadio tuple. If it is a binary-mode Full
|
||||
Companion, the current `motatool` can switch modes for the serving session:
|
||||
|
||||
```bash
|
||||
motatool serve \
|
||||
--dir ./motas \
|
||||
--serial /dev/ttyACM1 \
|
||||
--baud 115200 \
|
||||
--companion-terminal \
|
||||
-v
|
||||
```
|
||||
|
||||
Omit `--companion-terminal` for an ordinary text-console OTA source. Restart
|
||||
`motatool` for every step so the source emits a fresh catalog advert. Leave it
|
||||
running during the download and stop it with Ctrl-C only after the destination
|
||||
reports `ready to install`.
|
||||
|
||||
### 3. Install all nine packages in order
|
||||
|
||||
| Step | Manifest ID | Before hash | Expected version | After hash |
|
||||
|---:|---|---|---|---|
|
||||
| 1 | `C147BCEF` | `71F4026CBE4B8B74` | `1.16.7.9` | `42BC53A64288E845` |
|
||||
| 2 | `C510B628` | `42BC53A64288E845` | `1.16.7.10` | `6F6E51D63BF3E93F` |
|
||||
| 3 | `8CAD7045` | `6F6E51D63BF3E93F` | `1.16.8.7` | `F04DA8DB515E5C6D` |
|
||||
| 4 | `8B1EEFF6` | `F04DA8DB515E5C6D` | `1.16.9.105` | `3894A4D7B11ED282` |
|
||||
| 5 | `687E3BEA` | `3894A4D7B11ED282` | `1.16.9.110` | `CDC5CA630881DA15` |
|
||||
| 6 | `0D59A34B` | `CDC5CA630881DA15` | `1.16.9.111` | `D0CC4A9E135B9A4D` |
|
||||
| 7 | `2C5C2082` | `D0CC4A9E135B9A4D` | `1.16.9.116` | `66272A0E7FEF2773` |
|
||||
| 8 | `994AB743` | `66272A0E7FEF2773` | `1.16.9.118` | `8E00019AA08E00BF` |
|
||||
| 9 | `FE986948` | `8E00019AA08E00BF` | `1.17.1.02` | `4BB1526BF647547D` |
|
||||
|
||||
For each row, first prove that `ota self` exactly matches its **Before hash**.
|
||||
Then run:
|
||||
|
||||
```text
|
||||
ota cancel
|
||||
ota ls
|
||||
ota pull MANIFEST_ID flash
|
||||
ota status
|
||||
```
|
||||
|
||||
Repeat `ota status` at a restrained interval until it says `ready to install`.
|
||||
If the manifest is initially absent, wait for a fresh source advert, run
|
||||
`ota ls` again, or restart `motatool`; do not pull a different ID. Stop the
|
||||
seeder and install:
|
||||
|
||||
```text
|
||||
get system.watchdog
|
||||
ota install
|
||||
```
|
||||
|
||||
The watchdog reply must still be `> off`. Allow up to 90 seconds for the USB
|
||||
port to disappear and return. Then run `ver`, `ota self`, and `ota help`.
|
||||
Require the row's exact **After hash**, require `bootloader: apply OK`, and
|
||||
require `rescue install <hash16>` in the help before exposing that bridge to
|
||||
the next package. Clear only the now-proven retained download with `ota cancel`,
|
||||
reapply the transfer guardrails and TempRadio tuple, restart `motatool`, and
|
||||
continue with the next row.
|
||||
|
||||
If the board boots but `ota self` says the EndF is invalid, stop. Only when
|
||||
`ota status` still identifies that row's complete staged package may the
|
||||
guarded `ota rescue install BEFORE_HASH` command be used. It is not a force
|
||||
option and must use that row's exact Before hash. If the board does not boot,
|
||||
recover the documented start/recovery UF2 locally over USB.
|
||||
|
||||
### 4. Intermediate relays and restoration
|
||||
|
||||
On every managed intermediate relay, save `get rxdelay` and `get txdelay`, then
|
||||
use the airtime-scaled collision window during the maintenance session:
|
||||
|
||||
```text
|
||||
set rxdelay 0
|
||||
set txdelay 0.3
|
||||
```
|
||||
|
||||
Current OTA transfer packets honor that configured relay `txdelay`; setting
|
||||
`0.3` gives competing relays a small randomized, airtime-scaled forwarding
|
||||
window. The source's manifest-fragment gap independently follows active packet
|
||||
airtime and duty spacing, clamped to 100-1000 ms. These two delays solve
|
||||
different problems.
|
||||
|
||||
After step 9 is proven, restore each saved destination and relay value exactly,
|
||||
then restore normal radio operation. Re-enable the RAK system watchdog last:
|
||||
|
||||
```text
|
||||
normalradio
|
||||
set system.watchdog on
|
||||
get system.watchdog
|
||||
```
|
||||
|
||||
Final success requires version `v1.17.1.02-halo-keymind-cascade-dev-e742333a`,
|
||||
body hash `4BB1526BF647547D`, target `2FA509C1`, hardware `RAK_3401`, and
|
||||
`get system.watchdog` reporting `> on`. If a relay cannot be restored before
|
||||
its TempRadio lease ends, wait for it to return to the normal channel and
|
||||
restore its saved `rxdelay` and `txdelay` there.
|
||||
|
||||
## Two-relay deployment
|
||||
|
||||
For two intermediate relays, list them farthest-to-nearest and use three OTA
|
||||
hops. Run a non-mutating preflight first:
|
||||
|
||||
```bash
|
||||
python3 tools/lora_ota/rak3401_mota_chain.py \
|
||||
--bundle /path/to/RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.01-8c5262c6.zip \
|
||||
--bundle /path/to/RAK3401-update-chain-v1.16.7-c1caa5ad-to-v1.17.1.02-e742333a.zip \
|
||||
--work-dir ./rak3401-mota-chain-work \
|
||||
--controller-serial /dev/ttyACM0 \
|
||||
--source-tcp SOURCE_IP:5001 \
|
||||
@@ -185,64 +304,38 @@ python3 tools/lora_ota/rak3401_mota_chain.py \
|
||||
--temp-radio 909.950,250,5,5,120 \
|
||||
--ota-hops 3 \
|
||||
--motatool /path/to/motatool \
|
||||
--accept-test-candidate \
|
||||
--preflight-only
|
||||
```
|
||||
|
||||
A bare relay name uses `MESHCORE_ADMIN_PASSWORD`. Append `=PASSWORD` only for
|
||||
a relay with a different password. After preflight succeeds, rerun the same
|
||||
command with `--yes` in place of `--preflight-only`.
|
||||
After preflight succeeds, rerun with `--yes` in place of
|
||||
`--preflight-only`. Confirm that the selected frequency and bandwidth are
|
||||
legal at the deployment location.
|
||||
|
||||
Arm the relay chain farthest-to-nearest while all nodes are still reachable on
|
||||
the ordinary mesh. The runner then moves the source and controller to the same
|
||||
temporary tuple. Keep the private TempRadio network reserved for OTA during
|
||||
the run; public-mesh flooding does not improve this transfer. A 120-minute
|
||||
window is the minimum used here; raise it if the selected timeouts and relay
|
||||
count require more time.
|
||||
## Rescue and completion
|
||||
|
||||
## Guarded no-EndF rescue
|
||||
The guarded `ota rescue install <base_body_hash>` command is present after
|
||||
step 1. It is not a force command: it refuses a valid normal EndF, a base
|
||||
mismatch, wrong target/hardware, or invalid payload. A failure before step 1
|
||||
completes still requires local USB recovery because the deployed start image
|
||||
predates the rescue command.
|
||||
|
||||
The rescue command is present from the first installed bridge onward. If a
|
||||
bridge remains reachable but `ota self` reports no EndF, serve and fetch only
|
||||
its exact successor package. Read that row's 16-hex `base_body_hash` from
|
||||
`CHAIN.csv`, then issue:
|
||||
Before the first mutation, the runner saves the destination's RXPS periods,
|
||||
CPU power-saving state, and RX flood delay in the persistent work directory.
|
||||
It verifies `radio.rxps off`, `powersaving off`, and `rxdelay 0` after every
|
||||
bridge reboot, then restores the original values only after the exact endpoint
|
||||
is proven. An interrupted run deliberately leaves those transfer guardrails
|
||||
active; rerunning with the same work directory resumes and restores them.
|
||||
CPU power saving was not the cause of the observed folder-source failure: that
|
||||
was a USB CDC receive-ring overrun fixed by bounded serial reads. The runtime
|
||||
settings remain conservative isolation and fast-link reliability guardrails.
|
||||
|
||||
```text
|
||||
ota rescue install <base_body_hash>
|
||||
```
|
||||
For every named `--relay`, the per-step runner also captures `rxdelay` and
|
||||
`txdelay`, writes them to `relay-timing-settings.json`, applies `rxdelay 0` and
|
||||
`txdelay 0.3` during transfer, verifies the readback, and restores both before
|
||||
the relay leaves TempRadio.
|
||||
|
||||
This is not a force command. It refuses a valid normal EndF, a base mismatch,
|
||||
wrong target or hardware, or invalid payload. OTAFIX hashes the physical
|
||||
running application before its first write. A missing/corrupt EndF can
|
||||
therefore continue through its exact successor instead of becoming stuck,
|
||||
provided the installed bridge already contains the rescue command. The
|
||||
c1caa5ad starting image predates rescue, so a failure before step 1 completes
|
||||
still requires local USB recovery.
|
||||
|
||||
## Safety and completion
|
||||
|
||||
The runner performs the following guarded sequence:
|
||||
|
||||
1. Persist `system.watchdog off`, allow the already-running watchdog to reset
|
||||
once, and prove stable uptime with the watchdog off.
|
||||
2. Recheck destination identity, OTA reach, source identity, and exact package
|
||||
base before every step.
|
||||
3. Require `system.watchdog` to report `off` immediately before every install.
|
||||
4. After every install, probe `ota self` at 10 and 20 seconds rather than
|
||||
sleeping for 90 seconds. Require the exact version and EndF body hash, then
|
||||
prove the rescue command is present before exposing that bridge to another
|
||||
step. Relayed runs keep the same 10-second probe cadence until the relays'
|
||||
mandatory return-to-normal window has elapsed.
|
||||
5. Re-enable the watchdog only after the exact step-30 endpoint boots.
|
||||
|
||||
Success requires all of the following:
|
||||
|
||||
- version `v1.17.01-halo-keymind-cascade-dev-8c5262c6`;
|
||||
- EndF body hash `3DD88C3DD7B8A35B`;
|
||||
- target `2FA509C1`, hardware `RAK_3401`;
|
||||
- normal radio `910.525 MHz`, `62.5 kHz`, `SF7`, `CR5`;
|
||||
- `system.watchdog` verified `on`.
|
||||
|
||||
A completed download or an accepted install reply is not success without the
|
||||
post-reboot identity checks. The bundle includes exact test-start and final
|
||||
local recovery UF2/ZIP files if USB recovery is ever needed.
|
||||
The runner also keeps the watchdog off across the chain, rechecks identity and
|
||||
OTA reach before every package, requires the exact post-boot EndF hash, and
|
||||
only re-enables the watchdog after step 9. Success requires endpoint body hash
|
||||
`4BB1526BF647547D`, target `2FA509C1`, hardware `RAK_3401`, normal radio
|
||||
`910.525 MHz / 62.5 kHz / SF7 / CR5`, and the watchdog verified on.
|
||||
Reference in new issue
Block a user