Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

40kWh 2018+ Nissan LEAF support? #323

Open
glynhudson opened this issue Jan 16, 2020 · 95 comments
Open

40kWh 2018+ Nissan LEAF support? #323

glynhudson opened this issue Jan 16, 2020 · 95 comments

Comments

@glynhudson
Copy link
Contributor

I was under the impresssion that the 2018 40kWh Leaf is currently not suported by OVMS since the OBD port in the 2018 LEAF is now behind a gateway, so it no longer hears any passive CAN traffic requires active polling to obtain metrics, see: http://lists.openvehicles.com/pipermail/ovmsdev/2019-September/006340.html

e.g here is a test modification to enable active polling to test obtaining data from the 40kWh LEAF: caederus-ovms@66906c0).

I tested OVMS myself with a 40kWh leaf in October 2019 running edge build and confirmed support was not available. Since then I've not seen any commits to suggest that support for active polling has been added.

However, issues and PR's by @dalathegreat suggest the 40kWh Nissan LEAF is working with ovms .eg #312 , openvehicles/Open-Vehicle-Android#97

What is the current status of the 40kWh leaf? It would be really great if support has been added. If so, what metrics are currently supported?

@dalathegreat
Copy link
Contributor

I only confirmed that the 40kWh battery was working, the rest of the car I test on is a 2015 "24kWh" model.

The active polling branch looks good, we should continue with this. I don't have access to any ZE1 40/62kWh Leaf, so I cannot help much.

@glynhudson
Copy link
Contributor Author

Interesting, so you connect OVMS directly to a 40kwh battery?

Since the 40kWh LEAF is still not supported via the ODB2 port. I reckon we should hide the images from the Android app, it's caused some confusion since some users now think the 40kWh leaf is supported since the images of the car are shown in the app.

I have accesss to a 40kWh leaf so can help with testing if required. With the help of Robin O'Leary I ran the active polling branch linked above I managed to capture canbus data in a 40kWh leaf. The firmware and pre-compiled active-polling FW is attached below.

driving.crtd
- 76% Soc - 63%

rapid-charge.crtd
- 63% soC - 75%
- 41kW start

driving2.crtd
- 75% - 75% Soc
- 1.5 miles

7kw-ac-chargin.crtd
- 75% -76% soc
- car on
- heating on

CAN-log.crtd.zip

ovms3-activepolling-firmware.zip

@dalathegreat
Copy link
Contributor

Great progress!

Yes, OVMS reads the 40kWh data directly, but my testing data is not so good for the masses, since I first pass the CAN data thru a Muxsan CAN-bridge, so that the car will accept the battery. So think of it like a truncated version. I drop 0x633 0x1C2 0x5EB completely, these messages never leave the battery. I also re-format many messages so they fit the older gen Leaf.

I don't think we need to hide the images in the Android app. Anyone installing an OVMSv3 system should read the support page, and find out which features are currently applicable to their vehicle. By having the images ready we are also getting techies interested in improving OVMS for the ZE1 40/62kWh Leaf.

@sharph
Copy link

sharph commented Sep 4, 2020

I own a 62kWh 2019 Leaf, and just bought OVMS HW knowing full well that getting it to work may very well be an adventure. Though -- I was surprised to see no CAN traffic when I enabled logging on the monitor, which I guess the "gateway" on the OBD port explains.

I'm going to give the posted firmware a try tonight. I'm happy to test and do what I can to further development.

@dalathegreat
Copy link
Contributor

Thank you for taking the step @sharph ! There are two ways to get OVMS working on the 2018+ Leaf.

  1. Is to extend the EV-CAN wiring to reach the OBD2 port. This can be done with two wires, ran from the LH-side footwell, up to the OBD2 port. This will make the OBD2 port work like on the old LEAF. Oh, and a section of CAR-CAN is also needed to really get everything. After this starting of remote heating should also work.
  2. We need to step up as OVMS devs, and implement all the data monitoring via polling the canbus available on the OBD2 port.

@BojanG72
Copy link

BojanG72 commented Oct 1, 2020

Hi I have a 2019 Nissan Leaf ZE1 and I am trying to read the SoC using the polling method.
I have been able to get a successful response from the car, but I am not exactly sure which bytes are supposed to represent the state of charge.

According to everything I have read online it supposed to be bytes 5-7 on the fifth line of the response. But the numbers I am reading does not match what is shown on the vehicle dash.

So my question is, am I reading the correct bytes? and if not do you know if it changed in the 2019 Nissan Leaf?

Here are the CAN msgs I am reading from my car

(1601485858.880592) can0 79B#0221010000000000
(1601485858.885052) can0 7BB#10356101FFFFFC18
(1601485859.063325) can0 79B#3000000000000000
(1601485859.065120) can0 7BB#210288FFFFFB79FF
(1601485859.079208) can0 7BB#22FFF0601B584650
(1601485859.085033) can0 7BB#23904E3287038600
(1601485859.098547) can0 7BB#24017000270F000A
(1601485859.105193) can0 7BB#257FA70019F07E80
(1601485859.120629) can0 7BB#260001FFFFFB79FF
(1601485859.125149) can0 7BB#27FFFC9201AEFFFF

The dash on the car shows state of charge is at 65%.

Thanks

@dalathegreat
Copy link
Contributor

@BojanG72 I would so want a ZE1 to experiment with! Maybe it is in this location?

(1601485859.065120) can0 7BB#210288FFFFFB79FF = 64,8%
or
(1601485859.085033) can0 7BB#23904E3287038600 = 64,7%

SOC is usually 10bits long, so can be hard to spot from raw hex. Maybe post another point at some other SOC?

@BojanG72
Copy link

BojanG72 commented Oct 1, 2020

I'll try and collect some more data over the next few days.

Possibly, right now I'm leaning towards this one
(1601485859.098547) can0 7BB#24017000270F000A = 655,294,474

@caederus-ovms
Copy link
Contributor

caederus-ovms commented Oct 1, 2020 via email

@BojanG72
Copy link

BojanG72 commented Oct 2, 2020

Thanks everyone, I found the SOC and range using 743 commands instead of 79B.

I ran 2 tests just to be sure, during the first test the range was 221km and the SoC was 58%. During the second test range was 218km and the SoC was 57%.

Range = 221
SOC = 58%

(1601653726.937543) can0 743#03220E2E00000000
(1601653726.953204) can0 763#05620E2E00DDFFFF ------> Range

(1601653731.489510) can0 743#03220E2D00000000
(1601653731.503573) can0 763#1016620E2D052412
(1601653731.505970) can0 743#3000000000000000
(1601653731.513103) can0 763#210A646400000000
(1601653731.533383) can0 763#22000000003A0000 ----> SOC
(1601653731.553206) can0 763#230000FFFFFFFFFF

Range = 218
SOC = 57%

(1601655704.066370) can0 743#03220E2E00000000
(1601655704.079444) can0 763#05620E2E00DAFFFF -----> Range

(1601655720.519401) can0 743#03220E2D00000000
(1601655720.540148) can0 763#1016620E2D052412
(1601655720.543408) can0 743#3000000000000000
(1601655720.547998) can0 763#210A646400000000
(1601655720.568381) can0 763#2200000000390000 -----> SOC
(1601655720.588017) can0 763#230000FFFFFFFFFF

Additionally I collected data using the 79B command, but I didn't see and obvious candidates for SoC. I'll post the previous data
and the new data if anyone wants to take a crack at it.

--New Data--
Range = 221 km
SOC = 58%

(1601654256.913278) can0 79B#0221010000000000
(1601654256.923555) can0 7BB#10356101FFFFFE8A
(1601654257.703975) can0 79B#3000000000000000
(1601654257.705940) can0 7BB#210288FFFFFD52FF
(1601654257.713860) can0 7BB#22FFF7371B584650
(1601654257.725930) can0 7BB#238D4A3299038600
(1601654257.738364) can0 7BB#2401700026F70009
(1601654257.746220) can0 7BB#25870B0019F07E80
(1601654257.753787) can0 7BB#260005FFFFFD52FF
(1601654257.766060) can0 7BB#27FFFE6601AEFFFF

---Previous Data----
SoC = 65%

(1601485858.880592) can0 79B#0221010000000000
(1601485858.885052) can0 7BB#10356101FFFFFC18
(1601485859.063325) can0 79B#3000000000000000
(1601485859.065120) can0 7BB#210288FFFFFB79FF
(1601485859.079208) can0 7BB#22FFF0601B584650
(1601485859.085033) can0 7BB#23904E3287038600
(1601485859.098547) can0 7BB#24017000270F000A
(1601485859.105193) can0 7BB#257FA70019F07E80
(1601485859.120629) can0 7BB#260001FFFFFB79FF
(1601485859.125149) can0 7BB#27FFFC9201AEFFFF

@caederus-ovms
Copy link
Contributor

caederus-ovms commented Oct 3, 2020 via email

@gorghino
Copy link

gorghino commented Oct 13, 2020

Hi @caederus-ovms , do you know LEAF40HVBATT_R01 variables' meaning as well?
Maybe @dalathegreat , you know where @caederus-ovms got those?

@gorghino
Copy link

Hi all,
I uploaded a PDF with all the active queries I've found so far for 2018+ Leaf here on mynissanleaf with some open challenges I'm facing. I hope this may help you.

@glynhudson
Copy link
Contributor Author

Has anyone had any success with OVMS 2018+ 40kWh/62KWh LEAF support?

@aidehuazi
Copy link

I have a 2020 ZE1 and I’ve started having a go at getting ZE1 active poling working and can see active poling has been introduced to the main branch a while back so is in the latest versions of the code. I will try work out how to switch it on as logs don’t show any of the active poling codes.
Using the posted activepolling firmware above, I can see the transmitted 79B but don’t see any received messages, no 7BB or any other Recieved for that matter. I tried logging leaf spy and it sends 79B and gets 7BB responses on can2, so I don’t think it’s a problem with the can bus or my OVMS connection. Is there a parameter I’m missing? Any hints to get me started would be greatly appreciated.
Here’s my log using the above posted firmware.

1638401544.945804 1CXX Info Type:vfs Format:crtd(discard) Filter:off Vehicle:NL Path:/sd/can.crtd
1638401544.946772 CXX OVMS CRTD
1638401563.384139 2T11 79B 02 21 02 00 00 00 00 00
1638401565.379302 2T11 745 02 21 09 00 00 00 00 00
1638401579.379566 2T11 79B 02 21 01 00 00 00 00 00
1638401581.379515 2T11 743 02 21 01 00 00 00 00 00
1638401589.379549 2T11 79B 02 21 04 00 00 00 00 00
1638401603.379637 2T11 744 02 21 10 00 00 00 00 00
1638401607.379629 2T11 758 02 21 10 00 00 00 00 00
1638401622.379436 2T11 743 02 21 01 00 00 00 00 00
1638401638.379506 2T11 79B 02 21 02 00 00 00 00 00
1638401644.379483 2T11 745 02 21 09 00 00 00 00 00
1638401648.379551 2T11 79B 02 21 01 00 00 00 00 00

@gorghino
Copy link

Anybody knows where

743 02 21 01 00 00 00 00 00
758 02 21 10 00 00 00 00 00

come from? What are they? I can't find any references in the OVMS files.

@glynhudson
Copy link
Contributor Author

glynhudson commented Dec 13, 2021 via email

@gorghino
Copy link

Hi @glynhudson , yes I know Dala and his work! Unfortunately his files are not useful when you do active polling.
I use active polling for my OBD project but among the queries @aidehuazi posted, I don't know two of them.

758 doesn't seem to be any known ECU's ID.
I use 743 to get range and Tires pressure, but payload is different from 02 21 01.

@dalathegreat
Copy link
Contributor

For anyone wanting to continue the development, I have updated the section about Active Polling on github: https://github.com/dalathegreat/leaf_can_bus_messages#what-about-active-can-polling

Here is also a link to all the metrics that Leafspy polls for: https://drive.google.com/file/d/1jH9cgm5v23qnqVnmZN3p4TvdaokWKPjM/view

@alibahba
Copy link

There are two ways to get OVMS working on the 2018+ Leaf.

  1. Is to extend the EV-CAN wiring to reach the OBD2 port. This can be done with two wires, ran from the LH-side footwell, up to the OBD2 port. This will make the OBD2 port work like on the old LEAF. Oh, and a section of CAR-CAN is also needed to really get everything. After this starting of remote heating should also work.

@dalathegreat For me, this would be a good solution. Are there any schematics available for this mod?

@aidehuazi
Copy link

aidehuazi commented Jan 13, 2022

I’ve managed to get most of the ZE1 polling to metrics code solved, just need to resolve :
Cabin Temp, can’t find a TXID / PID
Speed, nearly there might have the wrong metric ms_v_pos_speed or timing might need to be adjusted
TPMS all 4 measures are 0 in 79A OE 25-28, so not sure if thats just my vehicle, would be good if someone with TPMS working in car or Leaf spy can check this.
Plug state is flakey at best, along with charging, the slide to charge appears randomly.
Haven’t started on things like doors as no poling codes available.
If anyone has any more detail on the above issues or codes, would be very welcome, I can implement and we can pull request an update, although someone may want to review my code due to my lack of cpp skills.
I’ll post the firmware for others to test and review?
Here’s where it’s at.
5CF64363-BB48-4153-BB9D-CBAA5F389B4A
38450C18-A502-43F1-92B2-C9E2867B131F

@mjkapkan
Copy link
Contributor

We lived a long time with no cabintemp for the previous model. So it will work perfectly without it as well. Anyway great job in getting this stuff!

@alibahba
Copy link

alibahba commented Jan 13, 2022 via email

@aidehuazi
Copy link

Ok think I have a useful version of the firmware for ZE1's , mostly due previous work done on the polling elements of the code already in the current master, so thanks to those who put in all that hard work.

I've spent a bit of time trying to sort out a way to have polling switched on when the car turns on and off when it's off, but haven't managed to nail that yet, but will continue to work on it as it's about saving the acc battery when the car is idle. I still believe polling is the only way to make this palatable for the ZE1 and as many vehicles are or will soon be going down this route of can gateways, polling is the future.
I've tested this version in the 2011 and made sure polling is off for any pre 2019 model ZE1 Leaf.

On a side note, I've noticed that the 3.3 build has something going on with excessive can messages on can1 and can2 in my 2011 at least, which is not present in the ZE1, for obvious reasons. In the 3.3 Firmware theres also vehicle.charge.pilot.off and vehicle.charge.pilot.on executing multiple times a second in the ZE0 Leaf. This can be seen on the OVMS's Web server, on the Status Page-Live Events section. This issue is also be in the branch that has the 2011-2012 Climate control fix and likely in 3.3 branches before that. So for that reason I wouldn't suggest running this firmware OR any 3.3 fw build on a ZE0 or AZE0 yet, other than to test it to see if you see the same issues as I've seen. Note you won't notice these messages or excessive can bus traffic if you don't turn on can or OVMS logging or check out the status or shell web page. It operates fine and the App behaves as per normal, no polling, all passive can analysis.

Anyhoo, anyone here who's interested, please try this firmware on a ZE1 and let me know what you think. I'll talk to the OVMS and Leaf guys and work out where to next, unless someone here can advise?
Might be worth getting some of the other features like remote climate and locking working before any of this gets pulled into he master.

Note for this to work I have the following xnl config from my ZE1 e+:
canwrite: yes
maxGids: 775
modelyear: 2020
newCarAh: 176
soc.newcar: no
soh.newcar: true < required as existing code to populate the range on the App is used.
ovms3.bin.zip

@glynhudson
Copy link
Contributor Author

Nice work guys! This is very exciting, I reckon if you have the basic metrics working e.g SoC and charging status we should get this released in beta, so users can help to test. Also, even having basic metrics is very useful. IMO door status is very low of the list of useful features!

@christian-nolte
Copy link

Hi @aidehuazi and all the others,
thanks for your great work to make the 2018+ Nissan Leaf working with OVMS.
I downloaded the firmware 3.3.001-104-gcbdc6f05-dirty form the comment above, but it didn't run with my Nissan Leaf 40kwh MY21.
I can see the 12V Battery, but not more.
Could you give me some hints or what I have to configure, sry, I'm an absolute newbie with OVMS, CAN and OBDII.

@aidehuazi
Copy link

Have you checked your setting either on the gui or in the shell?
You need the following which can be obtained from the shell under tools or via ssh :

Each entry can be set using the following format:

config set xnl soc.newcar true

And a listing can be obtained by

config list xnl

canwrite: yes
maxGids: 500
modelyear: 2021
newCarAh: 112.6
soc.newcar: no
soh.newcar: true
Or in the gui menu Nissan Leaf - Features
Screen Shot 2022-03-21 at 10 22 02 am

Via the gui is easier if you're not used to shell commands. ?Just Set and save

@aidehuazi
Copy link

I recently provided a later build for another ZE1 user with a few things cleaned up, which might help. I still haven't got round to creating a seperate branch, so have provided it here, both bin and code.
Let me know if the config or this firmware changes things, otherwise I can provide a build with a bit of debug to work out what is going on.

@christian-nolte
Copy link

Thanks for your support, I changed the maxGids from 502 to 500 and the newCarAh from 115 to 112.6, the other parameters was similar to yours.
It didn't work, so I tried your newer firmware, but it doesn't work, too.
But there are some errors in the shell.

I (9043) netmanager: WIFI client has good signal quality (-85.3 dBm); connect
I (9043) netmanager: Interface priority is st1 (192.168.1.13/255.255.255.0 gateway 192.168.1.254)
I (9043) netmanager: Set DNS#1 0.0.0.0
I (9043) netmanager: Set DNS#2 0.0.0.0
I (9043) netmanager: WIFI client up (with MODEM down): starting network with WIFI client
I (9053) time: Starting SNTP client
I (9053) ovms-server-v2: Status: Network is up, so attempt network connection
I (11043) ovms-server-v2: Connection is ovms.dexters-web.de:6870 Toni
I (11043) ovms-server-v2: Status: Connecting...
I (12043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
I (13813) webserver: HTTP POST /cfg/firmware
I (13823) webserver: HandleLogin: 'admin' logged in, sid af0f06f4db29aa9e
I (13863) webserver: HTTP GET /menu
I (13933) ovms-server-v2: Connection successful
I (13933) ovms-server-v2: Status: Logging in...
I (13933) ovms-server-v2: Sending server login: MP-C 0 ***** ***** Toni
I (13943) webserver: HTTP GET /cfg/firmware
I (14423) ovms-server-v2: Got server response: MP-S 0 ***** ******
I (14423) ovms-server-v2: Server token is ***** and digest is ******
I (14433) ovms-server-v2: Status: Server authentication ok. Now priming crypto.
I (14433) ovms-server-v2: Shared secret key is ***** (44 bytes)
I (14433) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established
I (14463) ovms-server-v2: Incoming Msg: MP-0 Z0
I (15043) ovms-server-v2: Send MP-0 S0,K,0,0.00,stopped,standard,0,0,0,0,0,0,0,21,0,0,0,0,0.00,0,0,0,0,-1,0,0,0,0,0,284,0,0.00,0.00,0,0.00,100.00,0.00,0.0
I (15043) ovms-server-v2: Send MP-0 D0,0,5,0,0,0,0,0,0,715257,0,0,1,1,14.68,0,12.7,16,0,0,0
I (15043) ovms-server-v2: Send MP-0 L0,0,0,0,0,0,0,0,0,0,0,0,0,100,,0,0,0
I (15053) ovms-server-v2: Send MP-0 Y4,FL,FR,RL,RR,0,-1,0,-1,0,-1,0,-1
I (15053) ovms-server-v2: Send MP-0 W0,0,0,0,0,0,0,0,-1
I (15053) ovms-server-v2: Send MP-0 F3.3.001-116-gf80b3878-dirty/ota_0/main (build idf v3.3.4-848-g1ff5e24b1 Jan 30 2022 11:59:39),,19,0,NL,Landhaus,-1,-1,OVMS WIFI BLE BT cores=2 rev=ESP32/3
I (18043) cellular: State: Enter PoweredOff state
I (22043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
I (32043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
I (35813) webserver: HTTP GET /status
I (42043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
I (52043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
I (55773) webserver: HTTP GET /shell
I (62043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
I (72043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
E (81913) can: can2: intr=2 rxpkt=0 txpkt=0 errflags=0x80001080 rxerr=27 txerr=0 rxinval=0 rxovr=0 txovr=0 txdelay=10 txfail=0 wdgreset=0 errreset=0
W (81913) mcp2515: can2 EFLG: RX_Err_Passv RX_Err_Warn EWARN
E (81913) can: can2: intr=3 rxpkt=0 txpkt=0 errflags=0xa00b10a0 rxerr=135 txerr=0 rxinval=0 rxovr=0 txovr=0 txdelay=10 txfail=0 wdgreset=0 errreset=0
E (81913) can: can2: intr=4 rxpkt=0 txpkt=0 errflags=0x800b1080 rxerr=135 txerr=0 rxinval=0 rxovr=0 txovr=0 txdelay=10 txfail=0 wdgreset=0 errreset=0
I (82053) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1
E (85053) can: can2: intr=31174 rxpkt=0 txpkt=0 errflags=0x800b1080 rxerr=135 txerr=0 rxinval=0 rxovr=0 txovr=0 txdelay=11 txfail=0 wdgreset=0 errreset=0
I (92043) v-nissanleaf: vehicle.charge.pilot.off: using ms_v_door_chargeport false 1

@TommySharpNZ
Copy link

No more word on getting official support for the ZE1 leaf?

@mobicek
Copy link

mobicek commented Jul 28, 2023

Hi, please could someone send me can logs from ZE1 CAR CAN in charging mode (when charger wake up the car) or waked up via nissan remote command ? Thanks.

@cods4
Copy link

cods4 commented Jul 31, 2023

Here is all my can logging data from last year. Sorry I don't have time at the moment to figure out how to set up the logging again.

https://drive.google.com/drive/folders/1KgSCeS5VRyIokIbVBJE_g6lh-6dCZZ_1?usp=sharing

@mobicek
Copy link

mobicek commented Aug 1, 2023

Here is all my can logging data from last year. Sorry I don't have time at the moment to figure out how to set up the logging again.

https://drive.google.com/drive/folders/1KgSCeS5VRyIokIbVBJE_g6lh-6dCZZ_1?usp=sharing

Thank you very much.

@1onord
Copy link

1onord commented Sep 21, 2023

Hello OVMS friends,

I would like to give you another Tip if anyone is interested. I have the OVMS Active Polling firmware running without the Hardware Modification.

The old known Problem is that you dont get a Status if the Car is off.

I will know the SOC because i load the CAR over the PV.

If you send a Request via the Connect API you will receive a current status via OVMS. I have an Automation that queries the Position for my ZE1 via the Connect API every 10 minutes when I charge the car and then you also get a current SOC via OVMS.

Maybe one or the other can work with it.

@TommySharpNZ
Copy link

Hi @1onord I would appreciate some more detail on this....
I am in New Zealand and NissanConnect is not available so there is no API we can query...
I obviously turn my car off, plug it in and then it charges by schedule overnight.... I'm guessing the OVMS will not be able to give me SOC during this time?

@1onord
Copy link

1onord commented Sep 22, 2023

Hi,

oh yes you are right, i dont know that. Nissan Connect seems not to be available in NZ.

Without the 2 Wire Mod to the OBD Port you only got a Status if the Car is on, for me it wasn't that bad either. But of course it is nicer for energy Management if you know the SOC exactly. You can currently only achieve this via Connect, or you have to use the cable Mod, then the OVMS works like the ZE0 Leaf.

@WMTaylor3
Copy link

Joining the conversation to register interest in this. Recently picked up a 2018 Japanese import 40kwh Leaf. I live in NZ and so have no Nissan Connect services.

I have some development background but mostly only in UI and ASP.NET, probably not super helpful here....

Nonetheless, happy to test anything or help out in any way. I'd also be open to performing a hardware mod but would only be brave enough with some pretty clear instructions and a list of known limitations or dangers.

Big fan of this project and it's potential! (Also a Home Assistant user, like others in this thread)

@Jerther
Copy link

Jerther commented Oct 7, 2023

Same as @WMTaylor3 here. I have a 2018 SL in Canada, and I will happily do some hardware modifications, but I would need some fool-proof step by step instructions. With pictures™

@cods4 how successful have you been with your mod? Does it make the OVMS fully compatible with the ZE1? Any limitations? If all good, would you consider building a how-to for people like me and @WMTaylor3 ?

@ehilfer
Copy link

ehilfer commented Nov 19, 2023

@1onord , to use the Connect API I'm assuming you need a recent model year Leaf (2022) that uses 4g service to connect, separately from the OVMS connection, is that right?

@ehilfer
Copy link

ehilfer commented Nov 19, 2023

@cods4 thank you for sharing the wiring info! I think I follow most of it but could you share more about how and where you connected to the ev CAN and distinguish between H and L in both ev and car CAN connections? And also specifically where you are using connectors versus tapping into an existing wire.
Can the M24 connector and cable be accessed by removing the glove compartment, or is it a more complicated dashboard disassembly?
I'm looking forward to getting this running on my 2020 Leaf!

@ehilfer
Copy link

ehilfer commented Nov 20, 2023

@cods4 since you've had your hands on the wiring, do you think there's enough room to use something like this to tap onto the CAN wires?

Brightfour Low Voltage Wire splice connectors - Pack of 12 Quick Solderless T Tap Connector 1 Pin,Rock Solid Connector for 24-20 AWG Cable for Vehicle/audio/video/Lighting and Automotive Uses https://a.co/d/7l6141t

@caitotheonlypotato
Copy link

We have a "new" 2018 Nissan Leaf picked up today and already a little dismayed I can't get any stats into Home Assistant to show on our dashboard in the kitchen. I might order an OVMS and hopefully at some point the community can get it fully working. I'm not an EE or developer but happy to test and trial stuff... Although modifying any wiring would be off limits for me. My EV charger will be fully controllable from Home Assistant so maybe turning off the charger once and hour and back on might get the CAN gateway to wake up for a few moments?

You absolutely can, but thisis using leaf spy and a perma mounted phone. while level 2 charging you need the do something like leave the parking lights on to keep the CANbus awake. Probably not relevant for this discussion though

image

@reinux
Copy link

reinux commented Dec 21, 2023

2018 40kWh leaf owner and former IoT dev working in F#, C#, C, Python, JS/TS and the Zigbee stack. Could probably pick up CAN pretty quickly and chip in a little bit to this effort.

Seeing as car companies have become straight-up comic book villains, I intend not to buy a new car for as long as I can.

@honzakadlec
Copy link

Hi, Nissan leaf 2020 owner, attaching what I have found and tried to attach to connector M55 pins 28 & 29 to get to EV-CAN (I have simple SoC hardware posting data from my second car Nissan ZE0 and it works there) - but no luck so far.
Is the EV-Can active during charging same as on ZE0 @dalathegreat please?

nissan_leaf_Network_diagram.pdf

@caitotheonlypotato
Copy link

caitotheonlypotato commented Mar 11, 2024

Hi, Nissan leaf 2020 owner, attaching what I have found and tried to attach to connector M55 pins 28 & 29 to get to EV-CAN (I have simple SoC hardware posting data from my second car Nissan ZE0 and it works there) - but no luck so far. Is the EV-Can active during charging same as on ZE0 @dalathegreat please?

nissan_leaf_Network_diagram.pdf

Whilst I have no real technical knowledge, leafspy software will function on the ZE1 if the car is powered on, but not while charging unless the parking lights, or hazard lights are active. There may be other triggers that also work, but not that I've found. Hope that helps

@Jerther
Copy link

Jerther commented Mar 11, 2024

@honzakadlec Check out cods4's post about tapping into the CANBUS behind the CAN gateway.

@honzakadlec
Copy link

@honzakadlec Check out cods4's post about tapping into the CANBUS behind the CAN gateway.

aaah, I spot people are reffering to it, was not able to find it though, thank you @Jerther !

@Jerther
Copy link

Jerther commented Mar 11, 2024

@honzakadlec no problem! Please do keep us posted about your project if you can, successful or not ;)

@honzakadlec
Copy link

@honzakadlec no problem! Please do keep us posted about your project if you can, successful or not ;)

Hi @Jerther
I sucessfully connected to EV-CAN of ZE1 today, the pins in documentation are reversed (CAN-H / CAN-L) - wire colors are correct (blue for CAN-H),

I'm building my own EVSE so I can limit the power going to car by surplusses in PV plant. I have now the SoC data in my OpenHab and I can use it to control the EVSE output power.

Thank you again for support!

Jan

@honzakadlec
Copy link

For anyone needing to connect to EV CAN and not wanting to void waranty, I found there are connectors available to buy and create custom "CAN Cord" wire that can have the splicing, so we are not modifying car cables.
can-cord2
can-cord1

@damesmokesmids
Copy link

damesmokesmids commented Apr 12, 2024

For anyone needing to connect to EV CAN and not wanting to void waranty, I found there are connectors available to buy and create custom "CAN Cord" wire that can have the splicing, so we are not modifying car cables.

@honzakadlec wow, this seems great. Could this be used by a novice like me to get OVMS working on my 2020 leaf S? If so, could you tell me how?

@WMTaylor3
Copy link

For anyone needing to connect to EV CAN and not wanting to void waranty, I found there are connectors available to buy and create custom "CAN Cord" wire that can have the splicing, so we are not modifying car cables. can-cord2 can-cord1

This looks very promising! Work I would be happy to do! Seems like it's pretty accessible in the drivers footwell too... Out of interest, this gets you access to EV CAN but not CAR CAN yes? So presumably charging and battery status etc but not things like central locking etc?

Any idea how access to CAR CAN could be achieved in a similarly non-destructive manner?

@ehilfer
Copy link

ehilfer commented Apr 12, 2024 via email

@damesmokesmids
Copy link

I don't think this will help with the 2018+ Leaf, since you need to patch into the two can buses on the other side of the gateway from where that cable connects to the obd2 connector. I was able to make connections using clip on T-Taps on my 2020 Leaf and it works great with latest build. The taps create a little insulated spade lug that you can clip or un clip to. If needed the taps could be removed without damaging the original wire. I tapped into both ev and car can buses at the vehicle control module which is s sitting right behind the glove box on my left hand drive model. I'll share more details and pictures when I get time

@ehilfer this looks completely reasonable to do and has made me confident enough now to order a OVMS for my car. And you confirmed it works with 2020 and with the latest build. awesome. Those pictures are incredibly helpful!

@ehilfer
Copy link

ehilfer commented Apr 12, 2024

I've been using the iOS app and the following have been working well, and some changes I'd like to make in the firmware to improve metrics that show in the app:

  • Door locking / unlocking works
  • Turn on / off climate control works - hardcoded in the Nissan module code to the Home Link 1 and 2 commands in the Nissan Leaf module because the iOS app doesn't have a climate control UI.
  • SOC works
  • TPMS - not showing in the app due to iOS code only showing pressures if they come with tire temperature data, which the Nisson leaf module code does not provide. I'll look at either updating the iOS app to ignore missing temperatures (if the app authors are accepting any PR's and making any app updates) or maybe I"ll release a new app on testflight. Or, I could update the Nissan code on the ovms side to just send exterior temperate along with the tire pressures so that the app will be happy.
  • TEM and Motor temperatures display correctly, battery temp does not - Nissan code probably needs some model-specific decoding of the battery temp which isn't happening currently for 2018+
  • 12V battery voltage displayed correctly
  • During charging, charging state shows correctly - but, as noted in other posts, the calculation of the time to full charge is not taking into account the current SOC when charging began. I think I can update the Nisson code to calculate this correctly for 2018+ models.
  • GPS view of location works. But, openchargemap.org data is not shown. The openchargemap API now requires a token, which is not built into the current iOS app. I'll look into possibility of rebuilding that app
  • Messages view works and let's me send command straight to teh OVMS module - really cool

@ehilfer
Copy link

ehilfer commented Apr 12, 2024

Also - for power to the OVMS module I used same type of T-Taps to clip onto 12V and ground wires behind the car's ODB2 connector and ran the wires across behind the dashboard.

Here's the tap connectors I used for all of the connections: https://www.amazon.com/gp/product/B0C9C54F87/

@damesmokesmids
Copy link

damesmokesmids commented Apr 13, 2024

@ehilfer how did you find the correct wires? I can follow what wires you tapped into in the pictures, and im going to buy a multimeter for this project, but if i had a guide/diagram/another picture with wire colors that would be helpful with connecting to the OBD2 connector so i know which wires im plugging in. besides that it seems very straight forward to me. Thank you for the great work and information so far

@ehilfer
Copy link

ehilfer commented Apr 14, 2024

I'll post wiring diagrams and color codes. Also, my apologies about my comment about that CAN bus splice connector. I misunderstood and thought it was an obd2 connector. That connector would definitely work great to catch the ev CAN as shown in their picture, but doesn't have access to the car CAN so what I ended up doing gets you access to both CANs in the same place.

@damesmokesmids
Copy link

I'll post wiring diagrams and color codes. Also, my apologies about my comment about that CAN bus splice connector. I misunderstood and thought it was an obd2 connector. That connector would definitely work great to catch the ev CAN as shown in their picture, but doesn't have access to the car CAN so what I ended up doing gets you access to both CANs in the same place.

@ehilfer if you can get those and post them here you should also consider compiling everything and making a post on the OVMS forums as thorough as you can. It's a huge step towards official support finally after these cars being out for over a half decade. Really appreciate the work everybody has contributed towards this despite the challenges there are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests