Skip to content

obd: MG ZS EV vehicle profile - #2

Draft
TurkeyMan wants to merge 1 commit into
mainfrom
agent/obd-mg-zs-ev
Draft

obd: MG ZS EV vehicle profile#2
TurkeyMan wants to merge 1 commit into
mainfrom
agent/obd-mg-zs-ev

Conversation

@TurkeyMan

Copy link
Copy Markdown
Member

Draft: not ready to merge into a canonical catalogue. 100 of its 111 elements are deliberately unlabelled. Opened so the enumeration is tracked rather than parked, and so it does not ride on #1.

What it is

Every element is read from the VCU at 0x7E3 (replies 0x7EB) with UDS ReadDataByIdentifier. On this vehicle the OBD gateway exposes exactly one diagnostically reachable ECU: probing all 256 request addresses in 0x700-0x7FF with the mandatory 1001 DiagnosticSessionControl, CAN receive filter fully open (ATCF 000 / ATCM 000), answered at only 0x7DF and 0x7E3. The BMS documented at 0x781 in older MG datasets does not respond, so pack SOC is not reachable by that route.

The did space was swept 0xB000-0xBFFF. Unsupported dids answer 7F 22 31, so the 111 readable dids are an exhaustive map of that page rather than a guess.

Decoded

element did decode
battery.voltage B00C u16:0.01V -> 315.3 V, sagging monotonically under the running DC/DC
aux.dcdc_voltage B584 u16:0.1V -> 13.8 V
aux.dcdc_current B583 u16:0.1A -> 25-28 A
aux.voltage B182 u16:0.01V -> 13.90 V
battery.contactor, charging.state, charging.active B703, B71B, B717 u8

BA00 confirms the vehicle uses offset encoding: parked it reads 4E1F, and (19999 - 20000)/100 is -0.01 km/h.

Why the rest are raw

Two reasons, and both are why this is a draft.

Signals with a zero point cannot be expressed yet: BA00 needs (raw-20000)/100, and the pack currents use 20000/32767/40000 offsets. The value-spec grammar is multiply-only, the same blocker j1979.conf already documents for A-40 temperatures.

The remainder are simply not identified. They sit under a hidden: true raw component so polling records a history that can be diffed across vehicle states (parked, charging, ready, driving) to identify them. Element names are series identities in the recorder, so renaming did_b1a0 to something real later orphans any history recorded under the old name. That argues for identifying them before this lands, not after.

Testing

Loads and materialises on an ESP32-S3 over a ble-serial stream to an ELM327 dongle: 111 elements, units applied, info populated from the template, survives reboot. Parse verified against a negative control (a deliberately broken type spelling produces Invalid data type ... for element: did_b003, the clean file produces nothing).

🤖 Generated with Claude Code

Full enumeration of the UDS did space at 0x7E3; unidentified dids are carried
raw and hidden so polling records a history to diff across vehicle states.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant