Problem with MCP2515 and library CANbus

chrismel
2021-11-25
3 days ago
  • chrismel - 2021-11-25

    Hi guys,
    I'm starting a project with a raspberry pi and MCP2515 CAN-module.

    I've implemented code to open and send message to "can0" and apparently it work.

    However, when I try to send more then 10 messages each 100ms, the module block all trasmission.

    I've noticed CL2.CreateMessage(...., ....) return the error message "30112" I believe it is "queue error".

    After that I tried to change the "txqueuelen" of the device using the command "ifconfig can0 txqueuelen 10000"
    but the issue it's the same.

    I can send little more than 20 messages for a few minutes before I generate the same error.

    How do I transmit hundred messages on the CAN?
    Should I change other settings on the raspberry?

    I append the code I made to send messages.

    Let me know if you have any advice to give me to make it work.

    Thank you.

     
  • czek - 3 days ago

    Hello,
    I encountered this same error. I was able to resolve it by allocating more messages when I open the network driver (ctMessages:= 100). By default it is set to 25.

     

Log in to post a comment.