CAN Issue Collection
Precautions Before Searching for Devices
- Before searching for CAN ID, please first connect to SSH
- Please note that you need to ensure that you are logging in via network SSH rather than serial port login
- Please make sure that the motherboard with UTOC installed or the motherboard flashed with CAN bridge firmware is properly connected, and the data cable connecting the motherboard to the host has data transmission capability
Determining if Devices Exist
- Now that you have successfully logged into the host, you can enter
lsusb
to search for devices. You will encounter one of the following situations:- If entering
lsusb
prompts that thels
command is not found, you can enter the following command to install the commandsudo apt-get install usbutils
- If entering
lsusb
results in no response, this is a system issue beyond our control. You need to change the system or use a known working system. - If the information shown in the image below appears, note that this is just a reference. You only need to confirm that
1d50:606f
appears.
- If entering
1d50:606f
belongs to the device you will be using. You do not need to worry about the subsequent prompts because system issues may cause them to display incompletely or not at all.- If there are multiple
1d50:606f
, it is recommended to exclude one to avoid affecting subsequent firmware flashing and connection to the firmware. For example, if it'sFLY MINI PAD
, it is recommended to use the onboard UTOC and not other CAN bridge devices. - If none appear, please check if the data cable is properly connected and if the firmware is correctly flashed.
Note
You can only search for CAN ID when 1d50:606f
appears.
Identifying Issues Based on Error Messages
- Below are common error messages:
- OSError: [Errno 19] No such device
- can.CanError: Failed to transmit: [Errno 100] Network is down
- can.CanError: Failed to transmit: [Errno 105] No buffer space available
- The first one indicates that the host machine cannot find the CAN device (motherboard with USB bridge firmware or UTOC).
- The second one indicates that the host machine does not have CAN0 configured or configured incorrectly.
- The third one indicates that the host machine has insufficient cache or system issues leading to cache failure.
- Points two and three can be addressed by configuring CAN0 as shown below.
- If you cannot find the ID, refer to the section below.
Checking if the Host Machine Supports CAN
- If you are using the FLY host machine, you do not need to perform this step.
- If your system is
Ubuntu
, you need to configure CAN0, but this document has not been updated. - Enter the following command to determine if your system supports CAN
sudo modprobe can && echo "Your kernel supports CAN" || echo "Your kernel does not support CAN"
- After entering the above command, if your kernel supports CAN, it will return:
Your kernel supports CAN
. If it does not support CAN, it will return:Your kernel does not support CAN
. - If it returns
Your kernel supports CAN
, you can proceed to the next step to configure CAN0.
Configuring CAN0
- This command overwrites the original CAN0 configuration on the system and requires a system restart after execution.
- Choose one based on your actual situation
- For 1M rate, enter the following command
sudo /bin/sh -c "cat > /etc/network/interfaces.d/can0" << EOF
allow-hotplug can0
iface can0 can static
bitrate 1000000
up ifconfig $IFACE txqueuelen 1024
pre-up ip link set can0 type can bitrate 1000000
pre-up ip link set can0 txqueuelen 1024
EOF
- For 500K rate, enter the following command
sudo /bin/sh -c "cat > /etc/network/interfaces.d/can0" << EOF
allow-hotplug can0
iface can0 can static
bitrate 500000
up ifconfig $IFACE txqueuelen 1024
pre-up ip link set can0 type can bitrate 500000
pre-up ip link set can0 txqueuelen 1024
EOF
- Restart the device
sudo reboot
Things to Check After Not Finding an ID
- If Klipper is configured with the corresponding ID, you need to disable the ID in the system settings before shutting down, disconnect power, and then turn on or press the reset button on the motherboard.
- Check if the CAN speed of the host machine matches the motherboard, tool board, etc.
- You can use the following code to determine the CAN speed of the host machine
- Make sure there are no disconnections.
- Check if a
120Ω
termination resistor is installed between the tool board and the device (motherboard with USB bridge firmware or UTOC). - If a
120Ω
termination resistor is installed, use a multimeter to measure the resistance between CAN H and CAN L when the device is completely powered off to see if it is around60Ω
. - Ensure there are no disconnections.
ip -details link show can0
- The highlighted areas in the image below indicate the CAN speed and cache of the host machine.
- The above
1024
is the current CAN0 cache. - The below
1000000
is the current CAN0 speed.
-
If the UUID is still not found, carefully check the following notes:
- Confirm whether the motherboard or CAN tool board is correctly connected.
- Ensure proper power supply, it is recommended to connect VCC power to the motherboard.
- Check if the host machine supports CAN networks.
- Check if the CAN resistance is around
60Ω
. - Verify if the firmware compilation is correct.
Searching for ID
- Enter the following command to search for the ID
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
- If an ID appears and the
Application:
at the end showsKlipper
, it means this ID can be used directly. - If an ID appears and the
Application:
at the end showsCANBOOT
orKatapult
, it means you need to flash the firmware to use it.