<div dir="ltr"><div>Hi,</div><div><br></div><div>Thanks for the input - I'll push you a PR probably Monday - tomorrow Valentine's day and let's not take a chance on "you love that computer more than me" ;-)</div><div><br></div><div>Steve</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 13 Feb 2021 at 20:41, Michael Balzer <<a href="mailto:dexter@expeedo.de">dexter@expeedo.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
Steve,<br>
<br>
yes, that may be enough time to trigger an alert, as the modem also
will need a couple of seconds to get the first fix after a reboot.
If that happens on the highway, you may well reach the alert
threshold.<br>
<br>
A better init option:<br>
<br>
<font face="monospace"> if (!StdMetrics.ms_v_env_on->AsBool())
<br>
StdMetrics.ms_v_env_on->SetValue(false);
</font><br>
<br>
That takes advantage of the new persistence of the flag.
(Persistence cannot currently detect "false" as a defined value on
boot, as that's the default bool value.)<br>
<br>
Furthermore, you can test the flag to see if you should directly set
the poll state to your driving mode. Btw, the same applies to most
status flags now, so you can for example also detect if a charge
session was active before the reboot.<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
<div>Am 13.02.21 um 19:25 schrieb Steve
Davies:<br>
</div>
<blockquote type="cite">
<div dir="ltr">On Sat, 13 Feb 2021 at 12:39, Michael Balzer <<a href="mailto:dexter@expeedo.de" target="_blank">dexter@expeedo.de</a>>
wrote:<br>
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I suggest all vehicle
developers check their v.e.on logic before we <br>
change this.<br>
<br>
</blockquote>
<div><br>
</div>
<div>Well the bmwi3 logic is like so:</div>
<div><br>
</div>
<div>1) v_env_on is initialised to false when the module is
initialised</div>
<div>2) When the OBD-2 bus goes dead for 3 seconds I turn off
my polling and set v_env_on to false</div>
<div>3) Otherwise, v_env_on is set to <font face="monospace">(pollerstate
== POLLSTATE_READY &&
StdMetrics.ms_v_env_gear->AsInt() != 0) </font><font face="arial, sans-serif">- i.e. OBD alive, car is
responsive on the OBD, and its in gear. You can't put it
in gear unless its "ready". This was the best I could do
since I can't find an OBD2 that plainly distinguishes "on"
(viz accessory position) from "ready" (let's go).</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">If the module boots up and
the OBD2 is alive there will be a brief interval of v.e.on
being false and as soon as we see obd2 traffic and see the
car in gear (that is polled every 4 seconds when the car
is READY) then v.e.on will change to true.</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">I suppose that may be
enough time for this alarm to go off?</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">Steve</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
</div>
</div>
<br>
<font face="Arial, Helvetica, sans-serif"><span style="font-size:13px"><a href="https://www.telviva.co.za/legal/email-disclaimer" target="_blank">https://www.telviva.co.za/legal/email-disclaimer</a></span></font>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
OvmsDev mailing list
<a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
</div>
_______________________________________________<br>
OvmsDev mailing list<br>
<a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank">OvmsDev@lists.openvehicles.com</a><br>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" rel="noreferrer" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br>
</blockquote></div></div>
<br>
<font face="Arial, Helvetica, sans-serif"><span style="font-size:13px"><a href="https://www.telviva.co.za/legal/email-disclaimer" target="_blank">https://www.telviva.co.za/<wbr>legal/email-disclaimer</a></span></font>