Jump to content
Jason (ABRP)

Decoding the i3's PIDs

Recommended Posts

This thread is for anyone interested in figuring out how to get Live Data into ABRP for the BMW i3.

It's something of a manual process, identifying the PIDs and what data they contain.  Here's what I know so far:

  • BMWs have a unique activation code (See link) which needs to be input to Torque Pro to connect (may or may not be true for the i3)
  • PID reverse engineering is possibly done via CAN listening (See Link)
  • Torque has a plugin which scans for PIDs that have data (Link) but often doesn't turn anything up for EVs.

Reverse engineering the PIDs is not something I've done before, and requires physical access to the car.  A lot of trial and error, and guesswork.  I'm happy to provide help in troubleshooting the setups and figuring out the PIDs.

Share this post


Link to post
Share on other sites

Does torque work with iOS?  Last time I looked into it it was Android only. I don't have an android phone to play with. Guess i'm not much help here. I'll stick to updating the opencharge maps. 

Share this post


Link to post
Share on other sites
16 hours ago, tjsean0308 said:

Does torque work with iOS?  Last time I looked into it it was Android only. I don't have an android phone to play with. Guess i'm not much help here. I'll stick to updating the opencharge maps. 

EngineLink is pretty good for iOS, and can use the same kinds of PID lists that Torque does.  I'm just not very familiar with it as an Android user myself.

Share this post


Link to post
Share on other sites

@Jason (ABRP) Deep obd can certainly see a lot of ECU, and read values from registers. Not that I can begin to understand what I'm looking for, I didn't see anything specifically marked as something that looked like state of charge. Since I am not familiar with what deep obd was showing me I didn't poke too much around. If someone can give me an idea of what I'm looking for I can try and look more into it. I also gave Torque Pro a try, and the scanner plugin. Couldn't see a battery SoC there either, and the scanner took forever only to give me a long list of PIDs with their response. All of which seemed to be "7E8037F2213". Not sure if that's a status response equivalent to "404 not found" or OK, or what, but they all responded with that. 

Deep OBD showed these ECU:

Quote

CAS: Body Domain Controller

EME/RLM1R: Electric Motor-Electronics I01

GWS: Gear selector switch

KLE: Universal Charging Extension

KOMBI: The instrument cluster

LHM_L: Frontal light electronics left

LHM_R: Frontal light electronics right

PMA/USS: Park Maneuver Assistant

RE_DME: Range-Extender Engine Electronics

RE_EME: Range Extender, E-Machine Electronics

SME: Memory Management Electronics 

TBX: Erkennerbox to the ZBE Touch

TFM: Tank-Function-Module

ZGW: Central Gateway

This all seems like it's pretty comprehensive. Selecting an ECU loads for a good while, then presents "jobs" to run and results to select to view after the "job".

For instance for the ECU "CAS" the "jobs" look like things like:

Quote

STATUS_ENERGIESPARMODE: Energy-Saving-mode read-out; UDS : $22

or

STATUS_FH_THERMOMONITOR_AKTIV

plus many more naturally, it's a long list

 

Not sure where to go from here. Torque PID scanner didn't seem to go anywhere. Supposedly the "deep odb" app should be able to do anything that INPA/tool32 can according to the dev. I sent them an email to see if they can assist with finding the information were looking for like the battery SoC, gps info, power use commanded, and instantaneous range estimates etc. We'll see if they can get back to me and help.

Share this post


Link to post
Share on other sites
15 hours ago, mlow said:

@Jason (ABRP) Deep obd can certainly see a lot of ECU, and read values from registers. Not that I can begin to understand what I'm looking for, I didn't see anything specifically marked as something that looked like state of charge. Since I am not familiar with what deep obd was showing me I didn't poke too much around. If someone can give me an idea of what I'm looking for I can try and look more into it. I also gave Torque Pro a try, and the scanner plugin. Couldn't see a battery SoC there either, and the scanner took forever only to give me a long list of PIDs with their response. All of which seemed to be "7E8037F2213". Not sure if that's a status response equivalent to "404 not found" or OK, or what, but they all responded with that. 

Deep OBD showed these ECU:

This all seems like it's pretty comprehensive. Selecting an ECU loads for a good while, then presents "jobs" to run and results to select to view after the "job".

For instance for the ECU "CAS" the "jobs" look like things like:

 

Not sure where to go from here. Torque PID scanner didn't seem to go anywhere. Supposedly the "deep odb" app should be able to do anything that INPA/tool32 can according to the dev. I sent them an email to see if they can assist with finding the information were looking for like the battery SoC, gps info, power use commanded, and instantaneous range estimates etc. We'll see if they can get back to me and help.

Great that you've made some progress! Generally PIDs come in a mode/pid combo.  Example: mode=22, pid=2411 is the Raw SOC PID for the Chevy Bolt.  Unfortunately for us most of the EV PIDs are in the "proprietary" modes (21,22,etc), and don't have a lot of carry-over between manufacturers. 

In the end, you'll probably need help from the developer to access those PIDs.  Does Deep OBD have a server logging method?

I've never had success with Torque's scanning plugin, as you said, a lot of non-responses on the PIDs it tries.  I have been tinkering with an AutoPi and intend to develop my own scanning plugin to try to do a better job of finding the PIDs.  Remains to be seen if I will be successful.

Share this post


Link to post
Share on other sites
4 hours ago, Jason (ABRP) said:

Great that you've made some progress! Generally PIDs come in a mode/pid combo.  Example: mode=22, pid=2411 is the Raw SOC PID for the Chevy Bolt.  Unfortunately for us most of the EV PIDs are in the "proprietary" modes (21,22,etc), and don't have a lot of carry-over between manufacturers. 

In the end, you'll probably need help from the developer to access those PIDs.  Does Deep OBD have a server logging method?

I've never had success with Torque's scanning plugin, as you said, a lot of non-responses on the PIDs it tries.  I have been tinkering with an AutoPi and intend to develop my own scanning plugin to try to do a better job of finding the PIDs.  Remains to be seen if I will be successful.

I've got a half dozen(well closer to dozen) Pi devices and Pi-like devices. So let me know if I can help with that. I'll give the deep obd app another look, but yes it has a logging option in the menu, with some options for data types. I'll also try and use that profile command option in the torque app, as when I tried before I did not have that string of commands added to the vehicle profile. Perhaps it will reveal more information. The developer of the deep obd app did get back to me but doesn't quite know how information such as SoC would be obtained. They suggested using the "ediabas tool" to see which "jobs" to run. But I'll admit to that stuff being over my head. It certainly looks like the information could be gotten that way but it's certainly not the most straightforward app. The developer will straight up tell you the tool is only for "experts", I assume they mean essentially it's only for people very familiar with bmw CAN bus knowledge. 

Share this post


Link to post
Share on other sites

Some deep obd screen shots. Not that I know what really that they show or is of use, since most is German but I think it says battery in there somewhere.

Screenshot_20190809-022426.png

Screenshot_20190809-033734.png

Screenshot_20190809-034159.png

Share this post


Link to post
Share on other sites

My opinion - there's only one way to become an expert: Starting as an amateur!

Do any of your Pi devices have an OBD port you could plug in? We could certainly work with that to devise a means of probing the CAN bus.  Python has a very nice OBD module that's fairly easy to use, we'd need to work out a learning algorithm, first finding all of the PIDs that respond, then figuring out which ones provide useful information.

Share this post


Link to post
Share on other sites
Posted (edited)
3 hours ago, Jason (ABRP) said:

My opinion - there's only one way to become an expert: Starting as an amateur!

Do any of your Pi devices have an OBD port you could plug in? We could certainly work with that to devise a means of probing the CAN bus.  Python has a very nice OBD module that's fairly easy to use, we'd need to work out a learning algorithm, first finding all of the PIDs that respond, then figuring out which ones provide useful information.

I did a lot of web browsing and found some info that may help.

image.png.d11dbd33bcf4f4a00dc1eff01eea8277.png

This appears to be the software "ISTA" used for diagnosis and programming. For windows machines, and used with a "K/D-CAN cable". So the protocol is obviously CAN, meaning that the ECU/module of interest is "SME", I believe.

image.png.abb9939892ae4c65e3c41f0dd8f2ea81.png

The circled text reads, "Condition high voltage battery".

image.thumb.png.3f8b4675aabb61518722f47e20dd23f1.png

Circled text here reads "Current State of Charge". Bingo.

 

So from what I gather we're looking for reading info from the SME ECU/module. Either it is exposed as a PID over OBD, or it's a message sent over CAN at intervals, and has to be "caught" I guess.

Edited by mlow

Share this post


Link to post
Share on other sites

anybody else tried deepobd with i3?

i can read some sensors and parameters from EDME ecu, but nothing at all from SME ecu. it's got some parameters for battery temperature, but cant read anything at all.

At the same time reads battery temperature, charge level with ista-d and laptop no problem.

Share this post


Link to post
Share on other sites

So, I'm trying to have a go at this. First thing is trying to work out what to get to connect to the car. I too have been doing various bits of research, and found some schematics for the wiring inside the i3.

Quote

This appears to be the software "ISTA" used for diagnosis and programming. For windows machines, and used with a "K/D-CAN cable". So the protocol is obviously CAN, meaning that the ECU/module of interest is "SME"

So, the OBD connector has two protocols on it. There's the DCAN bus, , and Ethernet.  The K+DCAN cable allows access to DCAN and K-Line buses (K-Line isn't connected on the i3 I think). The ENET cables allow you to talk TCP-IP. Most things I see about coding the car talk about using the ENET cable, but Bimmercode just seems to use DCAN I think.

Second thing is that the OBD connector connects to the BDC (Body Domain Controller). It then connects over the PT-CAN bus to the EDME (Electrical Digital Motor Electronics), and that connects over the PT-CAN2 bus over to the SME (Supply Machine Electronics - The box that sits in the battery tray).

OBDII Port <---DCAN---> BDC <---PT-CAN---> EDME <---PT-CAN2---> SME 

That matches the diagram you've posted.

There's no guarantee  that the CAN messages from the SME that we want are forwarded from the PT-CAN2 bus, through the EDME, to the BDC, and then onto the DCAN bus on the OBD port. We are a few levels deep here. One thing that's working for us is that the instrument cluster is on the PT-CAN bus, so the charge level updates should be on that bus, and that's just one step away.

I'm waiting for my cables to turn up, and then I'll start doing some experiments.

Share this post


Link to post
Share on other sites
On 9/20/2019 at 10:51 AM, PaulS said:

So, I'm trying to have a go at this. First thing is trying to work out what to get to connect to the car. I too have been doing various bits of research, and found some schematics for the wiring inside the i3.

So, the OBD connector has two protocols on it. There's the DCAN bus, , and Ethernet.  The K+DCAN cable allows access to DCAN and K-Line buses (K-Line isn't connected on the i3 I think). The ENET cables allow you to talk TCP-IP. Most things I see about coding the car talk about using the ENET cable, but Bimmercode just seems to use DCAN I think.

Second thing is that the OBD connector connects to the BDC (Body Domain Controller). It then connects over the PT-CAN bus to the EDME (Electrical Digital Motor Electronics), and that connects over the PT-CAN2 bus over to the SME (Supply Machine Electronics - The box that sits in the battery tray).


OBDII Port <---DCAN---> BDC <---PT-CAN---> EDME <---PT-CAN2---> SME 

That matches the diagram you've posted.

There's no guarantee  that the CAN messages from the SME that we want are forwarded from the PT-CAN2 bus, through the EDME, to the BDC, and then onto the DCAN bus on the OBD port. We are a few levels deep here. One thing that's working for us is that the instrument cluster is on the PT-CAN bus, so the charge level updates should be on that bus, and that's just one step away.

I'm waiting for my cables to turn up, and then I'll start doing some experiments.

Keep us posted for sure. I stopped short of buying the cable, as I wasn't sure which would be best to get. Plus it also seems a windows PC laptop will also be needed. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


Contact Us

Bo - Lead Developer and Tesla owner: bo@abetterrouteplanner.com

Jason - New Car Models, Developer and Bolt owner : jason@abetterrouteplanner.com

Idreams - Forums Administrator, Forums Developer and Tesla owner : idreams@abetterrouteplanner.com

×
×
  • Create New...