Files
ESP32-S3-Touch-LCD-5B/wiki/pages/can-id-candidates.md
T
julian 1cba9f30bc
Firmware / build (push) Successful in 10m49s
Reverse lights on DO0, Sport + Vehicle screens, per-DDE live data, ECU identification
- 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.
2026-10-28 16:46:42 +01:00

130 lines
17 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
type: synthesis
tags: [can-bus, reverse-engineering, e60, research]
updated: 2026-10-18
---
# E60/E65 CAN ID Candidates (Research Results)
Findings from the 2026-07-15 deep-research run (95 claims extracted from ~15 sources, 30 adversarially verified against primary repos before the run was interrupted; synthesis done manually from the journal). These are the IDs to program into the firmware **for bench testing against a live capture** — none are `(verified)` until seen on the actual swap's bus.
> [!success] Live capture 2026-07-15 — the map is CONFIRMED on the real bus
> First dump off the actual swap's bus ([[can-capture-2026-07-15]]) validates the research:
> - **All four signal IDs are live**: `0x1D0`, `0x1D2`, `0x0B5`, `0x3B4` (+ bonus `0x0AA`, `0x0BA`). (verified: present)
> - The firmware's placeholder IDs are **absent** — confirmed junk. (verified: absent)
> - `0x1D0` byte0 drifts up `0x55→0x58` = coolant warming (−48 scaling holds). **Oil temp `0x1D0` byte1 = `0xFF`** (not populated here).
> - `0x1D2` **gear fully VERIFIED** (2026-07-16, [[gear-box-can-revealings]]): byte0 `0xE1`=P/`0xD2`=R/`0xB4`=N/`0x78`=D — all codes match; byte4 splits D vs S/M and carries manual +/− shifts.
> - Absent despite being researched: `0x130`, `0x304`, `0x192`.
> [!success] 2026-07-17 — [[e65-reverse-engineering-repo]] ingested: both disputes resolved, engine state closed
> A per-ID DBC-style source with worked examples on every page. Combined with re-analysis of our own capture:
> - **Gearbox oil temp offset RESOLVED → `raw − 40`** (not offset 0, not +40). Cross-checked against our coolant trace.
> - **Battery layout RESOLVED → 12-bit LE × 0.015** (the E65 reading; the E90 24-bit BE reading is wrong for us).
> - **Engine-run state CLOSED** — `0x1D0` bits 20–21 read "running" in 397/397 frames of the 2026-07-15 capture. That dump *was* a genuine warm-up trace, so **no cold-start capture is needed to trust the coolant scaling**.
> - **Engaged gear number RESOLVED** without a drive capture → `0x1D2` D1 high nibble ([[gear-box-can-revealings]]).
> - **New signals**: turbine speed (`0x1A2`), output shaft speed (`0x0BA` D3/D4), pedal position + cruise state (`0x0AA`) → [[driveline-speed-signals]].
## 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) |
| Engine oil temp | **0x1D0** | byte 1 | °C = raw − 48 | DME/DDE | 100 ms | **High** — same sources as coolant |
| Gearbox oil temp | **0x0B5** (`TEMP_GRB`) | byte 7 | **°C = raw − 40** | EGS | 10 ms | **✅ RESOLVED 2026-07-17** — [[e65-reverse-engineering-repo]] worked example (raw `0x43`=67 → 27 °C), plus our own cross-check: D7 `0x47`(71)→**31 °C** while coolant read 37 °C and climbing. Offset-0 would have the box at 71 °C with the engine at 37 °C — impossible for a warm-up |
| Gear lever position | **0x1D2** ("TransmissionDataDisplay") | **byte 0** | `0xE1`=P `0xD2`=R `0xB4`=N `0x78`=D/(S/M) | EGS | 200 ms | **✅ VERIFIED on the swap bus 2026-07-16** — every code matches. Full decode: [[gear-box-can-revealings]] |
| Gearbox mode | **0x1D2** | **byte 4** | `0xF0`=Drive(auto) `0xF1`=Sport `0xF2`=Manual | EGS | 200 ms | **✅ VERIFIED 2026-07-17** — `0xF2` is a *persistent mode*, not a downshift event (earlier claim corrected) |
| Engaged gear number | **0x1D2** | **byte 1** | `gear = (D1 >> 4) − 4`; `0x0F` = none (P/R/N) | EGS | 200 ms | **✅ VERIFIED 2026-07-17** — clean +16 ladder across gears 1–6, identical in D and M/S ([[gear-box-can-revealings]]). **Never set for R** |
| Engaged gear **incl. reverse** | **0x0BA** (`ST_GR_GRB`) | byte 0 low nibble | `1`=N `2`=**R** `3`=P `5`–`A`=1st–6th `0xF`=invalid | EGS | 20 ms | **✅ FULLY VERIFIED 2026-07-17** — all of 1/2/3/5/6/7/8/9/A observed live in the drive capture ([[can-capture-2026-07-17-drive]]). **A complete gear source on its own**, and the only source of engaged reverse (`0x1D2` D1 is blind to it). Value `4` unobserved |
| Converter lockup clutch | **0x0BA** (`ST_CCLT`) | byte 0 bits 6–7 | `0`=disengaged `1`=controlled `2`=closed `3`=invalid | EGS | 20 ms | **✅ VERIFIED 2026-07-17** — 422 frames "controlling", clustered in higher gears. Matters for the turbine-ratio test: when locked, turbine = engine exactly → [[driveline-speed-signals]] |
| Battery voltage | **0x3B4** (`U_BT`) | bits 0–11 | **`((D1 & 0x0F) << 8 \| D0) × 0.015` V** | Power module | 5 s | **✅ RESOLVED 2026-07-17** — 12-bit LE × 0.015 confirmed by [[e65-reverse-engineering-repo]] worked example (`0x3D9`→14.775 V). The E90 24-bit BE × 0.001 reading is **wrong for us**. Bonus: `ENG_ST` bits 16–19 |
| Engine RPM | **0x0AA** (`RPM_ENG`) | bits 32–47 | **`(D4 + D5×256) × 0.25`** 1/min | DME/DDE | 10 ms | **✅ VERIFIED 2026-07-17** — 679–684 rpm at idle on our capture, matching `RPM_IDLE_TARGET`=700 from `0x1D0` |
| **Turbine speed** | **0x1A2** (`RPM_GRB_TURB`) | bits 0–15 | **`(D0 + D1×256) × 0.125 + 6`** 1/min | EGS | 20 ms | **✅ VERIFIED 2026-07-17** — physical proof of gear engagement; collapses ~630→~0 when the box engages. → [[driveline-speed-signals]] |
| **Output shaft speed** | **0x0BA** | bits 20–39 (D3/D4) | 🔬 raw × ~**0.107** rpm (was 0.125) | EGS | 20 ms | **ID ✅ verified 2026-07-17** — rises monotonically 1st→6th, zero whenever the output is held. **Scaling 🔬 and revised**: a direct Launch reference (128 rpm @ raw 1192) **contradicts ×0.125** (would predict 149) and points to ~0.107. Needs a multi-point Launch sweep to fix. **Our only road-speed signal** (no DSC on this bus) → [[driveline-speed-signals]] |
| Engine run state | **0x1D0** (`ST_ENGINE_RUN`) | bits 20–21 | `0`=off `1`=starting `2`=running `3`=invalid | DME/DDE | 100 ms | **✅ VERIFIED 2026-07-17** — read 2 ("running") in 397/397 frames of the 2026-07-15 capture |
| Engine torque (available) | **0x0A8** (`TORQ_AVL`) | bits 12–23 | signed × **0.5 Nm** (`(D2<<8\|D1)/32` after masking D1's alive-counter nibble) | DME/DDE | 10 ms | **✅ VERIFIED 2026-07-17** — user-identified ID; formula matches the repo's 0x0A8 worked example (24 Nm, ALIV=8 in D1 low nibble); ~27–28 Nm at warm idle. On the driveline screen → [[driveline-speed-signals]]. NB **0x0AA `TORQ_DVCH`** is the same layout but is driver *demand* — diverges under load |
| Pedal position / cruise state | **0x0AA** | `ANG_ACPD` bits 24–31 (×0.39063 %); `ST_CLCTR_V` bits 52–55 | see [[driveline-speed-signals]] | DME/DDE | 10 ms | (source: [[e65-reverse-engineering-repo]]) — relevant to a cruise-control PoC |
| Gearbox cooling demand | **0x0B5** (`ST_OTMP_GRB`) | bits 38–39 | `0`=none `1`=stage 1 `2`=stage 2 `3`=invalid | EGS | 10 ms | (source: [[e65-reverse-engineering-repo]]) — the box's own overheat opinion; better display warning than a raw threshold |
| Ignition/terminal status | **0x130** | byte 0 bitmasks | 0xD5/0xC5/0xC1 | CAS | 100 ms | **Absent from our bus** (verified 2026-07-15) — CAS not retained in the swap |
### The 0x1D2 encoding dispute — ✅ RESOLVED on the swap bus (2026-07-16)
The live lever capture ([[gear-box-can-revealings]]) settles it — **DLC 6**, whole-byte codes in byte 0, matching the documented table exactly:
| Byte | Meaning | Values |
|------|---------|--------|
| **0** | **Lever position** | `0xE1`=P, `0xD2`=R, `0xB4`=N, `0x78`=D **and** S/M |
| **1** | **Engaged gear** | `gear = (D1 >> 4) − 4`; `0x0F` = none (P/R/N). Never set for R |
| 2 | unused | `0xFF` |
| 3 | Rolling counter | fluctuates — ignore (matches the predicted byte-3 counter) |
| **4** | **Mode** | `0xF0`=Drive(auto), `0xF1`=Sport, `0xF2`=Manual |
| 5 | unused | `0xFF` |
Byte 0 alone gives P/R/N/D; byte 4 splits **D vs S vs M**; byte 1 gives the engaged gear 1–6. The old "dispute" was just notation — the E65 whole-byte values and the E90 low-nibble scheme agree (`0xE1` low nibble = 1 = P, etc.), and this bus speaks the whole-byte/DLC-6 dialect.
> [!warning] Two 2026-07-16 labels on this page were wrong — corrected 2026-07-17
> - **D1 was called a "drive-gate flag"**. It is the **engaged gear number**; it only ever showed two values because the vehicle was stationary in 1st. This also means the "engaged gear needs a drive capture" task was never real — a per-detent capture sufficed.
> - **D4 `0xF2` was called "downshift (−)"**, a transient event. It is a **persistent Manual-mode flag** — it holds across gears 2–6. The `+`/`−` nudges have no distinct code; they merely promote Sport → Manual. The old "up-shift (+) value unconfirmed" question therefore dissolves rather than being answered.
>
> Both errors came from over-reading a two-value field as a boolean. Full evidence: [[gear-box-can-revealings]].
> Note `0x1D2` is where **our decode is ahead of the published source**: [[e65-reverse-engineering-repo]] lists `0x1D2` as "Display Gearbox Data" with an **empty signal table** — it never decoded it. Its sample frame (`E1 0C 8F 7C F0 FF`) does independently confirm `0xE1`=P.
> The firmware's `automotive_data.h` gear map should be rewritten to `0x1D2` byte 0 + byte 1 + byte 4, with `0x0BA` for engaged reverse. → [[can-bus-integration]]
## Field checklist for the live capture session
Setup: 500 kbps, board's 120 Ω termination switch **OFF**, common ground with the vehicle, tap CAN-H/CAN-L on the PT-CAN. (Note: the firmware runs `TWAI_MODE_NORMAL` and ACKs the bus — not listen-only — see [[can-bus-integration]].) **Log everything raw for the whole session** and save the dump into `wiki/raw/` — even IDs we don't care about yet.
Setup notes still apply. **Most of the original checklist is now done** — gear (lever, engaged, mode), coolant, gearbox temp, battery, RPM, engine state are all resolved. What remains:
| Test | Watch | Confirms |
|------|-------|----------|
| **Wheels lifted, steady speed in D; step 1st→6th** | `0x0BA` D3/D4 vs `0x1A2` turbine vs `0x0AA` RPM, logged together | **Output-shaft scaling.** Turbine ÷ output at each gear should reproduce the 6HP26 ratios — a built-in self-check. → [[driveline-speed-signals]] |
| Compare `0x3B4` to a multimeter at the battery | `((D1 & 0x0F) << 8 \| D0) × 0.015` vs meter (engine off ≈12.4 V, running ≈14+ V) | Battery factor — layout is settled, this is a sanity pass only |
| Cross-check `0x0B5` D7 − 40 against the Launch's gearbox oil temp readout | Expect agreement within a degree | Confirmatory only — offset already settled two ways |
| Lever to R **on the ground**, brake released | `0x1A2` turbine ÷ `0x0AA` RPM ratio | The engagement test for the "lever says R but nothing happens" fault → [[driveline-speed-signals]] |
| Engage cruise (if the donor's stalk is wired) | `0x0AA` `ST_CLCTR_V` bits 52–55 → `0x4`–`0x7` | Whether the DME's CC regulator is live on this swap |
Absent IDs are themselves answers — `0x130`/`0x304`/`0x192` and the whole DSC group (`0x0CE`/`0x19E`/`0x1A0`) never appear, meaning CAS and DSC aren't on the swap bus ([[open-questions]] #3).
## Fault codes: passive reading is NOT possible ⚠
Consistent across sources: **no DTC/fault-code broadcast exists**. The `dieslg8` project (M57 diesel, later EDC17 DDE) gets coolant temp and DTCs only via **active diagnostic requests** (send on 0x6F1, parse responses on 0x612; e.g. coolant = raw×0.01 − 100). At most, a **MIL/check-engine lamp status bit** may be passively derivable (a commercial Patrol-swap CAN module offers a check-engine output). Consequences for the firmware `(repo)`:
- The `fault_codes` field in `automotive_data_t` cannot be filled in LISTEN_ONLY mode.
- Options: (a) drop the field, (b) show MIL lamp status only, (c) leave LISTEN_ONLY and accept it empty, or (d) later add a diagnostic-request mode (means transmitting on the bus — design decision).
## Swap-context validation
A commercial module exists specifically for **BMW M57/N57 swaps into Nissan Patrols/Landcruisers** that derives tach, check-engine lamp, reverse trigger (from the ZF EGS via CAN — the box has no reverse wire), and fan trigger from the engine CAN. Proof that passive listening on exactly this drivetrain-in-a-Patrol works. → [[nissan-patrol-swap]]
Also useful: an E60 forum claim `(unverified)` that arbitration IDs are identical across E60 K-CAN and PT-CAN (PT-CAN just broadcasts faster, ~10 ms vs ~100 ms) — meaning E90 K-CAN DBC findings likely transfer to our 500 kbps PT-CAN tap.
## Sources
- [[e65-reverse-engineering-repo]] — **E65/E66 per-ID DBC-style docs (ingested 2026-07-17)** — the highest-value source found so far: resolved the gearbox-temp offset and battery layout, closed the engine-state question, and supplied turbine speed, output shaft, pedal position and cruise state. Caveat: petrol MED 9.2.1 donor, not M57N diesel
- [[e60-vfl-can-codes-xlsx]] — **E60 VFL community spreadsheet (ingested)**: E60-specific confirmation of 0x1D0 (−48 scaling), 0x3B4, 0x1D2 DLC 6; adds 0x304 gear lever; contains NO oil-temp or gearbox-temp rows
- [[listen-and-send-pid-arduino]] — technique reference (ingested): ELM327 PID-request pattern for the fault-code fallback; E46 cluster frames, not E60 evidence
- `damienmaguire/BMW-E65-CANBUS` (GitHub) — live E65 735i captures + working EGS emulator code (0x1D2 encoding, 0x192, 0x0AA)
- `TimesNewRomanZ/e60-canbus` (GitHub, community `bmw_e9x_e8x.dbc`) — author runs a real E60 545i; 0x1D0 confirmed live on E60
- `kmalinich/dieslg8` (GitHub) — M57 diesel (E90 335d, EDC17): diagnostic-request-only coolant/DTC evidence
- loopybunny E90 K-CAN DBC — 0x1D0/0x1D2/0x3B4 E90 layouts
- E60 forum thread with tool32/EDIABAS-derived ID table — confirms 0x1D0/0x1D2/0x304/0x3B4 exist on E60 with DDE1 as sender
- Commercial M57/N57 Patrol-swap CAN module product page — swap-context feasibility
## Caveats
- No source used an actual **E60 M57N diesel** end-to-end; the closest anchors are the E60 tool32 table (lists DDE1 as sender for 0x1D0/0x3B4), the E60 VFL spreadsheet, and the M57 dieslg8 project. Engine-side layouts are inferred from petrol DME captures of the same bus generation. **Mitigating evidence (2026-07-17)**: every signal from the petrol-donor [[e65-reverse-engineering-repo]] that we checked against our own bus decoded to physically sensible values first try — coolant, gearbox temp, RPM, turbine speed, engine state, gear. The layouts evidently carry.
- **Engine oil temp is now the only dead signal**: `0x1D0` byte 1 reads `0xFF` on our bus — the sensor isn't populated on this M57N. Not a decode error; there is nothing to read. The UART packet's `engine_oil_temp` field has no source.
- **`AIP_ENG` (`0x1D0` byte 3) is barometric, not boost** — 8 bits ×2 +598 caps at 1108 hPa; a boosting M57N reaches ~2500 hPa absolute. Manifold boost is **not broadcast**; the Launch polls for it. → [[obd-diagnostic-polling]]
- Firmware's original IDs (`0x4F`, `0x55`, `0x201`, `0x1001`, `0x101F`) are contradicted by every source AND **confirmed absent from the live bus** (verified, 2026-07-15) — definitively placeholders. → [[can-bus-integration]]
- **The cold-start capture is no longer needed.** It was on the list only because the 2026-07-15 engine state was unknown; `ST_ENGINE_RUN` = running in 397/397 frames settles that, making the coolant trace a genuine warm-up and its −48 scaling trustworthy.
- Remaining `(unverified)`: `0x0BA` `ST_GR_GRB` values 6–A (2nd–6th, inferred from the parallel `0x1D2` ladder), and the `0x0BA` D3/D4 output-shaft **scaling**. → [[driveline-speed-signals]]
## Related
[[can-bus-integration]] · [[driveline-speed-signals]] · [[e65-reverse-engineering-repo]] · [[gear-box-can-revealings]] · [[bmw-m57n-engine]] · [[nissan-patrol-swap]] · [[open-questions]]