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>
45 lines
2.1 KiB
Markdown
45 lines
2.1 KiB
Markdown
# led-controller
|
|
|
|
ESP32-S3 controller for LED drivers: W5500 Ethernet, web UI, I2S microphone beat detection and an ESP-NOW link to the drivers. The firmware is C (ESP-IDF) at the repository root; see [`docs/BENCH_TEST.md`](docs/BENCH_TEST.md) for the bench tests.
|
|
|
|
## Build and flash
|
|
|
|
```bash
|
|
make build # minify the web UI from web/, then build the firmware (ESP-IDF in Docker)
|
|
make flash # flash over USB
|
|
make ota HOST=<ip> # update firmware (web UI included) over Ethernet, no USB (POST /ota)
|
|
make ota-drivers HOST=<ip> [MAC=..] [BROADCAST=1] # push changed led-driver .py files over ESP-NOW
|
|
make monitor # serial console
|
|
make test # driver unit tests and the C/Python envelope cross-check
|
|
```
|
|
|
|
`make` lists every target. The web UI sources are in `web/` (`static/`, `templates/`, `audio.html`).
|
|
|
|
## Other directories
|
|
|
|
- `led-driver/` (submodule): MicroPython firmware for the ESP32 LED drivers.
|
|
- `led-tool/` (submodule): `led-cli`, configures drivers over serial and updates the controller over Ethernet (`led-cli --ota HOST`).
|
|
- `led-simulator/` (submodule), `espnow-sender/`: test helpers.
|
|
- `db/`: stored zones, presets and devices, importable with `PUT /db/<name>`.
|
|
|
|
## Docs
|
|
|
|
- API reference: `docs/API.md`
|
|
- User guide: `docs/help.md` (`scripts/build_help_pdf.sh` regenerates `docs/help.pdf`)
|
|
- Specification: `docs/SPECIFICATION.md`
|
|
|
|
## Network
|
|
|
|
The controller advertises `<hostname>.local` over mDNS (default `led-controller`, plus an `_http._tcp` service). Both settings below come from `/settings` and apply on reboot.
|
|
|
|
`static_ips` is a list of networks to try, in order, each time the Ethernet link comes up. The first entry whose gateway answers ARP is used; if none does (or the list is empty) the controller uses DHCP. `netmask` defaults to `255.255.255.0`, `dns` to the gateway.
|
|
|
|
```bash
|
|
curl -X PUT http://led-controller.local/settings/settings -H 'Content-Type: application/json' -d '{
|
|
"hostname": "stage",
|
|
"static_ips": [
|
|
{"ip": "192.168.1.50", "netmask": "255.255.255.0", "gw": "192.168.1.1"},
|
|
{"ip": "10.0.0.50", "netmask": "255.255.255.0", "gw": "10.0.0.1"}
|
|
]}'
|
|
```
|