<div dir="auto"><div><div dir="ltr">Thankyou all!<div><br></div><div>I have not been idle - I've not quite moved away from the polling for receiving information.. but at least now I can clamp right down on it being used while the car is off by looking at the 12v power!</div><div dir="auto"><br></div><div dir="auto">The only code in the original  using tester present is the commands, which I am yet to try.</div><div dir="auto"><br></div></div>I will have a look at the upmiigo code. I'm not seeing multiple high levels.. But once it spikes I can poll for a bit. </div><div dir="auto"><br></div><div dir="auto">There is a crash that happens periodically.   It's not in my code I don't think as I have put a debug on all functions in the directory that logs if it isn't 'disarmed'.  Not for production, but useful. </div><div dir="auto"><br></div><div dir="auto">I guess once I have a GPS aerial I can use that to make sure the polling is activated on movement! I'm guessing it has to be significant to avoid inaccuracies of GPS triggering it. </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Michael </div><div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Wed, 28 Sept 2022 at 14:21, Michael Balzer <<a href="mailto:dexter@expeedo.de" target="_blank" rel="noreferrer">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>
    Cars now often do not provide live process data frames on the OBD
    port's primary CAN. You may have an auxiliary CAN bus there, e.g.
    for infotainment communication, that may provide live frames. But
    you may not be able to detect a charge session from these.<br>
    <br>
    A very simple approach is to monitor the 12V level. For example on
    the UpMiiGo, if it rises to around 13V the car is recharging the 12V
    battery, if it goes to 14V or higher, it's fully awake for a drive
    or charge session. We used that approach until I found PIDs we can
    poll without keeping the car awake.<br>
    <br>
    If you didn't do so yet, try polling without a tester presence or
    diag session.<br>
    <br>
    Also try polling low priority / auxiliary PIDs instead of the actual
    status PIDs, i.e. PIDs that do not carry crucial system state data.<br>
    <br>
    You may also need to keep the polling frequency below some threshold
    to avoid the keep-alive trigger.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div>Am 28.09.22 um 06:15 schrieb Timo
      Penttilä:<br>
    </div>
    <blockquote type="cite">
      
      
      
      <div>
        <p class="MsoNormal"><span>Hi
            Michael.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Back when I had a Kia Niro I did some
            measurements on power draw.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">It’s not the poll itself that causes the power
            drain, it prevents the car from going to deep sleep. So I
            don’t think polling less frequently will have much effect. I
            didn’t find any way on the Kia to detect if it’s on without
            additional hardware involved, e.g. to check if there was
            power on the radio fuse.
            <u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/275" target="_blank" rel="noreferrer">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/275</a><u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><b><span style="font-size:10pt;font-family:Verdana,sans-serif;color:navy" lang="EN-US">Best Regards</span></b><span style="color:black" lang="EN-US"><u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:10pt;font-family:Verdana,sans-serif;color:navy" lang="EN-US"> </span><span style="color:black" lang="EN-US"><u></u><u></u></span></p>
        <p class="MsoNormal"><b><span style="font-size:10pt;font-family:Verdana,sans-serif;color:black">TIMO
              PENTTILÄ</span></b><span style="color:black"><u></u><u></u></span></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal"><span><u></u> <u></u></span></p>
        <div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
          <p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> OvmsDev
              <a href="mailto:ovmsdev-bounces@lists.openvehicles.com" target="_blank" rel="noreferrer"><ovmsdev-bounces@lists.openvehicles.com></a>
              <b>On Behalf Of </b>Michael Geddes<br>
              <b>Sent:</b> den 28 september 2022 04:31<br>
              <b>To:</b> OVMS Developers
              <a href="mailto:ovmsdev@lists.openvehicles.com" target="_blank" rel="noreferrer"><ovmsdev@lists.openvehicles.com></a><br>
              <b>Subject:</b> Re: [Ovmsdev] OVMS Power Drain?<u></u><u></u></span></p>
        </div>
        <p class="MsoNormal"><u></u> <u></u></p>
        <div>
          <div>
            <div>
              <div>
                <p class="MsoNormal">Yeah, I'm beginning to see that
                  continuous polls are Bad(tm).<u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal">With my latest changes, the 2 polls
                  that are always done are for detecting On and Unlock
                  which are on different module addresses. Setting the
                  Car Type to NONE (and rebooting) certainly confirms
                  that the battery drain goes away. Crap.<u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal">Is there a better way of detecting
                  'On', 'unlock' and possibly 'alarm'? Anything else
                  could be checked much less frequently anyway.<u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal"> Maybe I could use internal battery
                  test changes to trigger checks... A bit dodgy though. <u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal">Should I expect to see _any_
                  messages floating around on the bus without being
                  requested? I'm not seeing any..  Presumably if I send
                  'Tester Present' it will keep the module powered (and
                  back to square 1), or is there some kind of bus switch
                  that is not letting me see messages? I'm coming into
                  Can messages as a complete noon. <u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><br>
                  Maybe Peter could help me on this, and we could put
                  some of my changes back to kia/Kona or the common
                  class when I'm done. <u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal">I'll certainly look at using the
                  wakeup. <u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal">BTW for  updating images I have set
                  a SSH pubkey and am using<u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal">scp <<image>> <a href="mailto:admin@ovms.lan:/sd" target="_blank" rel="noreferrer">admin@ovms.lan:/sd</a>
                  && ssh
                  <a href="mailto:admin@ovms.lan" target="_blank" rel="noreferrer">admin@ovms.lan</a>
                  "module reset" <u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal">Which works like a charm! <u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
              </div>
              <div>
                <p class="MsoNormal">Michael <u></u><u></u></p>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
                <div>
                  <div>
                    <p class="MsoNormal">On Tue, 27 Sept 2022, 3:55 pm
                      Michael Balzer, <<a href="mailto:dexter@expeedo.de" target="_blank" rel="noreferrer">dexter@expeedo.de</a>>
                      wrote:<u></u><u></u></p>
                  </div>
                  <blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
                    <div>
                      <p class="MsoNormal" style="margin-bottom:12pt">Michael,<br>
                        <br>
                        it's generally a bad idea to have polls running
                        just based on the client connection status.
                        Clients may be connected all the time, e.g. if
                        users attach some API pollers or set the App to
                        persistent background operation (which is
                        necessary for widgets or tasker scripting for
                        example).<br>
                        <br>
                        You should only enable polling when actually
                        necessary to perform some user requested action,
                        or to monitor a drive / charge session of
                        course.<br>
                        <br>
                        We've got an explicit "wakeup" command users can
                        call to tell the module to wake up the car. That
                        needs to implement some timeout to put the car
                        back to sleep if it doesn't do so by itself.<br>
                        <br>
                        Regards,<br>
                        Michael<br>
                        <br>
                        <u></u><u></u></p>
                      <div>
                        <p class="MsoNormal">Am 27.09.22 um 09:41
                          schrieb Michael Geddes:<u></u><u></u></p>
                      </div>
                      <blockquote style="margin-top:5pt;margin-bottom:5pt">
                        <div>
                          <div>
                            <p class="MsoNormal">Thanks Michael,<u></u><u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal"><u></u> <u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal">I rang the Hyundai
                              service centre, and apparently, my BMS
                              should not need any updates (build date
                              2021 vs 2020 cars with the problem
                              apparently), but I'm putting it in for a
                              checkup of the battery.  Apparently, the
                              BMS update was the subject of a recall for
                              those cars affected. I'm going to take it
                              in anyway in case.  <u></u><u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal"><u></u> <u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal">It seems, according to
                              the OVMS, that the 12V is going from 13v
                              down to 12v over about 3hours before
                              (generally) being recharged.  Looking at
                              that link you shared with me (and related
                              <a href="https://www.youtube.com/watch?v=lr3Z_z1C0Uk&t=965s" target="_blank" rel="noreferrer">https://www.youtube.com/watch?v=lr3Z_z1C0Uk&t=965s</a>),
                              it should be more like 24 hours.   It
                              still should be triggering a charge cycle
                              - and obviously in this case it seems to
                              miss one and then it just goes downhill
                              from there - so maybe the BMS still has a
                              bug; not helped by being forced to trigger
                              about 4x more frequently than normal!<u></u><u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal"><u></u> <u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal">Assuming nothing is
                              wrong with the car (which unless I install
                              some kind of external battery monitor like
                              that youtube clip), I can only assume that
                              the 3hr drain is because my Ioniq 5 module
                              is polling too much (which, seeing I
                              copied the vehicle_kianiroev/src/ as my
                              base, would mean THAT polls too much as
                              well).  I still have the  PollSetPidList()
                              called with the same data (albeit a copy)
                              as the Kia.  <u></u><u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal"><u></u> <u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal">So in drafting this
                              email I think I've hit on the problem,
                              which is when the car is off, but a V2 or
                              V3 client is connected (like the android
                              app in 'background' mode), then it uses
                              the 'Charging' pollstate element.  <u></u><u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal"><u></u> <u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal">It has {OFF, Charging,
                              ON} at the moment, which means there's
                              space for a 4th which I will assign to
                              'off, not-charging and clients
                              connected'.  I'll see what I can do to
                              drop that right down in polling frequency
                              and the number of modules being addressed.<u></u><u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal"><u></u> <u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal">At some point soon it
                              might be worth me pushing up to a fork in
                              case anybody else wants to jump in!  For
                              example, the Lock module that the kia has
                              is not present in the Australian version,
                              but I suspect US ones with key-card
                              ability might have it.<u></u><u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal"><u></u> <u></u></p>
                          </div>
                          <div>
                            <p class="MsoNormal">//.ichael<u></u><u></u></p>
                          </div>
                          <p class="MsoNormal"><u></u> <u></u></p>
                          <div>
                            <div>
                              <p class="MsoNormal">On Fri, 23 Sept 2022
                                at 17:03, Michael Balzer <<a href="mailto:dexter@expeedo.de" target="_blank" rel="noreferrer">dexter@expeedo.de</a>>
                                wrote:<u></u><u></u></p>
                            </div>
                            <blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
                              <p class="MsoNormal">Michael,<br>
                                <br>
                                while the OVMS draws some power, unless
                                you actually keep the car alive <br>
                                by polling, that's normally no issue.
                                The 12V battery will be recharged <br>
                                automatically from the main battery by
                                the car.<br>
                                <br>
                                The Ioniq 5 though has a history of
                                issues with the 12V battery. <br>
                                According to Andrew Till, a BMS update
                                has fixed his issues:<br>
                                <a href="https://www.youtube.com/watch?v=YmfkvL_O1IA" target="_blank" rel="noreferrer">https://www.youtube.com/watch?v=YmfkvL_O1IA</a><br>
                                <br>
                                Also see his previous posts on that
                                topic.<br>
                                <br>
                                Regards,<br>
                                Michael<br>
                                <br>
                                <br>
                                Am 23.09.22 um 09:55 schrieb Michael
                                Geddes:<br>
                                > Hi All,<br>
                                ><br>
                                > I have just had a bit of a painful
                                experience with my 12V being <br>
                                > drained (twice).  I'm guessing it's
                                related to OVMS, but also <br>
                                > something seems to have happened as
                                it was running file for a week!<br>
                                ><br>
                                > For some reason, the 12V battery
                                graphs aren't working in the <br>
                                > (android) App.. which means I'm not
                                quite sure of the timelines, <br>
                                > however it was most likely
                                overnight.  This morning my 12V was <br>
                                > severely depleted (like 6v!). (Oh,
                                it could be because I don't have <br>
                                > the app running in the background).<br>
                                ><br>
                                > I'm assuming it's likely not to be
                                the direct drain of the device <br>
                                > itself, but maybe something it is
                                querying on the CAN busses or <br>
                                > something that is then causing a
                                consequential power drain?<br>
                                ><br>
                                > I got road-side assist out and they
                                got me going, but then 20mins <br>
                                > later it was flat again! (I did see
                                an alert in the APP and so was <br>
                                > quick to go out, but was
                                unsuccessful in getting the car going
                                before <br>
                                > it died!).<br>
                                ><br>
                                > I'm going to unplug it and see if
                                that stops the card from dying.  <br>
                                > Also, I might leave the car on for
                                a bit longer.. but still I have <br>
                                > concerns!<br>
                                ><br>
                                > Also I haven't started using
                                'write' commands yet. Any ideas?<br>
                                ><br>
                                > //.ichael<br>
                                ><br>
                                <br>
                                -- <br>
                                Michael Balzer * Helkenberger Weg 9 *
                                D-58256 Ennepetal<br>
                                Fon 02333 / 833 5735 * Handy 0176 / 206
                                989 26<br>
                                <br>
_______________________________________________<br>
                                OvmsDev mailing list<br>
                                <a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank" rel="noreferrer">OvmsDev@lists.openvehicles.com</a><br>
                                <a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank" rel="noreferrer">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><u></u><u></u></p>
                            </blockquote>
                          </div>
                        </div>
                        <p class="MsoNormal"><u></u> <u></u></p>
                        <pre>_______________________________________________<u></u><u></u></pre>
                        <pre>OvmsDev mailing list<u></u><u></u></pre>
                        <pre><a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank" rel="noreferrer">OvmsDev@lists.openvehicles.com</a><u></u><u></u></pre>
                        <pre><a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank" rel="noreferrer">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><u></u><u></u></pre>
                      </blockquote>
                      <p class="MsoNormal"><br>
                        <br>
                        <u></u><u></u></p>
                      <pre>-- <u></u><u></u></pre>
                      <pre>Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<u></u><u></u></pre>
                      <pre>Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<u></u><u></u></pre>
                    </div>
                    <p class="MsoNormal">_______________________________________________<br>
                      OvmsDev mailing list<br>
                      <a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank" rel="noreferrer">OvmsDev@lists.openvehicles.com</a><br>
                      <a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank" rel="noreferrer">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><u></u><u></u></p>
                  </blockquote>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
OvmsDev mailing list
<a href="mailto:OvmsDev@lists.openvehicles.com" target="_blank" rel="noreferrer">OvmsDev@lists.openvehicles.com</a>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" target="_blank" rel="noreferrer">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" rel="noreferrer">OvmsDev@lists.openvehicles.com</a><br>
<a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" rel="noreferrer noreferrer" target="_blank">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br>
</blockquote></div>
</div></div>