CAN Firmware Connection Notes
Wiring Instructions
Please complete the following three steps in order:
Step 1: Set the DIP Switches
- Power off first: Unplug all power sources.
- Locate the DIP switches: Turn the tool board over. Find the DIP switch bank on the back.
- 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
- Keep power off: Do not power on any devices during wiring.
- Prepare the cable: Use an
XT30(2+2)-Ffour-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
- Connect devices:
- Plug the
XT30(2+2)-Fconnector 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.
- Plug the
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:
| Device | Operation Instruction |
|---|---|
| Tool Board | Locate the 120Ω jumper cap and install it. |
| Mainboard | If connecting via a mainboard, also install its 120Ω jumper cap. |
| UTOC Module | Has built-in resistor*. |
How to check:
- Ensure the system is completely powered off.
- Use a multimeter to measure the resistance between CAN-H and CAN-L on the tool board's CAN port.
- 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
- Log in to the host machine. Enter the command:
lsusb
- 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:606fentries → 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!
- Standard Linux System
- Raspberry Pi System
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!
Configuration Method for Raspberry Pi Systems
- Create network configuration (BitRate can be changed to 500000):
sudo tee /etc/systemd/network/99-can.network > /dev/null <<'EOF'
[Match]
Name=can*
[CAN]
BitRate=1000000
RestartSec=100ms
EOF
- Create link configuration (TxQueueLength modification is not recommended):
sudo tee /etc/systemd/network/99-can.link > /dev/null <<'EOF'
[Match]
OriginalName=can*
[Link]
TxQueueLength=1024
EOF
- 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
1024above indicates the current CAN0 buffer. - The
1000000below indicates the current CAN0 baud rate.
Search for Device:
- Fly-Armbian & Standard Host Search Command
- Fly-FAST Search Command
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
python ~/klipper/scripts/canbus_query.py can0
Normal output should show: Found canbus_uuid=xxxx...
Common Error Solutions
| Error Message | Cause | Solution |
|---|---|---|
OSError: [Errno 19] No such device | CAN device not found | 1. Check USB connection. 2. Confirm firmware is correct. 3. Run lsusb to verify. |
can.CanError: Failed to transmit: [Errno 100] Network is down | CAN network not configured | 1. Follow the configuration steps above. 2. Reboot the system. |
can.CanError: Failed to transmit: [Errno 105] No buffer space available | Insufficient buffer | 1. Confirm CAN buffer is 1024.2. Reboot the system. |
CAN ID Not Found - Troubleshooting Steps
Step 1: Basic Checks
-
lsusbshows1d50: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:
- Comment out or remove the corresponding configuration in Klipper.
- Power off completely for 1 minute.
- 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
- Check Device First:
lsusb→ See1d50:606f? - Check Configuration Next:
ip -details link show can0→ Baud rate correct? - 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
- Compile the new firmware file according to the tutorial.
- 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 Successmessage → 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.
Step 5: Restart Service
sudo systemctl start klipper
Update complete!