I hope you can give me some suggestions how to debug a can bus problem.
I hope there are ways to see problems without a oscilloscope because that would be a bit expensive to buy.
To describe my concrete problem.
I set up a CAN Bus between two (also tried 3 successfully) arduino nanos and i used MCP2515 and MCP2551 with a 8MHz crystal.
I followed this tutorial to set it up on a breadboard. This article links to this page for the arduino programming. It is based on the seeedstudio library.
On the first day of me tries it worked without problems with 2 and 3 arduinos.
(even though i did not use any resistors to terminate the bus)
After this success I kept researching about other libraries which might be better than the one from seeedstudio or provide some more abstraction from the interface.
I found the CANBus library from Cory J Fowler, which seem to solve some bugs in older libraries.
But It did not work (I use for the interrupt pin 2) I also modified the receive and send example to a lower bit rate and to be clocked at 8MHz.
if(CAN0.begin(MCP_ANY, CAN_125KBPS, MCP_8MHZ) == CAN_OK) Serial.println("MCP2515 Initialized Successfully!");
(I also bought and added in between the termination resistors.)
I also let the loopback example run successfully
When i went back to the seeedstudio library it as well stopped working.
Because the library from Cory Fowler seems to be more up to date I think it does not make sense to try debug on this old library
The output from the CAN_send script:
Entering Configuration Mode Successful!
Setting Baudrate Successful!
MCP2515 Initialized Successfully!
Error Sending Message...
7
Error Sending Message...
7
Error Sending Message...
7
Error Sending Message...
6
Error Sending Message...
6
The output from the CAN_receive script:
Entering Configuration Mode Successful!
Setting Baudrate Successful!
MCP2515 Initialized Successfully!
MCP2515 Library Receive Example...
Any suggestions how to proceed?
Is there anything i can measure with a multi-meter?