Setup:
Hassio in LXC container running on QNAP NAS
USB device: Aeotec Z-Stick and CC2530
Before:
I have passed the two ACM devices to the Hassio LXC container and the Hardware tab of Hassio shows /dev/ttyACM1 and /dev/ttyACM2
Now:
All of a sudden (May be since HA 0.94.3) the same USB devices is also shown as /dev/serial/by-id/. So I have 4 devices listed under my serial (2 and 2 duplicated). I have not done anythings with the QNAP NAS
Problem:
I can’t run any add-on (zigbee2mqtt and community SSH) that needs to access USB serial devices due to the fact that add-ons are not privilege containers and cannot access /dev/serial/by-id/. As a result, the add-on sees the /dev/serial/by-id/ but returns an error when in fact it cannot access the /dev/serial/by-id/
I have a similar or maybe even the same problem.
Everything was working fine for HA 0.92.2 but, after I updated to HA 0.95.4, I got the following error when I try to start some add-ons (Node-Red, Visual Studio Code, …):
error gathering device information while adding custom device “/dev/serial/by-id/usb-xxxx_xxxx-xxxx”: no such file or directory
Similar to yours. I have Hassio in Ubuntu LXC container running on QNAP too but I only have Aeotec Z-Stick (/dev/ttyACM0).
From what I understood, we should configure QNAP to expose /dev/serial/by-id to LXC container. Although I couldn’t find a proper configuration to do it now, I found a temporary fix for this issue (which it might not be ideal).
Thanks for the tip! I followed your suggestion and it works.
As far as I know, QNAP doesn’t expose /serial/by-id, so I assume the serial/by-id/ was created by Hassio. I guess by defining a symlink in QNAP and it overwrite those created by Hassio. Then the add-on being non-privileged container is able to access them again.
There are reports saying QNAP will overwrite the symlink every time it reboots. So I have added the symlink command in the startup script.
I am glad it worked for you too.
When I created the first time I didn’t have time to test everything properly but after reading your message, I restarted my server and lost the symlink. So, I had to add the symlink commands in a startup script too.
Agree, Hassio is creating the serial/by-id devices and somehow, the addons consider the list of devices from Hassio and not from LXC container. I believe it was a requested change since there were some issues related to using direct /dev/ttyACM0 or /dev/ttyACM1. Probably you know but you can check the list of devices in Hass.io -> System -> Hardware from Home Assistant page.
Unfortunately, I don’t know how to avoid Hassio to create those devices or change the addon configuration to not consider them.
I will keep trying to find a better solution for that, and I will keep you posted if I find one. It will be great if you let me know in case you find one too.