Skip to main content

CAN Firmware Connection Notes

Wiring Instructions

Please complete the following three steps in order:

Step 1: Set the DIP Switches

  1. Power off first: Unplug all power sources.
  2. Locate the DIP switches: Turn the tool board over. Find the DIP switch group on the back.
  3. Set the switches: To use CAN mode, set all switches to the position shown in the example below.
    Loading...

Important: After changing the DIP switches, you must re-flash the corresponding firmware (this guide uses CAN firmware).

Step 2: Connect the Wires

  1. Keep power off: Do not power on during the entire wiring process.
  2. Prepare the cable: Use the XT30(2+2)-F 4-core data cable. Its color definitions are as follows:
    • Red (VCC): Connect to 12V-24V power positive
    • Black (GND): Connect to power negative
    • Yellow (CAN-H): Connect to the H terminal of the CAN expansion port
    • White/Green (CAN-L): Connect to the L terminal of the CAN expansion port
  3. Connect the devices:
    • Plug the XT30(2+2)-F connector of the cable into the tool board.
    • Connect the wire terminals to the UTOC module or a mainboard that has been flashed with the "USB Bridge CAN" firmware.
    • Finally, connect the UTOC module or mainboard to your host computer (e.g., FLY Pi or Raspberry Pi) via a USB cable.

Step 3: Configure and Check the Termination Resistor

To ensure signal stability, the termination resistor must be correctly connected. Please configure according to the table below and measure with the power off:

DeviceInstructions
Tool BoardFind and insert the jumper cap labeled 120Ω.
MainboardIf connecting to a mainboard, also insert its 120Ω jumper cap.
UTOC ModuleHas a built-in resistor*.

How to check:

  1. Ensure complete power off.
  2. Use a multimeter to measure the resistance between CAN-H and CAN-L on the tool board's CAN port.
  3. Result judgment:
    • Approx. 60Ω: Normal. Termination resistors at both ends are correctly connected.
    • Approx. 140Ω: Possibly CAN-H and CAN-L are reversed.
    • Approx. 120Ω: The 120Ω resistor is not installed or there is a broken wire.
    • Approx. 40Ω: Possibly an extra resistor exists. Please check intermediate nodes.

Summary in one sentence: Power off first, set the DIP switches correctly, plug in the wires correctly, connect the 120Ω jumper caps at both ends, and finally measure if the resistance is around 60Ω.

Checklist:

  • Operated with power off throughout
  • All DIP switches are set to down (CAN mode)
  • Tool board 120Ω jumper cap is inserted
  • Mainboard (if applicable) 120Ω jumper cap is inserted
  • CAN data cable is securely connected
  • Measured resistance is approx. 60Ω

CAN Network Configuration and Troubleshooting

Step 1: Check if the Host Recognizes the CAN Device

  1. Log in to the host and enter the command:
lsusb
  1. Observe the result:
  • See 1d50:606f → Device recognized successfully
  • Prompt ls command not found → Execute: sudo apt-get install usbutils
  • No response → Possibly a system issue, consider changing the system
  • Multiple 1d50:606f entries → It is recommended to keep only one device (e.g., if using UTOC, disconnect other devices flashed with USB Bridge CAN firmware)

⚠️ Important: Only proceed to search for CAN ID after seeing 1d50:606f

Step 2: Configure the CAN Network

Choose the configuration method based on your system type:

If already configured or using FlyOS-FAST system, this step is not needed!

Standard Linux System Configuration Method

Set 1M rate (Recommended):

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

Set 500K rate:

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

Note: FAST system does not need to perform this operation!

  1. Reboot the system to take effect:
    sudo reboot

Step 3: Search for CAN ID

Check CAN status:

ip -details link show can0
  • The circled areas in the image below show the host CAN rate and buffer
  • The upper 1024 is the current CAN0 buffer
  • The lower 1000000 is the current CAN0 rate
Loading...

Search for devices:

~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0

Normally it will display: Found canbus_uuid=xxxx...

Common Error Solutions

Error MessageCauseSolution
OSError: [Errno 19] No such deviceCAN device not found1. Check USB connection
2. Confirm firmware is correct
3. Execute lsusb to verify
can.CanError: Failed to transmit: [Errno 100] Network is downCAN network not configured1. Execute the configuration steps above
2. Reboot the system
can.CanError: Failed to transmit: [Errno 105] No buffer space availableInsufficient buffer1. Confirm if CAN buffer is 1024
2. Reboot the system

Steps to Check if CAN ID Cannot Be Found

Step 1: Basic Checks

  • Execute lsusb and see 1d50:606f
  • Both CAN device and tool board are powered on
  • Data cable is securely connected

Step 2: Configuration Checks

  • CAN network is correctly configured
  • Host CAN rate matches the tool board firmware (default 1M)
  • System has been rebooted

Step 3: Hardware Checks

  • Both ends of the CAN bus have 120Ω termination resistors
  • Power off and measure resistance between CAN-H and CAN-L ≈ 60Ω
  • Check for broken wires
  • CAN-H and CAN-L are not reversed

Step 4: Special Case Handling

  • If Klipper already occupies the ID:

    1. Disable the corresponding configuration in Klipper
    2. Power off completely for 1 minute
    3. Power on and search again
  • Termination resistor measurement values:

    • ≈60Ω: Normal
    • ≈120Ω: Only one end has a resistor
    • ≈40Ω: Three ends have resistors
    • ≈140Ω: Possibly wires are reversed

Quick Troubleshooting Order

  1. Check device first: lsusb → Is 1d50:606f present?
  2. Check configuration next: ip -details link show can0 → Is the rate correct?
  3. Check hardware last: Power off and measure resistance → Is it approx. 60Ω?

If still not working after all checks: Try replacing the data cable or device, or contact technical support.

Tool Board Firmware Update Steps

Step 1: Preparation

  1. Compile the new firmware file according to the tutorial
  2. Stop the Klipper service:
    sudo systemctl stop klipper

Step 2: Obtain the Tool Board ID

Find the corresponding tool board's CAN UUID in the Klipper configuration file (e.g., 241696050c56)

Step 3: Execute Firmware Update

Use the following command to flash the firmware (replace 241696050c56 with your actual CAN UUID):

python3 ~/klipper/lib/canboot/flash_can.py -u 241696050c56

Step 4: Verify Result

  • See CAN Flash Success prompt → Flashing successful
  • See other error messages → Flashing failed, please check UUID and connection

Note: There must be a space after -u, followed by your tool board's CAN UUID

Loading...

Step 5: Restart Service

sudo systemctl start klipper

Update complete!

Loading...