Reverse lights on DO0, Sport + Vehicle screens, per-DDE live data, ECU identification
Firmware / build (push) Successful in 10m49s

- ReverseLight: isolated output DO0 (CH422G OC0 -> PC817 -> NPN sink) drives the
  reverse-lamp relay while the lever is in R on a live bus with ignition on; 10 Hz
  decision confirmed over 200 ms, written through the panel library's expander
  object so the backlight cannot undo it; `reverse status|on|off|force` console,
  default ON (NVS `revlight_en`). Wiki page reverse-lights-output with the wiring.
- Sport screen: BMW-style power + torque gauges (lv_meter on a dial-face image,
  image needle); PNG sources in assets/, tools/png2lvgl.py converter.
- Vehicle: final drive ratio + tyre circumference -> road speed, hp from torque;
  Settings > Vehicle page; `vehicle` console.
- Bench simulation (`sim` console) overlays torque / rpm / shaft on the snapshot.
- EcuIdent: KWP 1A 86 / 1A 80 read once, stored in NVS, shown on Settings >
  Vehicle, passive ECU CHANGED? check; `ecu` console.
- Ignition fallback from the 0x1D2 lever byte on buses without 0x3B4 (Patrol 2).
- Engine data: per-DDE `2C 10` identifier profiles (Patrol 1 vs Patrol 2
  rail 00C2 / boost 003A / battery 002F); DiagProbe liveConfigure().
- Wiki: Patrol 2 captures, vehicles page, obd identifier table per DDE, logs.
This commit is contained in:
2026-10-28 16:46:42 +01:00
parent 8ded9c2a08
commit 1cba9f30bc
60 changed files with 70386 additions and 100 deletions
+35
View File
@@ -140,6 +140,41 @@ difflock invert on | off polarity, same as the "Inverted" switch (saved): on =
```
Wiring: lock wire → DI0 / DI1, `DI_COM` → vehicle ground. If the screen shows locked when unlocked (the Patrol's ground-switched lamp wires do this), turn **Inverted** on. Details: wiki `diff-lock-inputs`.
### `reverse` — reverse-light relay on DO0 (follows the gear lever in R; default ON, no Settings row - the System page is full)
```
reverse status enabled?, DO0 on/off, lever / ignition / CAN as seen, write counters
reverse on | off enable / disable (saved); off = DO0 stays off
reverse force on | off drive DO0 regardless of the lever, for the wiring check (not saved, ends after 60 s)
reverse force auto back to the lever
```
Wiring: relay coil between +12 V and `DO0`, flyback diode across the coil (stripe to +12 V); the coil current returns through the board's `GND`. ≤ 450 mA per output. Details: wiki `reverse-lights-output`.
### `vehicle` — road speed from the gearbox output shaft (Settings → Vehicle; saved in NVS)
```
vehicle show final drive ratio, tyre circumference, and what 1000 shaft rpm comes to
vehicle set final <x.xx> final drive (differential) ratio, 2.00..8.00 - 4.11 on this Patrol
vehicle set tyre <mm> tyre rolling circumference, 1500..3500 mm (265/70 R16 ≈ 2440)
vehicle reset back to 4.11:1 and 2440 mm
```
### `ecu` — which engine ECU (DDE) this board is on (read once, saved in NVS)
```
ecu show stored identification: part number, software date, VIN prefix; or UNKNOWN ECU
ecu dump the stored KWP 1A 86 / 1A 80 payloads in hex
ecu forget drop them - UNKNOWN ECU until read again (do this when the board moves to another car)
```
While nothing is stored the board asks the DDE once (`1A 86`, then `1A 80`, up to 3 tries each per boot) as soon as CAN is on, the ignition has been on for 5 s, `sim` is off and no scan tool has spoken for 3 s. Once stored it never asks again. Same thing from the screen: Settings → Vehicle shows the Engine ECU line and has a **Re-read ECU** button. With a Launch connected the board also sees its `1A 80` reads and shows **ECU CHANGED?** if they differ from the stored block.
### `sim` — bench values for the screens (never saved, off at boot, nothing transmitted)
```
sim torque <Nm> [rpm <n>] [shaft <rpm>] e.g. sim torque 350 rpm 2500 shaft 1200
sim rpm <n> | sim shaft <rpm> change one value, the rest stays
sim status
sim off
```
Feeds the Sport gauges, the Driveline's torque / rpm / output / speed and the Vehicle page preview as if the ignition were on; the Driveline's chip reads `IGN SIM` and the Sport screen says SIMULATION meanwhile. The Inst. Cluster is not affected (use `cfg override` for its outputs).
Speed (km/h) = output shaft rpm ÷ ratio × circumference (m) × 60 ÷ 1000. The shaft rpm is still the provisional 0x0BA × 0.1074, so the screens show `~km/h`. The Sport screen's hp = Nm × rpm ÷ 9.5488 ÷ 745.7.
### Diagnostics
```
mem internal heap, PSRAM, LVGL pool