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.
I think these are the parts ( minus the software) needed for the Arduino based canbus-reader shown previvously

http://www.sparkfun.com/products/10039
http://www.sparkfun.com/products/9950
http://www.sparkfun.com/products/9393
http://www.sparkfun.com/products/10087

I am not sure about the cable, because it basically reads just one CAN bus and not three..
There is probably minimal soldering required with these parts (usually just the connectors between the shield and the arduino).
 
Perhaps I missed this topic, but when you are connected to the CANbus, can you promiscuously sniff all activity on that bus? If so, does CARWINGS activity show up?
 
That is one of the questions that we want to answer, but I suspect that the to/from Carwings data only appears on the USB buss between the VCM and TCM.

I believe that the TCM, receiving a call, can wake up the VCM with a special "ring, ring" line.
 
TonyWilliams said:
mogur said:
So, I want this to be my next Leaf construction project!
How difficult would it be to take that % value readout and make a few columns that showed range at a few different parameters.
Easy. Simple math. It can also do bargraphs, but I like the numeric readout.
For example, battery power level value divided by 2.16153846 equals "Best38mph" range. So, battery value 281 will display 130 miles.
You certainly could, but I think what I'm looking for is different than most.

Imagine a real-time display of (wall) Watt-Hours Per Mile. This is definitive measure of how much energy you're expending to drive.

If you are rolling along a flat highway, you could adjust your speed and see the direct impact of how much power it consumes to drive that way. A long flat road and cruise control would be very interesting to log. Uphill, downhill, etc.

My goal is to have an instant, 1-mile, and 5 or 10-minute average of Watt Hours per Mile, in addition to the remaining SOC and my own range calculation.
 
garygid said:
That is one of the questions that we want to answer, but I suspect that the to/from Carwings data only appears on the USB buss between the VCM and TCM.
The charging station and RSS feed data seems to go over USB.
However, the TCU is on the EV BAT CAN Bus, which does wake up briefly during the status poll. I believe the TCU is getting it from this bus.

I believe that the TCM, receiving a call, can wake up the VCM with a special "ring, ring" line.
Indeed. It has a dedicated wire for doing exactly this.
 
klapauzius said:
I think these are the parts ( minus the software) needed for the Arduino based canbus-reader shown previvously
http://www.sparkfun.com/products/10039
http://www.sparkfun.com/products/9950
http://www.sparkfun.com/products/9393
http://www.sparkfun.com/products/10087

I am not sure about the cable, because it basically reads just one CAN bus and not three..
There is probably minimal soldering required with these parts (usually just the connectors between the shield and the arduino).

Very close! The display is the 4x20 serial display, but it works the same way.
The CAN Bus OBD cable from SparkFun is useless, unless you want to see the Primary CAN data instead of the EV CAN data where SOC is.

That said, I would not recommend the rig I built, so I'm hesitant to say "Go buy these parts! Build one!" It was a one-off experiment, but the overall package cost is a bit high. I think I have $130 or so in parts. Gary's AT90CAN128 Olimex board is a cheaper solution that doesn't use Arduino. Further up in this thread, the pros/cons of each configuration is discussed a bit more.

The cable is a CAT5 (four twisted pair) ethernet cable, on which I put all three Bus pairs from the Diagnostic connector (and power). For the SOC gauge, you only need the one EV CAN pair, and you always have to build your own custom cable.


This thread is getting a bit long and windy.. I'd like to work with a mod to split it into separate topics, since it's likely to have long-term interest.
  • CANBus interface hardware, DIY designs, kits, firmware
  • EV-CAN CANBus message decoding (bus observations, bit analysis)
  • Primary CANbus messages (the 6/14 pair)
  • AV-CAN (likely to be a short thread!)
  • PC Software projects to decode and display data
  • Battery SOC behavior, as seen on the EV CAN bus
 
GroundLoop said:
Imagine a real-time display of (wall) Watt-Hours Per Mile. This is definitive measure of how much energy you're expending to drive.......
My goal is to have an instant, 1-mile, and 5 or 10-minute average of Watt Hours per Mile, in addition to the remaining SOC and my own range calculation.


SOLD !!! Yes, I want to be able to do modifications to the car, and then drive the same loop and give me instant AND a way to total the Watts used over the loop.

Plus, accurate range predictions at various pre-programmed parameters, like 38mph, 50mph, etc.
 
GroundLoop said:
This thread is getting a bit long and windy.. I'd like to work with a mod to split it into separate topics, since it's likely to have long-term interest.
  • CANBus interface hardware, DIY designs, kits, firmware
  • EV-CAN CANBus message decoding (bus observations, bit analysis)
  • Primary CANbus messages (the 6/14 pair)
  • AV-CAN (likely to be a short thread!)
  • PC Software projects to decode and display data
  • Battery SOC behavior, as seen on the EV CAN bus
I can make a separate sub-forum for CAN and we can have new threads for the above topics, along with this thread. But splitting the posts in this thread into the new threads would be impractical.
 
GroundLoop said:
That said, I would not recommend the rig I built, so I'm hesitant to say "Go buy these parts! Build one!" It was a one-off experiment, but the overall package cost is a bit high. I think I have $130 or so in parts. Gary's AT90CAN128 Olimex board is a cheaper solution that doesn't use Arduino. Further up in this thread, the pros/cons of each configuration is discussed a bit more.
What would be useful for the rest of us is a part list and instructions on putting this together. We need more people to be doing this to get all the codes decoded quickly ...

Gary ?

Or Turbo can put together the parts, flash the uPs and sell us the whole thing. Fast.
 
I'm ready to buy either way.


evnow said:
GroundLoop said:
That said, I would not recommend the rig I built, so I'm hesitant to say "Go buy these parts! Build one!" It was a one-off experiment, but the overall package cost is a bit high. I think I have $130 or so in parts. Gary's AT90CAN128 Olimex board is a cheaper solution that doesn't use Arduino. Further up in this thread, the pros/cons of each configuration is discussed a bit more.
What would be useful for the rest of us is a part list and instructions on putting this together. We need more people to be doing this to get all the codes decoded quickly ...

Gary ?

Or Turbo can put together the parts, flash the uPs and sell us the whole thing. Fast.
 
mogur said:
I'm ready to buy either way.

I'll sell you my whole Arduino+CAN Shield+whatever kit, but I'm going over to AT90CAN128 so there's nothing other than an SOC meter for it.

The only downside is that I will miss the (2GB!) logging capacity and (maybe in the future) GPS.
But I do want to attach a 4-bit parallel LCD display and use the AVR native CAN rather than Microchip over SPI.
 
A couple of suggestions for you brave CAN bus decoders.

Try to find the tire pressures. It would be very useful to have an accurate reading of these rather than only an idiot light when the pressure is 6 PSI low. I expect the pressures would be sent infrequently and only when the car is moving at speed. To be sure of the identification, you would have to change the tire pressure between trips.

Try to find the battery capacity. This number presumably won't change, but if you spoof it, the number of narrow bars on the outer circumference of the fuel gauge should change.

Thanks and happy decoding.
 
I like the AT90CAN128 concept personally... Perhaps we can put together a group buy for everything necessary to build one...

GroundLoop said:
mogur said:
I'm ready to buy either way.

I'll sell you my whole Arduino+CAN Shield+whatever kit, but I'm going over to AT90CAN128 so there's nothing other than an SOC meter for it.

The only downside is that I will miss the (2GB!) logging capacity and (maybe in the future) GPS.
But I do want to attach a 4-bit parallel LCD display and use the AVR native CAN rather than Microchip over SPI.
 
I do like this idea! I was very disappointed to learn that the car had a full tire pressure reporting system but that I had no access to the actual tire pressures...

thimel said:
Try to find the tire pressures. It would be very useful to have an accurate reading of these rather than only an idiot light when the pressure is 6 PSI low. I expect the pressures would be sent infrequently and only when the car is moving at speed. To be sure of the identification, you would have to change the tire pressure between trips.
 
I would love to find the raw 4-wheel TPMS pressures! Supposedly the senders have quite a bit of resolution in their reports, so a display could be useful indeed. You could (indirectly) track temperature that way too.


Has anyone tried CONNECTING two or three of the Can Bus pairs together? Wait -- Hear me out.. :)
CAN is naturally self-arbitrating, and all the existing nodes could broadcast onto the other bus as well.
There would be twice as much traffic, yes, but it's not saturated.
There would be four terminators on the network instead of the needed two, but I don't think the load would be unreasonable.

Then you could use one CANbus receiver board to monitor both CAN + EV-CAN at the same time.

Are the message IDs on all three busses Unique?
I'm thinking this over..
 
Four terminators would bring the bus impedance to 30 ohms, well out of spec for a CAN bus. With our equipment, it will work with one terminator, but fails with 3. I'd assume 4 would fail most can busses.

Also the more traffic, the more collisions you may have (well self-arbitration events) which may delay critical control messages.
 
mogur said:
I like the AT90CAN128 concept personally... Perhaps we can put together a group buy for everything necessary to build one...

That would be great! Is the AT90CAN128 Olimex as easy to program as the Arduino?

In a way it is absurd that we discuss all these kind of awkward hardware fixes, while Nissan could implement all of this simply and elegantly via a simple software upgrade... I assume it would take no more than a few keystrokes to display the battery charge status, voltage etc on the Leafs built in displays.

Maybe we should lobby Nissan harder to do so.

Hacking the CAN bus is nice and fun, but whatever comes out it in the end will not look as good as the stuff that Nissan already built and essentially it would not gives us data, that isnt already in the system. And then you have cables hanging around on the drivers side, which are a potential hazard anyway.

On my old 1999 E320 you can access a bunch of internal data on the AC control display, by pressing some funny combination of keys on the AC control...Could the LEAF have a similar feature?
 
Back
Top