feat: sequences v2, driver frame sync and submodule updates

- Sequences v2, bridges and sim-controller changes from the working tree.
- Records the led-driver, led-tool and led-simulator commits above.
- Includes dmx-driver/ and graphify-out/.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Haiku 5.5 committed 2026-11-11 14:10:56 +13:00
1 parent 3f8f67823b
commit 50ca46fee6
657 files changed
+15818 -1107

No files matched your search

+3 -14
View File
@@ -24,7 +24,7 @@ Request and response bodies are JSON (`Content-Type: application/json`) unless n
| GET | `/` | Main UI |
| GET | `/settings/page` | Standalone settings page |
| GET | `/audio` | Live audio and beat page (level, tempo, bar position, tap) |
| GET | `/settings/editor` | Driver settings editor: sends a driver settings (`PUT /devices/<id>`) and updates its code (`/drivers/ota`) over ESP-NOW |
| GET | `/settings/editor` | Driver settings editor: sends a driver settings (`PUT /devices/<id>`) |
| GET | `/static/<path>` | UI scripts and styles |
| GET | `/favicon.ico` | 204 |
@@ -164,7 +164,7 @@ A device is `{id: MAC, name, type: "led", transport: "espnow" | "wifi", address,
| PUT | `/devices/<id>` | Merge fields. `name` cannot be blank, the MAC cannot change, `output_brightness` 0–255. Changing `name`, `max_brightness`, `num_leds`, `color_order`, `startup_mode` or `reversed` also sends them to the driver as `device_config` |
| DELETE | `/devices/<id>` | Delete |
| GET | `/devices/status` | Per driver: `{"last_ack_ms_ago": ms or -1, "failed_messages": n}` from the acked link |
| POST | `/devices/ping` | Body `{"timeout_s": 0.5–30}` (default 3). Broadcasts a ping and collects replies: `{"ok", "ping_id", "timeout_s", "responses": {mac: {mac, name, rtt_ms}}, "registered": n}`. Drivers that answer are added or renamed |
| POST | `/devices/ping` | Body `{"timeout_s": 0.5–30, "broadcast": bool}` (timeout default 3). Sends the ping as an acked unicast to each known device and collects replies; `"broadcast": true`, or no known devices, broadcasts it instead so new drivers are found: `{"ok", "ping_id", "timeout_s", "responses": {mac: {mac, name, rtt_ms}}, "registered": n}`. Drivers that answer are added or renamed |
| POST | `/devices/layout` | Body `{"placements": {mac: {x0, y0, x1, y1} \| null}, "center"?: {x, y}}`: where each bar sits, in any units with y up, and the rig's centre (kept in `settings.rig_center`; without one, the layout's bounding-box centre). `x0,y0` is LED 1, the data-in end; `null` removes a bar. Saved as the device's `placement`. Then every placed ESP-NOW driver gets `device_config.place`: its ends relative to the centre, scaled so the furthest end is 1 from it. Reply `{"updated", "sent", "failed"}`; 400 without `placements` |
| POST | `/devices/groups` | Send every ESP-NOW driver its groups and wait for the acks: `{"ok", "total", "sent", "failed"}` (503 when any failed, 400 with no ESP-NOW devices) |
| POST | `/devices/resolve-brightness` | Body `{"macs": [...], "zone_brightness"?}` → `{"values": {mac: brightness}}` |
@@ -261,8 +261,7 @@ Pattern metadata is the `pattern` collection, keyed by name. Pattern sources are
| GET | `/patterns/ota/file/<name>.py` | The source (`text/plain`); 400 for `on`/`off`, 404 when missing |
| POST | `/patterns/upload` | Body `{name, code, overwrite?}`: store a source. 409 when it exists and `overwrite` is false. 201 |
| POST | `/patterns/driver` | Body `{name, code, overwrite?, min_delay?, max_delay?, max_colors?, n1?..n8?}`: store the source and its metadata (`n1`–`n8` are parameter labels). The name must be an identifier. 201 |
| POST | `/patterns/<name>/send` | Push the source over ESP-NOW to one driver (`{"device_id"}`) or every ESP-NOW driver, as `patterns/<name>.py`; drivers that wrote it reset to load it. `{"message", "pattern", "device_ids", "sent_count", "results"}`; 503 when none took it |
| POST | `/devices/<id>/patterns/push` | 400: use `/patterns/<name>/send` |
| POST | `/devices/<id>/patterns/push` | 400: not supported for ESP-NOW devices |
## Palettes — `/palettes`
@@ -301,16 +300,6 @@ Zones do not render to outputs: only the test pattern is sent.
On connect the controller sends `{"type": "device_tcp_snapshot", "connected_ips": []}` (there are no Wi-Fi driver sessions). Each text frame is a driver message (JSON object), sent as `/presets/push` would send it: an optional `to` (MAC) addresses one driver, otherwise it is broadcast. A frame that is not a JSON object, or a failed send, gets `{"error": ...}` back. A plain GET gets 426.
## Driver app update — `/drivers/ota`
Pushes led-driver `.py` files to ESP-NOW drivers, one file per request; `tools/driver_ota.py` (`make ota-drivers`) and the editor at `/settings/editor` run a whole session. The firmware embeds the driver files from its build: `/static/driver/manifest.json` lists `{path, sha, size}` and `/static/driver/<path>` serves each. The wire format is in `led-driver/src/espnow_ota.py`. One request runs at a time; another gets 409.
| Method | Path | Description |
|--------|------|-------------|
| POST | `/drivers/ota/file?mac=<macs>&sess=<n>&path=<p>&sha=<64 hex>` | Body: the raw file (up to 65536 bytes). `mac` is a comma-separated list of MACs, or `all` for every ESP-NOW device. `sess` (1–65535) is shared by every file of one update. `path` is the driver path: a root file, `patterns/…` or `lib/…`. Drivers that already have that sha256 skip it. One target gets acked unicast. Several get one broadcast, then each is asked for its missing chunks and repaired. The file is staged until commit. Reply: `{"<mac>": {"result": "same" | "written" | "error", "code"?, "repaired": n}}` |
| POST | `/drivers/ota/commit?mac=<macs>&sess=<n>` | Drivers move their staged files into place, update `file_hashes.json` and reset if anything changed |
| POST | `/drivers/ota/abort?mac=<macs>&sess=<n>` | Drivers delete their staged files |
---
## Driver messages