Setting Canbus Queue Length in Armbian

Basic Information:

Printer Model: Anycubic Chiron Frame and Motors
MCU / Printerboard: BTT Pico and BTT HermitCrab Can
klippy.log

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 was lucky enough to get my hands on a hexacore Radxa Zero 2 last week. I’ve been making the move to Armbian and really enjoying Radxa’s Zero line. The size is great and the boards tend to run cool. I modified my device tree to force the board into host mode and I was able to simplify my wiring to have a single usb C cable connecting the Pico and the Radxa Zero after bridging D16 on the Pico.

It seemed like everything was working well running some homing commands and heating the hot end, but when I tried to run a print, I was getting MCU shutdowns. I did some review of klippy.log and found that my can bus queue was out of room. (I use the BTT Pico as a can bus bridge to the HermitCrab and sometimes a BTT EBB42 when I’m using my rotary roller or doing resonance measurements on the bed.)

I use a pretty standard /etc/network/interfaces.d/can0 file. It’s straight off the Klipper can bus page save a larger queue length:

allow-hotplug can0
iface can0 can static
    bitrate 1000000
    up ifconfig $IFACE txqueuelen 1024

So I was surprised when my prints were failing due to no room in the queue.

I tried to run ifconfig but it is not present on a default Armbian install. I had also noticed its absence in a /var/log/syslog entry noting it wasn’t present, but the can bus was working in my tests moving the toolhead and issuing commands and monitoring thermals.

So I ran ip -details -statistic link show can0 and to my surprise my anticipated queue length of 1024 was being reported as just plain 10. I ultimately did an sudo apt install net-tools and rebooted, and everything is working now as expected.

This might be a batter question for an Armbian discussion, but am I doing it wrong? My understanding is that net-tools is being deprecated. Is there some other place that I should be setting my queue length? I looked through the settings for the can interface in nmtui, but I didn’t see an area there where I could set the queue length… Any thoughts or experiences anyone has on best practice regarding this issue would be much appreciated!

It looks like the less smelly way to do this would be to uninstall net-tools and change /etc/network/interfaces.d/can0 to

allow-hotplug can0
iface can0 can static
    bitrate 1000000
    up ip link set $IFACE txqueuelen 1024

If that’s correct, would it be valuable to include in the Klipper can bus page?

Or should it be

post-up ip link set $IFACE txqueuelen 1024

Still working to understand the difference…

Please post your klippy.log like you were asked to.

Sorry I didn’t see the relevance given that this is a general question for best practice. I’m not on site with the printer but I’ll be glad to tomorrow when I have access to it.

klippy.log (871.8 KB)

It does seem that distros are no longer installing ifconfig by default, so it does seem like it may make sense to change the documentation.

I’m not an expert on all the various distributions out there, so I rely on others to propose changes like this, get feedback from testers, and let me know the results.

Cheers,
-Kevin

I posted a question in the Armbian forum to see if anyone there can elucidate the distro specific take…

This RaspberryPi News Page (from October 11, 2023) states:

During Bullseye, we rolled out the use of the NetworkManager network controller as an option which could be selected in raspi-config. This is now the standard control mechanism for networking in most Linux distributions, and is now the default network controller for Bookworm, replacing the previous system, dhcpcd. NetworkManager does everything dhcpcd did, but adds a bunch of extra functionality, including the ability to connect to hidden wireless networks, to connect to virtual private networks (VPNs), and to use a Raspberry Pi as a wireless hotspot. It also includes a lot more customisation options for those who wish to fiddle with the nitty-gritty of their network

It doesn’t specifically mention abandoning ifconfig, and I don’t recall it missing in recent RpiOS installs…

For now,

allow-hotplug can0
iface can0 can static
    bitrate 1000000
    up ip link set $IFACE txqueuelen 1024

has been working well for me on Armbian if it’s helpful to anybody.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.