Skip to main content

CAN Problem Collection

Precautions Before Searching for Devices

  • Before searching for CAN ID, please connect to SSH first.
  • Please note that you need to ensure that you are logging into SSH via the network rather than serial port login.
  • Ensure that the UTOC or the motherboard with the CAN bridge firmware is properly connected and that the data cable connecting to the host computer has data transmission capability.

Determine If There Are Devices

  • Now that you have successfully logged into the host computer, you can enter lsusb to search for devices. It will result in one of the following scenarios:
    • If entering lsusb prompts that the ls command is not found, you can enter the following command to install the command:
      sudo apt-get install usbutils
    • If entering lsusb results in no response, this indicates a system issue. We cannot help here; you need to change the system or use a confirmed normal system.
    • If the information shown below appears, please note that this is just a reference. You only need to confirm that 1d50:606f appears.
  • 1d50:606f belongs to the device you will be using this time. Ignore the subsequent prompts as 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 burning and connection, such as FLY MINI PAD. In this case, it is recommended to use the onboard UTOC instead of other CAN bridge devices.
  • If not, check whether the data cable is properly connected and whether the firmware is correctly flashed.
Notice

You can only go to search for CAN ID when there is 1d50:606f.

Identify 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 computer cannot find the CAN device (the motherboard with the USB bridge firmware or UTOC).
  • The second one indicates that the host computer has not configured or has incorrectly configured CAN0.
  • The third one indicates that the host computer's cache is insufficient or there are system issues causing cache failure.
  • The second and third points can be addressed by checking the configuration of CAN0 as described below.
  • If you cannot find the ID, see the last section.

Check if the Host Computer Supports CAN

  • If you are using the FLY host computer, you do not need to perform this operation.
  • If your system is Ubuntu, you need to refer to the Ubuntu Configuration CAN0 document which has not been updated yet.
  • Enter the following command to determine if the 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 not, it will return: Your kernel does not support CAN.
  • If the return is Your kernel supports CAN, you can proceed to configure CAN0.

Configure CAN0

  • This command overrides the original system CAN0 configuration. After execution, the system needs to be restarted.
  • Choose one according to the actual situation.

  • For 1M speed, 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 speed, 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 Note If You Cannot Find the ID

  • If Klipper has configured the corresponding ID, you need to disable the ID in the system configuration before shutting down, disconnecting power, and then turning on the device or pressing the reset button on the motherboard.
  • Confirm whether the host computer CAN speed matches the motherboard, tool board, etc.
  • You can use the following code to determine the host computer CAN speed.
  • Confirm whether there is a broken wire.
  • Confirm whether a 120Ω jumper is installed between the tool board and the device (the motherboard with the USB bridge firmware or UTOC).
  • If a 120Ω jumper is installed, use a multimeter to measure the resistance between CAN H and CAN L under complete power-off conditions to check if it is around 60Ω.
  • Confirm whether there is a broken wire.
ip -details link show can0
  • The circled part in the image below shows the host computer CAN speed and cache.
  • The 1024 above is the current CAN0 cache.
  • The 1000000 below is the current CAN0 speed.
  • If the UUID still cannot be queried, carefully check the following points:

    • Check if the motherboard or CAN tool board is correctly connected.
    • Confirm proper power supply, it is recommended to connect VCC power to the motherboard.
    • Confirm whether the host computer supports CAN network.
    • Confirm whether the CAN resistance is around 60Ω.
    • Confirm whether the firmware was compiled correctly.

Search 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 final Application: shows Klipper, it means this ID can be used directly.
  • If an ID appears and the final Application: shows CANBOOT or Katapult, it means the firmware needs to be flashed before it can be used.