Mapping of USB ports changes sometimes between reboots

I have two devices plugged into my Pi3+: a zigbee dongle, and an RFXTRX receveiver.
image

Every once in a while when I reboot Home Assistant, it turns out that the port mapping gets switched. Zigbee moves from ttyUSB0 to ttyUSB1 and RFXTRX vice versa.

It seems for Zigbee2MQTT I cannot use the serial by id port so that it would always point to the correct location, and for RFXTRX I can’t even find where to indicate the port.

So I resort to stopping, unplugging, replugging, restarting cycles until the ports are back as they were…

Is there a way to permanently resolve this?

1 Like

Of course you can. Either directly or you bind-mount the /dev/serial/… path to /dev/ttyACM0 inside the container.

Thanks Christoph, I did try of course before posting, but I must be missing something:

Config of Zigbee2MQTT has this:

but log has this:

Must be a small thing…
(p.s. don’t know what “bind-mount the /dev/serial/… path to /dev/ttyACM0 inside the container.” means, I work with hassio, and have not worked with the concept of containers (yet?)

I don’t use HASS.IO (which is called HA OS now AFAIK). The devices of the host machine are not known inside the container (HA OS uses containers, too), unless they get “bind-mounted” into it. I know how to do that with HA Container, but not with HA OS. Others might help.

Overall, /dev/ttyUSBx is not common for use with a Zigbee USB Stick, check if /dev/ttyACM0 is available and stable.

I use devices in my docker-compose.yml, and hove no issue

        devices:
            - "/dev/serial/by-id/usb-Silicon_Labs_BV_2010_10_0137F5AD-if00-port0:/dev/ttyUSB0"
            - "/dev/input/by-id/usb-1912_2.4G_Composite_Devic-event-kbd:/dev/input/event0"
            - "/dev/input/by-id/usb-1912_2.4G_Composite_Devic-event-if01:/dev/input/event1"
            - "/dev/input/event16:dev/input/event2"

Edit: Oh, HAOS… No clue how to do the same there…

Thanks both.

HAOS should be more “non-technical user” oriented, so should be more straightforward there right :slight_smile:
Also the question where to set up the port to the RFXTRX receiver remains open…

That’s what they said …

Aynway, shouldn’t there be a “Supervisor” tab in the sidebar with a “Hardware” section?

1 Like

Yes, that’s where I took the screenshot.
Main issue is simply that sometimes the zigbee dongle is at one USB port, sometimes it switches over to the other one.
I have also tried your ttyACM0 approach, but that also “could not be found”.
Perhaps I should suggest the by-id approach to @koenkk?

I have the exact same issue, with a Zigbee and a RF dongle. Every time I reboot it changes places from USB0 to USB1… somewhat annoying. (HASSOS)

I had the same in begin of use of HAOS (now using docker).

I have added in configuration.yaml (value from devices screen):

rfxtrx:
  device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1XR25RT-if00-port0

RFXTRX was working, Zigbee stick was working after that without additional changes.

Maybe it help somebody if looking for this issue :wink:

Commenting in a very old answer, can you please share the configuration of your dongle inside Zigbee2MQTT?