obd: MG ZS EV vehicle profile - #2
Draft
TurkeyMan wants to merge 1 commit into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(replies0x7EB) with UDS ReadDataByIdentifier. On this vehicle the OBD gateway exposes exactly one diagnostically reachable ECU: probing all 256 request addresses in0x700-0x7FFwith the mandatory1001DiagnosticSessionControl, CAN receive filter fully open (ATCF 000/ATCM 000), answered at only0x7DFand0x7E3. The BMS documented at0x781in older MG datasets does not respond, so pack SOC is not reachable by that route.The did space was swept
0xB000-0xBFFF. Unsupported dids answer7F 22 31, so the 111 readable dids are an exhaustive map of that page rather than a guess.Decoded
battery.voltageu16:0.01V-> 315.3 V, sagging monotonically under the running DC/DCaux.dcdc_voltageu16:0.1V-> 13.8 Vaux.dcdc_currentu16:0.1A-> 25-28 Aaux.voltageu16:0.01V-> 13.90 Vbattery.contactor,charging.state,charging.activeu8BA00confirms the vehicle uses offset encoding: parked it reads4E1F, and(19999 - 20000)/100is -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:
BA00needs(raw-20000)/100, and the pack currents use 20000/32767/40000 offsets. The value-spec grammar is multiply-only, the same blockerj1979.confalready documents forA-40temperatures.The remainder are simply not identified. They sit under a
hidden: truerawcomponent 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 renamingdid_b1a0to 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-serialstream to an ELM327 dongle: 111 elements, units applied,infopopulated from the template, survives reboot. Parse verified against a negative control (a deliberately broken type spelling producesInvalid data type ... for element: did_b003, the clean file produces nothing).🤖 Generated with Claude Code