My apologies if this is the wrong stack website for this question.
We plan to use a BeagleBone Black as the control computer for an electric car. The BBB handles, among other things, communicating with the motor controllers over the CAN protocol (using can-utils).
Installation (according to a number of online guides) seemed to be going well (device tree setup, modprobe, etc), with no errors, until we actually plugged into the motor controllers… and nothing happened.
We hooked up an oscilloscope (to both the TX and RX wires on the BBB) and watched the execution of the following commands:
ifconfig can0 down
ifconfig can0 up
cansend can0 180#1234
which should send data along the bus. The oscilloscope showed the following (RX on top, TX on bottom), every time we executed the commands above.
I suspect this signal we were seeing is some sort of handshake which was not being answered.
(Note that if we tried to run cansend
again, nothing would happen until we ran ifconifg down/up
).
After many such execution cycles, interestingly, ifconfig
reported that the RX bytes had been increased, even though nothing had been received, only sent.
A few days later, with an identical setup, the CAN bus is still not working, and we are not seeing the handshake signal on the oscilloscope. ifconfig
reports dropped bytes but little else to help us.
Any ideas on where to go from here, how to debug this issue, etc.?
Best Answer
If there is no Acknowledge for a CAN packet, so this can be considered like a transmission error. I'm afraid that it can be up to the CAN implementation how to handle this situation.
If you have a single CAN device, try to use either loopback mode or set a restart time:
or
Note: BBB 3.8.x kernel apparently has a bug in CAN implementation. Sometimes there is kernel panic caused by CAN modules:
Some links where you can find some information regarding this problem https://groups.google.com/forum/#!topic/beagleboard/JL6aSRc0b7E http://lists.openwall.net/netdev/2013/11/27/64
Try to use another version of a kernel.