Rename Controller A/B -> Main CTRL / Inst. Cluster (user); Sleep when the car is off: Settings switch, deep sleep on quiet CAN + idle screen, CAN RX wake, switch mirrored to the cluster; docs
Firmware / build (push) Successful in 7m22s
Firmware / build (push) Successful in 7m22s
This commit is contained in:
+23
-13
@@ -1,9 +1,9 @@
|
||||
# Commands cheat-sheet — both controllers
|
||||
|
||||
Everything you type to build, flash, watch and drive the two boards. Kept in the
|
||||
Controller A repo (this one); the Controller B repo's README points here.
|
||||
Main CTRL repo (this one); the Inst. Cluster repo's README points here.
|
||||
|
||||
| | Controller A | Controller B |
|
||||
| | Main CTRL | Inst. Cluster |
|
||||
|---|---|---|
|
||||
| Board | Waveshare ESP32-S3-Touch-LCD-5B (5" touch) | Waveshare ESP32-S3-LCD-1.3 (1.3" round) |
|
||||
| Repo / branch | `ESP32-S3-Touch-LCD-5B`, `main` | `ESP32-S3-LCD-1.3`, `master` |
|
||||
@@ -39,7 +39,7 @@ Windows ports move around: `pio device list` shows what is plugged in.
|
||||
|
||||
Run inside the respective repo folder.
|
||||
|
||||
### Controller A
|
||||
### Main CTRL
|
||||
```powershell
|
||||
cd <path>\ESP32-S3-Touch-LCD-5B
|
||||
pio run # build only (dev build, version "dev")
|
||||
@@ -48,7 +48,7 @@ pio run -t clean # wipe the build directory
|
||||
```
|
||||
First build after a `platformio.ini` change rebuilds the ESP-IDF core (~20 min, `custom_sdkconfig`); later builds take 1–3 min.
|
||||
|
||||
### Controller B
|
||||
### Inst. Cluster
|
||||
```powershell
|
||||
cd <path>\ESP32-S3-LCD-1.3
|
||||
pio run
|
||||
@@ -63,8 +63,8 @@ A USB flash writes bootloader, partition table, `boot_app0` and the app into slo
|
||||
## 3. Serial monitor
|
||||
|
||||
```powershell
|
||||
pio device monitor -p COM14 -b 115200 --dtr 0 --rts 0 --echo # Controller A
|
||||
pio device monitor -p COM10 -b 115200 --dtr 0 --rts 0 --echo # Controller B
|
||||
pio device monitor -p COM14 -b 115200 --dtr 0 --rts 0 --echo # Main CTRL
|
||||
pio device monitor -p COM10 -b 115200 --dtr 0 --rts 0 --echo # Inst. Cluster
|
||||
```
|
||||
Type a command, press Enter. `--echo` shows what you type. Ctrl+C leaves.
|
||||
|
||||
@@ -79,7 +79,7 @@ python tools\diag_session.py COM14 "diag pids" "diag vin" # scripted OBD probe
|
||||
|
||||
---
|
||||
|
||||
## 4. Controller A console
|
||||
## 4. Main CTRL console
|
||||
|
||||
Type `help` for the list. Unknown lines are reported.
|
||||
|
||||
@@ -110,7 +110,7 @@ ota install [force] download, verify, flash the idle slot, reboot (parked
|
||||
ota rollback boot the previous slot (parked only)
|
||||
```
|
||||
|
||||
### `link` — Controller B over the link
|
||||
### `link` — Inst. Cluster over the link
|
||||
```
|
||||
link status B's version, pairing, update phase, credentials
|
||||
link pair new shared key → B over the UART WIRE (bench, wire connected)
|
||||
@@ -132,6 +132,14 @@ diag raw on | off CANRAW frame logging
|
||||
diag status
|
||||
```
|
||||
|
||||
### `sleep` — deep sleep when the car is off (Settings → System switch, default OFF)
|
||||
```
|
||||
sleep status enabled?, and what currently keeps the board awake
|
||||
sleep on | off same as the switch; the Inst. Cluster follows through the CONFIG frame
|
||||
sleep now deep sleep immediately - wake = CAN bus activity (GPIO 16) or power cycle
|
||||
```
|
||||
Asleep, the USB port disappears; on the bench only a power cycle or the reset button wakes a Main CTRL that has no CAN bus.
|
||||
|
||||
### Diagnostics
|
||||
```
|
||||
mem internal heap, PSRAM, LVGL pool
|
||||
@@ -141,7 +149,7 @@ perf on [sec] | perf off
|
||||
|
||||
---
|
||||
|
||||
## 5. Controller B console
|
||||
## 5. Inst. Cluster console
|
||||
|
||||
```
|
||||
help
|
||||
@@ -153,6 +161,8 @@ ota status version, slot, rollback state
|
||||
ota check join Wi-Fi, ask Gitea for the latest release, leave
|
||||
ota install [force] download, verify, flash, reboot (parked only)
|
||||
ota rollback
|
||||
sleep status sleep flag received from the Main CTRL, link state
|
||||
sleep now deep sleep now; wakes on the UART wire (IO1) or every 60 s for a 4 s listen
|
||||
```
|
||||
B prints a stats line every 5 s (`applied=… uart … espnow …`) — `uart alive` means the wire works.
|
||||
|
||||
@@ -160,9 +170,9 @@ B prints a stats line every 5 s (`applied=… uart … espnow …`) — `uart al
|
||||
|
||||
## 6. Procedures
|
||||
|
||||
### Pair a Controller B (once per board pair)
|
||||
### Pair a Inst. Cluster (once per board pair)
|
||||
1. Wire: 5B terminal `485_A` → B `IO1`, GND → GND (a real wire, not just the USB hub), 5B's 120 Ω switch OFF. Both powered. B's stats line must say `uart alive`.
|
||||
2. A console: `link pair`. Within 5 s A logs `Controller B confirmed pairing (fingerprint XXXX)`; B logs `PAIRED over the wire`.
|
||||
2. A console: `link pair`. Within 5 s A logs `Inst. Cluster confirmed pairing (fingerprint XXXX)`; B logs `PAIRED over the wire`.
|
||||
3. `link status` on A: `key XXXX (matches)`. About 15 s later `Wi-Fi creds yes` (A pushes them by itself; `link creds` forces it).
|
||||
|
||||
The key lives in NVS on both boards and survives every flash and update. Re-pair only after an NVS erase, `link unpair`, or a board swap.
|
||||
@@ -175,10 +185,10 @@ git push --follow-tags origin main # A (B: origin master)
|
||||
One push, so only the tag build runs. Gitea builds, signs (`BMW_NISSAN_FIRMWARE_SIGNING_KEY`) and publishes `firmware.bin` + `manifest.txt`: A takes 7–20 min, B 2–5 min. Check: `https://git.infra.msai.al/<owner>/<repo>/releases`. Version strings must stay under 16 characters.
|
||||
|
||||
### Update A from the screen
|
||||
Settings → Updates → Controller A → **Check** → **Install vX.Y.Z** (parked, Wi-Fi joined). Progress bar, restart, `A vX.Y.Z` bottom-right. A reset in the first 30 s rolls back.
|
||||
Settings → Updates → Main CTRL → **Check** → **Install vX.Y.Z** (parked, Wi-Fi joined). Progress bar, restart, `A vX.Y.Z` bottom-right. A reset in the first 30 s rolls back.
|
||||
|
||||
### Update B from the screen
|
||||
Settings → Updates → Controller B → **Check** → **Install** (A on Wi-Fi, parked, B paired). B's round screen shows `Updating vX.Y.Z N%`, the card on A shows the percentage, B restarts and confirms itself after 30 s. Console equivalent: `link ota check`, `link ota install`.
|
||||
Settings → Updates → Inst. Cluster → **Check** → **Install** (A on Wi-Fi, parked, B paired). B's round screen shows `Updating vX.Y.Z N%`, the card on A shows the percentage, B restarts and confirms itself after 30 s. Console equivalent: `link ota check`, `link ota install`.
|
||||
|
||||
### Something is wrong after an update
|
||||
`ota rollback` on the affected controller's console (B: `link ota rollback` from A also works). A reset within 30 s of the first boot of a new image rolls back on its own.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
**Version:** 2 (`PACKET_VERSION 0x02`)
|
||||
**Last Updated:** 2026-09-27
|
||||
**Source of truth:** `include/protocol/automotive_data.h` (+ `link_secure.h`) — byte-identical in both repos.
|
||||
**Direction:** gauge data Controller A (ESP32-S3-Touch-LCD-5B) → Controller B (ESP32-S3-LCD-1.3). Since 2026-09-27 B answers with `STATUS` frames over ESP-NOW and A sends B maintenance frames (`PAIR` on the wire, `SECURE` over ESP-NOW) — see *Maintenance frames* below.
|
||||
**Direction:** gauge data Main CTRL (ESP32-S3-Touch-LCD-5B) → Inst. Cluster (ESP32-S3-LCD-1.3). Since 2026-09-27 B answers with `STATUS` frames over ESP-NOW and A sends B maintenance frames (`PAIR` on the wire, `SECURE` over ESP-NOW) — see *Maintenance frames* below.
|
||||
|
||||
---
|
||||
|
||||
@@ -101,7 +101,7 @@ Tach: `f = rpm × tach_ppr / 60 × (1 + trim/100)`, clamped, 50 % duty. Output l
|
||||
|
||||
---
|
||||
|
||||
## Controller A console commands (USB serial)
|
||||
## Main CTRL console commands (USB serial)
|
||||
|
||||
```
|
||||
cfg show
|
||||
@@ -120,13 +120,13 @@ The same console also carries the OBD-II diagnostic probe (`diag pids | pid <hex
|
||||
|
||||
---
|
||||
|
||||
## Maintenance frames (2026-09-27) — for Controller B's firmware updates
|
||||
## Maintenance frames (2026-09-27) — for Inst. Cluster's firmware updates
|
||||
|
||||
`PACKET_VERSION` did not change: DATA and CONFIG are byte-identical, and a B built before these types counts them as type errors and carries on.
|
||||
|
||||
| Type | Direction | Transport | Payload | Purpose |
|
||||
|---|---|---|---|---|
|
||||
| `STATUS` 0x03 | B → A | ESP-NOW unicast to A's MAC (learned from A's data frames) | `link_status_t` (78 B): B's version, OTA phase (`LINK_OTA_*`, same numbering as A's `Ota::phase_t`), progress %, flags (paired / have Wi-Fi / joined / pending verify), `key_fp`, uptime, free heap, latest tag, message | every 5 s and on every phase change; A's Updates page "Controller B" card |
|
||||
| `STATUS` 0x03 | B → A | ESP-NOW unicast to A's MAC (learned from A's data frames) | `link_status_t` (78 B): B's version, OTA phase (`LINK_OTA_*`, same numbering as A's `Ota::phase_t`), progress %, flags (paired / have Wi-Fi / joined / pending verify), `key_fp`, uptime, free heap, latest tag, message | every 5 s and on every phase change; A's Updates page "Inst. Cluster" card |
|
||||
| `PAIR` 0x04 | A → B | **UART wire only** — B drops a PAIR heard by radio | `link_pair_t` (42 B): magic `"PAIR"`, 32-byte random key, A's STA MAC | `link pair` on A's console, sent 3×; both sides keep the key in NVS. The only secret in the system (both repos are public) |
|
||||
| `SECURE` 0x05 | A → B | ESP-NOW unicast | `nonce[12] \| tag[16] \| AES-256-GCM(key, nonce, inner_type \| inner)` — helpers in `link_secure.h` | inner `LINK_INNER_OTA_CMD` 0x11 (`link_ota_cmd_t`: check / install [force] / rollback + random nonce, B ignores a repeat of the last 4) or `LINK_INNER_WIFI_CREDS` 0x12 (`link_wifi_creds_t`: SET/FORGET, ssid, pass). B also requires the sender MAC to be the paired A |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user