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 bank on the back.
  3. Set them correctly: To use CAN mode, set all switches to the position shown in the example below.
    Loading...

Important: After modifying 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 any devices during wiring.
  2. Prepare the cable: Use an XT30(2+2)-F four-wire cable. The color definition is as follows:
    • Red (VCC): Connect to 12V-24V power positive
    • Black (GND): Connect to power ground
    • Yellow (CAN-H): Connect to H on the CAN expansion port
    • White/Green (CAN-L): Connect to L on the CAN expansion port
  3. Connect devices:
    • Plug the XT30(2+2)-F connector of the cable into the tool board.
    • Connect the terminal block of the cable to a UTOC module or a mainboard flashed with "USB Bridge CAN" firmware.
    • Finally, connect the UTOC module or mainboard to your host machine (e.g., FLY-Pi or Raspberry Pi) via a USB cable.

Step 3: Configure and Check Termination Resistors

To ensure signal stability, termination resistors must be correctly connected. Configure according to the table below and measure when the power is off:

DeviceOperation Instruction
Tool BoardLocate the 120Ω jumper cap and install it.
MainboardIf connecting via a mainboard, also install its 120Ω jumper cap.
UTOC ModuleHas built-in resistor*.

How to check:

  1. Ensure the system is completely powered off.
  2. Use a multimeter to measure the resistance between CAN-H and CAN-L on the tool board's CAN port.
  3. Result Interpretation:
    • ~60Ω: Normal, termination resistors are correctly installed.
    • ~140Ω: CAN-H and CAN-L might be reversed.
    • ~120Ω: The 120Ω resistor is missing or there is a broken wire.
    • ~40Ω: There might be an extra resistor. Please check intermediate nodes.

One-sentence summary: Power off first. Set the DIP switches correctly. Plug in the wires correctly. Install the 120Ω jumper caps on both ends. Finally, measure the resistance; it should be around 60Ω.

Checklist:

  • All operations performed with power off.
  • DIP switches are all set to the ON position (CAN mode).
  • 120Ω jumper cap installed on the tool board.
  • 120Ω jumper cap installed on the mainboard (if applicable).
  • CAN data cable is firmly connected.
  • Measured resistance is approximately 60Ω.

CAN Network Configuration and Troubleshooting

Step 1: Check if the Host Recognizes the CAN Device

  1. Log in to the host machine. 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 → Possible system issue. It is recommended to reinstall/change the system.
  • Multiple 1d50:606f entries → It is recommended to keep only one device (e.g., if using a UTOC, disconnect other devices flashed with USB Bridge CAN firmware).

⚠️ Important: Only proceed to search for the 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 the FlyOS-FAST system, this step is not needed!

Configuration Method for Standard Linux Systems

Set 1M Baud 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 Baud 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: This operation is not required for the FAST system!

  1. Reboot the system to apply changes:
sudo reboot

Step 3: Search for the CAN ID

Check CAN Status:

ip -details link show can0
  • The circled areas in the image below show the host's CAN baud rate and buffer.
  • The 1024 above indicates the current CAN0 buffer.
  • The 1000000 below indicates the current CAN0 baud rate.
Loading...

Search for Device:

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

Normal output should show: 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. Run lsusb to verify.
can.CanError: Failed to transmit: [Errno 100] Network is downCAN network not configured1. Follow the configuration steps above.
2. Reboot the system.
can.CanError: Failed to transmit: [Errno 105] No buffer space availableInsufficient buffer1. Confirm CAN buffer is 1024.
2. Reboot the system.

CAN ID Not Found - Troubleshooting Steps

Step 1: Basic Checks

  • lsusb shows 1d50:606f.
  • CAN device and tool board are powered on.
  • Data cable connections are secure.

Step 2: Configuration Check

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

Step 3: Hardware Check

  • 120Ω termination resistors are installed at both ends of the CAN bus.
  • Measurement of CAN-H to CAN-L resistance with power off is ≈60Ω.
  • Check that the wiring is intact (no breaks).
  • CAN-H and CAN-L are not reversed.

Step 4: Special Case Handling

  • If Klipper has already taken the ID:

    1. Comment out or remove the corresponding configuration in Klipper.
    2. Power off completely for 1 minute.
    3. Power on and search again.
  • Termination Resistance Measurement Values:

    • ≈60Ω: Normal.
    • ≈120Ω: Only one end has a resistor.
    • ≈40Ω: Three ends have resistors.
    • ≈140Ω: Wires might be reversed.

Quick Troubleshooting Sequence

  1. Check Device First: lsusb → See 1d50:606f?
  2. Check Configuration Next: ip -details link show can0 → Baud rate correct?
  3. Check Hardware Last: Measure resistance with power off → ~60Ω?

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

Tool Board Firmware Update Procedure

Step 1: Preparation

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

Step 2: Get Tool Board ID

Find the CAN UUID for the tool board 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 message → Flashing successful.
  • See any other error message → Flashing failed. Check the 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...