CANopenNode / CANopenLinux

CANopenNode on Linux devices
Apache License 2.0
111 stars 51 forks source link

Why does CPU% increase significantly once the CAN bus is physically disconnected? #13

Open rpereira-FS opened 1 year ago

rpereira-FS commented 1 year ago

Hello!

I implemented the CANopen project, canopend, into my controller and am able to use it just fine with I/O modules through the CAN bus. When I physically disconnect the CAN bus from my controller, however, I notice the CPU% of the canopend command in linux shoots up to 5-6x from what is was before.

When the CAN bus is disconnected, I see these log messages from the canopend: (CO_CANsend) Transmitting CAN msg OID 0x202 failed(can0) ...and it persists until I reconnect the CANbus back into the controller. I found

My best guess for the CPU% increase at this moment is that canopend sees that there is no CAN bus and it is stuck on a cycle where it keeps retrying often, and maybe that's whats taking up the extra CPU? Is there any setting in the stack that I can set in order to mitigate this?

Any insight/direction on this would be much appreciated, thank you!

CANopenNode commented 1 year ago

You are right. Actually there is missing detection of disconnected CAN bus or disconnected adapter. Not yet implemented.