CAN Interface DOWN after reboot (Pi4 MainSailOS 2.2.0)

Basic Information:

Printer Model: -
MCU / Printerboard: OctoPus PRO
Host / SBC: Raspberry Pi 4 (8GB)
klippy.log → not available yet

klippy.zip (1.4 KB)

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

I have a fresh installed Raspberry Pi 4 with MainSailOS 2.2.0 64 Bit.
Attached is a OctoPus Pro flashed with Katapult & Klipper 0.13 in USB/CAN Bridge Mode.

The board shows up with lsusb:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 1d50:606f OpenMoko, Inc. Geschwister Schneider CAN adapter
Bus 001 Device 003: ID 0483:3748 STMicroelectronics ST-LINK/V2
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I see also the can interface:

pi@Pi4Test:\~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether d8:3a:dd:a5:ec:cf brd ff:ff:ff:ff:ff:ff
inet 192.168.30.230/24 brd 192.168.30.255 scope global dynamic noprefixroute eth0
valid_lft 172401sec preferred_lft 172401sec
inet6 fe80::8bd5:130c:9a3a:b143/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 128
link/can
4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether d8:3a:dd:a5:ec:d0 brd ff:ff:ff:ff:ff:ff

But as you can see the Interface is in state DOWN. And I wonder why …

This is my can config:
/etc/systemd/network/25-can.network

[Match]
Name=can*
[CAN]
BitRate=1M
RestartSec=0.1s
[Link]
RequiredForOnline=no

/etc/udev/rules.d/10-can.rules

SUBSYSTEM==“net”, ACTION==“change|add”, KERNEL==“can\*”  ATTR{tx_queue_len}=“128”

Bringing up the CAN0 interface with

sudo ip link set can0 up type can bitrate 1000000

is no problem. It immediately geht UP:

3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 128
link/can

Even changing the network config with

[Link]
RequiredForOnline=no
ActivationPolicy=always-up

does not help at all.

So did I miss something to configure? Anything I could check / debug to get rid of this problem?

Best regads
Dominik

Please: For your code use the Preformatted text feature of the forum editor and not

Blockquote

Format

I don´t have that icon when I edit text.
If you tell me the normal maarkdoiwn notation I can change it.

You may try:

It’s three backticks (```)

```
code here
```

displays as:

code here

Ok fixed the formatting :slight_smile:

And I find a solution for my problem.
There seems to be a Kernel Bug. See here:

So removing the
RestartSec=0.1s
line from the config solved my issue.

After a recent update, the same thing is happening to me. I’ll try this tomorrow.

Thanks.

I released a new MainsailOS release tonight (v2.2.2). In this Release, the CAN fix is included: Release MainsailOS 2.2.2 · mainsail-crew/MainsailOS · GitHub