LEAF CANbus decoding. (Open discussion)

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Just been looking at the Decoded notes for messages,
ref https://github.com/dalathegreat/leaf_can_bus_messages
lot nicer that that the old google doc file, easy to work out visual how to check things with code.

But on the 1DB message from the HV battery is a note about Byte[3] Bit [0] saying
0->1:Cell Voltage Latch
1->0:Cell Voltage Latch
Can someone explain little more what it actual means ?

I have been testing message 1DB Byte[3] Bit [3] does let know about Interlock connection
0 = Not Inter Lock connected
1 = Inter Lock connected

Now that will show '0' no interlock connected,
if either the HV main lead or the heater lead is not connected with a Gen2 battery

But what I noticed was that data shows this
Byte[3] is Dec 170, 1010 1010 (Both in)
Byte[3] is Dec 162, 1010 0010 (HV in only)
Byte[3] is Dec 163, 1010 0011 (Heater in only)(Or both disconnected)

So as you can see Byte[3] Bit [3] is about if either interlock not in

But Byte[3] Bit [0] seem to be 1 if the HV interlock in not in also
Which why wonder about what this 'Cell Voltage Latch' actual means
 
We don't actually know - this is straight from a nissan confidential datasheet and seems to be some kind of translation error as well as a nonfunctional bit in the Leaf LBC.

A similar bit exists for other AESC BMSes (Zoe, Kangoo, Fluence) and any transition signifies new cell voltage data is available. However, on those cars the live CAN data actually includes max/min cell voltage values, while in the Leaf you can only get cell voltage data in engineering data (which Nissan forbids to use except if the car is in a debugging session using their tools), so it's probably not functional outside of debug mode.
 
HI Dala

I have read through this thread, but can't seem to find the equivalent minimal message(s) to get the cell voltages on a ZE0 pack like the 79B below. Do you have this handy too? Using the two 79B messages as shown below using savvyCAN is not doing it.

tia,
charles

Dala said:
nickonck said:
Hi,

Thank you very much for this thread, Im learning a lot about my new leaf.

I've bought a 2020 model (ZE1), and Im triying to make an application to connect a OBD plug with my phone and read some battery data. I know that the OBD is locked, and I need to query. I've tried to query with 79B messages that I found in https://docs.google.com/spreadsheets/d/1EHa4R85BttuY4JZ-EnssH4YZddpsDVu6rUFm0P7ouwg/edit#gid=7 . With these querys I receive data, but I cant decode most of them, like the SOC, that I think it should be trivial. Somebody knows how can I get these parameter?

Hi, yes here is how:

Query to LBC:
0x79B 02 21 01 00 00 00 00 00
0x79B 30 00 00 00 00 00 00 00
Answer from LBC:
0x7BB 10 35 61 01 FF FF FC 18
0x7BB 21 02 AF FF FF FB 62 FF
0x7BB 22 FF F0 DD 0B 1C 30 D4
0x7BB 23 95 1D 33 06 03 95 00
0x7BB 24 01 70 00 26 9A 00 0C
0x7BB 25 44 B5 00 11 0B B8 80
0x7BB 26 00 01 FF FF FB 62 FF
0x7BB 27 FF FC AA 01 AD FF FF

Name: SOC (%)
Type: Integer
Description: State of Charge (SOC) of the HV Battery
Formula:
0x7BB 24 01 70 00 26 9A 00 0C
0x7BB 25 44 B5 00 11 0B B8 80
SOC = (data 24[7] << 16 | ((data 25[1] << 8) | data 25[2]))/10000
 
cgalpin said:
HI Dala

I have read through this thread, but can't seem to find the equivalent minimal message(s) to get the cell voltages on a ZE0 pack like the 79B below. Do you have this handy too? Using the two 79B messages as shown below using savvyCAN is not doing it.

tia,
charles


Hi cgalpin, in order to get cell voltage, the requests are:

0x79B 02 21 02 00 00 00 00 00
and
0x79B 30 00 00 00 00 00 00 00 to get all the messages.

The answers are:
0x7BB 10 C6 61 02 10 6F 10 6E
0x7BB 21 10 6D 10 6F 10 6E 10
0x7BB 22 6F 10 70 10 6E 10 6F
....

with all the voltages in two bytes:

CV array[0] = (( data 10[4] << 8 ) | data 10[5] ) //10 6F
CV array[1] = (( data 10[6] << 8 ) | data 10[7] ) //10 6E
CV array[2] = (( data 21[1] << 8 ) | data 21[2] ) //10 6D
CV array[3] = (( data 21[3] << 8 ) | data 21[4] ) //10 6F
CV array[4] = (( data 21[5] << 8 ) | data 21[6] )
CV array[5] = (( data 21[7] << 8 ) | data 22[1] )
 
Thanks a lot, this works great! I notice the 3rd byte is 02 and not 01, but I think it must have been a error on my part before (although I did not try with 01 again today - just glad it's working :) )
 
Hi All,

I would like to ask, if someone already figured out the status parameter / HEX code for the D ECO and B ECO modes in case of Acenta/TEKNA (SV/SL) model variants?

nissan-leaf-automata-24kwh-zero-emission-179757_257817_7xl.jpg


Thanks!
 
Hi bkvszomorito,
I suggest to get D/B with Gear query:
Code:
0x797 03 22 11 56 00 00 00 00
and you will get
Code:
0x79A 04 62 11 56 01 00 00 00
where 5th byte is the gear value. (1=Park, 2=Reverse, 3=Neutral, 4=Drive).

Could you check what's byte value for B mode? 7?

To get ECO ON/OFF you can ask
Code:
0x797 03 22 13 18 00 00 00 00
with
Code:
0x79A 05 62 13 1B 10 39 00 00
as response.
5th byte is 10 or 11 if ECO is ON.
 
Hi,
I have a Leaf ZE0 and have built an Arduino CAN (MPC2515) to read from the primary CAN bus (Github https://github.com/sfewings/emon_Suite/blob/master/emon_Leaf/emon_Leaf.ino) and publish on an internal house monitoring system; odometer (0x5C5), battery SOH, temperature, GIDs, dashboard charge bars (0x5B3) and range km (0x5A9). This is working well but I only receive these for a minute or so after the car ignition is turned off.
I want to recieve these details while the car is charging so I can display it indoors and track how charged the car is and its updated range.
The question is,

All the resources on this forum and other contributions are fantastic. There is no way I could have already got this far in integrating my Leaf with the house monitoring.
 
sfewings said:
Hi,
I have a Leaf ZE0 and have built an Arduino CAN (MPC2515) to read from the primary CAN bus (Github https://github.com/sfewings/emon_Suite/blob/master/emon_Leaf/emon_Leaf.ino) and publish on an internal house monitoring system; odometer (0x5C5), battery SOH, temperature, GIDs, dashboard charge bars (0x5B3) and range km (0x5A9). This is working well but I only receive these for a minute or so after the car ignition is turned off.
I want to recieve these details while the car is charging so I can display it indoors and track how charged the car is and its updated range.
The question is,

All the resources on this forum and other contributions are fantastic. There is no way I could have already got this far in integrating my Leaf with the house monitoring.

Cool project(Very similar to OVMS ), I would recommend adding a second MCP2515 to EV-CAN, since this bus will be on all the time while the vehicle is charging.
 
In EVs Enhanced's latest video, they showcased the new replacement batteries for the LEAF. One thing that caught my attention was that they are using the community Nissan LEAF .DBC files for reverse engineering! Take a look at this:
BOuLSPs.png


Now if only they would contribute back some knowledge :D
 
Dala said:
Cool project(Very similar to OVMS ), I would recommend adding a second MCP2515 to EV-CAN, since this bus will be on all the time while the vehicle is charging.

Thanks Dala,
That is exactly what I did. I now have two Arduinos (use the same .ino) each with a MCP2515. The Arduinos interconnect by serial and just one of them send the aggregated data to the home monitoring system. Working a treat.

I notice that the RangeInstrumentCluster of message 0x5A9 is updated if charging starts within a minute of turning the ignition off. Otherwise, this is set to 0xFFF as the .dbc reference states.

Thanks for the link to OVMS. And thanks for all your contributions to the reverse engineering of the Nissan Leaf.
 
Dala said:
goldbrick said:
Thanks for sharing that. I have to say, as a firmware professional that I'm very impressed with the tools available today for this sort of thing. I started with BASIC in the 1960's when I was just a kid and my uncle let me play on the local college's PDP-8. My times have changed! :D

You should see the paid tools then! They are even better, but my budget don't allow for these yet..

Along with some friends, we completed a quick sideproject. We did a nag-screen delete, with a permanent box mounted behind the OBD2 port. This box sends CAN messages onto the AV-CAN on every startup, so you don't have to see the nag-screen. Here it is in action:
https://www.youtube.com/watch?v=Rptz6ULKjXU

If anyone wants to replicate this at home, send these commands with 100ms inbetween
To get it to Status:

0x681 0x04 30 40 0d b1 ff ff ff

0x681 0x04 40 40 0d b1 ff ff ff

0x681 0x04 50 40 0d 31 ff ff ff

To get it to FM:

0x681 0x04 20 40 0d a3 ff ff ff

0x681 0x04 30 40 0d a3 ff ff ff

0x681 0x04 40 40 0d 23 ff ff ff

Maybe it would be worthwile to create a plug'n'play solution for the OBD2 port? Something you just set and forget there?
I wrote a plugin for OVMS. More details here :
https://github.com/Vasioky/ovms-nowo-plugin
 
mafify said:
I am trying to get reading for the battery alone, not connected to vehicle and as stated in the discussion thread, SOC doesn't update by itself. I need to turn the +IGN and +12 off and on to recalculate the SOC. I was just wondering if anyone figured out what is the heartbeat msg that the back take to keep alive and keep updating SOC

@mafify did you find a solution for this
Im having same issue that after about 5min or less the BMS stops sending the SOC
You still get voltage etc

@Dala or any other what cmds do we need send the BMS so can keep it returning the SOC
 
TrueSoln said:
mafify said:
I am trying to get reading for the battery alone, not connected to vehicle and as stated in the discussion thread, SOC doesn't update by itself. I need to turn the +IGN and +12 off and on to recalculate the SOC. I was just wondering if anyone figured out what is the heartbeat msg that the back take to keep alive and keep updating SOC

@mafify did you find a solution for this
Im having same issue that after about 5min or less the BMS stops sending the SOC
You still get voltage etc

@Dala or any other what cmds do we need send the BMS so can keep it returning the SOC

To get SOC% to keep updating, you need to feed the following messages to the BMS;
50B
1F2
1D4

VCM_WakeUpSleepCommand needs to be 11b in 50B so it doesn't go to sleep.
 
Dala said:
To get SOC% to keep updating, you need to feed the following messages to the BMS;
50B, 1F2 , 1D4

VCM_WakeUpSleepCommand needs to be 11b in 50B so it doesn't go to sleep.

Working on that now
Will update the other thread on topic though, link for anyone else needing SOC updates

https://www.mynissanleaf.com/viewtopic.php?t=32578
 
Does the Gen2+ (2013 or newer) have means to tell the PDM/Charger up to what voltage it will charge the 12v Battery ?
Are any of the CAN buss messages relating to that.

In Gen1 (2011/2012) was a wire that could alter the PWM signal to get effect of what it produced.
Any wondering if any wiring hack or CAN message to chance things.
 
When have been looking at LeafSpy on BSM only mode,
its displaying the voltage of the Aux battery (12v car battery)
(Screen below show it as 11.82v )

Is that being decoded from a message sent out from Nissan Leaf Battery (BMS)?

Have look at message from HBAT and cant see it mentioned
https://github.com/dalathegreat/leaf_can_bus_messages

Leaf Spy is great tool for any one that is checking up on car battery states,
Very simple to make up a tool use for battery checking out of the car
uc

uc
 
Back
Top