cap_add needed to detect usb device

Hello–

I have a multicontainer app that is finally able to detect a Google coral connected through USB. The issue is that the first time it checks for the device it throws an error (I’d include, but suffice to say it doesn’t see the device connected on USB).

After the service restarts, it’s able to see and use the device correctly. Does anyone know the necessary cap_add permission to allow my container to see the connected USB device right away? Here are the relevant section of my docker-compose.yaml:

version: "2"
volumes:
  data-service:

services:
  data-service:
    build: ./data-service
    volumes:
        - "data-service:/data-srv"
  hardware-logic:
    build: ./hardware-logic
    cap_add:
      - "SYS_RAWIO"
      - "SYS_ADMIN"
      - "SYS_RESOURCE"
      - "SYS_MODULE"
    devices:
     - /dev/bus/usb
     - /dev/video0
     - /dev/ttyACM0
    labels:
      io.balena.features.balena-socket: '1'
      io.balena.features.kernel-modules: '1'
      io.balena.features.firmware: '1'
      io.balena.features.dbus: '1'
      io.balena.features.sysfs: '1'
      io.balena.features.procfs: '1'

Cheers

Sorry for the super delayed response here. Is this resolved for you yet. Also, did you already try cap_add with ALL option to see if that makes a difference.

You can enable persistent logging to compare logs 1:1 before and after restart to see if what changes. Ref: Configuration - Balena Documentation

Feel free to share logs of the device, we can help debug the same.

Regards,
Nitish