Roy13
Posts: 13
Joined: Sat Sep 23, 2017 3:09 pm

Identifying CanBus parameters

Sun Sep 24, 2017 8:29 pm

Hi everyone,
I have made a GPS tracker for my PHEV that reports back to my raspberry pi with database (emoncms & HASS) at home.
I would love to have State Of Charge available so i can see it from my phone any where anytime similar to a Leaf.
Also i don't want to see the fake SOC meter on the dash but the real SOC, hopefully you all understand what i mean.
I have an MCP2515 connected to an Arduino UNO and have been taking various logs using Hyperterminal.
Please feel free to look over them and see if you can see any patterns, or better so if you can direct me to a program that could help me start a list on the page for future tinkerer's.
Currently ID 353 Data 0 & 1; show an incremental pattern counting up. Time between Data 0 incrementing can be measured giving a charge current.
ID 346 Data 2 appears to be dashboard SOC as i get FE when full and 06 when battery depleted and generator switching on.
Soon as i work out how to upload my logs i will.
I also have a Nissan leaf if anyone wants logs from it.


anko
Posts: 3405
Joined: Mon Dec 01, 2014 11:30 am
Location: Netherlands, Utrecht area

Re: Identifying CanBus parameters

Sun Sep 24, 2017 9:06 pm

Finally, somebody who is into monitoring, rather than polling :lol: . How about 375, (D*256+E)/100-5

Gives you SOC with two decimal digits. No crap with 30 is empty or anything the like. True WYSIWYG. :mrgreen:

-- edit --

You may have a problem there, as 375 is only available on the secondary CANBUS. You will not see it on the primary CANBUS, which is available via the OBD port that sits under the steering wheel. If you really want it, you will have to tap into the secondary bus, for example at the connector the hooks up the rear motor ECU. That is how I did it.

BTW: To my best knowledge, 346 will give you this:

BARS SOC GAUGE: (C*17/100)
PCT EV DRIVING: H
POWER (METER) (A*256+B-10000)/100

Roy13
Posts: 13
Joined: Sat Sep 23, 2017 3:09 pm

Re: Identifying CanBus parameters

Mon Sep 25, 2017 12:36 am

I knew there would be someone out there playing with this stuff.
Well conveniently my GPS tracker is located in the boot with the battery right near the Rear motor controller.
I have thrown a picture in the link above please point out the connector and if you remember the colour of the high and low CanBus wires.
I'll post a log of the data for others to see in the same folder. Also i'll make note of when it's active so i can read it anytime or only if ignition on?

You must have spent many hours reading over the numbers looking for patterns....?

I'll have access to a written off PHEV soon so radio out and connect to stereo CanBus to see if i can get GPS directly from the car.
I don't hold much hope on this though too many number in a coordinate.

So what have you made up that's connected to these CanBus's?

anko
Posts: 3405
Joined: Mon Dec 01, 2014 11:30 am
Location: Netherlands, Utrecht area

Re: Identifying CanBus parameters

Mon Sep 25, 2017 1:06 am

Go here: http://mmc-manuals.ru/manuals/outlander ... dex_M1.htm

Select Workshop manual and the correct model year, in the top left corner.

Section 80 -CONFIGURATION DIAGRAMS => OVERALL CONFIGURATION DIAGRAM<PHEV> => OVERALL CONFIGURATION DIAGRAM <LOW VOLTAGE (LHD)> provides an overview of the CANBUS harness.

Section 80 -CONFIGURATION DIAGRAMS => FLOOR<PHEV> => FLOOR<LHD> details out the boot area.

Section 90 -CIRCUIT DIAGRAMS<PHEV> => CONTROLLER AREA NETWORK (CAN) => CONTROLLER AREA NETWORK (CAN)<LHD> provides details on various connectors and wire colours.

From the top of my head, you should be looking at Connector D211 in the third schema. It has also +12v and ground in case you need it. You should be able to find details about that in same source.

anko
Posts: 3405
Joined: Mon Dec 01, 2014 11:30 am
Location: Netherlands, Utrecht area

Re: Identifying CanBus parameters

Mon Sep 25, 2017 1:16 am

Roy13 wrote:So what have you made up that's connected to these CanBus's?
I have three OBD Link WiFi adapters hooked up (yes, I am broke). One in ST MA mode to monitor front (primary) CANBUS, one in ST MA mode to monitor secondary (rear) CANBUS and one that I use for request/response communication. The latter is basically needed to get whatever I was not able to identify in the existing traffic. All three adapters are controlled from a single Java app on my phone (phone sets up Access Point, adapters run in Infrastructure Mode, so the app can talk to all three adapters simultaneously).

The app captures existing traffic (via first two adapters) and retrieves additional info via third adapter. All this info is buffered in the app. The app itself can be talked to via local port 35000 using the ELM327 protocol. This allows me to use Torque Pro (or any other standard OBD monitoring tool) to extract data from the app and display it on screen.

You will not believe how fast Torque Pro can be when it does not have to wait for request/response delays :mrgreen:

anko
Posts: 3405
Joined: Mon Dec 01, 2014 11:30 am
Location: Netherlands, Utrecht area

Re: Identifying CanBus parameters

Mon Sep 25, 2017 1:17 am

Roy13 wrote:You must have spent many hours reading over the numbers looking for patterns....?
Uhhh .... a few, yes :lol:

I did three phases:

first phase: prepare to extract as much information as possible via normal request / response
second phase: prepare to capture as much raw data as possible using ST MA command
third phase: combine first two phases and map out data from two sources in graphs and look for similarities

Roy13
Posts: 13
Joined: Sat Sep 23, 2017 3:09 pm

Re: Identifying CanBus parameters

Tue Sep 26, 2017 4:55 am

So much useful information thankyou, I'm taking the family to the snow then ripping into the car as soon as I return.
I'm currently monitoring using Bluetooth obd front & rear torque, display and controller SOC (real) & cell 01 voltage so now I know why mine is painfully slow!
I would be keen to set up an old phone on the dash with exactly your setup but permanent!
If I put a display on my GPS tracker I have to run wires all the way up front and those cheap 16 X 2 displays aren't very flash looking.

anko
Posts: 3405
Joined: Mon Dec 01, 2014 11:30 am
Location: Netherlands, Utrecht area

Re: Identifying CanBus parameters

Tue Sep 26, 2017 5:19 am

Roy13 wrote:I'm currently monitoring using Bluetooth obd front & rear torque, display and controller SOC (real) & cell 01 voltage so now I know why mine is painfully slow!
You mean, using request / response requests, rather than monitoring with STM or ATM commands? Then, switching to ATM or STM + buffering will make a huge difference. With me, Torque Pro refreshes several times per second, basically regardless of how many PIDs I display. Really funny.

(Of course, the buffered data that you obtain via request / response requests will be updated as often, but will most of the time be a little bit outdated)

Enjoy the snow. and the family.

Roy13
Posts: 13
Joined: Sat Sep 23, 2017 3:09 pm

Re: Identifying CanBus parameters

Mon Oct 09, 2017 2:52 am

Ok i connected to the rear canbus via plug 210 which appears to be the canbus link for 2 buses. Logged some data and included in the folder above.
Now to write some code on a Hologram dash that talks to a arduino nano via level translation that talks to a mcp2515 on the can bus. Some masks and filters to only get the can data i want and some maths on the hex data thanks to anko. Should be be in say a year....
Then I'm going to research these STM, ATM commands you speak of and set that up on an old android phone.

Return to “Technical Discussions”