First, you need to confirm whether the wiring is correct: CAN_L needs to be connected to CAN_L, and CAN_H needs to be connected to CAN_H. After confirming that there is no problem with the wiring, I suggest you use the Arduino board to test whether it can communicate, because the example you gave seems to use Arduino as the carrier. If the Arduino can’t run, maybe there is a problem with the CAN bus. If the Arduino can run but the Wio Terminal can’t, it might be a code compatibility problem.
I’m pretty sure this behaviour is given by Wio Terminal speed (120mhz) and maybe you don’t have this problem on other platforms.
I had to edit the Longan Labs library file “Longan_I2C_CAN_Arduino.cpp” in two overrided methods :
*bool I2C_CAN::IIC_CAN_GetReg(unsigned char __reg, int len, unsigned char __dta)
and
*bool I2C_CAN::IIC_CAN_GetReg(unsigned char __reg, unsigned char __dta)
adding a little delay between endTransmission and requestFrom in both methods like this:
Wire.endTransmission();
delay(1); // THE FIX
Wire.requestFrom(IIC_ADDR, len);
The one with 2 parameters is called by byte I2C_CAN::checkReceive(void) method and it won’t work if you don’t put a little delay here :
Now the receiver (finally !!!) works
Three last notes:
1 - the video’s author suggests to use a smaller delay, but I’ve wasted so much time that delay(1) it’s ok with me.
2 - Pay attention to library updates ! they could reset your editing
3 - I’d like manufacturer to better test their code before releasing…