<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Chris,<br>
    <br>
    <blockquote type="cite">
      <blockquote type="cite">The best option to capture anything going
        on with the bus over the night is activating an unfiltered can
        log to the SD card. </blockquote>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">Do you
        mean setting the global log level to verbose?</div>
    </blockquote>
    <br>
    No, I mean activating a CAN logger. You can simply start one on the
    monitor channel, which outputs the CAN log to the system log:<br>
    <br>
    <font face="monospace">OVMS# log level verbose canlog-monitor<br>
      OVMS# can log start monitor crtd</font><br>
    <br>
    For more info on CAN logging, see the user guide:
    <a class="moz-txt-link-freetext" href="https://docs.openvehicles.com/en/latest/crtd/can_logging.html">https://docs.openvehicles.com/en/latest/crtd/can_logging.html</a><br>
    <br>
    I've now added output of the TX queue fill level to the CAN status
    outputs, that should help identifying the effect. Hint: you can use
    "git pull --rebase --autostash" to merge this with your local
    changes.<br>
    <br>
    On my UpMiiGo (which switches off the bus), the ESP32CAN most of the
    time recognizes an immediate failure for a TX with the vehicle being
    off. That means the TX buffer (in the controller) gets cleared
    immediately, with an immediate "TX_Fail" result for the frame.
    Ideally that would be the case always while the bus is off.<br>
    <br>
    But the ESP32CAN controller sometimes tries to send the frame,
    waiting for an ack, repeating the transmission and then ending up in
    the frame being stuck in the TX buffer. Then the TX queue (software)
    gets filled with the status ping request frame from there, up to the
    30 frames capacity of the TX queue, then counting TX overflows.<br>
    <br>
    This continues until the ESP32CAN, due to unknown reasons, thinks it
    could send the frame. The TX queue then gets flushed immediately,
    with the frames appearing as being sent successfully (although there
    is no ECU active, the bus is still off).<br>
    <br>
    After the queue has been cleared, this loop starts over.<br>
    <br>
    So it may happen, that the TX queue gets filled, and the ESP32CAN
    thinks it can send frames, even while the bus is shut off.<br>
    <br>
    Reading the Leaf code, I don't see any regular status ping polling,
    but it may still be, the Leaf queued some TX packets just before
    switching off the vehicle. Those would stick in the queue until the
    ESP32CAN enters the state described above, so actually tries to send
    the frames queued.<br>
    <br>
    You should be able to determine if that's the case from the TX fill
    level being logged & displayed in the status output.<br>
    <br>
    Regards,<br>
    Michael<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 28.01.25 um 00:20 schrieb Chris Box:<br>
    </div>
    <blockquote type="cite"
cite="mid:010b0194aa10b865-c72079a9-11b9-4628-84b3-05ea95e329c2-000000@eu-west-2.amazonses.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <p id="reply-intro">On 2025-01-27 21:50, Michael Balzer via
        OvmsDev wrote:</p>
      <blockquote type="cite"
style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
        <div class="pre"
          style="margin: 0; padding: 0; font-family: monospace">
          <blockquote type="cite"
style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">0x8048d9
            was logged twice last night while parked and locked, with
            nothing going on</blockquote>
          <br>
          So please verify there really was nothing going on. Maybe you
          didn't see the vehicle was actually active due to reduced log
          levels or missing log entries in the leaf code?</div>
        <div class="pre"
          style="margin: 0; padding: 0; font-family: monospace"> </div>
      </blockquote>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">Logging to
        SD card was globally at info level, except with debug for can,
        esp32can, mcp2515 & events. Here's all I saw:</div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">
        <p>2025-01-26 19:56:25.997 GMT I (92702057) housekeeping:
          2025-01-26 19:56:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285676)<br>
          2025-01-26 20:01:25.997 GMT I (93002057) housekeeping:
          2025-01-26 20:01:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285644)<br>
          2025-01-26 20:03:57.337 GMT E (93153387) can: can1:
          intr=4800273 rxpkt=4799065 txpkt=900 errflags=0x8048d9 rxerr=0
          txerr=128 rxinval=0 rxovr=5 txovr=0 txdelay=51 txfail=281
          wdgreset=0 errreset=0<br>
          2025-01-26 20:03:58.337 GMT E (93154387) can: can1:
          intr=4800319 rxpkt=4799065 txpkt=901 errflags=0x8048d9 rxerr=0
          txerr=135 rxinval=0 rxovr=5 txovr=0 txdelay=51 txfail=282
          wdgreset=0 errreset=0<br>
          2025-01-26 20:06:05.337 GMT E (93281387) can: can1:
          intr=4800334 rxpkt=4799065 txpkt=902 errflags=0x8048d9 rxerr=0
          txerr=134 rxinval=0 rxovr=5 txovr=0 txdelay=51 txfail=289
          wdgreset=0 errreset=0<br>
          2025-01-26 20:06:26.007 GMT I (93302057) housekeeping:
          2025-01-26 20:06:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285676)<br>
          2025-01-26 20:11:25.997 GMT I (93602057) housekeeping:
          2025-01-26 20:11:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285612)</p>
      </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">
        <p>2025-01-26 23:16:26.017 GMT I (104702057) housekeeping:
          2025-01-26 23:16:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285488)<br>
          2025-01-26 23:21:26.017 GMT I (105002057) housekeeping:
          2025-01-26 23:21:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285456)<br>
          2025-01-26 23:23:04.347 GMT E (105100387) can: can1:
          intr=4801533 rxpkt=4799065 txpkt=903 errflags=0x8048d9 rxerr=0
          txerr=131 rxinval=0 rxovr=5 txovr=0 txdelay=51 txfail=888
          wdgreset=0 errreset=0<br>
          2025-01-26 23:26:26.017 GMT I (105302057) housekeeping:
          2025-01-26 23:26:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285488)<br>
          2025-01-26 23:31:26.017 GMT I (105602057) housekeeping:
          2025-01-26 23:31:25 GMT (RAM: 8b=79720-82596 32b=12560
          SPI=3263128-3285456)</p>
      </div>
      <blockquote type="cite"
style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
        <div class="pre"
          style="margin: 0; padding: 0; font-family: monospace"><br>
          The best option to capture anything going on with the bus over
          the night is activating an unfiltered can log to the SD card.</div>
      </blockquote>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">Do you
        mean setting the global log level to verbose?</div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <blockquote type="cite"
style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
        <div class="pre"
          style="margin: 0; padding: 0; font-family: monospace">The
          normal behaviour of a parked car is doing 12V battery
          maintenance every few hours, i.e. topping up the 12V battery
          from the main battery. That will normally also cause a limited
          CAN wakeup of the ECUs taking part in that process.</div>
      </blockquote>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">With the
        MQTT metrics I observe c<span style="font-size: 10pt;">harging
          of 12V ceased at 18:40. The battery</span><span
          style="font-size: 10pt;"> then went into gradual decline
          starting at 12.8V until it reached 12.4V the next morning.</span></div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <blockquote type="cite"
style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
        <div class="pre"
          style="margin: 0; padding: 0; font-family: monospace">Another
          option is some plugin or script doing a wakeup to query
          values.</div>
      </blockquote>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">The only
        activity I have is an MQTT idle update interval of 10 minutes.
        Overnight this just sends things like free memory, 12V voltage
        and signal strength.</div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <blockquote type="cite"
style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
        <div class="pre"
          style="margin: 0; padding: 0; font-family: monospace">As you
          don't see any issues yet, proceed with both buses active to
          see if the new timing solved that.</div>
      </blockquote>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace"> </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">Both buses
        now set to active.<br>
        <br>
      </div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">Thanks</div>
      <div class="pre"
        style="margin: 0; padding: 0; font-family: monospace">Chris</div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Michael Balzer * Am Rahmen 5 * D-58313 Herdecke
Fon 02330 9104094 * Handy 0176 20698926</pre>
  </body>
</html>