Commit Graph
179 Commits
Author SHA1 Message Date
jimmyandClaude Sonnet 5.5 2543673bd8 feat: sequences v2, bridges, and sim-controller
Rework sequences (engine, seqplay, envelope, API, web UI), add bridge
support, add the host sim-controller and rig simulation tests, and
update docs, presets and project tooling config.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 17:47:27 +13:00
jimmyandClaude Opus 5.5 d664026ee5 feat: sequences can step on time; searchable group pickers
- Sequences: advance_mode "time" makes each step last its `seconds`
  (0.1–3600) instead of beats; editor gets a "Steps last" selector.
- UI: search box in the groups modal; searchable add pickers for zone
  groups and presets.
- Preset "try" sends only to the current zone's groups, never broadcast.
- led-driver: max_brightness ceiling from device config; follow a
  controller that restarted its beat counter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:05:31 +13:00
jimmyandClaude Sonnet 5.5 38162d4b89 feat: faster, correct preset editor; default presets use their own pattern
- Editing a preset can change its pattern (the dropdown was disabled).
- on, off and rainbow are built-in patterns and are always listed, so the
  editor no longer falls back to the first pattern (aurora) for them.
- The editor loads the pattern names once and only the selected pattern's
  definition (new GET /patterns/names and GET /patterns/<name>).
- A shared GET cache (fetch_cache.js) reuses profile, palette, zone, preset,
  group and pattern lookups; any write clears it and entries expire at 30 s.
- The seeded rainbow preset uses the rainbow pattern.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:46:11 +13:00
jimmyandClaude Sonnet 5.5 d4118072f6 feat: log how long each API request takes
Every request through the locked API handlers logs lock wait, handler
time, and the split into build, JSON print and send.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:46:05 +13:00
jimmyandClaude Sonnet 5.5 f85021d40d feat: Wi-Fi access point with a setting, password and boot button
The controller runs an AP (SSID = hostname, 192.168.5.1) next to ESP-NOW,
on by default. Network settings gain an on/off switch (ap_enabled) and an
optional WPA2 password (ap_password, 8-63 chars; empty is open). A button
on D7 (GPIO44) held at boot forces the AP on.

Wi-Fi now starts before Ethernet, and a missing W5500 no longer aborts the
boot: the web server and mDNS start anyway so the AP stays usable.

Network tuning found while testing over the AP: HTTP backlog 10 and 12 open
sockets (the default 5 dropped the 6th SYN, a 1 s stall on every page load),
larger TCP and Wi-Fi buffers, and IPv6 link-local addresses so mDNS answers
AAAA queries (browsers waited about a second for them).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:46:05 +13:00
jimmyandClaude Sonnet 5.5 9989dd3062 build: make runs build, flash and monitor; make flash only flashes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:45:59 +13:00
jimmyandClaude Opus 5.5 06953028ab feat(ui): driver settings and code updates over ESP-NOW
Settings gets a Driver tab (/settings/editor). It sends a driver its settings through PUT /devices/<id>, which now forwards name too, and runs the tools/driver_ota.py session from the browser. The firmware embeds the led-driver files and a manifest of their hashes, because crypto.subtle is unavailable over plain HTTP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 23:51:41 +13:00
jimmyandClaude Opus 5.5 2f0c26e9b8 feat: default IP, reset reason in /status, seeded default group
With no DHCP answer in 15 seconds the controller takes 192.168.4.1/24, for a cable straight to a PC with a static IP. /status reports why the board last restarted. First boot also seeds a default group that the default zone plays to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:25:22 +13:00
jimmyandClaude Opus 5.5 4372ba4105 fix: recover a collection cut off between remove and rename
store_save removes the old file before renaming the finished .tmp, so a restart between the two started that collection empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:25:22 +13:00
jimmyandClaude Opus 5.5 f47237696e fix: stop the first-boot seed overflowing the event task
The seed runs from the got-IP handler on sys_evt, whose 2304-byte stack overflowed on the flash writes. A store with no profile then crashed mid-save on every boot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:25:22 +13:00
jimmyandClaude Opus 5.5 190c8bc982 feat: seed a default profile at first boot
A store with no profile gets a default one, using the seed POST /profiles already
creates plus a starter palette. db/ now holds those records instead of stored
data, and the unused db/presets/*.bin files are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:47:00 +13:00
jimmyandClaude Opus 5.5 b6aa0635ae build: refresh the build time on every build, default make ota host
A web-only change relinked without recompiling esp_app_desc.c, so the image kept
its old build time. make ota now uses led-controller.local unless HOST is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:47:00 +13:00
jimmyandClaude Opus 5.5 a560a1a72b feat(ui): Edit mode Menu on desktop, device groups and Identify
Sequences, Settings and Audio only show in Edit mode. On wide screens the Edit
mode actions and Run mode move into the Menu.

Edit device gets a Groups checklist. The Devices list and Edit device group
show names without addresses, and every device in Edit device group, in the
group or in the list to add from, gets an Identify button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:47:00 +13:00
jimmyandClaude Opus 5.5 24d3c1149d test(api): share one profile() fixture in conftest
Six test files each defined the same profile() fixture. It now lives once
in conftest.py, with test_profiles.py's 201 check on create.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 01:35:56 +13:00
jimmyandClaude Opus 5.5 16a3d3aa26 fix(ui): bring back v1's header and menu
The header is one row again: zone tabs on the left, then the BPM readout,
and on wide screens the Beat/Downbeat switch, brightness and the buttons.
Under 1000 px the buttons fold into the Menu, which opens with the mode
toggle and brightness, as in v1. Groups and the Beat/Downbeat switch from
main are kept; the Zones dropdown main used on narrow screens is gone,
since the zone tabs stay visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 00:55:26 +13:00
jimmyandClaude Opus 5.5 011883a6a8 feat(ui): one-line header with every action in the Menu
Zone tabs, the BPM readout and the Menu share one line at every width.
The header buttons and the Beat/Downbeat switch move into the Menu (the
narrow-screen layout, now everywhere), and the brightness slider sits at
the bottom of the Menu, under its items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:46:39 +13:00
jimmyandClaude Opus 5.5 b2cd242390 docs: describe the v2 controller's API, UI and tests
API.md now documents what the firmware serves: groups, combined
brightness, beat-driven sequences, import/export, /api/audio, patterns
over ESP-NOW, outputs, /ws, driver OTA, and how API calls become driver
messages and group commands. The user guide follows the current UI; the
in-app audio help describes the microphone instead of input devices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:42:03 +13:00
jimmyandClaude Opus 5.5 bfeeb958df feat: main's import/export, zones, audio API and web UI
Profiles, presets and sequences export and import as main's bundles.
Zones carry group_ids, preset_group_ids, sequence_ids, content_kind and
brightness; profiles seed rainbow as colour_cycle, and deleting a
profile also deletes its sequences. Groups, zones and sequences written
by older versions are migrated at boot.

/api/audio (status, event stream, start/stop, reset, anchor-bar,
devices) maps main's audio detector onto the mic's beat detector. Audio
start/stop picks whether mic beats or the BPM clock time sequences; the
clock's beats also go to the drivers while the mic is off.
/ws now greets from a post-handshake callback (httpd does not call the
handler for the upgrade).

The web UI is main's, plus v2's outputs editor, list search and
hostname/static IP settings; the bridge, Wi-Fi AP and led-tool parts
are gone. API tests follow main's behaviour (119 pass on the board).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 20:34:22 +13:00
jimmyandClaude Opus 5.5 04b56c6ef2 feat: device groups, combined brightness and beat-driven sequences from main
Groups (registry of driver MACs, optionally scoped to a profile) become
the drivers' group membership, alongside z<zone id> for zones that still
name drivers. Zones play to their group_ids. Group and device routes for
driver config, brightness (global x groups x device x zone) and identify.
The push path takes main's message shape: select as a list, groups as a
filter (one GROUP_CMD per group, or JSON when a preset has a background),
short keys so JSON fits a frame.

Sequences follow main: lanes of {preset_id, beats} steps played to each
lane's groups, advanced by the mic's beats or a clock at
audio_simulated_bpm; a switch waits for the next beat or downbeat; sync-
phase, stop (clears the zone's drivers) and status. This replaces the
time-based per-zone sequencer and scene playback, as in main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 18:09:42 +13:00
jimmyandClaude Opus 5.5 19fea0b0a1 feat: ping drivers and push groups from the devices modal
POST /devices/ping broadcasts an ESP-NOW PING_REQ, collects the drivers'
PING_RSP for timeout_s and registers or renames the ones that answer. A
reply also counts as the driver being heard, so group updates go to it
again. POST /devices/groups sends every ESP-NOW driver its groups and
reports the acks. The devices modal gets the Ping drivers and Update
groups buttons from main, with per-driver ping dots.

UI files are now served with Cache-Control: no-cache and the firmware
build hash as ETag, so a browser picks up a new UI right after an update
instead of a day later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:53:56 +13:00
jimmyandClaude Opus 5.5 e7f238aebc fix: stop group updates to silent drivers from starving zone play
Every acked unicast holds a pending slot for its whole retry run, so zone
and profile edits with drivers switched off filled the link and the next
zone play timed out (503). Group updates now go to a driver that has
failed three messages in a row at most once every 30 s; one that comes
back still gets its groups when it announces or resyncs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:38:51 +13:00
jimmyandClaude Opus 5.5 57182188ba feat: port the remaining v1 API to the v2 controller
Profiles seed presets, a default zone and a palette, and clone with their
own copies; deleting a profile removes what it owned. Zones get the v1
list shape, set-current, current, clone and content-fragment. Devices are
keyed by MAC with v1 validation and identify. Patterns: definitions, OTA
file and manifest, upload, driver, and send over ESP-NOW (the led-driver
pattern sources are embedded in the firmware). Pixel outputs get v1
validation and a DDP/Art-Net/sACN test pattern. Sequences, palettes and
settings follow v1 replies and validation, and /ws forwards browser
messages to the drivers.

The resource handlers move out of api.c into res_*.c, patterns.c and
outputs.c. cJSON now allocates from PSRAM: the store had grown enough to
starve internal RAM and abort the mic at boot. /status reports
free_internal.

The Wi-Fi AP and led-tool routes are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 09:58:17 +13:00
jimmyandClaude Opus 5.5 4b42391a46 test: port the v1 endpoint and browser tests to v2
HTTP tests against a running controller (make test-api HOST=ip). They
snapshot every collection through /db and restore it afterwards. v1
behaviour v2 does not have yet is marked as a strict xfail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 01:33:08 +13:00
jimmyandClaude Opus 5.5 9d628aa3c8 fix: run the W5500 SPI bus at 10 MHz
At 20 MHz the controller intermittently dropped every Ethernet frame
over about 900 bytes, while small packets got through. The web UI then
hung after the first chunk of a response. At 10 MHz, full-size pings
and repeated fetches of every UI file all succeed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:50:46 +13:00
jimmyandClaude Opus 5.5 32c0ecfa76 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>
2026-11-02 23:45:38 +13:00
jimmyandClaude Opus 5.5 1c222771a5 refactor: move the v2 controller to the repository root
The ESP-IDF project, docs, tools, tests and web UI move from v2/ to the
root, and the Makefile, README, build scripts and test runner drop the
v2/ prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 23:44:58 +13:00
jimmyandClaude Sonnet 5.5 71bd320661 feat(v2): move web UI into v2, remove legacy MicroPython app
Move the web assets and templates under v2/web, drop the old src/, lib/
and scripts, and update firmware, tools, docs and db files. Add the audio
page, LED test scripts and VPN autoconnect script.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 20:30:02 +13:00
jimmyandClaude Sonnet 5.5 6c16998691 feat(v2): OTA firmware update over Ethernet
POST /ota writes the image to the idle app slot and reboots; GET /ota
reports the running slot. App rollback is enabled, and a new image confirms
itself after 10 s. Adds make ota HOST=<ip>, tools/ota.py and the led-tool
--ota update.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 00:22:55 +13:00
jimmyandClaude Sonnet 5.5 8d78af1246 docs(v2): bench guide results for the loss, beat, USB and C3 tests
Adds the audio endpoints, the Makefile pointer, the first-run results of
the lossy-link and beat tests, the USB and analyzer latency methods and the
ESP32-C3 comparison (delivery, latency, frame rate, Wi-Fi start-up order).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:30:26 +13:00
jimmyandClaude Sonnet 5.5 899d4f2418 build(v2): root Makefile for build, flash and monitor
make build / flash / monitor / flash-monitor / log / size / menuconfig /
erase / clean / test run ESP-IDF in Docker and handle rootless ownership.
Adds the helper scripts behind log and test, and a --settle option for
usb_latency.py (an ESP32-C3 driver resets when its port is opened).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:30:26 +13:00
jimmyandClaude Sonnet 5.5 f7ac4ab290 feat(v2): audio page, beat endpoints and an Audio menu button
Restores the live audio section from esp32-eth: /audio page, /audio.wav
stream, /beats event feed, POST /tap and /time, and the mic and beat state
in /status. The web build adds an Audio entry to the header menu and the
mobile dropdown for the v2 copy of index.html only, so the Pi UI is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:30:26 +13:00
jimmyandClaude Sonnet 5.5 d332d447aa fix(v2): do not wipe a driver's groups when it announces and is in no zone
The controller sent a GROUPS packet on every driver hello. For a driver in
no zone that was an empty list, which replaced the groups stored on the
driver. It is now sent at announce and resync only when the list is not
empty; explicit zone and device edits still send every list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 22:30:26 +13:00
jimmyandClaude Sonnet 5.5 a94d6a7de5 feat(v2): ESP32-S3 controller with Ethernet, I2S mic beat detection and ESP-NOW
New ESP-IDF project in v2/ that replaces the Pi and the UART bridge:

- W5500 Ethernet, INMP441 beat/tempo detector (from esp32-eth), ESP-NOW master
- LittleFS data store and a JSON API over the Pi's db/*.json collections,
  with /db import and export; web UI minified and gzipped at build time
- Zone play/stop as 0x4C GROUP_CMD, preset push/send as CMD (binary v2
  envelope, byte-identical to src/util/binary_envelope.py), sequencer and
  scenes, driver registration from the boot hello
- Reliable bulk link: acks with retransmit, fragments, state-version digest
  and resync; beat frames sent twice with a lead so drivers fire together
- Bench tooling: lossy-link mode, synthetic beats with echo measurement,
  USB and logic-analyzer latency scripts, and docs/BENCH_TEST.md

Needs the matching led-driver changes (p2p branch) to receive the link and
beat frames.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 17:15:28 +13:00
jimmyandClaude Sonnet 5.5 7336c7fb22 docs: document engine, outputs, sequences, brightness and search; update spec
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 02:02:13 +13:00
jimmyandClaude Opus 5.5 3a7723c586 feat(ui): add search filter to devices, zones and presets modals
Client-side filter that hides non-matching rows as you type, persists
across list re-renders, and clears when the modal is reopened or on Esc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:11:55 +13:00
jimmyandClaude Opus 5.5 a5a7fc575f feat(engine): Pi-side animation engine with protocol outputs and sequencer
Add src/engine, modelled on technicalkiwi/portal's player and sequence runner:

- Pixel generator: runs the unchanged led-driver patterns under CPython
  (utime shim + NeoPixel-like buffer) on a per-zone render thread and
  streams frames to pixel outputs, with keepalive for static frames.
- Output drivers: DDP, Art-Net (ArtDMX/ArtSync), sACN/E1.31, USB-DMX
  (Enttec Pro / Open DMX), plus an ESP32 preset output that reuses the
  existing preset + select delivery path. Registry in db/output.json,
  CRUD and test pattern at /outputs.
- Sequencer: timed preset chains per zone (portal step shape), deadline
  scheduling, loop/repeat, resume after restart; legacy sequence records
  are migrated. Zone play/stop, sequence and scene play/stop endpoints.
- CLI (python -m engine.cli), Outputs and Sequences modals, preset tiles
  drive pixel outputs, API/README docs, engine test suite.

ESP32 firmware is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 13:24:14 +13:00
piandCursor 827eb97203 feat(settings): server global brightness and Wi-Fi driver resync
- Serve GET /settings as JSON by removing duplicate HTML route (use /settings/page for the standalone UI).

- Save global_brightness via PUT; broadcast to connected drivers; push saved level when outbound WS connects.

- Zones UI loads brightness from GET /settings only (no localStorage).

- Bump led-driver submodule for settings.save on brightness with save flag.

- Extend API doc and endpoint tests for global_brightness.

Co-authored-by: Cursor <cursoragent@cursor.com>
xchc-1.0
2026-05-03 22:15:30 +12:00
piandCursor 3cca0cffc5 chore: bump led-tool and led-driver submodules
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 21:27:32 +12:00
piandCursor d36828bde2 feat(ui): persist header brightness slider in localStorage
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 21:27:31 +12:00
piandCursor ed0048c795 chore(service): avoid network-online stall and speed pipenv boot
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 21:27:31 +12:00
piandCursor b316edbaf9 fix(wifi): stagger driver ws dials and extend initial retry window
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 21:27:31 +12:00
jimmyandCursor c1b0c41ef2 fix(transport): disable UART ESP-NOW bridge by default
Require serial_enabled true in settings to open serial_port; default false in
set_defaults for Wi-Fi-only and dev machines.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 15:07:16 +12:00
jimmyandCursor 3bb75d49de feat(util): add binary envelope packing and message helpers
Includes tests for v1/v2 envelope round-trips.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 14:56:37 +12:00
jimmyandCursor 3d77cb448a chore: add vertical stand OpenSCAD model
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 14:56:35 +12:00
jimmyandCursor 49383c0003 feat(espnow): add espnow-sender utility
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 14:56:35 +12:00
jimmyandCursor 7d821b9c1c chore(db): add local preset fixtures
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 14:56:35 +12:00
jimmyandCursor 9b7e387ea6 chore(scripts): add dev-run helper
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 14:56:34 +12:00
jimmyandCursor b4f0d1891e chore(submodule): bump led-driver and led-tool; register led-simulator
led-simulator was already a gitlink; add the missing .gitmodules entry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 14:56:30 +12:00
jimmy 0da30b6d6b fix(submodule): update led-tool pointer to existing commit 2026-04-30 23:28:39 +12:00
jimmy 6cbb728d9a feat(patterns): add new pattern suite and improve mobile controls
Add a broad set of LED patterns with metadata/tests and update zone/profile preset seeding, while refining mobile/desktop UI behavior for scrolling, brightness controls, and bulk pattern sending.
2026-04-23 20:07:55 +12:00