<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    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 class="moz-cite-prefix">Am 13.02.21 um 19:25 schrieb Steve
      Davies:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABFTEGVpC1BB9RsKnsc2U146YE-+dua-oPta=4qHR0Zpvd0dCQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">On Sat, 13 Feb 2021 at 12:39, Michael Balzer <<a
          href="mailto:dexter@expeedo.de" moz-do-not-send="true">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" moz-do-not-send="true">https://www.telviva.co.za/<wbr>legal/email-disclaimer</a></span></font>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
  </body>
</html>