<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Nigel,<div><br></div><div>Regarding the polling framework, sorry this is very new and there is zero documentation. Implementation is in vehicle.{h,c}.</div><div><br></div><div>Have a look at vehicle_obdii.c for an example implementation.</div><div><br></div><div>The idea is that vehicle_poll_setpidlist() is used to set the table of PIDs to be polled, vehicle_poll_setstate() is used to set the state, and vehicle_fn_poll0() is used to receive the PID values coming back. The other vehicle_fn_poll1() function can be used for general listen-only can bus messages. The CAN bus rx filters for poll0() should be setup to receive the responses from the polled modules (the example in vehicle_obdii.c illustrates this for standard OBDII responses).</div><div><br></div><div>The table of PIDs to be polled is based on the vehicle_pid_t structure. It is stored in ROM and contains the CAN module ID, poll type, PID to be polled, and a sub-array of three poll times (for each of the three states). The states can be used for whatever is required (I suggest something like: 0=vehicle off, 1=charging, 2=driving), and setting a poll time to 0 for that state will disable polling of a particular PID. The poll type is designed to recognise different ways of polling for PID. We currently have listed VEHICLE_POLL_TYPE_OBDIICURRENT normal OBDII over CAN), VEHICLE_POLL_TYPE_OBDIIVEHICLE (for polling things like VIN over OBDII), VEHICLE_POLL_TYPE_OBDIIGROUP (for Nissan Leaf - currently just a stub implementation) and VEHICLE_POLL_TYPE_OBDIIEXTENDED (0x22 as used in Volt/Ampera).</div><div><br></div><div>Regards, Mark.</div><div><br><div><div>On 7 May, 2014, at 2:39 am, Nigel Jones <<a href="mailto:nigel@cherrybyte.me.uk">nigel@cherrybyte.me.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">I have the OVMS module running in my car so found an hour tonight to start looking through the source - sorry it's taking a while to catch up, so forgive the newbie questions too......<div><br></div><div>

One thing I noticed is that I'm getting a 0% state of charge indication, and regular texts saying my battery is low (for testing I setup the sim with unlimited texts.....). I see there was a commit last year which used some of the data from the spreadsheet at </div>

<div><br></div><div><a href="https://docs.google.com/spreadsheet/ccc?key=0An7gtcYL2Oy0dGRaSWl6VTV2eXBQMy1ON2xZSzlMUXc#gid=0">https://docs.google.com/spreadsheet/ccc?key=0An7gtcYL2Oy0dGRaSWl6VTV2eXBQMy1ON2xZSzlMUXc#gid=0</a></div>

<div><br></div><div>which I found references from the nissan leaf forum discussion at</div><div><a href="http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&start=340">http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131&start=340</a></div>

<div><br></div><div>If I'm not mistaken the OVMS currently reads the CAR CanBus ? </div><div><br></div><div>There's an indication in the spreadsheet that CAN message 0x5b3 contains SOC information - but in fact the spreadsheet refers to it as SOH. I have a leafDD and I think this is also known as the Hx figure -- ie it seems to vary with battery age/capacity -- mine for example is down to around 82%, but it is not current state of charge, so I don't think decoding that will help?</div>

<div><br></div><div>GIDs are what I use in daily driving as they are absolute. The sheet suggests that figure might be retrievable from this message, but then most people would only see a % of 95% for example as life is lost? Is that's what's wanted? I suspect not for the overall SOC figure.</div>

<div><br></div><div>I can't see much else decoded yet (I was looking for low hanging fruit!) on the CAR canbus - instead most work was done on the EV canbus, including looking at state of charge etc.</div><div><br></div>

<div>So the question comes how to bridge the data from that bus onto the CAR can. There was reference to this previously on the list at </div><div><br></div><div><a href="http://lists.teslaclub.hk/pipermail/ovmsdev/2013-October/001712.html">http://lists.teslaclub.hk/pipermail/ovmsdev/2013-October/001712.html</a></div>

<div><br></div><div>It would appear the way to get any of the EV can data is to actively request the data. I can see examples of CAN data requests in the tesla module but haven't yet figured how I might for example retrieve CAN msg 0x5bb for example (it's one of the ones to try). I can also see the developers guide p24 which refers to writing on the bus. I'm also wary of the need to be careful in making active requests rather than the easier passive monitoring! Can anyone point me to an example of how I might do this? I'd make that call from the ticker functions? and then handle it in the poll right? </div>

<div><br></div><div>Apologies if this is all covered in the nissan leaf forum thread - I have 39 pages to read now...</div><div><br></div><div>Thanks</div><div>Nigel.</div><div><a href="mailto:nigel@cherrybyte.me.uk">nigel@cherrybyte.me.uk</a><br clear="all">

<div><br></div>-- <br>----<br>Nigel Jones
</div></div>
_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br>http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br></blockquote></div><br></div></body></html>