Sorry for my long response-time and thank you very much for your helpful hint.
The cmd lsusb
in the service-container terminal indeed always brought me the correct USB-devices. And therefore, for a long time, I also suspected the usb-detection library to be the root cause of non-working.
However, it turned out that the library is just fine and that the following brought the solution:
Next to privileged: true
and environment: - UDEV=1
, also make sure to set the network_mode: host
inside the docker-compose.yml file of your service-definition.
From the Balena documentation we learn network_mode: host
does the following:
Setting network_mode to host allows the container to share the same network namespace as the host OS.
When this is set, any ports exposed on the container will be exposed locally on the device.
This is necessary for features such as bluetooth.
And turns out, not only for bluetooth but also for services that need USB-detection.