diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index c086178..4b52eb4 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -136,3 +136,21 @@ If current is near zero: 5. Later add touch navigation and relay controls. 6. Later add config backup/restore. 7. Later improve BMS out-of-range behavior without changing NimBLE connect timeout. + + + +## Dashboard Direction + +Current dashboard target: + +- Waveshare 5" ESP32-S3 Display +- WiFi client +- Connects to cargo ESP32 AP +- Uses existing HTTP API +- Planned LVGL implementation + +Important: + +- ESP32 cargo controller remains source of truth. +- Dashboard is a client only. +- Existing UART protocol remains supported but is no longer the primary dashboard transport. diff --git a/docs/project-state.md b/docs/project-state.md index 9b09804..d098823 100644 --- a/docs/project-state.md +++ b/docs/project-state.md @@ -163,4 +163,22 @@ Examples: 5. Add config backup/restore. 6. Improve BMS out-of-range behavior without changing NimBLE connect timeout. -- Fixed WebUI temperature probe scan by registering `/temps/scan`, `/temps/assign`, and `/temps/clear` firmware routes.\n\n- Added per-temperature-sensor `weather` flag and WebUI outside temperature badge with emoji thresholds: below 50°F ice, 50-74°F happy, 75-84°F sun, and 85°F+ fire.\n\n- Improved WebUI temperature sensor config checkbox layout with compact On/Weather controls.\n\n- Temperature probe assignment now enforces one logical slot per physical DS18B20 address; assigning a probe to a new slot clears the old slot mapping.\n\n- Added per-slot WebUI Clear buttons for temperature probe assignments using the existing `/temps/clear` API.\n\n- Fixed weather temp checkbox persistence by saving the `weather` flag from WebUI temp config and auto-saving checkbox changes.\n\n- Fixed temperature assignment clearing so Clear removes the stored DS18B20 address, disables the slot, clears weather flag, and resets cached temp state.\n\n- Hardened `/temps/clear` so clearing a temp slot removes the persisted DS18B20 address, disables the slot, clears weather flag, resets cached temp state, and supports clearing all slots with an empty POST body.\n\n- Removed legacy physical-scan-order fallback for unassigned DS18B20 slots; enabled slots now require an explicit assigned address before reporting a value.\n\n- Filtered DS18B20 scan results so already-assigned probe addresses are hidden until cleared from their configured temp slot.\n\n- Moved WebUI Temperature Assignment card directly above Temperature Sensor Config for better setup flow.\n\n- Added read-only assigned DS18B20 address display under each WebUI temperature config slot.\n\n- Fixed DS18B20 scan filtering so assigned probes are hidden from assignment results without removing them from runtime polling.\n\n- Dashboard temperature list now hides disabled, unassigned, offline, or invalid temp slots while keeping all slots visible in Config.\n\n- Fixed dashboard temp filtering to avoid requiring address in runtime temp payload.\n\n- Fixed WebUI temp config so the On checkbox fully controls whether each temp slot is enabled.\n\n- Restored Overview relay control rendering after dashboard temp layout changes.\n\n- Fixed Overview relay buttons to call the existing `relay()` WebUI handler instead of missing `setRelay()`.\n\n- Restored Overview relay controls to separate ON and OFF buttons per relay.\n \ No newline at end of file +- Fixed WebUI temperature probe scan by registering `/temps/scan`, `/temps/assign`, and `/temps/clear` firmware routes.\n\n- Added per-temperature-sensor `weather` flag and WebUI outside temperature badge with emoji thresholds: below 50°F ice, 50-74°F happy, 75-84°F sun, and 85°F+ fire.\n\n- Improved WebUI temperature sensor config checkbox layout with compact On/Weather controls.\n\n- Temperature probe assignment now enforces one logical slot per physical DS18B20 address; assigning a probe to a new slot clears the old slot mapping.\n\n- Added per-slot WebUI Clear buttons for temperature probe assignments using the existing `/temps/clear` API.\n\n- Fixed weather temp checkbox persistence by saving the `weather` flag from WebUI temp config and auto-saving checkbox changes.\n\n- Fixed temperature assignment clearing so Clear removes the stored DS18B20 address, disables the slot, clears weather flag, and resets cached temp state.\n\n- Hardened `/temps/clear` so clearing a temp slot removes the persisted DS18B20 address, disables the slot, clears weather flag, resets cached temp state, and supports clearing all slots with an empty POST body.\n\n- Removed legacy physical-scan-order fallback for unassigned DS18B20 slots; enabled slots now require an explicit assigned address before reporting a value.\n\n- Filtered DS18B20 scan results so already-assigned probe addresses are hidden until cleared from their configured temp slot.\n\n- Moved WebUI Temperature Assignment card directly above Temperature Sensor Config for better setup flow.\n\n- Added read-only assigned DS18B20 address display under each WebUI temperature config slot.\n\n- Fixed DS18B20 scan filtering so assigned probes are hidden from assignment results without removing them from runtime polling.\n\n- Dashboard temperature list now hides disabled, unassigned, offline, or invalid temp slots while keeping all slots visible in Config.\n\n- Fixed dashboard temp filtering to avoid requiring address in runtime temp payload.\n\n- Fixed WebUI temp config so the On checkbox fully controls whether each temp slot is enabled.\n\n- Restored Overview relay control rendering after dashboard temp layout changes.\n\n- Fixed Overview relay buttons to call the existing `relay()` WebUI handler instead of missing `setRelay()`.\n\n- Restored Overview relay controls to separate ON and OFF buttons per relay.\n + + +## Dashboard Architecture Update + +Primary dashboard architecture is now: + +Cargo ESP32 Controller +→ WiFi AP/STA +→ HTTP API +→ WebUI + +Dashboard Client: +→ Waveshare 5" ESP32-S3 Display +→ Connects to cargo ESP32 over WiFi +→ Consumes existing HTTP API +→ Planned LVGL-based dashboard UI + +The Raspberry Pi Pico 2 W dashboard path is no longer the primary implementation target. UART JSON remains supported as an optional interface for future expansion, debugging, or alternate dashboard hardware. diff --git a/docs/roadmap.md b/docs/roadmap.md index 902f6d2..eb2a8d8 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -479,3 +479,48 @@ Phase 4: - Alarm details Do not start with touch or config UI on the Pico. The WebUI is the preferred configuration workflow. + + + +## Revised Dashboard Roadmap + +### Phase 1 +ESP32 cargo controller backend +- WiFi +- WebUI +- Relay control +- JBD/Xiaoxiang BMS +- DS18B20 +- Config persistence + +### Phase 2 +Waveshare 5" ESP32-S3 Dashboard +- Connect to cargo ESP AP +- Read /status API +- Basic dashboard +- Battery SOC +- Voltage/current +- Temps +- Relay status + +### Phase 3 +LVGL Dashboard UI +- Touch support +- Relay controls +- Alarm screens +- Config/status pages + +### Phase 4 +Extended Vehicle Telemetry +- OBD-II +- Coolant temp +- GPS +- Trip data +- Vehicle metrics + +### Phase 5 +Advanced Integrations +- Home Assistant +- MQTT +- Grafana +- InfluxDB diff --git a/docs/wiring.md b/docs/wiring.md index 3275190..ebf6105 100644 --- a/docs/wiring.md +++ b/docs/wiring.md @@ -635,3 +635,23 @@ UART wiring: ESP32 GND -> Pico GND Do not use the ESP32 6-pin UART header for the dashboard UART. It appears to be connected to RXD/TXD for UART0/programming/debug. + + + +## Dashboard Wiring (Current Direction) + +Dashboard Hardware: +- Waveshare 5" ESP32-S3 Display + +Communications: +- WiFi connection to cargo ESP32 AP +- HTTP API polling +- No UART required for normal operation + +CAT5e Usage: +- 12V power from cargo area to dashboard +- Local buck converter in dashboard enclosure +- Common ground + +Optional Future: +- UART over CAT5e for diagnostics or alternate dashboard hardware