0

I have a Raspberry Pi 0 W which I am setting up to share a USB device, I want to add the following somewhere so they are executed on boot:

    sudo ip link set dev can0 type can bitrate 500000
    sudo ip link set dev can0 up

I have already put into /etc/network/interfaces

############### CAN BUS CONFIG ###########################
auto can0
iface can0 inet manual
    pre-up ip link set $IFACE type can bitrate 500000 listen-only off
    up /sbin/ifconfig $IFACE up
    down /sbin/ifconfig $IFACE down

I'm not really sure what the above enables or its benefits, can anyone explain?

The OS on the Raspberry Pi 0 W is:

Raspbian GNU/Linux 11 (bullseye)

1 Answer 1

0

Fixed, I modified /etc/rc.local and add the lines:

ip link set dev can0 type can bitrate 500000
ip link set dev can0 up

Everything works great now....or it did, I spoke to soon I also needed to add:

usbip --debug bind -b 1-1
usbip -d

For some reason which I don't understand, executing usbip -d kills the can0 which is then no longer visible when typing: ip link

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .