1cba9f30bc
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.
56 lines
11 KiB
Markdown
56 lines
11 KiB
Markdown
---
|
||
type: index
|
||
updated: 2026-10-18
|
||
---
|
||
|
||
# Index
|
||
|
||
Catalog of every page in the wiki. Read this first when answering questions. Keep current on every change.
|
||
|
||
## Entities
|
||
|
||
- [[patrol-instrument-cluster]] — **what the Patrol cluster expects on its inputs**: tach = 2 pulses/rev (verified by calibration), temp = NTC sender 2.1–2.9 kΩ cold → ~250 Ω at 90 °C; the 1 kHz PWM needle-flutter problem and the mitigation ladder (fixed-duty test → 20 kHz → hardware damping)
|
||
- [[bmw-m57n-engine]] — the 3.0L BMW diesel whose CAN bus we read; E60/E65 donor (confirmed), DDE ECU, auto box with EGS on bus
|
||
- [[nissan-patrol-swap]] — the target vehicle: Patrol receiving the M57N + BMW auto; the tapped bus is a BMW island in a Nissan
|
||
- [[esp32-s3-touch-lcd-5b]] — Waveshare 5" display board (Main CTRL); onboard TJA1051 CAN transceiver, 7–36 V input, pinout, PSRAM/LCD gotchas — **flash writes flicker the RGB panel, full-screen fades stutter, internal RAM nearly full, opening the serial port resets the board unless DTR/RTS are low; Wi-Fi scans caused the flickering dots; all screens hand-coded since 2026-09-27**
|
||
- [[reverse-lights-output]] — **2026-10-28**: reverse lamps from the board — relay coil between +12 V and `DO0`, diode across; DO0 = NPN sink (450 mA) behind PC817 from CH422G OC0 `(source: schematic)`; firmware follows the lever in R (`reverse` console, default ON) `(repo)`; untested in the car
|
||
- [[diff-lock-inputs]] — **2026-09-29**: Patrol diff locks (+12 V = locked) on DI0 rear / DI1 front, `DI_COM` to ground; PC814 → CH422G EXIO0/EXIO5 (active low); the bank flip per read is unverified for panel flicker, so it is behind a Settings switch, default OFF
|
||
- [[vehicles]] — **one row per setup (2026-10-18)**: Patrol 1 (DDE 7796678 / 2006, `0x3B4` present), Patrol 2 (DDE 7794904 / 2004, no `0x3B4`, `0x38E` new), setup 3 pending; the ECU identity is a label read once by the firmware, behaviour adapts to the frames present — except the `2C 10` live-data identifiers, which are per DDE (Patrol 2: rail `00C2` only so far); capture checklist for a new car
|
||
|
||
## Concepts
|
||
|
||
- [[can-bus-integration]] — the core challenge; current firmware ID map flagged as placeholder, verification plan
|
||
- [[driveline-speed-signals]] — **engine / turbine / output-shaft speeds**: turbine speed as physical proof of gear engagement, and the output-shaft field that is our **only road-speed source** (no DSC on this bus) — the feedback variable for a future cruise-control PoC, with the safety envelope that would require
|
||
- [[dual-controller-architecture]] — Main CTRL → UART1 + ESP-NOW, protocol v2 → Inst. Cluster (1.3" display + Patrol gauge outputs); A owns alerts and the gauge tunables (`cfg` console)
|
||
- [[obd-diagnostic-polling]] — **why boost / MAF / rail / injection / DTCs never appear on the sniffer** and how a tester gets them: Route A generic OBD-II mode 01 on `0x7DF` and Route B BMW KWP on `0x6F1` → `0x612` — **BOTH VERIFIED WORKING 2026-09-23** (minimal PID set, no boost PID, mode 09 silent; `1A 86` ident identifies the donor; DTCs read via mode 03), the capture-with-Launch procedure, **the `2C 10` live-data identifier table — per DDE since 2026-10-18** (Patrol 1's set read junk on Patrol 2), and why polling is a transmit-on-the-bus design decision
|
||
- [[ota-updates]] — **Main CTRL updates itself from Gitea releases**: tag `v*` → CI builds + signs (ECDSA P-256) → Settings → Updates (confirm dialog) or `ota install` (manual, parked, Wi-Fi) pulls over HTTPS from the public repo, verifies, flashes the idle slot, 30 s confirm-or-rollback; **verified end-to-end, from the screen since 2026-09-27 (now v0.1.5)**, release with `git push --follow-tags origin main`; dual-slot partition table; **Inst. Cluster card on the Updates page (2026-09-27)**: B pulls its own release, A pairs over the wire (`link pair`), hands over credentials in encrypted frames and triggers - details in B's wiki `controller-b-ota`
|
||
|
||
## Synthesis
|
||
|
||
- [[canny-5-3-pico-gauge-drive]] — **why the CANNY-based setup moves the Patrol needles and our ESP32 doesn't**: CANNY "negative output" = 12 V-domain low-side switch, ESP32 IO7/IO8 = 3.3 V push-pull; the low-side transistor fix, and why it's not firmware PWM polarity
|
||
- [[can-id-candidates]] — **the E60/E65 CAN ID map — now decoded end-to-end**: gear (lever + engaged + mode), coolant, gearbox temp (raw−40), battery (12-bit ×0.015), RPM, turbine speed, engine state all verified; placeholder IDs verified absent; fault codes and boost not passively broadcast
|
||
- [[open-questions]] — the research frontier (#14 Wi-Fi UX resolved 2026-09-27): bench-verify the candidate IDs, operating temp, transient protection, fault-code design decision
|
||
|
||
## Sources
|
||
|
||
- [[esp32-s3-touch-lcd-5b-waveshare-wiki]] — official Waveshare product wiki (ingested 2026-07-15); answered CAN-transceiver and power questions, raised the 0–65 °C operating-temp concern
|
||
- [[e60-vfl-can-codes-xlsx]] — community E60 pre-facelift CAN table (ingested 2026-07-15); E60-specific confirmation of 0x1D0/0x3B4, new 0x304 gear-lever candidate
|
||
- [[listen-and-send-pid-arduino]] — Arduino ELM327→E46-cluster sketch (ingested 2026-07-15); technique reference for a diagnostic-request fallback, not ID evidence
|
||
- [[can-capture-2026-07-15]] — **first live CAN dump off the real swap bus** (captured with the board's own logger); confirms 15 IDs incl. all four signal IDs, resolves the 0x1D2 gear encoding, verifies placeholder IDs absent; raw at `raw/can-capture-2026-07-15-gearshift.csv`
|
||
- [[gear-box-can-revealings]] — **gear fully decoded & VERIFIED** (2026-07-16/17): `0x1D2` byte0 = lever, **byte1 = engaged gear 1–6**, byte4 = Drive/Sport/Manual mode; `0x0BA` = the box's own target gear incl. **reverse**; raw at `raw/gear_box_can_revealings.csv` + `raw/gearbox_engaged_gear.csv`
|
||
- [[can-capture-2026-07-17-drive]] — **first capture with the vehicle moving** (2026-07-17): verifies `0x0BA` gears 2nd–6th directly (making it a complete gear source), catches the lockup clutch live, and produces the ×0.125 output-shaft scaling evidence; raw at `raw/log_20260717_145930.txt`
|
||
- [[e65-reverse-engineering-repo]] — **E65 per-ID DBC-style docs (ingested 2026-07-17)** — the highest-value source yet: settled the gearbox-temp offset (raw−40) and battery layout (12-bit ×0.015), proved the engine was running in our capture, and revealed turbine speed, output shaft, pedal position and cruise state
|
||
- [[perf-xip-ota-2026-09-27]] — **step 3 result**: core rebuilt with XIP-from-PSRAM + IRAM-safe RGB ISR; a full OTA download no longer drops a single panel frame (24/s, 41.5 ms vs 4–8/s, 0.75 s gaps); PSRAM −1.7 MB; dots still to be judged by eye
|
||
- [[perf-dots-and-ota-2026-09-27]] — **dots are not dropped frames** (panel 24/s, 41.5 ms gap while dots visible → sub-frame DMA glitches, bounce buffers are the fix) and **OTA drops the panel to 4–8 frames/s** (flash writes blank it ~75 % of the download → XIP step needed before any progress bar)
|
||
- [[perf-baseline-2026-09-27]] — **first display-performance baseline** (`perf` monitor, 2026-09-27): per-screen fps / ms per frame / PSRAM copy load / idle; Driveline's needless 10 Hz redraw, 140–330 ms screen-change frames, Simulation tab as the heaviest load, flash writes invisible to LVGL counters (vsync counter needed), monitor blind during OTA
|
||
- [[esp32-s3-touch-lcd-5-schematic]] — **the board schematic** (re-downloaded 2026-09-26): VOUT = `I2C_VCC` chosen by solder jumper `H8` (3V3 default / 5V), level-shifted I2C, SY8293 2 A 5 V rail, SD pins, CAN/RS485 GPIOs confirmed
|
||
- [[esp32-s3-touch-lcd-5-intro-photo]] — Waveshare annotated board photo (moved into `raw/` 2026-09-21): terminal-block signal order (VIN/GND/VOUT · SDA/SCL · CAN · RS485 A/B · DO0/DO1 · DI), shared CAN/RS485 120 Ω switch, IO0/IO3/IO4/IO46 strapping pads
|
||
- [[google-ai-dde7m57-pids]] — Google AI Mode clipping on "dde7m57 pids" (ingested 2026-09-21, raw in `Clippings/`): uncited; its `0x612`-as-request claim is **contradicted**, its D1xx identifiers are `(unverified)`; kept for the Ediabas value names and the user's own observation that `0x612` appears with the Launch connected
|
||
- [[diag-route-a-2026-09-23]] — **first live Route A probe run (2026-09-23)**: DDE serves generic OBD mode 01 on `0x7E8` (verified: rpm + coolant cross-checked against the broadcast IDs); supported-PID list; MAF/IAT values implausible (explained by Route B session: sensor faults); mode 09 silent (no VIN); **5 stored DTCs, MIL off**; raw at `raw/diag-20260923-1117*.log`
|
||
- [[launch-capture-2026-09-23]] — **rail pressure decoded via Launch capture (2026-09-23)**: the DDE serves live data through service `2C` (`2C 10 00 DF` → `6C 10 HHLL`); **rail pressure bar = HHLL × 0.03**, verified two-point against the Launch (idle 305 / 2500 rpm 430); recipe generalises to any Launch-visible value; self-poll needs the session handshake (design decision); raw at `raw/serial-COM10-20260923-163511.log`
|
||
- [[launch-captures-2026-10-07]] — **boost, charge-air temp and battery identifiers** found with the CANNY logger while the Launch polled (engine off): `0091` boost (mbar ≈ raw ÷ 8), `16A8` charge-air temp, `0093` battery — scalings provisional (one point each); feeds the Engine data screen
|
||
- [[launch-captures-2026-10-18-patrol-2]] — **Patrol 2's boost and battery identifiers** (2026-10-18 evening, Launch + CANNY): charge-air pressure `003A` (1 018 mbar idle → 1 186 on a blip), battery `002F` (14.0 V running → 12.7 V off); every identifier differs from Patrol 1's, the scalings fit unchanged; charge-air temperature still uncaptured
|
||
- [[can-capture-2026-10-18-patrol-2]] — **the second Patrol's bus (2026-10-18)**: every decoded frame identical to Patrol 1 (verified: rpm, pedal, torque, turbine, temps, run state, lever, target gear), but **no `0x3B4`** → ignition fallback from the `0x1D2` lever byte (`F0` = key off); the DDE is a different unit (7794904 / 2004 vs 7796678 / 2006, from the Launch's `1A 80`); engine-off torque is junk (812 Nm); Launch polls `00C2` (rail, ~330 bar); `0x1D0` bytes 4–5 look like the fuel counter
|
||
- [[diag-route-b-2026-09-23]] — **Route B verified + DTCs read (same day)**: `0x6F1 [12]` → `0x612` confirmed live; `1A 86` ident = **VIN prefix WBANC92090 (E60 530d), DDE part numbers 7799764/7799765/7793887, 2006-03, KWP2000 not UDS**; `diag dtc` = P0101/P0113/P0500/P0545/P0030 (all disconnected-sensor swap leftovers); raw at `raw/diag-20260923-124*.log`
|
||
- [[dwr-335d-torque-pids]] — **DWR's "Extended BMW 335d PIDs for Torque"** (thread page 1 + `raw/BMW 335d.csv`, ingested 2026-09-21): a gauge-checked set of **generic J1979 mode-01 PIDs** from an M57 diesel (2009 335d, DDE7.3) — boost via PID 70, exhaust pressure, EGTs, MAF, fuel rate; nothing BMW-proprietary. Basis for the "try generic OBD first" route; the diesel-specific PIDs are probably absent on our EDC16
|