I am using Raspbian 11 (bullseye) on a Raspberry Pi 0 W, I have a OpenMoko Geschwister Schneider CAN Adapter connected to the Pi.  Initially I set-up the device with:
Quotesudo ip link set dev can0 type can bitrate 500000
sudo ip link set dev can0 up
The device appears when I type:
Quotesudo ip link
Just the bit showing can0:
Quote3: can0: <NOARP,UP,LOWER_UP,ECHO> mtg 16 qdisc pfifo_fast state UP mode DEFAULT group default glen 10
    link/can
The issue I have is that if I reboot the Pi for any reason or even power it up, can0 isn't always present and only unplugging the USB device and reconnecting will resolve the issue.  Can anyone help me to make this bullet proof?  I need the can0 to always be there after a reboot.


The adapter as reported when using
Quotelsusb
Device 003 Device 002: ID 1d50 606f OpenMoko, Inc. : Geschwister Schneider CAN adapter

Apologies for multiple posts...

Last night I refreshed the SSD card and started over, this time everything seems to be working ok even after a reboot.  I will not be updating the system again as it would appear that one of the updates causes a problem.

I wish I could say it still works, when I type:
Quotelsusb
I can see the device is listed:
QuoteBus 001 Device 002: ID: 1d50:606f OpenMoko, Inc. Geschwister Schneider CAN adapter
However if I then type:
Quoteip link
No can0 shows in the list, if I then pull the USB cable and re-insert and type ip link again, can0 is now present in the list.

How can I fix this without having to resort to pulling the USB cable out and inserting again?

This is plugged into a Raspberry Pi 0 W, the operating system is Raspbian GNU/Linux 11 (bullseye).

When I power up from cold, I can see the lights on the CAN module all come on, because in /etc/network/interfaces I have:
Quote############### 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
However, after approximately 8 seconds the lights go off except the RED LED, at this point can0 is no longer visible to the system.


Can someone please help, I need this system to be reliable and sadly the only thing that is reliable is that it doesn't work!

Can anyone help me with this because it starts off with the can adapter working on , but then as soon as I bind the USB Device, it stops working and it will not work again unless I physically unplug the device then reconnect it, obviously I cannot do this when the device has been situated in a place I cannot get to.

I imagine it requires a software fix, can anyone help me please, I really cannot use it like this, if anyone requires any further information please ask.

I have a Raspberry Pi Zero W and a OpenMoko, Inc. Geschwister Schneider CAN adapter.

I'm trying to set-up the system so that it boots up with the CAN adapter enabled and configured and is reliable and stays up, unfortunately what I see is that the system boots, the lights come on the adapter for a short period approx. 5 seconds then the lights go out except the power LED and the CAN0 adapter is no longer present.

From a Ubuntu 22.04.4 LTS virtual machine, I connect to Raspberry Pi Zero W using SSH.

If I execute ip link I can see that can0 is not listed, although it is on start-up.

In /etc/modules I have:
Quotei2c-dev
vhci-hcd
usbip-core
usbip-host
From ip link:
Quote1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 disc no queue state UNKNOWN mode DEFAULT group default glen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default glen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
Originally can0 was listed at 2.  From dmesg | grep can:
Quote[.   4.136105] usb 1-1: Product: candleLight USB to CAN adapter
The release details of the OS on the Raspberry Pi Zero W:
QuoteDistributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
In /etc/rc.local:
Quoteip link set dev can0 type can bitrate 500000
ip link set dev can0 up
I also have in /etc/network/interfaces:
Quoteauto can0
iface can0 net manual
   pre-up ip link set dev $IFACE type can bitrate 500000
   pre-up ip link set dev $IFACE up
   up /sbin/ifonfig $IFACE up
   down /sbin/ifconfig $IFACE down
What I've tried to try and fix this:
1. Commenting out the 2 lines from rc.local, no difference, still comes on for 5 seconds then off, so I'm thinking lines in rc.local aren't required...
2. Commenting out the entries from /etc/network/interfaces, now the LED's don't light at all except the power LED.

After performing each of the above, I shutdown and rebooted.

After the results from 1 and 2 I've removed the content from /etc/rc.local and left just the settings in /etc/network/interfaces, the blue, green and red come on together for 5 seconds then the blue and green go out and can0 is no longer visible or accessible.

Can anyone help?

Everything I've tried results in the same, the device comes up at boot up, the lights all go on, then 5 seconds later, all off except the power led, but can0 is no longer present in the operating system, if I unplug the USB and reconnect it appears.


Can someone please try this, I think I've included absolutely everything in my posts, if you need more information please ask.


The post on Raspbian:

https://raspberrypi.stackexchange.com/questions/147331/raspberry-pi-zero-w-with-openmoko-can-adapter