Link protocol v2, ESP-NOW leg, gauge tunables + tuning screen; remove Home screen

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>
This commit is contained in:
2026-09-21 19:12:31 +02:00
parent a8f68ebc27
commit f60bdac268
33 changed files with 1743 additions and 2266 deletions
+34
View File
@@ -0,0 +1,34 @@
# Repairs the PlatformIO Python environment for this project.
#
# Symptom: "Error: Failed to install Python dependencies into penv (exit code: 2)"
# at the start of `pio run`.
# Cause: The sibling ESP32-S3-LCD-1.3 project uses the official espressif32@6
# platform, which installs newer urllib3 / esptool into the shared penv.
# This project's pioarduino platform requires urllib3<2 and runs its
# dependency install with output discarded, so it just fails.
# Fix: Re-run the same install by hand (package list mirrors
# platforms/espressif32/builder/penv_setup.py :: python_deps), then build.
#
# Usage: .\tools\fix_penv_deps.ps1 (then `pio run ...` as usual)
$py = "$env:USERPROFILE\.platformio\penv\Scripts\python.exe"
$uv = "$env:USERPROFILE\.platformio\penv\Scripts\uv.exe"
if (-not (Test-Path $uv)) {
Write-Error "uv not found at $uv - is PlatformIO installed?"
exit 1
}
& $uv pip install "--python=$py" --upgrade `
"https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip" `
"pyyaml>=6.0.2" "rich-click>=1.8.6" "zopfli>=0.2.2" "intelhex>=2.3.0" `
"rich>=14.0.0" "urllib3<2" "cryptography>=45.0.3" "certifi>=2025.8.3" `
"ecdsa>=0.19.1" "bitstring>=4.3.1" "reedsolo>=1.5.3,<1.8" `
"esp-idf-size>=2.0.0" "esp-coredump>=1.14.0"
if ($LASTEXITCODE -eq 0) {
Write-Host "penv repaired - run your pio build again."
} else {
Write-Error "uv pip install failed (exit $LASTEXITCODE)"
}
exit $LASTEXITCODE