How to passthoug a USB device to a docker?


Recommended Posts

Hi all

 

Im running Home assistant in docker.

I have an USB dongel Sonoff Zigbee controller 3.0.

 

How can i passthough the dongel to my docker?

 

Im a little confused about all the topic and the correct way doing this.

Do i need this?

 

I can see this in the log

 

Feb  2 15:08:31 Kratos kernel: usb 1-14: USB disconnect, device number 7
Feb  2 15:08:31 Kratos kernel: cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
Feb  2 15:08:31 Kratos kernel: cp210x 1-14:1.0: device disconnected
Feb  2 15:09:27 Kratos kernel: usb 1-14: new full-speed USB device number 8 using xhci_hcd
Feb  2 15:09:27 Kratos kernel: cp210x 1-14:1.0: cp210x converter detected
Feb  2 15:09:27 Kratos kernel: usb 1-14: cp210x converter now attached to ttyUSB0
Feb  2 15:36:28 Kratos kernel: usb 1-14: USB disconnect, device number 8
Feb  2 15:36:28 Kratos kernel: cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
Feb  2 15:36:28 Kratos kernel: cp210x 1-14:1.0: device disconnected
Feb  2 15:37:24 Kratos kernel: usb 1-14: new full-speed USB device number 9 using xhci_hcd
Feb  2 15:37:24 Kratos kernel: cp210x 1-14:1.0: cp210x converter detected
Feb  2 15:37:24 Kratos kernel: usb 1-14: cp210x converter now attached to ttyUSB0

Thanks!

 

 

Edited by DanielPT
Link to comment

I have been searching for an answer and finally was able to do so! This reply also serves as my future reference.

  1. Plug in your USB device (not sure if restart is required)
  2. Open the Unraid console
  3. ls /dev/serial/by-id

     

  4. Copy the device name, for me it is `usb-Nabu_Casa_SkyConnect_v1.0_ba7a2aba7a2aba7a2aba7a2a-if00-port0`
  5. In your docker config, add another Device
  6. Make sure to have the Config Type and Value correct as below
  7. Config Type: Device
    Name: Any Device Name You Want
    Value: /dev/serial/by-id/usb-Nabu_Casa_SkyConnect_v1.0_ba7a2aba7a2aba7a2aba7a2a-if00-port0:/dev/ttyUSB0
  8. Done!

Please note that the value before colon is the path to your USB device, and the value after colon is the path within the container. It wasn't sccessful when I was trying to do

/dev/skyconnect

, until I do

/dev/ttyUSB0

.

 

The USB device then shows in my Home Assistant container.

Edited by PzrrL
typo
  • Like 1
Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.