<div dir="ltr">Based in Reigate Surrey October 2013 car , happy to help..</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 7 August 2014 20:21, Jeremy Whaling <span dir="ltr"><<a href="mailto:jeremy.whaling@gmail.com" target="_blank">jeremy.whaling@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I posted a response on the MNL forum, see here: <a href="http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&start=407" target="_blank">http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&start=407</a><div>

<br></div><div>I should be able to provide some more data Friday. I eventually need to do some logging on a "gen II" 2013 or newer car....</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 29, 2014 at 9:36 AM, Mark Webb-Johnson <span dir="ltr"><<a href="mailto:mark@webb-johnson.net" target="_blank">mark@webb-johnson.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div>I’ve posted on mynissanleaf a laundry-list of what we need for the Leaf. Hopefully we can get some help there, as well as validation that we are doing is the correct approach.<div>

<br></div><div>Regards, Mark.<br><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><a href="http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&p=380402#p380402" target="_blank">http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&p=380402#p380402</a></div>

<div><br></div><div><table width="100%" cellspacing="1" style="margin:0px;padding:0px;background-color:rgb(169,184,194);color:rgb(50,61,79);font-family:'Lucida Grande',Verdana,Helvetica,Arial,sans-serif;font-size:10px">

<tbody style="margin:0px;padding:0px"><tr style="margin:0px;padding:4px;background-color:rgb(220,225,229)"><td align="center" valign="middle" style="margin:0px;padding:2px"><b style="margin:0px;padding:0px;color:rgb(0,0,0)">markwj</b></td>

<td width="100%" height="25" style="margin:0px;padding:2px"><table width="100%" cellspacing="0" style="margin:0px;padding:0px"><tbody style="margin:0px;padding:0px"><tr style="margin:0px;padding:0px"><td width="100%" style="margin:1px;padding:2px;font-size:1em">

<div style="margin:0px;padding:0px;float:left"> <b style="margin:0px;padding:0px">Post subject:</b> <a href="http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&p=380402#p380402" style="margin:0px;padding:0px;color:rgb(0,87,132);text-decoration:none" target="_blank">Re: LEAF CANbus decoding. (Open discussion)</a></div>

<div style="margin:0px;padding:0px;float:right"><a href="http://www.mynissanleaf.com/viewtopic.php?p=380402#p380402" style="margin:0px;padding:0px;color:rgb(0,87,132);text-decoration:none" target="_blank"><img width="12" height="9" alt="Post" title="Post" style="margin:0px;padding:0px;border:none" src="cid:22FBEA16-003B-48E3-830E-84E092DEFE1D"></a><b style="margin:0px;padding:0px">Posted:</b> Wed Jul 30, 2014 1:14 am </div>

</td></tr></tbody></table></td></tr><tr style="margin:0px;padding:4px;background-color:rgb(220,225,229)"><td valign="top" style="margin:0px;padding:4px"><span style="margin:0px;padding:0px;color:rgb(0,0,0)"><br style="margin:0px;padding:0px">

<br></span></td><td valign="top" style="margin:0px;padding:2px"><table width="100%" cellspacing="5" style="margin:0px;padding:0px"><tbody style="margin:0px;padding:0px"><tr style="margin:0px;padding:0px"><td style="margin:0px;padding:2px">

<div style="margin:0px;padding:0px;font-size:1.3em;line-height:1.4em;font-family:'Lucida Grande','Trebuchet MS',Helvetica,Arial,sans-serif">We've made some progress getting OVMS working on the Leaf, thanks to some hard work at the recent #hackaleaf day in UK. We're now using a custom cable which delivers the single EV-CAN bus to the OVMS module. The cable also brings out the CAR-CAN bus, but we only have one CAN controller in the v2 OVMS module so are hoping to be able to do what we need with just the EV-CAN bus (with active polling through to the CAR-CAN bus for the few things we need there).<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px">Below are the items we are looking for, and our current approach. Apologies for the long-post - just want to put it down in one place. Any advise/recommendation appreciated. What mentioning CAN ID numbers, we mean 11bit can messages with the ID in 0x... hex format, and the Dx data byte indexes are D1..D8 (starting at 1 not 0).<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_type</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">It would be nice to be able to identify the car type (2011, 2012, 2013, etc). Presumably this can be retrieved from the VIN, but we've done nothing for this, yet.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_vin</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">This is the alpha-numeric VIN number. It is supposedly available by active polling on the CAR-CAN bus, via the EV-CAN we are on. We did some basic work on this, using standard OBDII PIDs and poll types, but couldn't get anything. One poster on the active-polling thread mentioned they have managed to get it using the leaf-style 0x21 poll type, but we haven't had a chance to try yet.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_gpslock, car_stale_gps, car_latitude, car_longitude, car_direction, car_altitude</span><br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px">OVMS has a built-in GPS, so we're just going to use that and ignore anything the car has on this.<br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_stale_tpms, car_tpms_t (0..3), car_tpms_p (0..3)</span><br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px">TPMS values (stale, temperatures and pressures) would be nice to have, but we've done nothing on this yet. These are nice-to-have, but not essential.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_doors1 [bit7]</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">Set if the car ignition is ON. At the moment we're using 0x56e D1=0x86 for car is driving, else not.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_speed</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">We don't have this at the moment. We see some wheel speeds on the EV-CAN bus, but no direct speedometer reading. This could be retrieved via GPS, but it would be good to be able to get this from the car.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_trip, car_odometer</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">We haven't found either of these on the EV-CAN bus. They are nice-to-have, but not essential.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_stale_ambient, car_ambient_temp, car_stale_temps, car_tpem, car_tmotor, car_tbattery</span><br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px">These are the ambient, PEM (AC-DC and DC-AC electronics), Motor, and Battery temperatures. We don't have any of these, but haven't started looking yet.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">Door status (front-left, front-right, bonnet, trunk, rear-left, rear-right), Handbrake status, Headlight status, lock/unlock status, alarm status</span><br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px">We haven't start looking yet. Presumably these are on the CAR-CAN bus, and will require active polling to retrieve.<br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">

<span style="margin:0px;padding:0px;text-decoration:underline">Vehicle awake/sleep status</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">This is trivial to get via activity (or lack of activity) on the EV-CAN bus.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_time, car_parktime</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">We will generate these timers internally based on cellular network time and an internal clock.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_SOC</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">We're currently getting these from 0x5bc, derived from the GIDs. We realise there are several competing ways of calculating SOC from GIDs and will offer a configuration setting to support them all.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_idealrange</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">This is the ideal range of the car, based on current SOC. It should be based on the standard testing cycle figure for the car. So if, for example, the testing cycle says 84 miles, then at 50% SOC the ideal range is 42 miles. At the moment, we're just using a simple SOC% x ideal range for this.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_estrange</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">This is the estimated range of the car, based on current SOC and current/recent driving behaviour. We can either show here what the car is showing, or derive our own. We haven't done this yet.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_cac100</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">This is some indication of the overall health of the battery. The meaning changes with each supported vehicle. For the Tesla Roadster, 160 is a new battery, and after 3 1/2 years my car is 152.28 today. For the Nissan Leaf, we can probably use GIDS/281 at full charge (or something like that) - but open to suggestions.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">Charging Status - pilot signal</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px">We need an indication that there is a pilot signal (i.e.; the charge cable has been connected and the <a href="http://www.myelectriccarforums.com/electric-vehicle-charger/" style="margin:0px;padding:0px;color:rgb(0,87,132);text-decoration:none" target="_blank">EVSE</a> is offering power). At the moment we are using 0x5bf D3 != 0 AND D4 != 0. It seems to work ok.</span><br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">Charging Status - car is charging, charge limit, line voltage, charge current</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">

We need an indication of if the charging is in progress, and if it is what voltage and current are being provided by the wall.<br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">Currently, for charge status (charging or not), we are using the same as the pilot signal (0x5bf D3 != 0 AND D4 != 0). For charge completion, as well as looking for EV-CAN bus data to tell us the charge has completed, we're also looking at a timeout of 10 seconds with no EV-CAN bus activity (car has gone to sleep, so charging must have completed).<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px">For charge limit (the current limit that the <a href="http://www.myelectriccarforums.com/electric-vehicle-charger/" style="margin:0px;padding:0px;color:rgb(0,87,132);text-decoration:none" target="_blank">EVSE</a> advertises), we are using 0x5bf D3/5 (in Amps). We tried this at various different values, and it seemed to match what the <a href="http://www.myelectriccarforums.com/electric-vehicle-charger/" style="margin:0px;padding:0px;color:rgb(0,87,132);text-decoration:none" target="_blank">EVSE</a> was offering quite well. The only issue is that it seemed to be capped at D3=0x5A (which would be 18A). Values we've seen for D3 are 0x00, 0x27, 0x28, 0x32, 0x33, and 0x5A.</span><br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px">We haven't managed to find the line voltage and charge current data at all. We can see current/voltage of the battery, but not from the wall. This is very useful, and we are still looking for this.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">Charge duration</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">We need the car_chargeduration (in minutes), but we can calculate this ourselves. We also need the car_chargekwh (which is the amount of kWh put into the battery / taken from the wall during the charge session) - which we would normally calculate ourselves based on line voltage and charge current over time.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_chargefull_minsremaining</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">This would be nice to have, but we haven't found it yet.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">car_stale_timer, car_timermode, car_timerstart</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">

These are the car charge timer values. We haven't started looking yet.<br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">Commands for pre-cool, pre-heat, lock, unlock, etc.</span><br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px">We haven't started on this yet, but it looks promising based on what is shown here. The only issue may be co-existing with the on-board telemetry unit. The OVMS module has some digital I/O pins available, so we can most likely offer a hardware tap for wakeup on pre-2013 cars.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px;text-decoration:underline">Other stuff</span><br style="margin:0px;padding:0px"><br style="margin:0px;padding:0px">We'd really like to expose all the other stuff on the car (like GIDs, etc). For that, we're going to use custom-metrics tags so we can send them to the apps directly, as well as do logging in a similar way to the way it was done on the Renault Twizy.<br style="margin:0px;padding:0px">

<br style="margin:0px;padding:0px"><span style="margin:0px;padding:0px">The above is really a laundry-list of everything we _want_. What we _need_ now is the VIN (active polling messages), speed, estimated range, cac100 (battery health), charging line voltage and current drawn. Any suggestions you guys have for these would be most appreciated. It would also be helpful if you could check our working for 0x5bf D3/5 (as <a href="http://www.myelectriccarforums.com/electric-vehicle-charger/" style="margin:0px;padding:0px;color:rgb(0,87,132);text-decoration:none" target="_blank">EVSE</a> pilot signal advertised current), as that seems to make sense for us but we are not sure if the calculation is correct or not (not enough data to be certain).</span></div>

</td></tr></tbody></table></td></tr></tbody></table><div><br></div></div></blockquote></div><div><div><div><br><div><div>On 26 Jul, 2014, at 11:37 pm, Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" target="_blank">mark@webb-johnson.net</a>> wrote:</div>

<br><blockquote type="cite"><div style="word-wrap:break-word">Jeremy,<div><br></div><div>Fantastic. Thanks for sharing.</div><div><br></div><div>I checked what you wrote against the EVCAN bus dumps we took, and they seem to match well.</div>

<div><br></div><div>For example, a carwings HVAC on shows:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>1405412687.875 R11 56e 46</div><div>1405413246.983 R11 56e 4E</div>

</div><div>1405454415.582 R11 56e 46</div><div>1405472495.666 R11 56e 86</div></blockquote></div><div><br></div><div>and HVAC off shows:</div><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">

<div><div>1405800125.677 R11 56e 86</div><div>1405801551.786 R11 56e 46</div></div><div>1405810295.435 R11 56e 56</div><div>1405827846.735 R11 56e 46</div><div>1405842751.818 R11 56e 86</div></blockquote></div><div><br></div>

<div>These were on a 2012 leaf (I think), so I’m not seeing any 68C messages from carwings - although I did see the 68C 00 message when the car was switched on.</div><div><br></div><div>Makes me glad that we recently decided to switch to using the EV-CAN bus.</div>

<div><br></div><div>For the hardware mod necessary for 2011/2012 Leafs, any ideas how this could be done? Anyone got the 2012 service manual that they can send to me? We have a bunch of 5V TTL level outputs in the OVMS module that could be used as the basis for this.</div>

<div><br></div><div>Regards, Mark.</div><div><br><div><div>On 26 Jul, 2014, at 3:46 pm, Jeremy Whaling <<a href="mailto:jeremy.whaling@gmail.com" target="_blank">jeremy.whaling@gmail.com</a>> wrote:</div><br><blockquote type="cite">

<div dir="ltr">Hi All-<div><br></div><div>Over the last few days a few of us on the mynissanleaf forum have been working on getting the TCU (telematics module) CAN messages for the various modes of operation (remote CC, status, charge). Here's what we know now:</div>


<div><br></div><div>To wake up the VCM (Main controller), the TCU sends a msgID of 68C on the EV CAN bus with one byte of 00. On 2013 and newer models wake up solely on the CAN message.  </div><div><br></div><div>For 2011 or 2012 models the TCU will bring a logic line high that connects to the VCM briefly as well to wake it up. Page 64 of the "AV" section of the 2012 service manual shows the pinout of the TCU. You will need to splice into Pin 11 (light green? wire) on the large connector going to the TCU and make an appropriate circuit to pull it high briefly when the OVMS module sends the 68C message. When doing non "remote charge" testing you might be able to hit the charge override button (which uses another line to wake the VCM) then send 68C. I think that might work for testing. :-)</div>


<div><br></div><div>Once the VCM is awake it looks to the TCU status message to see what's up. The status message has a msgID of 56E and the first byte determines the status (the 6 other bytes are FF). The 56E message repeats every 100ms whenever the EV CAN bus is active. The various modes are:</div>


<div><span style="color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px;background-color:rgb(250,250,250)">hex   binary   state</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px">


<span style="color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px;background-color:rgb(250,250,250)">46   01000110   status</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px">


<span style="color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px;background-color:rgb(250,250,250)">86   10000110   idle</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px">


<span style="color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px;background-color:rgb(250,250,250)">4E   01001110   cc on</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px">


<span style="color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px;background-color:rgb(250,250,250)">56   01010110   cc off</span><br style="margin:0px;padding:0px;color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px">


<span style="color:rgb(0,102,0);font-family:Monaco,'Courier New',monospace;font-size:11.199999809265137px;line-height:18.200000762939453px;background-color:rgb(250,250,250)">66   01100111   remote charge</span><br>


</div><div><br></div><div>That's all we have so far. Haven't tried pulling the TCU yet and duplicating it's messages but I'm reasonably confident this is all there is to it as far as remote activation.</div>


<div><br></div><div>For more info, see this Google Doc with the Leaf's CAN message info <a href="https://docs.google.com/spreadsheet/ccc?key=0An7gtcYL2Oy0dGRaSWl6VTV2eXBQMy1ON2xZSzlMUXc&usp=sharing" target="_blank">here</a></div>


<div>For the latest developments Leaf CAN wise, check out the thread on MNL <a href="http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&start=390" target="_blank">here</a></div><div><br></div><div>Take care,</div>

<div><br></div>
<div>Jeremy</div><div><br></div></div>
_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk" target="_blank">OvmsDev@lists.teslaclub.hk</a><br><a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev" target="_blank">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br>

</blockquote></div><br></div></div>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk" target="_blank">OvmsDev@lists.teslaclub.hk</a><br><a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev" target="_blank">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br>

</blockquote></div><br></div></div></div></div></div><br>_______________________________________________<br>
OvmsDev mailing list<br>
<a href="mailto:OvmsDev@lists.teslaclub.hk" target="_blank">OvmsDev@lists.teslaclub.hk</a><br>
<a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev" target="_blank">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
OvmsDev mailing list<br>
<a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br>
<a href="http://lists.teslaclub.hk/mailman/listinfo/ovmsdev" target="_blank">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev</a><br>
<br></blockquote></div><br></div>