62 Commits

Author SHA1 Message Date
490e0ee61f Add UART SET_LOG_LEVEL for runtime master ESP-IDF logging.
Expose the command via goTool CLI/REST and dashboard controls so log verbosity can be tuned without reflashing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 18:03:34 +02:00
ac223ada72 Added ECHO cmd and fixed some timing issues 2026-06-06 17:44:40 +02:00
35ce1476d8 Missed for Previous Commit 2026-06-06 17:17:42 +02:00
f89ea3cbe3 Stabelized OTA Update with Retries 2026-06-06 17:15:55 +02:00
99956e3362 Update InputClientSample struct to make TapKind optional and improve WebSocket API documentation. Adjust README to reflect changes in input push stream format and clarify connection flow. Enhance API_WEBSOCKET.md with detailed command and push message descriptions. 2026-06-06 12:26:31 +02:00
ab1844ac32 Fix UART hang after master restart from the dashboard.
ReadFrame now returns on serial timeout instead of looping forever, and
serve closes and reopens the port after a master reboot so polling and
API commands can resume.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 16:45:57 +02:00
e4ce18edd8 Close UART gracefully on SIGINT/SIGTERM in goTool.
Go exits on Ctrl+C without running defers, leaving the serial port locked; register shutdown hooks for serve and CLI commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 16:40:22 +02:00
0eea27a876 Fix web OTA upload and isolate OTA sessions across firmware and goTool.
Split ESP-NOW into core/master/slave modules, block non-OTA UART traffic during updates, and hold the host serial port exclusively so dashboard polling cannot interleave with firmware uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 16:35:18 +02:00
0cbc4d0644 Add ESP firmware architecture and reference documentation.
Document UART command flow, ESP-NOW data paths, and module map for
developers without covering goTool; link from main/README.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 15:55:32 +02:00
35b39fce46 Add configurable BMA456 tap detection profile in bosch456.h.
Centralize multitap tuning so sensitivity and timing can be adjusted without changing driver init logic.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 14:03:46 +02:00
41a66d4417 Unify external WebSocket push into a single input stream.
Replace separate accel/tap commands and messages with set_input_stream and input pushes that combine accel and tap per client, including pre_fetch timing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 13:47:39 +02:00
498b89d7ba Clear tap status in dashboard after 2s display window.
formatLastTap no longer falls back to server last_tap once the
ephemeral tapDisplay timer expires.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 21:25:03 +02:00
31e539052a Unify cache polling on CACHE_STATUS and split API docs.
Replace separate accel/tap snapshot UART commands with one clients[] response
that omits unsubscribed fields; remove snapshot handlers and CLI commands.
Add goTool/docs for WebSocket streams and REST; tap-snapshot REST uses CACHE_STATUS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 21:23:09 +02:00
a85d48320e Add list_clients WebSocket command to external API.
Lets API clients discover slave IDs and stream/notify flags before configuring per-slave accel or tap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 21:02:41 +02:00
f512936d97 Add CACHE_STATUS UART poll and dashboard live stream.
Combine cached accel and tap in one low-overhead master command for ~16 ms
host polling. The dashboard uses a single live-stream toggle plus per-slave
accel-stream controls; fix live_stream state so polling is not cleared every
slow client refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 20:57:54 +02:00
a8d4d42920 Add BMA456 tap detection with ESP-NOW notify and host snapshot API.
Slaves forward configured tap kinds to the master; goTool exposes CLI, dashboard, REST, and WebSocket with separate notify vs receive and 2s display cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 20:42:57 +02:00
3cb0b5bbe9 Add LiPo battery monitoring with ESP-NOW cache and dashboard API.
Slaves report pack voltages every 30s; the master caches them for fast
BATTERY_STATUS reads. goTool exposes REST/WebSocket and shows values in
the dashboard, with a nanopb fix so optional lipo submessages encode.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 20:14:28 +02:00
eb67a46158 Add LED ring control per client and broadcast over REST and WebSocket.
Solid color mode fills all ring LEDs; master routes UART commands to slaves
via ESPNOW_LED_RING. goTool exposes POST /api/led-ring, WebSocket set_led_ring,
and a dashboard LED panel with master/slave/all targets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 19:24:55 +02:00
47c75110c9 Stream slave accel via ESP-NOW with master snapshot cache.
Slaves push BMA456 samples at 16ms when enabled; the master caches per
client and exposes ACCEL_SNAPSHOT and ACCEL_STREAM over UART. goTool adds
dashboard stream controls, HTTP accel-stream routes, and an external
WebSocket API with per-connection receive/interval and slave stream commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 19:11:36 +02:00
ba20544762 Add UART ACCEL_READ command for on-demand BMA456 samples.
Expose MessageType 24 with protobuf response (success, x, y, z in raw LSB),
firmware handler with mutex-safe I2C read, goTool `accel` CLI, and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 19:55:02 +02:00
16c521f71c Move UART command handlers into main/cmd/ for clearer layout.
Add cmd/ to CMake include paths and update documentation paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:49:11 +02:00
95d5a9747a Extend autotest to cover all UART commands except OTA upload.
Add led_ring, find_me, restart, and ota_progress steps plus uart_cmds scenario.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:41:23 +02:00
a9e08107b4 Add RESTART command for master and slaves via ESP-NOW.
UART RESTART (client_id 0 = local reboot, >0 = unicast); dashboard and CLI hooks; delayed esp_restart after response.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:33:22 +02:00
5c3cf65bca Persist accelerometer deadzone in NVS across reboots.
Each node saves its local deadzone on UART or ESP-NOW set; pod_settings loads and applies it after BMA456 init.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:29:00 +02:00
2e88358c53 Add feature development guide and fix ESP-NOW proto generation.
Document UART-to-ESP-NOW flow using Find me; align proto_generate_espnow with uart (python3, -I .).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:09:24 +02:00
efd6260201 Add find-me LED locate on master and slaves via ESP-NOW.
UART FIND_ME (client_id 0 = local ring, >0 = unicast), ESPNOW_FIND_ME payload, CLI/dashboard buttons per slave.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:04:07 +02:00
8931912583 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>
2026-05-19 21:53:10 +02:00
508b684fdf Add UART LED_RING command for progress bar, digits, and clear.
Stop the main-loop digit demo so host-driven display persists; expose
clear/progress/digit modes with RGB and intensity via protobuf and goTool.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 21:18:18 +02:00
a0f4a81a55 Add per-slave ESP-NOW OTA progress over UART and fix dashboard updates.
Expose OTA_SLAVE_PROGRESS on the master, track per-slave state during
distribution, run ESP-NOW OTA in a background task so the host can poll
while slaves update, and show master/slave progress in the dashboard
with table layout and faster WebSocket refresh during uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 21:07:46 +02:00
5a948a5c8c Document ESP-NOW slave OTA and dashboard upload flow.
Describe master-to-slave distribution after UART OTA, partial final block, reboot, and goTool /api/ota behaviour.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 01:02:45 +02:00
9b7bda8551 Distribute master OTA images to slaves over ESP-NOW.
After UART OTA the master reads the staged partition in 4 KiB blocks (200 B ESP-NOW chunks), waits for per-slave block ACKs, and fixes the final partial block. Slaves reuse ota_uart; send pacing and logging improve reliability.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 01:00:56 +02:00
4bf43d8a5e Add web dashboard OTA upload with live progress.
Share UART OTA logic between CLI and serve via POST /api/ota, WebSocket progress events, and a dashboard upload UI showing the running partition.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:45:54 +02:00
59ca269407 Add UART OTA upload with A/B partition support.
Firmware buffers 200-byte chunks into 4 KiB blocks for esp_ota_write; goTool
uploads with per-block ACK flow control and larger UART buffers to avoid stalls.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:39:59 +02:00
1ad527119d Add board input driver for button and LiPo ADC logging.
TODO: Hardware pinning in powerpod.h (TASTER_GPIO, V_LIPO_1/2_GPIO) does not
match final hardware yet — verify against schematic before production.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:16:40 +02:00
80fb9cf55e Improve dashboard master config and separate slave deadzone updates.
Always show master deadzone input with read/set controls; apply bulk slave
changes via slaves_only without changing the master's BMA456.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:15:35 +02:00
85aeab85c0 Add web dashboard configuration for master and slaves.
Expose deadzone and unicast-test via HTTP API and UI, reusing the same UART commands as the CLI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:10:33 +02:00
caf1b8d0d8 Add Makefile target for goTool web dashboard.
gotool-serve runs serve with configurable SERVE_ADDR (default :8080).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:05:46 +02:00
c4696657a7 Add goTool web dashboard with UART auto-reconnect.
Serve polls the master over UART and pushes live state via WebSocket;
reopens the serial port when the device is unplugged and comes back.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 00:04:57 +02:00
0299ba44fd Add bench UART ports and cold-start reset to goTool autotest.
Bench configs define command and console serial paths; scenarios can
reset nodes via esptool before tests. Smoke resets all nodes then waits
for ESP-NOW join.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:44:58 +02:00
d24b0cb5c3 Add goTool autotest with bench configs and UART scenarios.
JSON configs describe network and node MACs; scenarios run command
sequences with expect checks. Share UART client API across CLI and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:36:28 +02:00
a8ae65d9dc Align BMA456H driver with Powerpod and document sensor integration.
Clarify hearable variant usage, clean up I2C/GPIO/tap init, and add README
coverage for hardware, boot behavior, deadzone paths, and logging.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:27:20 +02:00
e95097085d Add uart_cmd helpers to deduplicate UART command handlers.
Centralize protobuf decode, response init/send, registration, and common
nanopb encode callbacks; refactor existing cmd_* modules to use them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:21:48 +02:00
20fea02b78 Add Makefile shortcuts for goTool and ignore built binary.
Expose common gotool targets (build, clients, version, unicast-test,
deadzone) with configurable PORT, and add goTool/.gitignore for gotool.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:16:29 +02:00
241e82b35b Fix ESP-NOW unicast by using sender MAC in client registry.
Register slaves from recv src_addr instead of protobuf mac bytes, add
ESPNOW_UNICAST_TEST for path verification, restore unicast deadzone, and
expose unicast-test in goTool.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:15:03 +02:00
ee38ce551a Add accelerometer deadzone via UART and ESP-NOW.
Filter BMA456 logs by configurable LSB threshold; master can set deadzone
for local sensor or slaves using ACCEL_DEADZONE (UART) and ESP-NOW broadcast
until unicast delivery is restored.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:06:25 +02:00
e5db0b21c7 Add optional BMA456 accelerometer init on shared I2C bus.
Probe and configure the sensor when present; log and continue boot if
init fails so boards without BMA456 still run normally.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:51:32 +02:00
755bdd92d7 Refactor ESP-NOW air protocol to nanopb protobuf.
Add esp_now_messages.proto with EspNowMessage types, encode/decode helpers,
and Makefile targets to regenerate firmware and UART schemas together.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:44:57 +02:00
6cdca4f3ad Add ESP-NOW heartbeat, client timeout, and slave reconnect.
Slaves send HEARTBEAT every 1s; the master marks clients inactive after
3s without traffic and reactivates on reconnect. CLIENT_INFO reports
last_ping as milliseconds since the last packet, not uptime.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:39:10 +02:00
16bfbd1091 Add goTool clients subcommand for CLIENT_INFO query.
Refactor into version/clients subcommands with shared serial framing
to list registered slaves from the master over UART.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:26:42 +02:00
92e146e2ed Add client registry and CLIENT_INFO UART command on master.
Track ESP-NOW slaves in a shared registry and respond to CLIENT_INFO
with protobuf ClientInfoResponse; ESP-NOW path upserts registry entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 22:26:42 +02:00