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
+6 -2
View File
@@ -1,6 +1,6 @@
---
type: index
updated: 2026-10-07
updated: 2026-10-18
---
# Index
@@ -13,14 +13,16 @@ Catalog of every page in the wiki. Read this first when answering questions. Kee
- [[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 (still wanted for the `22 D1xx` live-data identifiers), and why polling is a transmit-on-the-bus design decision
- [[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
@@ -47,5 +49,7 @@ Catalog of every page in the wiki. Read this first when answering questions. Kee
- [[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
+40
View File
@@ -230,3 +230,43 @@ In the car the Driveline showed locked while unlocked and open while locked; the
## [2026-10-07] ingest + build | Boost / charge-air temp / battery identifiers; Engine data screen
Ingested three CANNY-logger captures (`raw/airtemp38-63.txt`, `raw/boost.txt`, `raw/battery12-27.txt`) -> [[launch-captures-2026-10-07]]: the Launch reads `2C 10 16A8` (charge-air temp), `0091` (boost actual), `0093` (battery), each a 2-byte `6C 10` reply. Engine off throughout, so one calibration point each: boost mbar = raw / 8 fits 1028-1034 mbar; temp and battery fits are guesses. User decision: a no-password **Engine data screen** (button on Driveline) showing rail, boost, charge-air temp, battery - polled only while shown, paused while another tester is on the bus, provisional values tagged and raw shown. Updated [[obd-diagnostic-polling]] (identifier table, decision), index.
## [2026-10-13] update | Road speed from the output shaft; Sport screen (torque + power gauges)
User requirements: road speed = output shaft × differential ratio 4.11:1 × tyre circumference, both numbers as settings under System; and a BMW-style "Sport screen" with two gauges, torque and hp (P(W) = Nm × rpm / 9.5488, hp = W / 745.7). Built as `vehicle.cpp` (final drive x100 + tyre mm in NVS, deferred write, `vehicle` console, speed and power maths) and `sport_screen.cpp` (two `lv_meter` gauges 0-600 Nm / 0-300 hp with arc fill, needle, 3 s peak-hold needle; rpm + ~speed below; Sport button on the Driveline). Settings gained a fourth tab, **Vehicle** (-/+ rows, live preview, Reset). The Driveline's bottom row now has four stats: torque, pedal, output (~rpm), speed (~km/h). The final drive 4.11:1 is recorded on [[nissan-patrol-swap]] (user); tyre size is still open (default 2440 mm = 265/70 R16, unverified), so [[open-questions]] #10 is half closed and every speed keeps the `~` of the provisional shaft factor (#8). Flashed to the Main CTRL on COM11 later the same day, together with the `sim` console (next entry).
## [2026-10-13] update | `sim` console: bench torque / rpm / shaft for the screens
User asked whether torque can be simulated to look at the Sport gauges without the bus; the existing `cfg override` only forces the Inst. Cluster's outputs. Added `bench_sim.cpp`: `sim torque <Nm> [rpm <n>] [shaft <rpm>]`, overlaid on the driveline snapshot with ignition on, shown as `IGN SIM` / SIMULATION on the screens, console only (no slider - user decision), never saved, off at boot. The first bench run of `sim torque 350 rpm 2500 shaft 1200` exposed a x10 slip in the speed maths (4.3 km/h for 1199 shaft rpm); fixed to 42.7 km/h, 122.9 hp checked against the formula, `sim` / `vehicle` commands verified on COM11, flashed.
## [2026-10-13] update | Sport gauges redrawn after the BMW photo; needle as a PhotoCraft image
The user shared a photo of the BMW iDrive Sport displays and wanted the gauges like it. Band rebuilt from stacked `lv_meter` arcs (dark red -> orange inward, bright rim, dark dividers, numbers inside the band, unit in the middle, name below, black background; Power left, Torque right). The needle went through three versions: plain line, a hand-drawn tapered wedge in the meter's draw hook, and finally an **image**: the user asked whether to draw PNGs in Photoshop, then pointed at PhotoCraft (storytold/photocraft, open-source Rust Photoshop clone with a built-in MCP server) - installed portable, its `photocraft-cli mcp` registered in Claude Code, and the needle drawn through it (gradient wedge + bright tip, two outer glows, exported `assets/needle.png`, source `assets/needle.pcraft`). `tools/png2lvgl.py` converts to `src/assets/needle_img.c`; `lv_meter_add_needle_img` rotates it. Flashed COM11 with `sim torque 350 rpm 2500` on for the user to judge.
## [2026-10-13] update | BMW gauge deconstructed element by element with the PhotoCraft MCP; dial face as an image
User: "deconstruct the gauge element by element using this new MCP". Opened the photo in PhotoCraft, perspective-cropped the screen straight (`assets/reference/bmw-screen-straight.png`), cut the Torque gauge and three zooms, fitted the rim circle and profiled the band radially and angularly. Findings (fractions of the outer radius): thin bright rim 0.985-1.0; a ruler ring 0.93-0.985 with ~5 fine rungs per cell between two bright lines; a dark gap; the cells ring 0.75-0.91, brightest orange at its inner edge fading to dark red outward, 16 cells with dark gaps, 5 bright spokes at the numbers; numbers at ~0.64 R; sweep ~230 degrees open at the bottom (the firmware had 270); needle from ~0.33 R with a lit tip. The photo's colours are unusable (glass reflection) - structure only. Rebuilt at 420 px as PhotoCraft layers from computed geometry (`assets/dial_geometry.json`, circles as boolean subpaths, 81 rungs and 15 gaps as polygons), exported `assets/dial.png`, source `assets/dial.pcraft`; the Sport screen now shows the image under an lv_meter that draws only numbers and the image needle. Gotcha found: PhotoCraft maps a shape gradient to the bbox of all subpaths including subtracted ones.
## [2026-10-18] ingest + build | Second Patrol's CAN captures; ignition without 0x3B4; the DDE read once (`EcuIdent`)
User: "I have a new patrol with bmw engine. The ECU is the same. I did collected some can bus logs using canny" — three CANNY logs (`raw/ingnition-only.txt`, `raw/engine-on.txt`, `raw/launch-diag-rail-pressure.txt`) → [[can-capture-2026-10-18-patrol-2]]. Offline analysis with the firmware's scalings: every decoded frame identical in layout and plausible in value; **`0x3B4` / `0x3B3` / `0x332` absent** (the firmware's only ignition source), `0x38E` new, `0x1B6` changed; the Launch's `1A 80` reads show a **different DDE** (7794904 / 2004-01-21 vs 7796678 / 2006-02-16); engine-off `TORQ_AVL` is junk (812 Nm); the Launch polled a new rail identifier `00C2`; `0x1D0` bytes 4–5 behave like a fuel counter. Then "How to differentiate between these different DDEs? Tomorrow I will have another setup" → the identity is a label (read once), behaviour adapts to the frames present; user's rule: save the part number at the first start, never re-check at boot, show UNKNOWN ECU until read. Built `(repo)`: ignition fallback from the `0x1D2` lever byte (`0x3B4` keeps precedence for 10 s after it is seen, source logged), torque gated on the run state (Sport + Driveline), `EcuIdent` (`1A 86` then `1A 80` through `DiagProbe`, NVS blobs, Settings → Vehicle line + Re-read ECU, `ecu show | dump | forget`, passive compare of a Launch's `1A 80` → ECU CHANGED?). Flashed to COM11; on the bench `ecu show` = UNKNOWN ECU, no transmit (CAN off). New page [[vehicles]] (one row per setup + capture checklist for tomorrow); [[can-id-candidates]] callout, [[obd-diagnostic-polling]] identifiers + ident layouts, [[open-questions]] #15, [[nissan-patrol-swap]] note.
## [2026-10-18] build | Live-data identifiers are per DDE: Engine data profiles keyed on the ECU identity
User, with the board on Patrol 2 for the first time: "The rail pressure is wrong. It shows nothing. The air intake temp shows some > 300 degree. The boost is static somewhere 2800 mBar. Also the output speed remains 0." Diagnosis from the logs already in `raw/`: Patrol 1's `2C 10 00DF/0091/16A8/0093` are addresses inside that DDE's software; the Launch polled `00C2` for rail on Patrol 2 and sent no `15E0` define. So the rule "the identity is a label" gets its one exception: `(repo)` the Engine data screen now carries a `PROFILES[]` table (part numbers → identifier set + provisional flags), selected through `EcuIdent::hasPart()`, installed into `DiagProbe` with the new `liveConfigure()` (`live_set_t`, 0 = slot never asked). Patrol 2's profile has rail `00C2` only (scale assumed ×0.03 — the Launch showed ~330 bar at idle); boost, charge-air temp and battery read "identifier not known for this ECU yet". No identified ECU or no profile → nothing is polled and the status line says why; the profile is re-evaluated every tick so the first identification takes effect on screen. The output-speed question stays open: every Patrol 2 log is stationary. Pages: [[obd-diagnostic-polling]] (per-DDE identifier table + callout), [[vehicles]] (rule 3, identifier column, checklist asks for a Launch session per value), [[open-questions]] #15, [[can-capture-2026-10-18-patrol-2]] consequence 5. Built; the board was in the car (no COM port), so not flashed from here yet.
## [2026-10-18] update | Patrol 2's own identification read: DDE 7796156 - 2006-05-17
User: "The actual reading is DDE 7796156 - 2006-05-17" (Settings → Vehicle, the board's first key-on on Patrol 2) — the `1A 86` read succeeded on this unit. Like Patrol 1 (7796678 on `1A 80` vs 7799764 on `1A 86`) the two blocks carry different part numbers; the Launch's `1A 80` says 7794904 / 2004-01-21. Both numbers are in the Patrol 2 `PROFILES[]` row `(repo)`; [[vehicles]] row, [[obd-diagnostic-polling]] table header and [[open-questions]] #15 updated. Rebuilt; flashing waits for the board to be back on USB.
## [2026-10-18] verify | Patrol 2 ident dumped over USB: E65 donor; profile firmware flashed
Board back on COM11 (dev build with the per-DDE profiles flashed, SUCCESS). `ecu show`: both blocks stored on Patrol 2 — `1A 86` 66 B part 7796156 / 2006-05-17 / VIN prefix **WBAGM21070 (E65 7-series)**, `1A 80` 31 B part 7794904 / 2004-01-21 (so this board's `1A 80` is answered here, unlike Patrol 1). `diag status`: 0 requests since boot. All four part numbers are in the Patrol 2 `PROFILES[]` row. Donor difference (E60 vs E65) recorded on [[vehicles]], [[nissan-patrol-swap]], [[open-questions]] #15 as the likely reason for the bus and identifier differences `(unverified)`.
## [2026-10-18] ingest + build | Patrol 2 boost `003A` and battery `002F` from two Launch captures; output shaft confirmed
User: "The output shaft is good now" (the earlier 0 was the stationary car) and two new CANNY logs with the Launch on Patrol 2, `raw/charge-air-pressure.txt` and `raw/battery.txt` → [[launch-captures-2026-10-18-patrol-2]]. The Launch polled `2C 10 00 3A` for charge-air pressure (raw 8 071–9 487: 1 018 mbar at idle, 1 186 at the top of a 2 553 rpm blip, decaying to ambient after key-off at ÷ 8) and `2C 10 00 2F` for battery (5 166–5 723: 14.0 V with the alternator, 12.7 V after the engine stop at × 0.002455). No define, no negatives. The Launch's displayed values were not noted, so both keep Patrol 1's scale as `(unverified scale)`. `(repo)` Patrol 2's `PROFILES[]` row = rail `00C2`, boost `003A`, battery `002F`, all provisional; charge-air temperature still "identifier not known". Pages: [[obd-diagnostic-polling]] table, [[vehicles]] row (shaft resolved), [[open-questions]] #15, index. Built; the board was off USB, flash pending.
## [2026-10-28] setup | Reverse lights from DO0 — relay on the isolated output, firmware follows the lever in R
User: "I need to control a relay from ESP32-S3-LCD-5B ... I have some 2N2222 transistors", then "When the R gear is selected I need to light the rear lights." Read the DO circuit off the schematic PDF text (`raw/ESP32-S3-Touch-LCD-5-Sch.pdf`): CH422G **OC0** (pin 8) → R24 100 Ω → PC817 T1 (anode 510 Ω to 3V3) → 1 kΩ → NPN power transistor T2, collector = `DOUT0`, emitter = board GND; OC1/T3/T4 the same for DO1. So the "isolated" outputs return through the board's GND, and OC0 LOW = output on. No 2N2222 needed (no spare native GPIO anyway). New page [[reverse-lights-output]] with the wiring (coil +12 V ↔ DO0, flyback diode, ≤ 450 mA). `(repo)` new `reverse_light.cpp`: lever == R on a live bus with ignition on → DO0 on, 10 Hz decision confirmed over 200 ms, written through the panel library's expander object (the backlight rewrites the cached OC register, so raw I2C would be undone during OTA), `reverse status | on | off | force on|off|auto`, default ON, no Settings row (System page full). [[esp32-s3-touch-lcd-5b]] I/O row updated, index. Not yet seen in the car.
+4 -1
View File
@@ -1,7 +1,7 @@
---
type: synthesis
tags: [can-bus, reverse-engineering, e60, research]
updated: 2026-07-17
updated: 2026-10-18
---
# E60/E65 CAN ID Candidates (Research Results)
@@ -26,6 +26,9 @@ Findings from the 2026-07-15 deep-research run (95 claims extracted from ~15 sou
## The map (replaces the firmware's placeholder IDs)
> [!warning] 2026-10-18 — the map holds on a SECOND Patrol, but `0x3B4` is not there
> [[can-capture-2026-10-18-patrol-2]]: a different DDE unit (7794904 / 2004 vs 7796678 / 2006) broadcasts every ID below byte-for-byte the same; rpm, pedal, torque, turbine, coolant, run state, gearbox temp, lever and target gear all decode correctly `(verified)`. **But `0x3B4`, `0x3B3` and `0x332` (the 5-s trio) are absent** on that bus, `0x38E` is new and `0x1B6` changed — the difference is which modules are wired, not the ECU. Ignition therefore has a fallback: the `0x1D2` lever byte (`0xF0` = key off, any lever code = key on) `(verified timing)`, used whenever no `0x3B4` has been seen for 10 s `(repo)`. `0x0A8` `TORQ_AVL` holds a junk value with the key on and the engine off (812 Nm there, 245 Nm here) — gate it on `ST_ENGINE_RUN`. One row per setup: [[vehicles]].
| Signal | CAN ID | Bytes | Scaling | Sender | Rate | Confidence |
|--------|--------|-------|---------|--------|------|------------|
| Coolant temp | **0x1D0** | byte 0 | °C = raw − 48 | DME/DDE | 100 ms | **Very high** — verified verbatim in E65 docs, present in E90-gen DBC, confirmed live on a real E60 545i, E60 tool32 table lists 0x1D0 "Motordaten" from DDE1 (diesel!), and the [[e60-vfl-can-codes-xlsx]] sheet shows 0x7A→74 °C on a real E60 VFL (raw−48 checks out) |
+3 -1
View File
@@ -139,7 +139,9 @@ Still worth logging **`0x1A2` alongside `0x0BA`** in the same capture: turbine
### Raw counts → km/h
Still needs numbers nobody has written down. The 6HP26**X** measures its output shaft **upstream of the transfer case**, so the conversion depends on the swap's driveline:
**Firmware since 2026-10-13 `(repo)`**: `~km/h = shaft rpm ÷ final drive × tyre circumference × 60 ÷ 1000`, with final drive 4.11:1 (user) and the tyre circumference as a setting (default 2440 mm, unverified) on Main CTRL's Settings → Vehicle page; shown on the Driveline and the Sport screen. The `~` is inherited from the shaft factor below.
Still needs numbers nobody has written down for the transfer case. The 6HP26**X** measures its output shaft **upstream of the transfer case**, so the conversion depends on the swap's driveline:
- BMW transfer case retained → rear output ~1:1, math unaffected
- Transfer case deleted, straight to the Patrol driveline → also fine
+1 -1
View File
@@ -40,7 +40,7 @@ Main CTRL of the [[dual-controller-architecture]] — the main in-cabin display.
| Interface | Details |
|-----------|---------|
| RS485 | SP3485, auto TX/RX direction; terminal block used for UART1 → Inst. Cluster, GPIO 43/44, 115200 baud `(repo)` |
| Isolated I/O | Optocoupler digital in 5–36 V (dry/wet contact), open-drain out sinking 450 mA/ch — could read ignition-on or drive a relay later |
| Isolated I/O | Optocoupler digital in 5–36 V (dry/wet contact) — DI0/DI1 read the diff locks ([[diff-lock-inputs]]); outputs DO0/DO1 = NPN power transistor (450 mA sink, emitter on board GND) behind a PC817 from CH422G OC0/OC1 — DO0 drives the reverse-light relay ([[reverse-lights-output]]) `(source: schematic)` |
| I2C | Terminal block SDA/SCL, level-shifted to `I2C_VCC` (= VOUT, 3.3 V or 5 V via `H8`); CH422G expander occupies 0x20–0x27 & 0x30–0x3F, GT911 touch at 0x5D — avoid these addresses |
| RTC | PCF85063 + CR927 coin cell |
| TF card | SPI: MOSI IO11, SCK IO12, MISO IO13; SD_CS via CH422G EXIO4 (source: schematic) |
+4 -2
View File
@@ -1,7 +1,7 @@
---
type: entity
tags: [vehicle, swap, project-context]
updated: 2026-07-17
updated: 2026-10-18
---
# Nissan Patrol M57N Swap
@@ -12,6 +12,7 @@ The target vehicle (verified — user, 2026-07-15): a **Nissan Patrol** receivin
- Gearbox: **ZF 6HP26X** (verified — user, 2026-07-17). The "X" is the xDrive output variant — same internal gearset as the 6HP26, different output housing/shaft to drive a transfer case. Ratios: 4.171 / 2.340 / 1.521 / 1.143 / 0.867 / 0.691.
- **This dates the donor**: M57N + xDrive means **E60/E61, not E65** — the 7-series never took that combination. → [[open-questions]] #2
- Final drive (differential) ratio: **4.11:1** (user, 2026-10-13). Tyre rolling circumference: not stated yet; the firmware defaults to 2440 mm (a 265/70 R16, `(unverified)` for this car) and both numbers are editable on Main CTRL's Settings → Vehicle page `(repo)`.
> [!question] Was the BMW transfer case retained?
> Open, and it blocks road-speed display. The EGS measures the gearbox output shaft **upstream of the transfer case**, so the raw→km/h conversion depends on what sits downstream:
@@ -19,13 +20,14 @@ The target vehicle (verified — user, 2026-07-15): a **Nissan Patrol** receivin
> - **Deleted, coupled straight to the Patrol driveline** → also fine
> - **A Patrol transfer case in the path** → its ratio enters the calculation, **and changes with high/low range** — road speed would become range-dependent, which the firmware would have to know about
>
> Also still needed for km/h: the Patrol's **final drive ratio** and **tyre size**. → [[driveline-speed-signals]], [[open-questions]] #10/#11
> Also needed for km/h: the Patrol's **final drive ratio** (4.11:1, user 2026-10-13) and **tyre size** (still open). The firmware now computes `~km/h = shaft rpm ÷ 4.11 × circumference` on the Driveline and Sport screens `(repo)`; the `~` stays until the shaft factor (#8) and the tyre are confirmed. → [[driveline-speed-signals]], [[open-questions]] #8/#10/#11
## Why this matters for research
- The M57-into-Patrol swap is popular (especially in Australia and the Middle East), so swap-community forums likely contain solved CAN-ID lists and gauge projects for exactly this drivetrain. `(unverified)` → [[can-bus-integration]]
- The bus the display taps is essentially a **BMW island in a Nissan vehicle**: only the modules the swap harness retains (DDE, EGS, possibly others) are broadcasting. Nissan-side electronics are not on this bus. **Confirmed by absence**: no DSC/CAS traffic appears, which is why there is no wheel-speed message and why the gearbox output shaft is our only road-speed source. → [[driveline-speed-signals]]
- Patrol generation, swap-harness maker (or DIY), and which BMW modules were retained are still unknown → [[open-questions]].
- **There is more than one Patrol (2026-10-18).** A second Patrol with the same M57N carries a different DDE unit and a differently populated bus (no `0x3B4`), and a third setup is expected; the firmware now labels each setup by its DDE identification and adapts to the frames present → [[vehicles]], [[can-capture-2026-10-18-patrol-2]]. Patrol 2's donor is an **E65 7-series** (VIN prefix WBAGM21070 from its `1A 86`), Patrol 1's an E60 530d.
## Related
+18 -10
View File
@@ -1,7 +1,7 @@
---
type: concept
tags: [can-bus, dde, egs, diagnostics, kwp2000, uds, obd, design-decision, rail-pressure]
updated: 2026-10-07
updated: 2026-10-18
---
# OBD / Diagnostic Polling
@@ -123,20 +123,28 @@ Run via `tools/diag_session.py` (one serial session, logs straight into `wiki/ra
5. `diag status` once at the end (counters, tester guard), then stop the monitor.
6. Copy the log into `raw/`, write a `sources/` page with the supported-PID list and the VIN, update this page (Route A verified / refuted) and [[open-questions]] #2 and #7.
## Known live-data identifiers (`2C 10 <id>` → `6C 10 HH LL`)
## Known live-data identifiers (`2C 10 <id>` → `6C 10 HH LL`) — PER DDE
| Value | ID | Scaling | Status |
|---|---|---|---|
| Rail pressure, actual | `00DF` | bar = raw × 0.03 | `(verified 2026-09-23)`, two points |
| Charge-air pressure, actual (boost, absolute) | `0091` | mbar = raw ÷ 8 | `(unverified)` one point, engine off |
| Charge-air temperature | `16A8` | °C = raw × 0.01 − 15 | `(unverified)` one point, engine off |
| Battery voltage | `0093` | V = raw × 0.002455 | `(unverified)` one point, engine off |
> [!warning] The identifiers belong to one DDE software, not to the M57N `(verified 2026-10-18)`
> With the board on Patrol 2 (DDE 7794904) and Patrol 1's set in the firmware, the Engine data screen showed **no rail pressure, a flat "2800 mbar" boost and a charge-air temperature above 300 °C** (user). The Launch, which re-reads `1A 80` on every cycle precisely to pick its data set, polled **`00C2`** for rail pressure on that car instead of `00DF`. So `2C 10 <id>` is an address inside each unit's software (the "define" `15 E0` was not seen on Patrol 2 either). The firmware now keeps **one identifier set per DDE part number** (`(repo)` `engine_screen.cpp` `PROFILES[]`, keyed by `EcuIdent`) and asks nothing for a slot it has no identifier for. Every value on a new DDE must be captured with the Launch again (recipe below).
Evidence: [[launch-capture-2026-09-23]], [[launch-captures-2026-10-07]]. Each provisional scaling needs one more capture at a different operating point.
| Value | DDE 7796678 / 7799764 (Patrol 1) | DDE 7794904 / 7796156 (Patrol 2) | Scaling | Status |
|---|---|---|---|---|
| One-time define sent by the Launch | `15E0` | none seen | — | — |
| Rail pressure, actual | `00DF` | `00C2` | bar = raw × 0.03 | Patrol 1 `(verified 2026-09-23)`, two points; Patrol 2 `(unverified)` — raw 11 016–11 304 at idle = 330–339 bar at the same scale, the Launch showed "rail pressure" while polling it (label/value not noted) |
| Charge-air pressure, actual (boost, absolute) | `0091` | **`003A`** | mbar = raw ÷ 8 | Patrol 1 `(unverified)` one point, engine off; Patrol 2 `(unverified scale)` — 1 018 mbar idle → 1 186 on a rev blip, physically right, Launch value not noted ([[launch-captures-2026-10-18-patrol-2]]) |
| Charge-air temperature | `16A8` | not captured | °C = raw × 0.01 − 15 | `(unverified)` one point, engine off |
| Battery voltage | `0093` | **`002F`** | V = raw × 0.002455 | Patrol 1 `(unverified)` one point; Patrol 2 `(unverified scale)` — 14.0 V running, 12.7 V after the engine stop, Launch value not noted ([[launch-captures-2026-10-18-patrol-2]]) |
Evidence: [[launch-capture-2026-09-23]], [[launch-captures-2026-10-07]], [[can-capture-2026-10-18-patrol-2]], [[launch-captures-2026-10-18-patrol-2]]. Each provisional scaling needs one more capture at a different operating point; the remaining empty Patrol 2 cell (charge-air temperature) needs one Launch session. Note how every identifier moved between the two DDEs while the scalings stayed the same — expect the same on setup 3.
## ECU identification (`1A 80` / `1A 86`) `(verified 2026-09-23 / 2026-10-18)`
The Launch re-reads `1A 80` on every cycle and both Patrols' DDEs answer it in their default state (31 / 37-byte replies); our own probe's `1A 80` was silent on Patrol 1 on 2026-09-23 while `1A 86` answered with 65 bytes. Observed layouts (field names `(unverified)`): `1A 80` → BCD part number at payload bytes 4–7, BCD date YY MM DD at 15–17; `1A 86` → ASCII `"@B892524 "`, date at 11–13, three 6-byte BCD part-number fields from byte 16, VIN prefix at 53–62. The firmware stores both blocks once per setup ([[vehicles]], `(repo)` `EcuIdent`) and compares the Launch's `1A 80` passively.
## Engine data screen `(repo, 2026-10-07)`
**Decision (user, 2026-10-07):** the four values above get their own screen on Controller A, opened by an **"Engine data" button on the Driveline screen**, **no password**. This replaces the 2026-09-23 plan of a password-protected Diagnostics screen for these reads. Guard rails kept: polling runs **only while the screen is shown** (stops ~1.5 s after it is left), one request in flight, ~100 ms apart (each value ~2.5 Hz), **pauses while another tester is on the bus** (3 s guard), only these fixed frames - `2C` stays forbidden from the `diag` console. Sends the Launch's `2C 10 15 E0` once per start, then the four reads in turn. Provisional scalings are tagged on screen and every value shows its raw number for calibration against the Launch. A password can still come with a future Diagnostics screen for anything beyond these reads.
**Decision (user, 2026-10-07):** the four values above get their own screen on Controller A, opened by an **"Engine data" button on the Driveline screen**, **no password**. This replaces the 2026-09-23 plan of a password-protected Diagnostics screen for these reads. Guard rails kept: polling runs **only while the screen is shown** (stops ~1.5 s after it is left), one request in flight, ~100 ms apart (each value ~2.5 Hz), **pauses while another tester is on the bus** (3 s guard), only these fixed frames - `2C` stays forbidden from the `diag` console. Sends the profile's define once per start (Patrol 1: `2C 10 15 E0`), then its reads in turn. **Since 2026-10-18 the identifier set is chosen per identified DDE** (table above): an unidentified ECU or one without a profile polls nothing and the status line says so; a slot without an identifier reads "identifier not known for this ECU yet". Provisional scalings are tagged on screen and every value shows its raw number and identifier for calibration against the Launch. A password can still come with a future Diagnostics screen for anything beyond these reads.
## Beyond the probe `(repo)`
+4 -2
View File
@@ -1,7 +1,7 @@
---
type: synthesis
tags: [meta, todo]
updated: 2026-09-27
updated: 2026-10-18
---
# Open Questions
@@ -20,7 +20,9 @@ The research frontier. Answering any of these should trigger updates across the
9. **Is a cruise-control PoC worth pursuing, and under what safety envelope?** The bus architecture supports it natively (the DME arbitrates torque requests from the EGS and ACC; `ST_CLCTR_V` reports which regulator has control). But actuation means **transmitting frames that command engine torque**, with unknown checksum/alive-counter algorithms and **no brake-pedal signal on this bus** to build the standard cancel interlock from. Design decision, not a research question. → [[driveline-speed-signals]]
10. **What are the Patrol's final drive ratio and tyre size?** Needed to turn output-shaft rpm into road speed. Swap-specific — not in any donor documentation. → [[nissan-patrol-swap]]
10. **What are the Patrol's final drive ratio and tyre size?** *Half answered 2026-10-13.* Final drive **4.11:1** (user). Tyre size still open — the firmware defaults to a 2440 mm rolling circumference (265/70 R16) and the Settings → Vehicle page lets the user correct it `(repo)`. Road speed is shown as `~km/h` until this, #8 and #11 are settled. → [[nissan-patrol-swap]]
15. **Patrol 2's bus (2026-10-18): who sent the 5-s trio on Patrol 1, and what are `0x38E` / `0x1B6` / `00C2`?** [[can-capture-2026-10-18-patrol-2]]. `0x332` / `0x3B3` / `0x3B4` came every 5 s from one transmitter on Patrol 1 (battery field always invalid) and are absent on Patrol 2 — a retained donor module (CAS? cluster? junction box?) or an EWS-delete difference `(unverified)`; the answer tells which cars keep `0x3B4`'s ignition nibble (the firmware no longer depends on it). `0x38E` (2 B, 10 Hz) is new on Patrol 2, `0x1B6` changed content and rate. The Launch's `2C 10 00 C2` reads 11 016–11 304 raw at idle while showing rail pressure (330–339 bar at the `00DF` scale) — setpoint or actual? Ask the user for the Launch's label next time. **Same evening, with the board on Patrol 2:** Patrol 1's live identifiers returned junk there (no rail, boost flat at 2800 mbar, charge-air temp > 300 °C) — the `2C 10` identifiers are per DDE software, so Patrol 2 needs its own Launch sessions — done the same evening for **boost `003A` and battery `002F`** ([[launch-captures-2026-10-18-patrol-2]]); **charge-air temperature is the one still missing**, and the Launch's own readings for all three Patrol 2 values are still wanted to confirm the (Patrol 1) scales → [[obd-diagnostic-polling]]. The output speed that stayed at 0 was the stationary car: the user confirmed it reads correctly when rolling. Also open: which modules are on each car's PT-CAN ([[vehicles]]). Patrol 2's `1A 86` block was read by the board the same evening: part **7796156**, 2006-05-17 (the Launch's `1A 80` says 7794904 / 2004-01-21 — as on Patrol 1 the two blocks carry different numbers and dates, hardware vs software `(unverified)`); full dump on [[vehicles]]: three part numbers 7796156 / 7796157 / 7789877 and **VIN prefix WBAGM21070 = E65 7-series**, so the two donors are different cars (E60 530d vs E65), which may be the reason for both the missing 5-s trio and the different `2C 10` addresses `(unverified)`.
## Design decisions (parked, not blocking)
+54
View File
@@ -0,0 +1,54 @@
---
type: concept
tags: [hardware, patrol, outputs, ch422g, wiring, relay, reverse]
updated: 2026-10-28
---
# Reverse lights from the board (DO0)
The Patrol's reverse lamps have no signal of their own after the swap; the gear lever position is on the bus (`0x1D2` byte 0, `(verified)` → [[can-id-candidates]]). The Main CTRL lights them through a 12 V relay on its isolated output **DO0** whenever the lever is in **R** (user request, 2026-10-28).
## The output circuit `(source: [[esp32-s3-touch-lcd-5-schematic]], sheet 1 "DI/DO", read from the PDF text)`
- CH422G **OC0** (pin 8) → R24 100 Ω → PC817 (T1) LED, anode via R74 510 Ω to 3V3. **OC0 LOW = LED on.**
- PC817 phototransistor → R58 1 kΩ → base of NPN power transistor T2 (R60 10 kΩ base pull-down). T2 collector = terminal **`DOUT0`** (silkscreen `DO0`), **emitter = board GND**, C102 100 nF across.
- DO1 is the same circuit on OC1 / T3 / T4 / `DOUT1`.
- Waveshare's rating: 5–36 V, **450 mA sink per channel** (source: [[esp32-s3-touch-lcd-5b-waveshare-wiki]]). The transistor's part number is not readable in the schematic text `(unverified)`.
> [!warning] "Isolated" only between the expander and the transistor
> There is no `DO_COM` terminal: the load current flows out of DO0 into the board's **GND**. The optocoupler isolates the CH422G from the output transistor, not the output from the board's ground. Fine here, because the board already shares vehicle ground for CAN and for the diff-lock inputs — but never return the relay current anywhere but the board's `GND`/vehicle ground.
The chip powers up with OC0 high (LED off), and the panel library writes that default again at every display init `(source: ESP32_IO_Expander, esp_io_expander_ch422g.c reset())`, so the lamps are off from reset until the firmware decides otherwise.
## Wiring
| Relay pin (ISO mini relay) | Connect to |
|---|---|
| 86 (coil +) | +12 V — the same supply that feeds the board's `VIN` (switched with the ignition is best) |
| 85 (coil −) | **`DO0`** |
| flyback diode (1N4007 or similar) | across 85/86, cathode (stripe) on the +12 V side |
| 30 / 87 | the reverse-lamp feed, as the lamp circuit needs |
- A standard 30 A mini relay coil is 70–90 Ω → 130–200 mA at 14 V, well inside 450 mA `(unverified: typical values)`.
- Not from USB power: the coil must return into the board's GND terminal with the 7–36 V supply on VIN.
- A ready-made 5 V relay module with an opto input also works: DO0 to its active-low `IN`, module VCC from `VOUT` set to 5 V (`H8` jumper, [[esp32-s3-touch-lcd-5b]]), grounds common.
- The 2N2222 the user has is not needed on this board (no spare native GPIO). It would be the right part to drive a relay from an Inst. Cluster GPIO instead: GPIO → 1 kΩ → base, emitter to GND, coil between +12 V and the collector, same diode.
## Firmware `(repo, 2026-10-28)`
`reverse_light.cpp`: every 100 ms, DO0 on ⇔ lever == R **and** CAN running **and** ignition on — the same snapshot the Driveline's big letter shows. A change is applied after two equal decisions (200 ms) so a one-frame glitch cannot chatter the relay. The CAN driver forgets the lever 2 s after the bus goes silent, and the key-off lever code `0xF0` clears ignition, so both turn the lamps off. The output is written through the panel library's expander object (OC0 = pin 8), never raw I2C: the backlight writes the library's cached OC register back to the chip on every on/off, so a raw write would be undone during an OTA install.
Console: `reverse status | on | off | force on|off|auto`. `on/off` is saved (NVS `revlight_en`, default ON); `force` drives DO0 regardless of the lever for the wiring check, never saved, ends itself after 60 s. No Settings row — the System page is full at four rows.
## Check in the car
1. Bench first: `reverse force on` → relay clicks, lamps on; `reverse force off` → off. `reverse status` shows the DO0 state and write counters.
2. Car, key on, engine off: move the lever to R — lamps on within ~0.3 s, `[reverse] lights ON (lever R)` on the console; back to N/P — off.
3. Key off in R: lamps must go off (lever code `0xF0` clears ignition).
4. Watch for relay chatter when the lever passes through R between P and D; if any, raise `CONFIRM` in the module.
Status: **not yet seen in the car** `(unverified)`.
## Related
[[esp32-s3-touch-lcd-5b]] · [[esp32-s3-touch-lcd-5-schematic]] · [[diff-lock-inputs]] · [[can-id-candidates]] · [[nissan-patrol-swap]]
+49
View File
@@ -0,0 +1,49 @@
---
type: entity
tags: [vehicles, patrol, dde, ident, can-bus]
updated: 2026-10-18
---
# Vehicles — one row per setup this firmware has met
The project started on one Patrol; on 2026-10-18 the user brought logs from a **second Patrol** ([[can-capture-2026-10-18-patrol-2]]) and announced a third setup for 2026-10-19. The two DDEs turned out to be different units that broadcast identical frames; what differed was **which other modules sit on the PT-CAN**. Two rules follow `(design, 2026-10-18)`:
1. **The ECU identity is a label.** The firmware reads it once (KWP `1A 86`, then `1A 80`), stores it, shows it on Settings → Vehicle, and never asks again until Re-read ECU (`(repo)` `EcuIdent`). It tags captures and this table; no broadcast scaling depends on it.
2. **Behaviour adapts to the frames present**, never to the ECU name: e.g. ignition from `0x3B4` when that frame is on the bus, from the `0x1D2` lever byte otherwise.
3. **Exception, found the same evening: the diagnostic live-data identifiers are per DDE software.** Patrol 1's `2C 10` set read junk on Patrol 2 (no rail, boost flat at 2800 mbar, charge-air temp above 300 °C); the Launch polls `00C2` there instead of `00DF`. The Engine data screen therefore keys its identifier set on the stored part number and asks nothing it has no identifier for → [[obd-diagnostic-polling]] table.
| Setup | DDE `1A 80` (part number, date) | DDE `1A 86` | IDs on the bus | Live-data identifiers (`2C 10`) | Differences | Evidence |
|---|---|---|---|---|---|---|
| **Patrol 1** (July – October 2026; the board's first car) | **7796678**, 2006-02-16 (from the Launch's reads in `raw/boost.txt`) | 7799764 / 7799765 / 7793887, 2006-03-07, VIN prefix WBANC92090 (E60 530d) — our probe, 2026-09-23 | `0A8 0A9 0AA 0B5 0BA 1A2 1B6 1D0 1D2 200 332 3B3 3B4 492 498 592 598` | define `15E0`; rail `00DF`, boost `0091`, charge-air temp `16A8`, battery `0093` | `0x3B4` present but battery field always invalid; `1A 80` from our probe went unanswered on 2026-09-23 | [[can-capture-2026-07-15]], [[diag-route-b-2026-09-23]], [[launch-captures-2026-10-07]] |
| **Patrol 2** (2026-10-18) | **7794904**, 2004-01-21 (from the Launch's reads) | **7796156** / 7796157 / 7789877, 2006-05-17, `"@DR55820 "`, **VIN prefix WBAGM21070 — an E65 7-series (730d `(unverified)`)**, not an E60 like Patrol 1 — the board's own read, `ecu dump` 2026-10-18 evening (`1A 80` also stored by the board: 7794904 / 2004-01-21, 31 B) | `0A8 0A9 0AA 0B5 0BA 1A2 1B6 1D0 1D2 200 38E 492 498 592 598` | rail `00C2`, boost `003A`, battery `002F` (all `(unverified scale)`, Patrol 1's formulas fit — [[launch-captures-2026-10-18-patrol-2]]); charge-air temp **not captured**; Patrol 1's identifiers return junk here | no `0x332` / `0x3B3` / `0x3B4` (ignition from the lever); `0x38E` new; `0x1B6` content/rate changed; output shaft `0x0BA` bytes 3–4 work here too (user, rolling, 2026-10-18 evening) | [[can-capture-2026-10-18-patrol-2]] |
| **Setup 3** (planned 2026-10-19) | — | — | — | — | said to differ from both | — |
Human names for the part numbers (a parts-catalogue lookup would name the exact DDE variant) are `(unverified)`; both are M57N DDE6-era units by behaviour (KWP2000, same `2C` live-data service, same broadcast map). **The donors differ: Patrol 1's DDE came from an E60 530d (WBANC92090), Patrol 2's from an E65 7-series (WBAGM21070)** — a plausible reason for the different `2C 10` addresses and the different bus population (the E60's 5-s trio `0x332/0x3B3/0x3B4` absent, `0x38E` present) `(unverified link)`.
Raw `1A 86` of Patrol 2 (66 bytes, this board, 2026-10-18):
```
+000 5A 86 40 44 52 35 35 38 32 30 20 06 05 17 00 00 |Z.@DR55820 .....|
+016 07 79 61 56 00 00 07 79 61 57 00 00 07 78 98 77 |.yaV...yaW...x.w|
+032 01 11 11 31 32 33 34 35 9E 30 30 38 39 45 48 30 |...12345.0089EH0|
+048 41 51 39 31 42 57 42 41 47 4D 32 31 30 37 30 FF |AQ91BWBAGM21070.|
+064 FF FF |..|
```
Raw `1A 80` (31 bytes): `5A 80 00 00 07 79 49 04 10 00 00 10 35 39 20 04 01 21 08 08 02 30 08 FF FF 02 03 01 00 00 00`. Same layout as Patrol 1's blocks (part number at `1A 86` byte 16, date at 11; `1A 80` part at 4, date at 15) — the decoder fits both cars `(verified)`.
## What to capture on a new setup `(procedure)`
Three CANNY logs plus notes, the way Patrol 2 was done:
1. **Key on only**, ~15 s, then key off and keep logging until the bus goes quiet (gives the wake-up and after-run timing, and the lever byte's `F0` behaviour).
2. **Start, idle, two throttle blips, lever through R / N / D with the brake held, key off**, keep logging.
3. **Launch connected on each live parameter the Engine data screen shows** — rail pressure, charge-air pressure, charge-air temperature, battery voltage — one at a time, ~20 s each, noting the parameter's name and the value on the Launch screen (the `2C 10 <id>` identifiers differ per DDE, so this is the only way the screen gets its identifiers on a new car). The Launch's `1A 80` cycle identifies the DDE even without our board.
4. A note of **what else is wired to the PT-CAN** besides DDE and EGS.
5. If drivable: a short drive with a GPS speed reading at one steady moment (the output-shaft factor is still provisional, [[driveline-speed-signals]]) — and a check that `0x0BA` bytes 3–4 move at all on that car's EGS.
With the board on the car: `ecu show` after a few seconds with the key on (it reads the identification once by itself), `diag status`, and a `CANRAW` capture for the ID census (`tools/serial_logger.py`). Offline, the per-ID census and the decoded timeline come from the scripts used for Patrol 2 (per-ID counts, rates, per-byte variability; half-second decoded timeline).
## Related
[[can-capture-2026-10-18-patrol-2]] · [[nissan-patrol-swap]] · [[bmw-m57n-engine]] · [[can-id-candidates]] · [[obd-diagnostic-polling]] · [[open-questions]]
+10232
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+11657
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,82 @@
---
type: source
tags: [can-bus, capture, patrol-2, dde, ignition, kwp2000, ident, launch, rail-pressure]
updated: 2026-10-18
---
# CAN captures — the second Patrol, same M57N, "same" DDE (2026-10-18)
The user has a **second Nissan Patrol with a BMW M57N** and brought three CANNY 5.3 Pico logs (tab-separated, same format as [[launch-captures-2026-10-07]]): `raw/ingnition-only.txt` (14.5 s, 7 693 frames), `raw/engine-on.txt` (21.7 s, 11 657 frames) and `raw/launch-diag-rail-pressure.txt` (15.4 s, 8 971 frames, Launch connected). No malformed lines. Analysed offline against the firmware's own scalings. **Headline: every frame the firmware decodes is byte-for-byte the same layout as on Patrol 1, but this bus has no `0x3B4`, so the firmware's only ignition signal is missing — and the DDE is a different unit.** This page is the evidence for [[vehicles]].
## What happened in each log `(verified from the logs)`
- **ignition-only**: bus wakes at 0 s (EGS boot pattern on `0x0B5`, `0x1D2` byte 0 = `F0`), lever reads `E1` (P) from 1.0 s, **key off at 10.6 s** (`0x1D2` byte 0 back to `F0`, `0x0A8` byte 7 bit 6 clears, `0x0AA` byte 7 `C8` → `00`), bus still alive when the log ends at 14.5 s.
- **engine-on**: key on at 0 s, **crank at 5.8 s** (`0x1D0` run state 1, rpm 138–186, lever flicks `E1`→`B4`→`E1` and `0x0BA` target nibble 3→1→3 for 30 ms), idle 735–760 rpm from 7.5 s (run state 2), three throttle blips (pedal 14 / 51 / 68 %) to 1 551 rpm at 12–14.5 s, **key off at 16.3 s**, rpm decays to 0 by 18 s, bus alive to the end (21.7 s).
- **launch**: engine idling 736–748 rpm in P, coolant 24→25 °C, the Launch polling one live value.
## ID inventory against Patrol 1
| ID | Hz | Patrol 1 (`raw/boost.txt`, 2026-10-07) | Patrol 2 | Note |
|---|---|---|---|---|
| `0A8 0A9 0AA` | 100 | yes | yes | DDE torque / rpm / pedal, same layouts |
| `0B5 0BA 1A2 1D2` | 100 / 50 / 50 / 5 | yes | yes | EGS, same layouts |
| `1D0` | 10 | yes | yes | DDE engine data, same |
| `200` | 5 | yes, constant `2C 81 FC` | yes, same | unknown |
| `492 498 592 598` | 5.5 / 0.2 | yes | yes | network management style, unknown |
| `1B6` | 1 → 10 | constant `00 FC 00 04 00 F8 00` at 1 Hz | `FF FF 00 04-07 xx F0/F8 xx`, speeds up to 10 Hz with the engine running | unknown, changed |
| **`332 3B3 3B4`** | 0.2 | **yes**, every 5 s | **absent in all 51 s** | the 5-s trio from one transmitter is gone |
| **`38E`** | 10 | absent | **yes**, 2 bytes, `FF FF` at wake-up then `00 00` | unknown, new |
| `612 6F1` | — | with the Launch | with the Launch | diagnostics |
The same logger saw `0x3B4` on Patrol 1 at 0.2 Hz, so this is not a tool filter. Whatever module sent the trio on Patrol 1 is not on Patrol 2's bus → [[open-questions]] #15.
## Every firmware-decoded signal matches `(verified)`
| Signal | Patrol 2 reads | Plausible |
|---|---|---|
| `0x0AA` rpm (`raw16 × 0.25`) | 0 key-on, 138–186 cranking, 735–760 idle, blips to 1 551 | yes |
| `0x0AA` pedal | 0 / 14 / 51 / 68 % | yes |
| `0x0A8` torque (`TORQ_AVL`) | 25–30 Nm warm idle, negative on overrun; **812 Nm with key on, engine off** (Patrol 1: 245 Nm) | the engine-off value is junk → firmware now gates torque on run state `(repo)` |
| `0x1A2` turbine (`raw / 8 + 6`) | tracks rpm within 20 rpm in P | yes |
| `0x1D0` coolant (`raw − 48`) | 23 → 25 °C, cold engine | yes |
| `0x1D0` run state (bits 20–21) | 0 off, 1 cranking, 2 running | yes |
| `0x0B5` gearbox oil (`raw − 40`) | 19 → 20 °C | yes |
| `0x1D2` lever | `E1` P, `B4` N during the crank, `F0` with the key off | yes |
| `0x0BA` target nibble / output shaft | 3 (P) / 0 | yes, stationary |
## The DDE is a different unit `(verified from the Launch's ident reads)`
The Launch reads the KWP identification (`6F1: 12 02 1A 80` → `612: F1 10 LL 5A 80 …`) every cycle. Decoded (BCD part number at payload bytes 4–7, BCD date YY MM DD at 15–17; offsets observed, field names `(unverified)`):
| Car | `1A 80` reply length | Part number | Date | Raw (after `5A 80`) |
|---|---|---|---|---|
| Patrol 1 | 37 B | **7796678** | 2006-02-16 | `00 00 07 79 66 78 00 00 00 11 4C 52 20 06 02 16 08 08 02 30 39 36 32 03 03 01 00 00 00 00 00 07 79 54 64 00` |
| Patrol 2 | 31 B | **7794904** | 2004-01-21 | `00 00 07 79 49 04 10 00 00 10 35 39 20 04 01 21 08 08 02 30 08 FF FF 02 03 01 00 00 00 FF` |
Patrol 1's `1A 86` block (read by our own probe, [[diag-route-b-2026-09-23]]) gives other numbers (7799764 / 7799765 / 7793887, 2006-03-07, VIN prefix WBANC92090) — `1A 80` and `1A 86` are different identification blocks of the same ECU. Same family, same broadcast layouts, same diagnostic behaviour; nothing in the decoding changes.
## Ignition without `0x3B4` — the lever rule `(verified timing on both logs)`
`0x1D2` byte 0 is `F0` for the first second after wake-up and from the instant the key goes off, while the bus keeps running another 5–10 s (EGS/DDE after-run). With terminal 15 on it is a lever code (`E1`/`D2`/`B4`/`78`). On Patrol 1 `F0` never appeared in any capture (always `E1`). So: **a recognised lever code = ignition on, `F0` = off**, within one 200 ms frame. A second vote with the same behaviour on both cars: `0x0A8` byte 7 bit 6 (set ~3 s after wake-up while the key is on — `40`/`42`/`E0`/`E2` —, cleared at key-off). Not consistent across the cars: `0x0AA` byte 7 (`C8` with key on / engine off on Patrol 2, `00` on Patrol 1).
Firmware `(repo, 2026-10-18)`: `0x3B4` keeps precedence while seen in the last 10 s, otherwise the lever rule decides; the driver logs which source decided.
## The Launch dialogue — a new rail identifier `(unverified meaning)`
Every ~270 ms: `12 02 1A 80` → multi-frame ident, flow control `12 30 00 00`, then **`12 04 2C 10 00 C2`** → `F1 04 6C 10 HH LL`. Raw `0x2B08`–`0x2C28` (11 016–11 304) at idle. At the verified `0xDF` rail scale (× 0.03 bar) that is 330–339 bar, a normal idle rail pressure, so `00C2` is probably the rail setpoint or the Launch's other rail item — the user did not note the Launch's label/value this time. → [[obd-diagnostic-polling]] identifiers table, [[open-questions]] #15.
## Bonus: a fuel counter on `0x1D0` `(unverified)`
Bytes 4–5 of `0x1D0` are a 16-bit counter that only advances with the engine running: ~400–500 counts/s at idle (0 → 5 433 over the engine-on log, flat before cranking and after key-off). Almost certainly the fuel-consumption counter (E65 docs name one on this ID) — a future fuel-rate readout once scaled against the Launch's consumption figure.
## Consequences `(repo, 2026-10-18)`
1. **Ignition fallback** from the `0x1D2` lever byte (above) — without it every live screen on Patrol 2 stays at "Ignition off".
2. **Torque gated on `ENGINE_RUN_RUNNING`** on the Sport and Driveline screens (the key-on/engine-off junk value).
3. **`EcuIdent`**: the DDE identification is read once (`1A 86` then `1A 80`), stored, shown on Settings → Vehicle (UNKNOWN ECU until then), re-read only on request; a connected Launch's `1A 80` reads are compared passively (ECU CHANGED?). Design: the identity is a label; behaviour adapts to which frames are present.
4. One row per setup from now on: [[vehicles]].
5. **Added the same evening, after the board's first key-on on this car (user report):** the Engine data screen showed no rail pressure, boost flat at ~2800 mbar and a charge-air temperature above 300 °C, and the output speed stayed 0. The first three are Patrol 1's `2C 10` identifiers being read on a different DDE software — the Launch polled `00C2` here, not `00DF` — so the live-data identifier set is now per DDE (`(repo)` `engine_screen.cpp` `PROFILES[]`): Patrol 2 gets rail `00C2` only until its other values are captured with the Launch. The output speed: all three logs here are stationary (`0x0BA` bytes 3–4 = 0 throughout), so a rolling capture is needed before calling the shaft field different on this EGS → [[open-questions]] #15. The board's own identification read worked on this unit: Settings → Vehicle showed **DDE 7796156 - 2006-05-17** (the `1A 86` block; the Launch's `1A 80` reads 7794904 / 2004-01-21) — both numbers now select the Patrol 2 profile. `ecu dump` over USB the same evening: `1A 86` = 66 bytes, `"@DR55820 "`, 2006-05-17, parts 7796156 / 7796157 / 7789877, **VIN prefix WBAGM21070 (E65 7-series)**; `1A 80` = 31 bytes, 7794904 / 2004-01-21 — this board's own `1A 80` is answered on this unit (it was silent on Patrol 1). Full bytes on [[vehicles]].
## Related
[[vehicles]] · [[can-id-candidates]] · [[obd-diagnostic-polling]] · [[launch-captures-2026-10-07]] · [[diag-route-b-2026-09-23]] · [[nissan-patrol-swap]] · [[open-questions]]
@@ -0,0 +1,34 @@
---
type: source
tags: [can-bus, capture, patrol-2, dde, launch, kwp2000, boost, battery, live-data]
updated: 2026-10-18
---
# Launch captures on Patrol 2 — charge-air pressure and battery identifiers (2026-10-18)
Two CANNY 5.3 Pico logs the user took on Patrol 2 (DDE 7794904 / 7796156, E65 donor, [[vehicles]]) with the Launch showing one live value each: `raw/charge-air-pressure.txt` (30.8 s, 5 930 frames, idle → one throttle blip to 2 553 rpm → key off) and `raw/battery.txt` (18.8 s, 10 232 frames, idle → engine stop). Same method as [[launch-captures-2026-10-07]] on Patrol 1. The Launch's values on its own screen were **not noted**, so the scalings below are Patrol 1's, checked only for physical plausibility.
## The Launch dialogue `(verified from the logs)`
Per cycle (~270 ms): `12 02 1A 80` → ident reply (flow control `12 30 00 00`), then **one** `12 04 2C 10 <id>` → `F1 04 6C 10 HH LL`. No define (`15 E0`), no session, no security, no negative responses — as on this car's rail capture ([[can-capture-2026-10-18-patrol-2]]).
| Launch screen | Identifier | Raw range | Scaled with Patrol 1's formula | Behaviour | Status |
|---|---|---|---|---|---|
| Charge-air pressure | **`003A`** | 8 071 – 9 487 | mbar = raw ÷ 8 → 1 009 – 1 186 | 1 018 mbar flat at 700 rpm idle; blip to 2 553 rpm (pedal 99 %) → peaks at 1 186 mbar 0.6 s after the rpm peak, decays to 1 021 mbar after key-off (ambient) | `(unverified scale)` — plausible: atmospheric at idle, +170 mbar on a free rev; Launch value not noted |
| Battery voltage | **`002F`** | 5 166 – 5 723 | V = raw × 0.002455 → 12.68 – 14.05 | 13.9 – 14.05 V at idle (alternator), drops with the engine stop (13.7 → 12.9 V within 0.6 s), then creeps down 12.86 → 12.68 V over 4 s key-on | `(unverified scale)` — plausible alternator / rest voltages; Launch value not noted |
Compare Patrol 1 (DDE 7796678): charge-air pressure `0091`, battery `0093`, rail `00DF` — **every identifier is different on this DDE** (rail is `00C2` here). The scalings, however, look identical, which fits the same measurement firmware family with a different variable map.
## Consequences `(repo, 2026-10-18)`
- Patrol 2's profile in `engine_screen.cpp` (`PROFILES[]`) now carries rail `00C2`, boost `003A`, battery `002F`; **charge-air temperature is still unmapped** on this car (one more Launch session: "charge-air temperature" / "intake air temperature").
- All three Patrol 2 values are tagged provisional on the screen until the user reads them next to the Launch (one point each would already confirm the scale).
## Also in these logs
- The output shaft: the user confirmed the Driveline's output speed is fine on Patrol 2 once rolling (the stationary logs had shown 0) — [[open-questions]] #15 closed on that point.
- Both logs show the `0x1D0` fuel-counter bytes advancing only with the engine running, as before.
## Related
[[obd-diagnostic-polling]] · [[vehicles]] · [[can-capture-2026-10-18-patrol-2]] · [[launch-captures-2026-10-07]] · [[launch-capture-2026-09-23]]