<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="">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><br class=""></div><div>CAN3 was operating normally. Flags identical.</div><div><br class=""></div><div>I fixed this with:</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div><div><font face="Andale Mono" class="">OVMS# can can2 start active 500000</font></div><div><font face="Andale Mono" class="">Can bus can2 started in mode active at speed 500000bps</font></div><div><font face="Andale Mono" class=""><br class=""></font></div><div><font face="Andale Mono" class="">OVMS# can can2 status</font></div><div><font face="Andale Mono" class="">CAN: can2</font></div><div><font face="Andale Mono" class="">Mode: Active</font></div><div><font face="Andale Mono" class="">Speed: 500000</font></div><div><font face="Andale Mono" class="">Interrupts: 831</font></div><div><font face="Andale Mono" class="">Rx pkt: 831</font></div><div><font face="Andale Mono" class="">Rx err: 0</font></div><div><font face="Andale Mono" class="">Rx ovrflw: 0</font></div><div><font face="Andale Mono" class="">Tx pkt: 0</font></div><div><font face="Andale Mono" class="">Tx delays: 0</font></div><div><font face="Andale Mono" class="">Tx err: 0</font></div><div><font face="Andale Mono" class="">Tx ovrflw: 0</font></div><div><font face="Andale Mono" class="">Err flags: 0x01000001</font></div></div></div></blockquote><div class=""><div><br class=""></div><div>No need to power on/off.</div><div><br class=""></div><div>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><br class=""></div><div>Regards, Mark.</div><div><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="">http://lists.openvehicles.com/mailman/listinfo/ovmsdev<br class=""></div></blockquote></div><br class=""></div></body></html>