HiI tried the "can can2 start active 500000” command.The first time it stopped again almost instant.The second time it worked for a minute.I got two different error flags:CAN: can2Mode: ActiveSpeed: 500000Interrupts: 16480Rx pkt: 16643Rx err: 0Rx ovrflw: 37Tx pkt: 231Tx delays: 0Tx err: 128Tx ovrflw: 0Err flags: 0x8015CAN: can2Mode: ActiveSpeed: 500000Interrupts: 9164Rx pkt: 9230Rx err: 0Rx ovrflw: 17Tx pkt: 25Tx delays: 0Tx err: 0Tx ovrflw: 0Err flags: 0x2040Regards,Stein Arne SordalOn 16 Aug 2018, at 13:05, Mark Webb-Johnson <mark@webb-johnson.net> wrote:The mcp2515 issues are probably different than esp32can, but similar logic can probably be used to address them both._______________________________________________After a week in my car with three buses running, can2 locked up today. Here is the status:OVMS# can can2 statusCAN: can2Mode: ActiveSpeed: 500000Interrupts: 40069Rx pkt: 40429Rx err: 0Rx ovrflw: 0Tx pkt: 0Tx delays: 0Tx err: 0Tx ovrflw: 0Err flags: 0x01000001OVMS# can can3 statusCAN: can3Mode: ActiveSpeed: 125000Interrupts: 5003600Rx pkt: 5003610Rx err: 0Rx ovrflw: 0Tx pkt: 0Tx delays: 0Tx err: 0Tx ovrflw: 0Err flags: 0x01000001CAN3 was operating normally. Flags identical.I fixed this with:OVMS# can can2 start active 500000Can bus can2 started in mode active at speed 500000bpsOVMS# can can2 statusCAN: can2Mode: ActiveSpeed: 500000Interrupts: 831Rx pkt: 831Rx err: 0Rx ovrflw: 0Tx pkt: 0Tx delays: 0Tx err: 0Tx ovrflw: 0Err flags: 0x01000001No need to power on/off.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.Regards, Mark.On 16 Aug 2018, at 4:58 PM, Tom Parker <tom@carrott.org> wrote:_______________________________________________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?
On 16/08/18 01:46, Mark Webb-Johnson wrote:
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.
On 15 Aug 2018, at 9:45 PM, Mark Webb-Johnson <mark@webb-johnson.net> wrote:
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?
When this happens, do we need to power off then on the can bus, or is a ‘can canX stop’ ‘can canX start …’ sufficient?
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?
Regards, Mark.
OvmsDev mailing list
OvmsDev@lists.openvehicles.com
http://lists.openvehicles.com/mailman/listinfo/ovmsdev
OvmsDev mailing list
OvmsDev@lists.openvehicles.com
http://lists.openvehicles.com/mailman/listinfo/ovmsdev
_______________________________________________
OvmsDev mailing list
OvmsDev@lists.openvehicles.com
http://lists.openvehicles.com/mailman/listinfo/ovmsdev