User avatar
Dala
Forum Supporter
Posts: 235
Joined: Sun Oct 28, 2018 11:24 am
Delivery Date: 01 Jan 2015
Leaf Number: 316851
Location: Finland
Contact: Website

Re: LEAF CANbus decoding. (Open discussion)

Thu Jul 09, 2020 8:59 am

For anyone planning on adding a MITM CAN-device to their Leaf, and wonder where to mount it, here is a brief video on the subject
https://youtu.be/eLcNSo2Vn6U

prensel
Posts: 2
Joined: Wed Jul 01, 2020 3:07 pm
Delivery Date: 01 Jul 2020

Re: LEAF CANbus decoding. (Open discussion)

Thu Jul 09, 2020 12:51 pm

mux wrote:
Sun Jul 05, 2020 10:33 pm
DTCs are not communicated via 'normal' CAN messages, they are generated on OBDII PIDs (https://en.wikipedia.org/wiki/OBD-II_PIDs). You cannot read a DTC via the general EV-CAN datastream, just like you can't read any other service parameters on plain CAN data.
The OBD2 PID's seem to be transmited in the 0x79b/0x7bb messges in group 2, the same as the cell voltages group but with a different identifier.

gorgo
Posts: 3
Joined: Tue Jul 07, 2020 6:11 am
Delivery Date: 07 Jul 2020

Re: LEAF CANbus decoding. (Open discussion)

Sun Jul 12, 2020 9:10 am

Hi all,
I'm a computer science student who's struggling to understand how to retrieve battery info from my Nissan Leaf 2018 ZE1.
My goal is to embed GSM computer board with OBD2 interface to some Leaf we have at the university, collecting battery info as capacity/SOH/SOC/Voltage. Unfortunately, asking all drivers to always connect to LeafSpy is not possible :)

Actually, from wikipedia and other articles, I thought every new car model would have been ISO 15765-4 compliant, replying on OBD2 pins DTCs code and errors etc, but my Nissan doesn't. I tried to send 7DF queries without any replies.
The Linux board we're using has an active can0 500kbps interface on pins 6 and 14 but candump doesn't show any 'passive' messages.
From the threads I read here, I guess pins 6/14 communicates with the CARcan since I can get 7BB or 79A messages asking for 797 or 797.

Below some results (car ON, Parked)

> Often I read that odometer was easy to get asking:
Query: 743#022119FFFFFFFFFF Reply: 763#056119005D6AFFFF
but I get error in my case:
can0 743 [8] 02 21 19 FF FF FF FF FF
can0 763 [8] 03 7F 21 11 FF FF FF FF
I noted that neither LeafSpy is getting it at the moment, so they probably removed it :|

> I got the VIN correctly!
VIN
can0 797 [8] 02 21 81 FF FF FF FF FF
can0 79A [8] 10 15 61 81 53 4A 4E 46
can0 797 [8] 30 01 00 FF FF FF FF FF
can0 79A [8] 21 41 41 5A 45 31 55 30
can0 797 [8] 30 01 00 FF FF FF FF FF
can0 79A [8] 22 30 35 33 39 32 37 00
echo "53 4A 4E 46 41 41 5A 45 31 55 30 30 35 33 39 32 37" | xxd -r -p
SJNFAAZE1U0053927

> Tire pressure is always 0 asking to 0x745: 0x02 0x21 0x10 0xff 0xff 0xff 0xff 0xff

> Cabin and ambient temperature is different from the famous spreadsheet https://docs.google.com/spreadsheets/d/ ... UFm0P7ouwg:
can0 797 [8] 03 22 11 5D FF FF FF FF
can0 79A [8] 04 62 11 5D 82 00 00 00

I guess 82 (before was 81) is HEX81 = DEC130 - 41 = 89F = 31,66°C (right?)
Cabin temperature is zero though.

> QC counter and L1/L2 counter seem to work:

can0 797 [8] 03 22 12 03 FF FF FF FF
can0 79A [8] 05 62 12 03 00 01 00 00

can0 797 [8] 03 22 12 05 FF FF FF FF
can0 79A [8] 05 62 12 05 00 73 00 00

> I tried to get some battery info querying 79b:

can0 79B [8] 02 21 01 FF FF FF FF FF
can0 7BB [8] 10 35 61 01 FF FF FC 18
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 21 02 AF FF FF FB 62 FF
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 22 FF F0 DD 0B 1C 30 D4
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 23 95 1D 33 06 03 95 00
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 24 01 70 00 26 9A 00 0C
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 25 44 B5 00 11 0B B8 80
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 26 00 01 FF FF FB 62 FF
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 27 FF FC AA 01 AD FF FF
can0 79B [8] 30 01 00 FF FF FF FF FF

So, according to the excel:

PackHealth (% * 100) is 0x7000 = DEC28672 = 286.72%
SOC high precision SOC (% * 10000) is 0x9a000c = DEC10092556 = 1009.2556 %
Pack Capacity (Ah * 10000) is 0xb50011 = DEC11862033 = 1186.2033 Ah

The numbers are nosense to me 🤔

> Cell pair voltages:
79B group 3:
can0 79B [8] 02 21 03 FF FF FF FF FF
can0 7BB [8] 10 1C 61 03 FF FF 02 AE
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 21 01 AB 00 0C A1 FF 0F
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 22 84 0F 75 00 00 F3 00
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 23 00 00 00 00 00 00 00
can0 79B [8] 30 01 00 FF FF FF FF FF
can0 7BB [8] 24 0B FF FF FF FF FF FF
cell pair min/max voltage (mV)
Vmax: 0x0f84 = 3972 mV = 3,972 V
Vmin: 0x0f75 = 3957 mV = 3,957 V

Even if numbers seem ok, I guess they're too low than real values...

I read here (https://github.com/baradhili/leaf_can_b ... s/issues/2) that EVcan should be accesible from pid 12,13 even if @Dala told me they probably removed EVcan from my model.

Does somebody know how to get aforementioned values on my Leaf model?
Is it normal I don't see any passive message on CARcan (some are described on 'carCAN' tab in the spreadsheet)?
I found a DBC file here for Leaf 2018 (https://github.com/commaai/opendbc/blob ... f_2018.dbc) but I guess it works with passive mode only.
Some expert could clear my doubts?

coleafrado
Posts: 291
Joined: Fri Oct 11, 2019 11:58 pm

Re: LEAF CANbus decoding. (Open discussion)

Mon Jul 13, 2020 11:08 am

What I recall is that the ZE1 models require a lot more querying to get data. They don't just passively broadcast as the ZE0 did.

gorgo
Posts: 3
Joined: Tue Jul 07, 2020 6:11 am
Delivery Date: 07 Jul 2020

Re: LEAF CANbus decoding. (Open discussion)

Tue Jul 14, 2020 7:23 am

coleafrado wrote:
Mon Jul 13, 2020 11:08 am
What I recall is that the ZE1 models require a lot more querying to get data. They don't just passively broadcast as the ZE0 did.
Hi @coleafrado,
yes is like I showed in my post. I tried to sniff pin 12/13 but I couldn't see any messages. Only on CARcan (6/14) apparently even if I guess even formulas are changed for ZE1 case.
Any chance somebody share them? :mrgreen:

Return to “LEAF CANBus”