Dim LED ring, add blink mode, and signal OTA outcome on the ring.

Default brightness is ~5%; UART blink mode and green/red pulses mark OTA success or failure. Failed UART uploads skip ESP-NOW distribution.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-19 21:53:10 +02:00
co-authored by Cursor
parent 508b684fdf
commit 8931912583
13 changed files with 324 additions and 71 deletions
+6 -2
View File
@@ -253,6 +253,8 @@ Inactive app partition is selected with `esp_ota_get_next_update_partition()`; `
`OTA_END` can take a long time on the wire (slave flash + ESP-NOW); the host should use a generous read timeout.
During OTA the LED ring shows progress at ~5 % brightness: **blue** while the image is written (UART on master, ESP-NOW on slaves), **green** on the master while it forwards the image to slaves over ESP-NOW. On **success** the ring gives one short **green** blink; on **failure** one **red** blink and ESP-NOW distribution is not started (failed UART upload / `OTA_END` validation).
`OTA_START_ESPNOW` (type `20`): re-run ESP-NOW distribution from the last staged image without a new UART upload (no-op if nothing staged).
Implementation: `ota_uart.c` (4 KiB buffer, `esp_ota_write`), `ota_espnow.c`, `cmd_ota.c`.
@@ -319,11 +321,12 @@ Control the 95-LED ring from the host. The firmware **does not** animate digits
| Field | Meaning |
|-------|---------|
| `mode` | `0` = clear, `1` = progress bar, `2` = digit |
| `mode` | `0` = clear, `1` = progress bar, `2` = digit, `3` = blink full ring |
| `progress` | 0100 (% of ring lit, mode `1`) |
| `digit` | 010 (mode `2`, same segment maps as built-in digits) |
| `r`, `g`, `b` | Color 0255 |
| `intensity` | Brightness 0255 (scaled into RGB; `0`255) |
| `intensity` | Brightness 0255 (scaled into RGB; `0`firmware default ~5 %) |
| `blink_ms`, `blink_count` | Pulse length and count (mode `3`; defaults 350 ms, 1) |
**Response:** `led_ring_progress_response` (`success`, `mode`, `progress`, `digit`).
@@ -331,6 +334,7 @@ Control the 95-LED ring from the host. The firmware **does not** animate digits
go run . -port /dev/ttyUSB0 led-ring -mode progress -progress 75 -g 80 -b 255
go run . -port /dev/ttyUSB0 led-ring -mode digit -digit 7 -r 255 -g 200
go run . -port /dev/ttyUSB0 led-ring -mode clear
go run . -port /dev/ttyUSB0 led-ring -mode blink -g 255 -blink-count 2
```
### CLIENT_INFO command