Specify serial adapter path

What is the problem?

Somehow my Zigbee adapter and my Ender 3 Pro both show up under the same ID, so home assistant and octoprint conflict.

What did you already try to solve it?

Home assistant can use the entry in /dev/serial/by-path/ instead which is unique (by-id isn't, somehow).
Octoprint however doesn't seem to accept anything but /dev/ttyUSB[0-9], which isn't always the same depending on the order things are plugged in.

I've tried putting the path directly in the config.yaml file but that doesn't seem to do anything, Octoprint still only accepts /dev/ttyUSB* and refuses to see anything under /dev/serial.

Additional information about your setup

Latest octoprint docker container, running on the latest unraid.
I'm just hoping there's a way to force octoprint to use an arbitrary path (/dev/serial/by-path/...) as it's adapter instead of what it auto detects, that way I could force it and home assistant to use the correct device instead of conflicting.


Nevermind, figured a way to separate them.
Added the following udev rules to create separate symlinks based on the only difference the two devices show : their device path.

SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", ATTRS{devpath}=="8", SYMLINK+="zzh"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", ATTRS{devpath}=="3", SYMLINK+="ender3pro"

Then I had docker remap the ender3pro symlink to a ttyUSB0 device node in octoprint's config : --device /dev/ender3pro:/dev/ttyUSB0.
That way from octoprint's perspective it'll always show up as ttyUSB0 so it does work, even though that's not at all it's path on the host.

Now to make that persistent and I'll be all set.

In OctoPrint's serial settings, you can specify additional serial ports to match against, yes by default it doesn't show up and try to connect to a wide range of ports to avoid confusion, if you need more just add them to the list.

1 Like

Ah yes, there's an additional serial port box in the settings in the UI, didn't notice that before.
Good to know, thanks !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.