I’ve had good success with the shield and the provided examples, however I’ve hit a problem that has me stumped.
About 50% of the time it works and 50% it doesn’t
When it works the Int LED flashes and the code receives and/or sends perfectly.
When it doesn’t work the Int LED goes immediately solid on start-up and I know that it has stalled.
If I do the following it works 100% of the time:
Disconnect one of the CAN wires.
Then power up the Arduino
Then attach the CAN wire that was disconnected
Adding some debug code it appears that when it stalls I get 5 in response to CAN.checkError()
Additional information is that the CAN.begin always seems to return OK, but if the stall occurs the error is present after a few ms of the begin.
There are two way to check if the canbus shield receive data, interrupt or check by a a function: CAN.checkReceive() . When there is some data coming, this will return CAN_MSGAVAIL(no data coming is CAN_NOMSG ).
I found that when the data is too fast, such as less than 10ms, the interrupt way will cause some problem. But you can use the other way, checkReceive(). you can try the following test code:
Hello guys i have the same problem i have a can bus shield v1.2 and a opel astra car, if i only want to receive data it works fine, when i try to send data the checkerror() it show 0 0 then 5 CAN_CTRLERROR. Can someone please help me? Almost forgot i use a arduino uno and the SPI_CS_PIN = 9;