Hi,
I have a RPi to control two printers. It is running two instances of Moonraker and two instances of Klipper (one for each printer). With the printers communicating over USB, everything works properly, and I can simultaneously control both. I have converted both printers to Can Bus: the SKR Mini with a UCAN usb-can, and the other with Octopus as the usb-can bridge.
I have created two independent networks, having tried first can3 and can4, then can0 and can1. Networks seem to come up correctly and I can see all the can terminals, however I cannot get Klipper to connect to them when the two are up. The only way to connect is by disconnecting one of the two and resetting the adapters so it shows up as can0.
My question is, is there a limitation on using multiple can networks simultaneously, or am I missing some config to let Klipper know about what controller is in what network?
@gaolst thanks for replying. Sorry for the klippy.log, at the time as was using one of the printers so couldn’t disconnect to show how both connected would show up in the log. As I said, if I restart everything and connect just one to grab can0, then it works. If I connect both and use udev to assign can0 and can1, then it stops working. Attached are the logs for both printers. Rollover for klippy1.log was done while still connected and working, then powered everything off and restarted everything.
Here are some screen grabs from the RPi:
MCU configuration have additional parameter canbus_interface
which by default have value can0
I don’t see that parameter defined in your configs.
So most probably both printers trying to use same interface can0.
That why I did asking about did you try to specify different interfaces for printers by defining property canbus_interface ?
P.S. Most probably with udev rules you can statically bind printers to their interfaces. Like printer 1 - will always be can0, Printer 2 - always can1
That did the trick. Thanks man.
I included the canbus_interface in all the CAN mcu’s and it is working. Guess I will find another use for the RPi and screen I had already ordered
To get udev to assign static network interface to each Canbus, create file in /etc/udev/rules.d/99-canbus.rules
with the following content according to your devices:
You can find the serials and other attributes using dmesg.
So your interfaces come up automatically, create a file in /etc/network/interfaces.d/ for each interface, so you would have the file can0:
allow-hotplug can0
iface can0 can static
bitrate 1000000
up ifconfig $IFACE txqueuelen 1024
and can1:
allow-hotplug can1
iface can1 can static
bitrate 1000000
up ifconfig $IFACE txqueuelen 1024