Protocol v2 (shared header, byte-identical with the 1.3 repo): - typed DATA/CONFIG frames: 0xAA | ver | type | len | payload | XOR | 0x55 - gear split into lever (P/R/N/D/S/M) + target/engaged nibbles, engine rpm, alert bitmap decided here from tunable thresholds, link_config_t tunables - docs/UART_PROTOCOL.md rewritten for v2 Controller A modules: - tunables: gauge calibration + alert thresholds in NVS, 'cfg' serial console, bench override (never persisted) - espnow_link: every frame also broadcast on ESP-NOW ch 1; radio stays in STA (WiFiManager no longer powers it off) - uart_manager: DATA at 5 Hz + CONFIG on change/5 s on both transports - can_driver: publishes gear pieces and rpm, evaluates alerts - tuning_screen: hand-coded Gauge Tuning page (swipe right from Driveline), -/+ rows, enable switches, override sliders, Driveline/Defaults buttons UI: SquareLine Home screen (3 meters + battery) and meters_manager removed; Driveline is the boot screen; Settings back-gesture calls app_show_driveline(). tools/fix_penv_deps.ps1: repairs the shared PlatformIO penv after a 1.3 build. Bench-verified with Controller B: both transports alive, dedupe, override rpm 2000 -> 133.3 Hz tach output. Co-Authored-By: Claude <noreply@anthropic.com>
2.1 KiB
type, tags, updated
| type | tags | updated | ||
|---|---|---|---|---|
| concept |
|
2026-09-21 |
Dual-Controller Architecture
The system is two ESP32-S3 boards linked by UART and ESP-NOW (repo, protocol v2 since 2026-09-21):
BMW M57N CAN bus ──▶ Controller A ──UART1 + ESP-NOW, 5 Hz──▶ Controller B ──▶ Patrol tach + temp gauge
(this repo: (ESP32-S3-LCD-1.3,
5" 1024×600 display) 1.3" round display, gauge outputs)
- Controller A — esp32-s3-touch-lcd-5b: listens to the CAN bus, renders the main UI, and re-broadcasts a compact sensor packet over UART1 (GPIO 43/44, 115200 baud) at 5 Hz.
- Controller B — ESP32-S3-Touch-LCD-1.3: a secondary display fed purely by that UART stream. Lives in a sibling repo (
bmw-patrol/parent directory).
Link protocol v2 (repo, 2026-09-21)
0xAA | 0x02 | type | length | payload | XOR | 0x55, identical on UART1 (GPIO 44 → SP3485 → 485_A/485_B) and ESP-NOW broadcast (channel 1). DATA frames (lever, target/engaged gear nibbles, rpm, temps, battery, alert bitmap, valid flags) every 200 ms; CONFIG frames (link_config_t: Patrol gauge calibration + alert thresholds, edited on A via the cfg serial console and stored in NVS) on change and every 5 s. Alerts are decided here; B only renders them. Spec: docs/UART_PROTOCOL.md. Bench-verified with both transports live and B deduplicating every frame (verified 2026-09-21).
Controller B's side of this (receiver, ESP-NOW channel hopping, gauge outputs, bench wiring) is documented in the sibling wiki: ../../ESP32-S3-LCD-1.3/wiki/pages/controller-link.md and patrol-gauge-outputs.md.
Why it matters for the wiki
Any change to what data we extract from the can-bus-integration ripples into this packet and into Controller B's parser — both ends must move together: edit include/protocol/automotive_data.h here, bump PACKET_VERSION, copy the header byte-identical to B (B rejects other versions).