<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <br>
    <div class="moz-cite-prefix">Am 08.08.20 um 20:23 schrieb Soko:<br>
    </div>
    <blockquote type="cite"
      cite="mid:E2958E56-A85F-4EED-95AB-F94201157640@soko.cc">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      OK, thanks heaps. Just to clarify: So if I know my session code I
      replace your 0xC0 with it, correct?<br>
    </blockquote>
    Yes.<br>
    <br>
    <blockquote type="cite"
      cite="mid:E2958E56-A85F-4EED-95AB-F94201157640@soko.cc">Is this
      session code global for all ECUs and static? The wiki link for UDS
      speaks about different sessions...<br>
    </blockquote>
    Yes and no. There are standard codes, but they need not apply. See
    the PDF I sent you on diagnostic sessions.<br>
    <br>
    <blockquote type="cite"
      cite="mid:E2958E56-A85F-4EED-95AB-F94201157640@soko.cc">Does this
      one source code line also take care about the "tester present"
      message?<br>
    </blockquote>
    Yes. You either do a login and keep that active by sending "tester
    presence", or repeat the login. See the PDF I sent you on tester
    presence.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <blockquote type="cite"
      cite="mid:E2958E56-A85F-4EED-95AB-F94201157640@soko.cc"><br>
      Your pacience with me is highly appreciated :)<br>
      Soko<br>
      <br>
      <div class="gmail_quote">On 8 August 2020 19:47:45 CEST, Michael
        Balzer <a class="moz-txt-link-rfc2396E" href="mailto:dexter@expeedo.de"><dexter@expeedo.de></a> wrote:
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;"> Soko,<br>
          <br>
          <a
href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/rt_obd2.cpp#L64"
            moz-do-not-send="true">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/blob/master/vehicle/OVMS.V3/components/vehicle_renaulttwizy/src/rt_obd2.cpp#L64</a><br>
          <br>
          as simple as that. But you need to know the session code you
          need to use for the gateway. 0xC0 is in the manufacturer
          specific range.<br>
          <br>
          I would test the gateway behaviour using manual CAN commands,
          a script or a web plugin. That way you're much more flexible.<br>
          <br>
          Regards,<br>
          Michael<br>
          <br>
          <br>
          <div class="moz-cite-prefix">Am 08.08.20 um 19:09 schrieb
            Soko:<br>
          </div>
          <blockquote type="cite"
            cite="mid:7BA1641E-5CF6-48DE-AF69-C2173C7764A8@soko.cc">
            <meta http-equiv="Content-Type" content="text/html;
              charset=UTF-8">
            Hmmm... ok lets forget the 2nd log and talk about the first
            one. <br>
            It must somehow be related to OVMS though as the replies get
            in immediately I swap the poll states. If I change the
            threshold from 5 secs to 3 or to 6 its always the same: once
            the poll state swaps the replies come in. So it must be
            related to the poll stat switch. The canlog shows all polls
            look the same... so the gateway must get confused every time
            exactly when the threshold*4 is over?<br>
            Hmmm... or maybe the gateway gets confused after a certain
            number of polls. So the threshold doesnt matter. <br>
            When I change the factor 4 to i.e. 6 I could validate this
            hypothesis. <br>
            <br>
            Havent had time for session implementation yet. <br>
            Is there a OVMS framework for a tester session? Or at least
            a vehicle implementation which does it?<br>
            <br>
            <div class="gmail_quote">On 8 August 2020 16:58:25 CEST,
              Michael Balzer <a class="moz-txt-link-rfc2396E"
                href="mailto:dexter@expeedo.de" moz-do-not-send="true"><dexter@expeedo.de></a>
              wrote:
              <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
                0.8ex; border-left: 1px solid rgb(204, 204, 204);
                padding-left: 1ex;"> Soko,<br>
                <br>
                lines 33 and 34 of your second log are due to the CAN TX
                buffer, which seems to have held back the frame until
                the bus became available.<br>
                <br>
                Besides that, I don't see an RX in that log after
                switching the polling state. So I assume the RX in your
                first log also isn't related to the poll state switch.<br>
                <br>
                There is an RX buffer, but that's just the internal
                queue of the vehicle CAN listener task. There is no
                delay on the processing unless you block the task
                somehow, for example by doing long term loops /
                communication in that context (which you shouldn't do).<br>
                <br>
                You still don't send a session login or tester presence,
                so maybe the gateway is simply confused by the requests,
                runs into some timeout, then restarts… something like
                that.<br>
                <br>
                Regards,<br>
                Michael<br>
                <br>
                <br>
                <div class="moz-cite-prefix">Am 08.08.20 um 13:20
                  schrieb Soko:<br>
                </div>
                <blockquote type="cite"
                  cite="mid:c56a0372-6676-fc0c-5276-00789bcb1b53@soko.cc">
                  <meta http-equiv="Content-Type" content="text/html;
                    charset=UTF-8">
                  <p>Soooo....</p>
                  <p>I've finally found time to test this again.</p>
                  <p>Basically the same behaviour as described below.</p>
                  <p><b>VWUP_OFF_TICKER_THRESHOLD 5 with 4 trys.log</b><br>
                    Car was locked initially. Unlocked the car before
                    line 21 (around time mark 60.000). Locked around
                    time mark 80.000. Car stayed responsive until line
                    108 (time mark 100.000).<br>
                    At line 130 (tm=116.814) I swap back to PollState=0.
                    The poll for PollState=0 gets an immediate reply
                    (line 131-133) and therefore I swap back to
                    PollState=1.<br>
                    The weird thing is that line 132 (which got a reply)
                    is exactly the same as 126 (or 118 or 110) which
                    didn't get a reply!?!? So the car has no idea of the
                    poll states as the data is the same? There must be
                    some issue/bug/behavior inside OVMS (maybe even in
                    the hardware buffer) which gets triggered by a
                    PollState change. Or the canlog-monitor uses somehow
                    a cache and doesn't show the messages immediately.</p>
                  <p><b>VWUP_OFF_TICKER_THRESHOLD 10 with 4 trys.log</b><br>
                    Same as below. One thing I've noticed though: Car
                    was locked until line 32 (tm=63.814). Then I've
                    unlocked it and the lines 33 and 34 showed up
                    immediately. This indicates a buffer/cache/etc.
                    issue with the canlog-monitor as well (imho).<br>
                  </p>
                  <p>Soko<br>
                  </p>
                  <div class="moz-cite-prefix">On 03.08.2020 13:10,
                    Michael Balzer wrote:<br>
                  </div>
                  <blockquote type="cite"
                    cite="mid:45e39eb9-c5eb-9a77-0d53-df8352c65270@expeedo.de">
                    <meta http-equiv="Content-Type" content="text/html;
                      charset=UTF-8">
                    Soko,<br>
                    <br>
                    I don't see any obvious mistakes on a first check.<br>
                    <br>
                    Please do the tests again with CAN monitoring, so we
                    can see what's actually going on on the bus.<br>
                    <br>
                    An OBD device normally logs into the device sending
                    a UDS diag session command (0x10), then keeps that
                    session alive by sending tester present (0x3E) evers
                    30-60 seconds. See the UDS documentation I sent you,
                    or for an overview, see <a
                      href="https://de.wikipedia.org/wiki/Unified_Diagnostic_Services"
                      moz-do-not-send="true">https://de.wikipedia.org/wiki/Unified_Diagnostic_Services</a><br>
                    <br>
                    You should be able to get the session type and
                    protocol by logging what your VCDS does on the bus.<br>
                    <br>
                    Regards,<br>
                    Michael<br>
                    <br>
                    <br>
                    <div class="moz-cite-prefix">Am 03.08.20 um 06:19
                      schrieb Soko:<br>
                    </div>
                    <blockquote type="cite"
                      cite="mid:ce92b6a4-35ed-83c0-f753-0043fc82dfbe@soko.cc">
                      <meta http-equiv="Content-Type"
                        content="text/html; charset=UTF-8">
                      <p>Mornin,</p>
                      <p>Source is here: <a
                          class="moz-txt-link-freetext"
href="https://github.com/devmarxx/Open-Vehicle-Monitoring-System-3/tree/master/vehicle/OVMS.V3/components/vehicle_vweup/src"
                          moz-do-not-send="true">https://github.com/devmarxx/Open-Vehicle-Monitoring-System-3/tree/master/vehicle/OVMS.V3/components/vehicle_vweup/src</a></p>
                      <p>Attached are two logs. I haven't had the
                        can-monitor active unfortuantely..</p>
                      <p><b>VWUP_OFF_TICKER_THRESHOLD 5 with 4 trys.log</b><br>
                        As the name says it polls every 5 seconds in
                        PollState=1 and swaps back to PollState=0 after
                        5*4=20 seconds.<br>
                        Until line 35 you see the CAN errors as the
                        vehicle is OFF. Then I unlocked the car and in
                        line 38 I get the first reply.<br>
                        Around line 90 I locked the car again. It polls,
                        but gets no reply, <u>but not error either</u>
                        (?!).<br>
                        Line 118 sets the PollState=0 and suddenly a
                        response comes in. So in Line 123 I set the
                        PollState=1 again.<br>
                        The the game starts again: Polls get send, no
                        reply but no error either. After 21
                        CarOffTickers I switch to PollState=0 and
                        suddenly a reply comes in...</p>
                      <p><b>VWUP_OFF_TICKER_THRESHOLD 10 with 4 trys.log<br>
                        </b>Here I unlocked at line 57 and locked around
                        line 100. After that polls get send, no reply, <u>but
                          errors happen</u>. And the car is finally off.<br>
                        Although I've tried the same thing later that
                        day and the car didn't even go to sleep with
                        Threshold=30!?!? So the behavior is not 100%
                        reproducible (yet)...<br>
                      </p>
                      <p>@gateway throttling: In VCDS (which - hopefully
                        - does only polling too) I have a little number
                        showing me the refresh rates of the values. It
                        indicates ~8 refreshes per second. So with 1
                        second shouldn't be any throttling.</p>
                      <p>@OBD "tester": I have no clue what this is ;)
                        So if the polling framework doesn't do it, I
                        don't do it. All I do is in the obd_eup.* files.</p>
                      <p>Soko<br>
                      </p>
                      <div class="moz-cite-prefix">On 02.08.2020 20:12,
                        Michael Balzer wrote:<br>
                      </div>
                      <blockquote type="cite"
                        cite="mid:e90a5b00-7b54-e83b-99d7-0725b4f7ad53@expeedo.de">
                        <meta http-equiv="Content-Type"
                          content="text/html; charset=UTF-8">
                        Soko,<br>
                        <br>
                        polling may keep the car awake, that's also an
                        issue on the Kia e-Niro IIRC.<br>
                        <br>
                        Changing the PollState can only affect the car
                        indirectly via the changed polls. Maybe you
                        could add your code & a log?<br>
                        <br>
                        Regarding the poll replies stopping, is that
                        also reflected in a CAN log? Maybe the OBD
                        gateway throttles if it sees too many requests?
                        (Hopefully not…)<br>
                        <br>
                        If the gateway does throttling: do you login to
                        the OBD as a "tester" and keep the session
                        active by periodically sending the "tester
                        present" frame?<br>
                        <br>
                        Regards,<br>
                        Michael<br>
                        <br>
                        <br>
                        <div class="moz-cite-prefix">Am 02.08.20 um
                          19:30 schrieb Soko:<br>
                        </div>
                        <blockquote type="cite"
                          cite="mid:e62d94b7-82c2-370f-53cd-fa5e7a60ddaf@soko.cc">
                          <meta http-equiv="Content-Type"
                            content="text/html; charset=UTF-8">
                          <p>Heya again,</p>
                          <p>I'm trying to develop a detection for when
                            the car is off/locked but I'm encountering a
                            weird phenomena:</p>
                          <ul>
                            <li>Car is shut down and locked</li>
                            <li>OVMS connected</li>
                            <li>CAN poll for voltage (only one poll
                              value active) with 30 secs fails with
                              error (so far nothing weird)</li>
                            <li>Unlock the car via car-key remote</li>
                            <li>Poll succeeds and I'm switching from
                              PollState=0 to PollState=1 where I poll
                              every 2 secs</li>
                            <li>Lock the car via car-key remote</li>
                            <li><u>After 1 hour the polls still work and
                                the car is active</u></li>
                          </ul>
                          <p>Is something like this known from other
                            vehicles? So basically my car never shuts
                            down :(</p>
                          <p>Another secondary weird thing:<br>
                            When increasing the time to 5 secs for
                            PollState=1 the polls get no reply and after
                            20 secs I swap back to PollState=0.<br>
                            BUT the second the PollState changes the car
                            replies again...<br>
                            Even more weirdness: When PollState=1 time
                            is 10 secs and I swap back to Pollstate=0
                            after 40 secs the same thing happens!
                            Immediately I swap to PollState=0 the car
                            replies again.<br>
                            As if the PollState switching somehow wakes
                            the car up??!</p>
                          <p>Any ideas?</p>
                          <p>Soko<br>
                          </p>
                          <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" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">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>
                        <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" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
                      </blockquote>
                      <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" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">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>
                    <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" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
                  </blockquote>
                  <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" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">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>
              </blockquote>
            </div>
            <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" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">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>
        </blockquote>
      </div>
      <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>