Can't reach usb device

Hello, I am new to docker
I’m running docker on a Raspberry 4 with Raspberry OS 64bit

I got Home Assistant in a container, with the RFXTRX integration. A few days ago RFXTRX stopped working, log said it failed to receive response from the usb device. The usb device works fine in windows with rfxmngr (tested just now)

I googled for a few days, and asked in the home assistant forum and eventually got a tip to add privileged: true to docker-compose.yml and it worked again. Until now.

I will be very grateful to anyone that can help, I am loosing my hair…

Here is my docker-compose.yml

version: '2.1'

        container_name: homeassistant
        network_mode: host
            - PUID=1000
            - PGID=1000
            - TZ=Europe/Stockholm

        privileged: true

            - ./common.env
            - ./secret.env

            - /home/pi/docker/homeassistant/data:/config
        restart: unless-stopped
            - '/dev/serial/by-id/usb-RFXCOM_RFXtrx433XL_DO5OP3V5-if00-port0:/dev/usb_RFXcom'
            - /dev/ttyUSB1:/dev/rfxcom
#            - /dev/ttyUSB0:/dev/zwave

Here are output from the Pi

$ ls -l /dev/serial/by-id
totalt 0
lrwxrwxrwx 1 root root 13 10 mar 19.46 usb-RFXCOM_RFXtrx433XL_DO5OP3V5-if00-port0 -> ../../ttyUSB1
lrwxrwxrwx 1 root root 13 10 mar 19.46 usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_1e914fd02487ec118153e93719c2d21c-if00-port0 -> ../../ttyUSB0

This time I got it working by changing to

- /dev/ttyUSB1:/dev/serial/rfx

But this inconsistent behavior is puzzling. If there might be a bug around, how can I troubleshoot to see if is within my Pi, Docker, Home Assistant or the RFXTRX integration?

I am not sure why it started to fail after some time, but one thing I noticed is that you are using the latest version of the Home Assistant image. This is not recommended. Always use a specific version so it can’t change (well, it could, but it is very unlikely that it would) unless you intentionally change it.

1 Like

Thank you for that tip. I will change to the version I am currently using. :slightly_smiling_face: