Jump to content

Canbus Networking Confusion


kayanite

Recommended Posts

Hi,

 

I setup a Radxa Zero 2 last week with Klipper, a 3d printing firmware. Over the past few months, I've transitioned my printer to using canbus. I'm finding the setup process slightly different with Armbian than it was on RpiOS, and I'd appreciate feedback or pointers that could help me better understand networking in Armbian.

 

I use a usb canbus adapter. In the past, I've configured it using the standard Klipper config written to `/etc/network/interfaces.d/can0`:

 

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


So, when I went to setup the Radxa, I did what I've always done, and it seemed to work fine. My canbus boards showed up and I was able to home and jog my printer, and heat the hotend.

 

But when I tried to print a full gcode file,  my print failed 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 worked as expected.

Then I thought,  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…

So I researched some more. 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

 

or 

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

 

... I still can't determine if there's a difference between the two.

 

But I'm still not sure if that's correct. My impression is that I shouldn't be using /etc/network/interfaces at all, but should be able to do the whole thing through Network Manager? 

 

I tried searching for something like an Armbian Networking Manifesto, but couldn't find anything. Any thoughts or experiences anyone has on best practice regarding this issue would be much appreciated!

Link to comment
Share on other sites

I saw this post when running into the same issue.  the link below can help you use ifupdown & netools...which you already have installed (and working) and it also includes instructions for "systemd-networkd (netplan)" which is what ubuntu and debian variants of armbian appear to use.  I hope this helps you or others than come across the topic.

 

https://canbus.esoterical.online/Getting_Started.html

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines