SPlatten
Posts: 19
Joined: Sun Jan 28, 2024 1:42 pm

Raspbian GNU/Linux 11 (bullseye)

Mon Feb 26, 2024 10:00 am

I have Raspberry Pi 0 W, attached to this I have a CANBUS USB Module:
https://www.aliexpress.com/item/1005006 ... 1802q2vTUK

I connect to the Raspberry Pi using SSH on my iMAC and type:

Code: Select all

root@RPi0:~# lsusb
Bus 001 Device 002: ID 1d50:606f OpenMoko, Inc. Geschwister Schneider CAN adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
In the console, if I then type:

Code: Select all

ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: usb0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 76:51:db:3c:b2:29 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
    link/ether b8:27:eb:e1:41:8e brd ff:ff:ff:ff:ff:ff
4: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
I can see 4: can0. The problem I am having is that if I then execute:

Code: Select all

sudo reboot
Then allow time for the Pi to reboot and boot up again then:

Code: Select all

root@RPi0:~# lsusb
Bus 001 Device 002: ID 1d50:606f OpenMoko, Inc. Geschwister Schneider CAN adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Then:

Code: Select all

root@RPi0:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: usb0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 4a:8d:1f:7c:0c:5a brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
    link/ether b8:27:eb:e1:41:8e brd ff:ff:ff:ff:ff:ff
Now there is no can0 present, if I unplug and then reconnect the USB device, it reappears, what can I do to resolve this issue so can0 always reappears in the list after a reboot ?

Is there a way to re-initialise a USB scan as if a device was freshly plugged in, something I can execute on boot ?

User avatar
RosettaStone
Posts: 21
Joined: Mon Oct 09, 2023 7:23 am
Location: The Land Down Under

Re: Raspbian GNU/Linux 11 (bullseye)

Wed Feb 28, 2024 6:59 am

I am not familiar with the particular device you're using but it might be a case of the driver module not being loaded at boot.

Run the following command(s) to see what modules are loaded when the device is working (I'm assuming the module has "can" in the name for the second command):

Code: Select all

lsmod

lsmod | grep -i can
The first command lists all loaded kernel modules. The second command searches the list for entries with "can" in them.

If there is a module listed then you can put it in the "/etc/modules" file to load at boot.

SPlatten
Posts: 19
Joined: Sun Jan 28, 2024 1:42 pm

Re: Raspbian GNU/Linux 11 (bullseye)

Fri Mar 01, 2024 11:53 am

Thank you, after a while of battling with the set-up I decided to reflash the SD Card, this time everything is perfect and I can reboot and shutdown, everything comes up great, I've just executed:
lsmod | grep -I can
The results:
can_dev 31349 1 gs_usb

Return to “HATs and other add-ons”