feat: update led-driver app files over ESP-NOW
tools/driver_ota.py (make ota-drivers) pushes the driver's .py files through the controller, one file per POST /drivers/ota/file. Drivers skip files they already have, and the rest are committed together. - one target: acked unicast, two chunks in flight - several targets: each file is broadcast once, then each driver is asked for its missing chunks and repaired by unicast - rel: rel_send_seq, rel_wait and rel_send_wait, plus a callback for the drivers' 0x26 status replies - commands are retried, because status replies are not acked - broadcast chunks are paced 50 ms apart: faster broadcast left C3 drivers unable to receive until reset - bench results in docs/BENCH_TEST.md, endpoints in docs/API.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1c222771a5
commit
32c0ecfa76
13 files changed
+862
-9
No files matched your search
+10
@@ -64,6 +64,16 @@ Wi-Fi devices are not targeted by `/ws` directly; use **`POST /presets/send`**,
|
||||
|
||||
Below, `<id>` values are string identifiers used by the JSON stores (numeric strings in practice).
|
||||
|
||||
### Driver app update over ESP-NOW — `/drivers/ota` (v2 controller)
|
||||
|
||||
Pushes led-driver `.py` files to ESP-NOW drivers, one file per request. `tools/driver_ota.py` (or `make ota-drivers`) runs a whole session. The wire format is described in `led-driver/src/espnow_ota.py`. Only one request runs at a time; a second one gets `409`.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| POST | `/drivers/ota/file?mac=<macs>&sess=<n>&path=<p>&sha=<64 hex>` | Body: the raw file (0 to 65536 bytes). `mac` is a comma-separated list of 12-hex MACs, or `all` for every ESP-NOW device. `sess` is 1–65535 and is shared by all files of one update. `path` is the device path: a root file, `patterns/…` or `lib/…`. Drivers that already have a file with that sha256 skip it. With one target the chunks go by acked unicast. With several, the file is broadcast once, then each driver is asked for its missing chunks and repaired. The file is staged as `<path>.new` until commit. Reply: `{"<mac>":{"result":"same"\|"written"\|"error","code":"…","repaired":n}}`. Error codes come from the driver (`badhash`, `badpath`, `ioerr`, `toobig`, `incomplete`, `nosess`) or the link (`no reply to begin`, `link lost`, …). |
|
||||
| POST | `/drivers/ota/commit?mac=<macs>&sess=<n>` | Each driver moves its staged files into place, updates `file_hashes.json` and resets if anything changed. Reply: `{"<mac>":{"result":"ok"\|"error"}}`. |
|
||||
| POST | `/drivers/ota/abort?mac=<macs>&sess=<n>` | Each driver deletes its staged files. |
|
||||
|
||||
### Settings — `/settings`
|
||||
|
||||
| Method | Path | Description |
|
||||
|
||||
Reference in new issue
Block a user