Jump to content

USB passthrough - SDR Radio to Home Assistant


Recommended Posts

Hello!  First time poster to the forums, appreciate anyone who manages to read this!

 

I have a UnRAID install with Home Assistant as a VM currently, but looking to move that to a Docker Container for the challenge/Learning opportunity of it but having issues with device pass through.  This is an optional activity, but I'd love to learn why I'm stuck.

 

When I do the command "lsusb" I get the a number of devices, but the one I want to use is here:

Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

 

However when I do: "ls -l /dev/serial/by-id" I do not see the device, insetad I only see my Zigbee dongle here, no signs of the SDR:

lrwxrwxrwx 1 root root 13 May 26 13:57 usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_cxxxxxxxxxxxxxxxxxxxx-if00-port0 -> ../../ttyUSB0

 

Finally, trying the following lsusb -v -s 001:004 based on the bus and device, I get an output of the following:

Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x2838 RTL2838 DVB-T
  bcdDevice            1.00
  iManufacturer           1 Realtek
  iProduct                2 RTL2838UHIDIR
  iSerial                 3 00000001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 USB2.0-Bulk&Iso
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 Bulk-In, Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 Bulk-In, Interface
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      2
Device Status:     0x0000
  (Bus Powered)

 

I guess what I'm trying to figure out is a) how to assign the device to my Home Assistant Container b) what is the device path I'd have to use to do it? For example in Zigbee2MQTT I have /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_cxxxxxxxxxxxxxxxxxxxxx-if00-port0. I'm just not sure what that would equate to for my SDR dongle.

 

Any thoughts? Am I tackling this incorrectly? Thanks!

Link to comment
4 hours ago, Macleg said:

Hello!  First time poster to the forums, appreciate anyone who manages to read this!

 

I have a UnRAID install with Home Assistant as a VM currently, but looking to move that to a Docker Container for the challenge/Learning opportunity of it but having issues with device pass through.  This is an optional activity, but I'd love to learn why I'm stuck.

 

When I do the command "lsusb" I get the a number of devices, but the one I want to use is here:

Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

 

However when I do: "ls -l /dev/serial/by-id" I do not see the device, insetad I only see my Zigbee dongle here, no signs of the SDR:

lrwxrwxrwx 1 root root 13 May 26 13:57 usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_cxxxxxxxxxxxxxxxxxxxx-if00-port0 -> ../../ttyUSB0

 

Finally, trying the following lsusb -v -s 001:004 based on the bus and device, I get an output of the following:

Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x2838 RTL2838 DVB-T
  bcdDevice            1.00
  iManufacturer           1 Realtek
  iProduct                2 RTL2838UHIDIR
  iSerial                 3 00000001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 USB2.0-Bulk&Iso
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 Bulk-In, Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 Bulk-In, Interface
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      2
Device Status:     0x0000
  (Bus Powered)

 

I guess what I'm trying to figure out is a) how to assign the device to my Home Assistant Container b) what is the device path I'd have to use to do it? For example in Zigbee2MQTT I have /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_cxxxxxxxxxxxxxxxxxxxxx-if00-port0. I'm just not sure what that would equate to for my SDR dongle.

 

Any thoughts? Am I tackling this incorrectly? Thanks!

You can us   /dev/bus/usb/001/004 issue you will have is that the device numbers will may change i.e. if the device is reset etc.

 

 

Link to comment
6 hours ago, SimonF said:

You can us   /dev/bus/usb/001/004 issue you will have is that the device numbers will may change i.e. if the device is reset etc.

 

 

I appreciate that, I’ll give it a shot!  Any thoughts possibly on my the Zigbee dongle would show up, but not the SDR?

Link to comment
1 hour ago, Macleg said:

I appreciate that, I’ll give it a shot!  Any thoughts possibly on my the Zigbee dongle would show up, but not the SDR?

Zigbee is a serial port Sdr is not. Only certain types report byid serial and storage. You may be able to create a udev rule to create a name to use.

Link to comment

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.

×
×
  • Create New...