Arduino CAN no full response

Hello,

I get only 8 bytes from response of VIN Code request:

Do you know what is the problem?

Thank you.

Any idea of my problem?

Hello,which particular product are you using? Is it the Can-Bus shield V2 or CANBed? Please post with the link.

CAN BUS Shield V3.0: https://www.marotronics.de/MCP2515-Can-Bus-controller-shield-V30-SunFlower-for-Arduino

Hi There ,
What happens if you uncomment those first to line of code out.
//Serial.println(len, HEX);
//unsigned char buf[8];

void taskCanRecv() {
    unsigned char len = 0;
    //Serial.println(len, HEX);
    //unsigned char buf[8];

    while (CAN_MSGAVAIL == CAN.checkReceive()) {                // check if get data
        CAN.readMsgBuf(&len, buf1);    // read data,  len: data length, buf: data buf
        
        Serial.println("\r\n------------------------------------------------------------------");
        Serial.print("Get Data From id: 0x");
        Serial.println(CAN.getCanId(), HEX);
        //Serial.println(len, HEX);
        for (int i = 0; i < len; i++) { // print the data
            Serial.print("0x");
            if(buf1[i] < 0x10)                // If data byte is less than 0x10, add a leading zero
            {
              Serial.print("0");
            }
            Serial.print(buf1[i], HEX);
            Serial.print("\t");
        }
        Serial.println();
       
    }
    
delay(3000);
}

curious if the LIB has it hardcoded? 8 Bytes
HTH
GL :slight_smile: PJ

I get only, the result is the same:

------------------------------------------------------------------
Get Data From id: 0x7E8
0x10	0x14	0x49	0x02	0x01	0x57	0x30	0x4C