User avatar
Dala
Forum Supporter
Posts: 261
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

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:

lucasfr
Posts: 2
Joined: Mon Jul 27, 2020 1:07 pm
Delivery Date: 27 Jul 2020
Leaf Number: 2

Re: LEAF CANbus decoding. (Open discussion)

Tue Nov 10, 2020 7:13 am

Hello people.

I'm trying to sniffer my Nissan Leaf 2020 data with an OBD2. I send the ATs commands. However I am having problems receiving the data.

Has anyone in the group already managed to get data on the Nissan Leaf 2020?

I'm using Raspberry Pi 4 + 2515 + OBD + Arduino and nothing worked.

Any idea? Thank you


Link: https://www.amazon.com.br/Festnight-KON ... 54&sr=8-26

nickname3
Posts: 4
Joined: Thu Oct 29, 2020 12:03 pm
Delivery Date: 29 Feb 2020
Leaf Number: 053834

Re: LEAF CANbus decoding. (Open discussion)

Thu Nov 12, 2020 8:39 am

Dala wrote:
Tue Jun 30, 2020 11:45 pm
goldbrick wrote:
Sat Jun 27, 2020 9:00 pm
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 did obd2 device on MCP2515 and arduino nano for this. It realy works) If anyone need, I can share my sketch and connection diagram.
Dala , do you know commands for getting TV-AUX screen?

User avatar
Dala
Forum Supporter
Posts: 261
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)

Fri Nov 13, 2020 1:19 am

nickname3 wrote:
Thu Nov 12, 2020 8:39 am
I did obd2 device on MCP2515 and arduino nano for this. It realy works) If anyone need, I can share my sketch and connection diagram.
Dala , do you know commands for getting TV-AUX screen?
Nice, congratulations! No sorry I don't!

ginetto
Posts: 8
Joined: Mon Sep 16, 2019 11:32 pm
Delivery Date: 17 Sep 2019

Re: LEAF CANbus decoding. (Open discussion)

Fri Nov 13, 2020 1:25 am

[/quote]
I did obd2 device on MCP2515 and arduino nano for this. It realy works) If anyone need, I can share my sketch and connection diagram.
[/quote]

Always is a good contribution give back to the community if somethig has been derived from the community => yes please :)

nickname3
Posts: 4
Joined: Thu Oct 29, 2020 12:03 pm
Delivery Date: 29 Feb 2020
Leaf Number: 053834

Re: LEAF CANbus decoding. (Open discussion)

Fri Nov 13, 2020 5:00 am

Dala wrote:
nickname3 wrote:
Thu Nov 12, 2020 8:39 am
<span>I did <a href="http://www.amazon.com/gp/product/B005NL ... ecarfor-20&" interlinkr"="" target="_blank">OBD2</a> device on MCP2515 and arduino nano for this. It realy works) If anyone need, I can share my sketch and connection diagram.</span>
Dala , do you know commands for getting TV-AUX screen?
Nice, congratulations! No sorry I don't!
I sniff commands for pressing TV-AUX button. There is:
0x681 0x04 10 40 0D AB FF FF FF
0x681 0x04 20 40 0D AB FF FF FF
0x681 0x04 30 40 0D AB FF FF FF

Return to “LEAF CANBus”