Issue using CAN to communicate with Arduino

Hi,
I’m trying to use a CAN bus to send information between my Jetson nano and a chain of arduino’s (using arduino nano’s for now.)

I’m using an InnoMaker USB to CAN converter for the Jetson, and some MCP2515 shields.

My issue is that I can’t seem to get the USB to CAN device working on the Jetson. I’ve done plenty of testing with the arduino + MCP2515’s and that all works fine, but I am unable to send or receive data from the Jetson to the Arduino.

I’m fairly new to Linux/Python and only really been using Arduino for a few years, all self taught, so I wondered if there’s some basic errors I’ve missed?

I set up the USB2CAN following the manufacturers user guide.

At the moment I’m just trying to get the USB2CAN to send a message to the MCP2515 (see code below). And I’m not getting any response at all from the MCP, It just seems as if no message is being sent (or received). I have tested by sending the same data from a second Arduino+MCP2515 to the first and it reads just fine.

I’ve tried to sanity check myself, making sure all the wires are correctly connected, same Baudrate etc.
I also did a quick check with the USB2CAN as the receiver and the MCP2515 as the transmitter, and the result was similar, it was as if they were not connected at all.

Any help is appreciated.

Thanks.

This is my python code for the Jetson:

import os
import can
os.system("sudo ifconfig can0 up")
os.system("sudo ip link set can0 type can bitrate 500000")

can0 = can.interface.Bus(channel = "can0", bustype = "socketcan")

msg = can.Message(arbitration_id=0x00, data=[7,6,5,4,3,2,1,0], extended_id=False)

print("Sending")
can0.send(msg)
    
os.system("sudo ifconfig can0 down")

And the Arduino Code, though this is tested and working OK. (Using this MCP2515 Shield Library)

#include <Arduino.h>
#include <SPI.h>
#include <mcp_can.h>

unsigned char len = 0;
unsigned char buf[8];
char str[20];

MCP_CAN CAN(10);

void setup() {   
//Init. Serial for output
Serial.begin(115200);
//Init. CAN device - Loop if not connecting. 
INIT_CAN:
    if (CAN_OK == CAN.begin(CAN_500KBPS)) //baudrate = 500k
    {
        Serial.println("CAN BUS Connected");
    }
    else
    {
        Serial.println("Failed to Connect");
        delay(100);
        Serial.println("Trying Again...");
        goto INIT_CAN;
    }
}

void loop()
{
    if (CAN_MSGAVAIL == CAN.checkReceive()) // check if message available
    {
        CAN.readMsgBuf(&len, buf); // read msg data (length and buffer)
        for (int i = 0; i < len; i++) // print the data
        {
            Serial.print(buf[i]);
            Serial.print("\t");
        }
        Serial.println();
    }
}