<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi<div class=""><br class=""></div><div class="">I tried the "can can2 start active 500000” command.</div><div class="">The first time it stopped again almost instant.</div><div class="">The second time it worked for a minute.</div><div class=""><br class=""></div><div class="">I got two different error flags:</div><div class=""><br class=""></div><div class=""><div class="">CAN:       can2</div><div class="">Mode:      Active</div><div class="">Speed:     500000</div><div class="">Interrupts:               16480</div><div class="">Rx pkt:                   16643</div><div class="">Rx err:                       0</div><div class="">Rx ovrflw:                   37</div><div class="">Tx pkt:                     231</div><div class="">Tx delays:                    0</div><div class="">Tx err:                     128</div><div class="">Tx ovrflw:                    0</div><div class="">Err flags: 0x8015</div></div><div class=""><br class=""></div><div class=""><div class="">CAN:       can2</div><div class="">Mode:      Active</div><div class="">Speed:     500000</div><div class="">Interrupts:                9164</div><div class="">Rx pkt:                    9230</div><div class="">Rx err:                       0</div><div class="">Rx ovrflw:                   17</div><div class="">Tx pkt:                      25</div><div class="">Tx delays:                    0</div><div class="">Tx err:                       0</div><div class="">Tx ovrflw:                    0</div><div class="">Err flags: 0x2040</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Stein Arne Sordal</div><div class=""><br class=""></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 16 Aug 2018, at 13:05, Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" class="">mark@webb-johnson.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">The mcp2515 issues are probably different than esp32can, but similar logic can probably be used to address them both.<div class=""><br class=""></div><div class="">After a week in my car with three buses running, can2 locked up today. Here is the status:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Andale Mono" class="">OVMS# can can2 status</font></div><div class=""><font face="Andale Mono" class="">CAN:       can2</font></div><div class=""><font face="Andale Mono" class="">Mode:      Active</font></div><div class=""><font face="Andale Mono" class="">Speed:     500000</font></div><div class=""><font face="Andale Mono" class="">Interrupts:               40069</font></div><div class=""><font face="Andale Mono" class="">Rx pkt:                   40429</font></div><div class=""><font face="Andale Mono" class="">Rx err:                       0</font></div><div class=""><font face="Andale Mono" class="">Rx ovrflw:                    0</font></div><div class=""><font face="Andale Mono" class="">Tx pkt:                       0</font></div><div class=""><font face="Andale Mono" class="">Tx delays:                    0</font></div><div class=""><font face="Andale Mono" class="">Tx err:                       0</font></div><div class=""><font face="Andale Mono" class="">Tx ovrflw:                    0</font></div><div class=""><font face="Andale Mono" class="">Err flags: 0x01000001</font></div></div><div class=""><font face="Andale Mono" class=""><br class=""></font></div><div class=""><div class=""><font face="Andale Mono" class="">OVMS# can can3 status</font></div><div class=""><font face="Andale Mono" class="">CAN:       can3</font></div><div class=""><font face="Andale Mono" class="">Mode:      Active</font></div><div class=""><font face="Andale Mono" class="">Speed:     125000</font></div><div class=""><font face="Andale Mono" class="">Interrupts:             5003600</font></div><div class=""><font face="Andale Mono" class="">Rx pkt:                 5003610</font></div><div class=""><font face="Andale Mono" class="">Rx err:                       0</font></div><div class=""><font face="Andale Mono" class="">Rx ovrflw:                    0</font></div><div class=""><font face="Andale Mono" class="">Tx pkt:                       0</font></div><div class=""><font face="Andale Mono" class="">Tx delays:                    0</font></div><div class=""><font face="Andale Mono" class="">Tx err:                       0</font></div><div class=""><font face="Andale Mono" class="">Tx ovrflw:                    0</font></div><div class=""><font face="Andale Mono" class="">Err flags: 0x01000001</font></div></div></blockquote><div class=""><div class=""><br class=""></div><div class="">CAN3 was operating normally. Flags identical.</div><div class=""><br class=""></div><div class="">I fixed this with:</div><div class=""><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><div class=""><font face="Andale Mono" class="">OVMS# can can2 start active 500000</font></div><div class=""><font face="Andale Mono" class="">Can bus can2 started in mode active at speed 500000bps</font></div><div class=""><font face="Andale Mono" class=""><br class=""></font></div><div class=""><font face="Andale Mono" class="">OVMS# can can2 status</font></div><div class=""><font face="Andale Mono" class="">CAN:       can2</font></div><div class=""><font face="Andale Mono" class="">Mode:      Active</font></div><div class=""><font face="Andale Mono" class="">Speed:     500000</font></div><div class=""><font face="Andale Mono" class="">Interrupts:                 831</font></div><div class=""><font face="Andale Mono" class="">Rx pkt:                     831</font></div><div class=""><font face="Andale Mono" class="">Rx err:                       0</font></div><div class=""><font face="Andale Mono" class="">Rx ovrflw:                    0</font></div><div class=""><font face="Andale Mono" class="">Tx pkt:                       0</font></div><div class=""><font face="Andale Mono" class="">Tx delays:                    0</font></div><div class=""><font face="Andale Mono" class="">Tx err:                       0</font></div><div class=""><font face="Andale Mono" class="">Tx ovrflw:                    0</font></div><div class=""><font face="Andale Mono" class="">Err flags: 0x01000001</font></div></div></div></blockquote><div class=""><div class=""><br class=""></div><div class="">No need to power on/off.</div><div class=""><br class=""></div><div class="">For mcp2515, I’ll try to add a ‘kick’ function able to try to read the status registers and restart as appropriate. That should give us more information.</div><div class=""><br class=""></div><div class="">Regards, Mark.</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 16 Aug 2018, at 4:58 PM, Tom Parker <<a href="mailto:tom@carrott.org" class="">tom@carrott.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
  
  <div text="#000000" bgcolor="#FFFFFF" class=""><p class="">On my Leaf the bus seems to stop quite often, so the reset would
      have to operate quite often too. Perhaps increment a metric when
      the reset fires so we can monitor how often it is happening?<br class="">
    </p>
    <br class="">
    <div class="moz-cite-prefix">On 16/08/18 01:46, Mark Webb-Johnson
      wrote:<br class="">
    </div>
    <blockquote type="cite" cite="mid:70C03BEE-CA3B-43D4-8283-816DD46F64DE@webb-johnson.net" class="">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
      Sorry, forgot to mention: another option is to poll the bus
      manually if an interrupt hasn’t been received in N seconds. Check
      the status registers and if everything is not perfect then reset
      the controller.<br class="">
      <div class=""><br class="">
        <blockquote type="cite" class="">
          <div class="">On 15 Aug 2018, at 9:45 PM, Mark Webb-Johnson
            <<a href="mailto:mark@webb-johnson.net" class="" moz-do-not-send="true">mark@webb-johnson.net</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <div class="">
            <meta http-equiv="Content-Type" content="text/html;
              charset=utf-8" class="">
            <div style="word-wrap: break-word; -webkit-nbsp-mode: space;
              line-break: after-white-space;" class="">This was my worry
              for both esp32 can and mcp2515. We get an interrupt, but
              for some reason the status is not showing anything to do,
              so we return from the interrupt. Then, the status changes.
              Or, for a particular status we had to do something that we
              didn’t. The bus is locked up, and the interrupt never
              fires again, so we never get called. I wonder if we just
              fired the interrupt handler again manually, would it
              recover?
              <div class=""><br class="">
              </div>
              <div class="">When this happens, do we need to power off
                then on the can bus, or is a ‘can canX stop’ ‘can canX
                start …’ sufficient?</div>
              <div class=""><br class="">
              </div>
              <div class="">Perhaps a general solution would be a
                watchdog. If the CAN bus does not receive anything for N
                seconds (perhaps 60), then restart the controller? We
                could simply protect it from restarting twice (a simple
                check of the counters), so worse case this would restart
                once 60 seconds after a bus normally went idle. Or is
                that too kludgy?</div>
              <div class=""><br class="">
              </div>
              <div class="">Regards, Mark.<br class="">
              </div>
            </div>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br class="">
  </div>

_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class=""><a href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br class=""></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.openvehicles.com" class="">OvmsDev@lists.openvehicles.com</a><br class="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></blockquote></div><br class=""></div></body></html>