Skip to content

Multiple Identical Serial Devices & Soultion for MCU Connection Issues #10

@xboxhacker

Description

@xboxhacker

I recently got a bdwidth for my Klipper TronXY Veho600 printer. I instantly ran into issues with MCU connection problems. After spending 2 full days working it out, it is now working fine. I want to put this here in case someone else is having the same MCU connection problems I had.

Hardware:

  • TronXY stm32f446
  • BTT Pi 1.2
  • bdwidth

It would seem my main board uses the same CH340 as the bdwidth. This caused a conflict when connecting to the MCU. Vendor 1a86, same product, no unique serial.

Image

Result: using /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 is ambiguous and will sometimes point to the MCU, other times to the sensor, causing read errors.

NOTE: I 100% do not know what I am doing, but I dug and dug to work this solution out. There may be far better ways to do this, but it works for me.


1. Identify Your Devices

Plug in both USB-serial devices (e.g., printer board and filament sensor).

List all USB serial devices:

ls -l /dev/ttyUSB*
ls -l /dev/serial/by-path

Unplug one device to see which /dev/ttyUSB* disappears—this helps you match each device to its function.


2. Get Each Device's Physical USB Path

For each device, run:

udevadm info -q property -n /dev/ttyUSB0 | grep ^ID_PATH=
udevadm info -q property -n /dev/ttyUSB1 | grep ^ID_PATH=

Example output:

ID_PATH=platform-5101400.usb-usb-0:1:1.0
ID_PATH=platform-5200400.usb-usb-0:1:1.0

3. Create a udev Rules File

Create /etc/udev/rules.d/99-serial-stable-names.rules with your favorite editor.

sudo nano /etc/udev/rules.d/99-serial-stable-names.rules

Paste this into Nano:

# Replace ID_PATH values with those from your system!
SUBSYSTEM=="tty", ENV{ID_PATH}=="<YOUR PATH HERE>", SYMLINK+="mcu"
SUBSYSTEM=="tty", ENV{ID_PATH}=="<YOUR PATH HERE>", SYMLINK+="bdwidth"

Save the new file with CTRL + X


4. Reload udev and Replug Devices

sudo udevadm control --reload-rules
sudo udevadm trigger -s tty

Check the new symlinks:

ls -l /dev/mcu /dev/bdwidth

5. Update Your Klipper printer.cfg

[mcu]
serial: /dev/mcu
restart_method: command

[bdwidth]
port: usb
serial: /dev/bdwidth
extruder: extruder
enable: all
<rest of the config from the git>

6. Troubleshooting

  • If /dev/mcu or /dev/bdwidth don’t appear, double-check the ID_PATH values and your rules file for typos.
  • Reload rules and replug both devices.
  • Use sudo udevadm test $(udevadm info -q path -n /dev/ttyUSB0) to debug rule application.
  • Never move the device to a different USB port, or you’ll need to redo the steps above.

Bonus: Use by-path Directly (Quick Hack)

You can also use /dev/serial/by-path/... in your config if you don't want to set up custom names.

Example:

[mcu]
serial: /dev/serial/by-path/platform-5101400.usb-usb-0:1:1.0
restart_method: command

Untested by me...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions