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:
jimmyandClaude Opus 5.5 committed 2026-11-02 23:45:38 +13:00
1 parent 1c222771a5
commit 32c0ecfa76
13 files changed
+862 -9

No files matched your search

+7 -1
View File
@@ -22,13 +22,15 @@ TTY := $(shell [ -t 0 ] && echo -it)
OWNER := $(shell docker info --format '{{.SecurityOptions}}' 2>/dev/null | grep -q rootless && echo 0:0 || echo $$(id -u):$$(id -g))
FIX_OWNER = chown -R $(OWNER) /project
.PHONY: help web build flash ota monitor flash-monitor log size menuconfig clean fullclean erase test test-driver test-envelope
.PHONY: help web build flash ota ota-drivers monitor flash-monitor log size menuconfig clean fullclean erase test test-driver test-envelope
help:
@echo "LED controller (ESP32-S3):"
@echo " make build minify + gzip the web UI, then build the firmware"
@echo " make flash flash firmware and web UI to PORT ($(PORT))"
@echo " make ota HOST=ip build, then upload the firmware (web UI included) over Ethernet (no USB)"
@echo " make ota-drivers HOST=ip [MAC=aabbccddeeff] [BROADCAST=1]"
@echo " push changed led-driver .py files over ESP-NOW (all drivers without MAC)"
@echo " make monitor serial console on PORT (Ctrl-] to quit)"
@echo " make flash-monitor flash, then open the console"
@echo " make log [SECS=10] print the console for SECS seconds and exit (no terminal needed)"
@@ -56,6 +58,10 @@ ota: build
@test -n "$(HOST)" || { echo "usage: make ota HOST=<controller ip>"; exit 1; }
python3 tools/ota.py $(HOST)
ota-drivers:
@test -n "$(HOST)" || { echo "usage: make ota-drivers HOST=<controller ip> [MAC=...] [BROADCAST=1]"; exit 1; }
python3 tools/driver_ota.py $(HOST) $(if $(MAC),--mac $(MAC),--all) $(if $(BROADCAST),--broadcast)
monitor:
$(DOCKER_RUN) $(TTY) $(DEVICE) $(IDF_IMAGE) idf.py -p $(PORT) monitor