Printer Model: Voron 2.4
MCU / Printerboard: Octopus + BTT MMB Cubic (CAN bridge + GPIO expander) + EBB36 (toolhead)
Host / SBC : Pi 4
klippy.log : not relevant in this issue
I need a second CAN Bridge that will be installed in a MMU (non standard Box Turtle MMU - 5 lanes - full CANbus). USB → EBB36(CAN bridge + GPIO) → EBB36_1 to EBB36_5
But no luck. I’m able to get udev to do what it has to when only one CAN bridge is installed. Works fine, with a custom peripheral name (“can_tool”).
Then the same thing with the second CAN bridge (“can_mmu”) : fail ! As soon as a second adapter is added to the systerm, Linux seems not to be using the udev configuration, and randomly assigns peripheral names. If the second bridge is not configured with udev, the OS randomly assigns can0 or can1. I can get a valid configuration after unpluging-replugging the USB cable a few times ; not acceptable !
The problem is that I don’t really have choice, each MMU lane having to be on a CAN bus ! I want to “daisy chain” the GPIO expander and 5 identical lanes, as well as add as many as needed/wanted lanes (“legs”), and not a hub + massive rats nest made of USB cables.
The serial "0000:01:00.0" looks weird. Tested with 3 different EBB36s, two used and one brnad new, flashed and reflashed, always get the same. Looks suspicious…
Got “Serial” with one bridge attached (the other being disconnected from its USB port)
allow-hotplug canphi
iface canphi can static
bitrate 1000000
up ip link set $IFACE txqueuelen 128
allow-hotplug canrho
iface canrho can static
bitrate 1000000
up ip link set $IFACE txqueuelen 128
allow-hotplug cantau
iface cantau can static
bitrate 1000000
up ip link set $IFACE txqueuelen 128
Are you running udevadm info -a -p $(udevadm info -q path -p /sys/class/net/can0)| grep serial| head -n 1 to find the serial? If so, I’m curious if you run udevadm info -a -p $(udevadm info -q path -p /sys/class/net/can0)| grep serial instead do you find something that makes more sense?
You aren’t beholden to using the serial for your rules… I chose it because it was unique, but you could also for instance assign it via the specific usb port… I have my machine stuffed in a closet ahnd I sometimes have to unplug everything to remove it, so I tried to choose a key that would work well regardless of how I reconnected things…
Thanks for your answers.
Yes, I got the Serials with udevadm info
Was thinking of one detail I overlooked. koconnor warns that not having at least one CAN device on a bus leads to unstable results. And it was done with no device on the bus… Have to fix this before going further.
Will try later witthout underscores : removed everything for now (returned to defaults), letting Linux assign the bus names (flashing EBBs with the lightest possible configuration, and a can0 alone)
BTW, discovered that if canXX is assigned by Linux (defaults), I always get can0 for the tool CAN bus, and can1 for the mmu bus… I don’t trust it, but it seems it is usable. Will later swap USB ports to see what happens…
So your ATTRS{serial}=="0000:01:00.0" is the serial of your usb hub (internal), and Udev is probably matching any network device plugged into it in your “can_mmu” rule…
When you plug things in, before running udevadm, run lsusb and make sure you see the device. You also might want to run udevadm info -a -p $(udevadm info -q path -p /sys/class/net/can0) (or can1 whichever is showing up in ip link show) and just read through the output…
First of all there’s 2 CAN busses running.
On for the toolhead, assigned by Linux, can0 CAN bridge + toolhead. Based on a RP2040. Legit Serial with udevadm. Can play with the fan, etc.
Second one, assigned by Linux, can1. EBB36 as bridge + GPIO expander, and a EBB36 node ; STM32. working.
I use RGB LEDs as “probes”. Can access them, change color, etc.
It works. At least it seems to be working.
Was thinking of something… No serial with the STM32. In klipper/make menuconfig , we have an option for a custom USB Serial Number. Could the missing serial be this one (by default : empty) ???
My ‘USB serial number from CHIPID’ seems to be selected by default… I had a EBB36 on my desk and just flashed with Katapult then Klipper in bridge mode, then ran udevadm info -a -p $(udevadm info -q path -p /sys/class/net/can0)| grep serial| head -n 1 and got ATTRS{serial}=="2C0043000B50304158373420" without having any other devices connected to it.
I just tried changing Klipper menuconfig option to an empty serial, and it reproduces your problem… I’ll update the instructions to explicitly reflect the necessary menuconfig settings!
Really weird… Default was “1234” for “USB serial number” and pretty sure “USB serial number from CHIPID” was selected… We will never know what happened. But it is something to be aware of. Will reflash (again !) with “USB serial number from CHIPID” and see what happens. Thinking of “(1234) USB serial number” being selected, and “1234” being rejected. And this for one year or so… The main menu doesn’t show the current USB ID. Maybe a relevant FR to do on Github…
[EDIT] the more I’m thinking of it, the more I’m thinking the problem was beteween the chair and the keyboard… But no whistles and no bells about the USB IDs… And english is not my first langage. And nearly 70 yo. Some neurons now are missing…