crycode-de / ioBroker.canbus

ioBroker CAN Bus integration
Other
10 stars 6 forks source link

Hardware recommendation #215

Closed an-klam closed 1 year ago

an-klam commented 2 years ago

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?

crycode-de commented 2 years 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.

an-klam commented 1 year ago

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?

crycode-de commented 1 year ago

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.

an-klam commented 1 year ago

What about can state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0

crycode-de commented 1 year ago

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.