Add UART OTA upload with A/B partition support.

Firmware buffers 200-byte chunks into 4 KiB blocks for esp_ota_write; goTool
uploads with per-block ACK flow control and larger UART buffers to avoid stalls.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-19 00:39:59 +02:00
co-authored by Cursor
parent 1ad527119d
commit 59ca269407
20 changed files with 806 additions and 101 deletions
+7
View File
@@ -27,6 +27,7 @@ go run . -port /dev/ttyUSB0 clients
| `unicast-test` | `0x07` | Sends ESP-NOW unicast test to one slave (`-client`, `-seq`) |
| `test` | — | Run an automated scenario (JSON configs under `testdata/`) |
| `serve` | — | Web dashboard at `http://localhost:8080` (WebSocket live updates) |
| `ota` | 1619 | UART firmware upload to inactive OTA slot (200 B chunks, 4 KiB flash blocks) |
`clients` requires slaves to have responded to master discover broadcasts first.
@@ -69,6 +70,12 @@ The dashboard can configure nodes using the same UART commands as the CLI:
HTTP API (used by the web UI): `GET/POST /api/deadzone`, `POST /api/unicast-test`.
```bash
go run . -port /dev/ttyUSB0 ota build/powerpod.bin
```
Waits for **ready** after start (~30 s erase), sends 200-byte `OTA_PAYLOAD` frames, reads **block_ack** every 4 KiB, then `OTA_END` and **success**.
```bash
go run . -port /dev/ttyUSB0 unicast-test -client 16 -seq 42
```