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.
My CAN-Do (evolving) software is also written in VB6,
but currently seems to work on at least XP and Vista.

I will add code to display a "Dashboard", read CAN messages
in real time, log them, and update the "dashboard" display.
 
Old way:

LBC sends out "capacity" (5BC) and "bars".
VCM took this data in, used capacity to calculate it's adjusted range and send that number to the display.
VCM forwarded bar value from LBC to display. As far as I could tell, it did nothing with it, nor did it monitor it.
VCM monitored capacity value for trigger points and warned driver as necessary.

New way:
LBC sends out "capacity" (5BC) and "bars". (there is no change in how the LBC comes up with these numbers)
VCM takes capacity and calculates a range that we know is offset so you have less range for a given capacity as compared to the old way.
VCM calculates a Bar value based on the capacity value from the LBC which is less bars for a given capacity as compared to the old firmware. The bar value from the LBC is now ignored. (all this has been tested by sending spoof messages on GoneWild's car)
VCM monitored capacity value for trigger points and warned driver as necessary. These trigger points have not changed. Nothing about the warning trigger points have changed.

The end result is you have less bars, and less range, but the same exact capacity for a given warning trigger point.

No updates to the display have been made as far as I can tell. The display gets direct messages for range, bars, long term capacity and charge times. The average m/kw is calculated in the dash.
 
Is anyone using the Lawicel adapter? My CANMon software will only work with that one, unless other modules use the same format..
 
turbo2ltr said:
Is anyone using the Lawicel adapter? My CANMon software will only work with that one, unless other modules use the same format..
I'm using the Lawicel (CAN232). CANUSB seems to use the same.
The format works for me, so I'm using the same format on my CANBus shield to write files to the microSD card.

Further, it seems the EasySync devices have cloned the Lawicel as well:
http://www.easysync-ltd.com/product/557/s1-a-7001.html

I'm normally running Linux, though, so VB6 software is more of a curiosity. I'll boot Windows to try it. :)
 
turbo2ltr said:
I have not gotten the update.
I think you should. If you are going to end up selling the soc gauge, you want to be on the same firmware version everyone else is using ...
 
Say I wanted to get into this CANbus monitoring game. Say I wanted to build my own hardware. It looks like I'd need some interface circuitry, and an appropriate microprocessor. And then a way to look at the data. I know that's reinventing the wheel, but I'm more interested in knowing how it works than getting useful data. Besides, it looks like you guys are way ahead in this game and it's practically over before I start. Still, this bus isn't going away any time soon, and I understand my poor little Scangauge can't hardly touch this stuff. I'd like to know I can modify what I make as I see fit, instead of running into this "well that board only does X, and this board is too old to know about Y", etc.

Would you say it's difficult, or really difficult? Or extremely difficult? I see the data rates are way up there, and the protocol may have a couple of layers. Kind of how Ethernet is. By the way, GroundLoop mentioned "pcap". Made me think if the data could be made to look like Ethernet data somehow, then Wireshark would be a great way to look at the data, as well as getting that data into a form usable by all.

I'll quit here before I really get rambling...
 
gbarry, I'd say the CAN Bus is somewhere between easy and really easy to interface to.
There are a number of factors in your favor:
  • It's a very mature bus, highly standardized
  • There is a plethora of pre-existing interface hardware (transceivers, adapters) to choose from
  • It's widely supported in embedded/microcontroller platforms, unlike something like firewire
  • The bitrate is low -- 500kbps. This is just above RS-232 and below the slowest 12Mbps USB 1
  • There is a LOT of documentation and published standards to read. There are no mysteries to the CAN bus itself.

And there is plenty of research/reverse-engineering left to be done. Turbo has copious notes on his discovered indicators.


One of the hardest things to establish will be units/scaling. It's one thing to know a value ranges from 5 to 125.. it's quite another to assign it an actual 'units' scale.

Most folks, including myself, are far more comfortable Receiving messages (snooping) and attempting to decode them. Injecting (transmitting) messages is a little more risky, since you may change the way the car behaves, or flag sticky error codes.

The next step would be to actually break connections between the modules and place interposer circuits in between. This would allow you to intercept/cancel/override messages without contention.

So.. yeah, lots left to do. Dive in!
 
turbo2ltr said:
The max value of the byte you are looking at for capacity moves. My car started out with 271. After 3 months of breaking in the battery it goes up t0 280.

Some data
231 = 80% charge (I havent tested if this number drifted, I would think not but would be interesting to know)
48 = battery warning
24 = very low battery warning
5 = turtle
I've been ignoring this thread thinking it would be way over my head, but this looks like fun.

Why has no one pointed out the basic catch in what turbo measured? 231/271 > 85%, not even close 80%. Even the unverified 231/280 = 82.5%. From the low end numbers I don't think it is a matter of a non-zero origin. So is an 80% charge not really 80%? Or maybe ... the question is, 80% of what?

What if it is 80% of battery maximum charge, but not 80% of allowed charge? That would mean a battery max of ~289, and the corresponding battery allowed limit (at 271) of ~94%. turbo's "break in" rise could be either an adjustment over time of the allowed charge or a change in what the battery could potentially handle. If the former, he has now gotten up to nearly 97%, which makes me squirm. I would tend to think it is the latter, and the 231 will also have moved up.

Of course that whole paragraph was a "what if". Please provide alternative rationalizations for why 80% is not 80%.

Ray
 
I can say that the value "003" is where the car turns off the heat. It leaves the fan running, but heater and A/C don't work. Range is "---", no turtle.

Up until that point, a parked&on LEAF makes a decent 3kW space heater for your garage. :)

Once it gets to "3", all the ECO gauges claim Zero consumption, even for the ancillary (250W) base systems.
 
planet4ever said:
Why has no one pointed out the basic catch in what turbo measured? 231/271 > 85%, not even close 80%. Even the unverified 231/280 = 82.5%. From the low end numbers I don't think it is a matter of a non-zero origin. So is an 80% charge not really 80%? Or maybe ... the question is, 80% of what?
Interesting - may be it is 82.5% and not 80%. But that is strange - really no reason to for that (unless it is 80% of the "total" capacity - which looks unlikely).
 
After running it down to "3" with the heater, I couldn't get it to go any lower while stopped. Running the fan at max didn't do much. I didn't have a 10A 12v load to plug into the accessory port, but that would be another way to sap 120W. :)

The charge plot isn't too surprising:
3-to-281-charge.png
 
What hw/sw are you guys using to get data into laptop ?

Is this any good ?

http://www.obdpros.com/product_info.php?products_id=133

usbcontents.jpg
 
Scroll up in this same thread to see the various hardware options.

In general, most of the "OBD" products will NOT WORK. They want to talk to an OBD controller, usually via the K-Line ISO interface. Useless on a Leaf, apparently.

To get the messages from the LEAF, you need a standard CANbus adapter that can handle 500kbps CAN, and a custom-made cable to connect to the Diagnostic Terminal Connector. (The standard pre-made cables will only tap one of the three available CAN bus pairs.)

I would venture that almost every product with "OBD" in the name is constrained to either the non-CAN bus, or the software is intended for OBD-via-CAN. Neither is useful.
 
GroundLoop said:
After running it down to "3" with the heater, I couldn't get it to go any lower while stopped. Running the fan at max didn't do much. I didn't have a 10A 12v load to plug into the accessory port, but that would be another way to sap 120W. :)

The charge plot isn't too surprising:
image
Why is it that other people can apparently look at GroundLoop's images, and I never can? I had to pull up the message source to see what was going on, and then discovered that my computer can't find www.trix.com
Could it be blacklisted by Charter Cable?

Ray
 
Back
Top