Closed an-klam closed 1 year ago
Hi, I'm using the MCP2515 CAN controller together with the MCP2562 CAN transceiver without any issues. See also https://crycode.de/can-bus-am-raspberry-pi
What cable length do you have? At 500 kbits this should not exceed 100 m, depending on the used cable often less than 100 m. Do you really need 500 kbits? Lower speeds are more reliable.
using 1m cable length. MCP2515 lost few messages.
Now with other hardware no messages lost.
New question: After a few messages the can communication get stuck. Just one Inverter and on the other site Raspberry with canbus hat and iobroker canbus adapter. I assume the ACK message from Raspberry is missing. Do i have to make some settings?
The ack messages are normally send automatically by the can controller.
You may check the current bus state by running ip -details -statistics link show can0
in a terminal. This should print something like "can state ERROR-ACTIVE" if all is fine or "can state BUS-OFF" in worst case. Bus off means the controller has detected too many errors and has self disconnected from the bus to prevent further errors.
What about
can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0
Error passive means at least one error counter of the controller has reached 127 errors. The controller still takes part on bus activities, but he sends only passive error frames to not float the bus with error messages. This is often a pre-state of bus-off.
Hi! I´m using MCP2515 with Raspberry but messages get lost. 500kbits
I know it because i got an CAN USB Adapter for my windows pc and there i can see more messages.
can you recommend hardware for raspberry pi?