Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] USB_Manager

Featured Replies

  • Author
11 minutes ago, dopeytree said:

Ok my bad. Dodgy mini usb cable. 3 of 5 are power only. 🤪

it shows up in the manager and in the VM but still doesn't update properly. 

The working method is use the esphome web app in chrome on mac.

Depends if you need to map as a whole device or as a serial port. I can see the device in HA.

image.png

  • 3 weeks later...
  • Replies 583
  • Views 125.2k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I have started to add support for mapping devices as a Serial connection to a VM. So you wont have to use the XML fix.   Function works for starting/stopping VM, hotplug removal but doesnt w

  • Option added in 2022.08.20  

  • What output do you get if you hover over the virsh error?   The port number is only used if you enable connect as serial via the slider which is required for map Conbee II correctly above 6.

Posted Images

How is it when I would like to pass a whole USB 2.0 Hub to a VM? As Home Assistant like USB 2.0 Hub, especially on zigbee I would like to pass the whole hub though. Is it any reliable way to do that? For me it seems like 1-13.1 -> is the hub as 1-13.2 is the UPS plugged on the USB2 plug next to the HUB.

 

Also of the three options should I usually choose? Automount on start, or on vm. What does serial do? And lastly dpes Connect as Serial Guest Port Number do, and why is it always 4?

 

 

Screenshot 2023-07-29 at 21.05.16.png

Screenshot 2023-07-29 at 21.02.25.png

Screenshot 2023-07-29 at 20.56.06.png

  • Author
1 hour ago, Aumoenoav said:

How is it when I would like to pass a whole USB 2.0 Hub to a VM? As Home Assistant like USB 2.0 Hub, especially on zigbee I would like to pass the whole hub though. Is it any reliable way to do that? For me it seems like 1-13.1 -> is the hub as 1-13.2 is the UPS plugged on the USB2 plug next to the HUB.

 

Also of the three options should I usually choose? Automount on start, or on vm. What does serial do? And lastly dpes Connect as Serial Guest Port Number do, and why is it always 4?

It is not possible to pass a hub through to a VM so the plugin emulates this as passes through each device that is connected to that hub.

 

Auto connect at plugin will attach a device to a VM if it is running if you physically connect a device i.e. hotplug.

Auto connect at start will connect the device to the VM when it starts.

Connect as serial changes the way the device is connected to the VM. it will be connected as serial port rather than a usb device. Conbee II need this option. The port number is the device number on the VM USB hub, so if you had two devices then you would need to set the other one to a different port number, this is only used for serial option.

 

in HA the serial mapped device will show like this. -4 is the port number

 

image.png

 

  • 4 weeks later...

I'm having an issue where Connect as Serial Guest Port Number won't change from 04.  I need to change it to 00, since that is what my HA VM is expecting.  I recently ran into this issue after upgrading Unraid.  I can get it to work if I hotplug the USB devices in the correct order, but ideally I would like to set it and forget it like I had it before.  It works when the device is classified as ttyUSB0.  Here is the hardware info when it works:

DEVLINKS: >-
  /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxx-if00-port0
  /dev/serial/by-path/pci-0000:00:07.0-usb-0:1:1.0-port0
DEVNAME: /dev/ttyUSB0
DEVPATH: /devices/pci0000:00/0000:00:07.0/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0
ID_BUS: usb
ID_MODEL: Sonoff_Zigbee_3.0_USB_Dongle_Plus
ID_MODEL_ENC: Sonoff\x20Zigbee\x203.0\x20USB\x20Dongle\x20Plus
ID_MODEL_ID: ea60
ID_PATH: pci-0000:00:07.0-usb-0:1:1.0
ID_PATH_TAG: pci-0000_00_07_0-usb-0_1_1_0
ID_REVISION: '0100'
ID_SERIAL: ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxx
ID_SERIAL_SHORT: xxx
ID_TYPE: generic
ID_USB_DRIVER: cp210x
ID_USB_INTERFACES: ':ff0000:'
ID_USB_INTERFACE_NUM: '00'
ID_USB_MODEL: Sonoff_Zigbee_3.0_USB_Dongle_Plus
ID_USB_MODEL_ENC: Sonoff\x20Zigbee\x203.0\x20USB\x20Dongle\x20Plus
ID_USB_MODEL_ID: ea60
ID_USB_REVISION: '0100'
ID_USB_SERIAL: ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxx
ID_USB_SERIAL_SHORT: xxx
ID_USB_TYPE: generic
ID_USB_VENDOR: ITead
ID_USB_VENDOR_ENC: ITead
ID_USB_VENDOR_ID: 10c4
ID_VENDOR: ITead
ID_VENDOR_ENC: ITead
ID_VENDOR_ID: 10c4
MAJOR: '188'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '1830641'

(replaced actual serial with xxx).

Edited by clowncracker

  • Author
1 hour ago, clowncracker said:

I'm having an issue where Connect as Serial Guest Port Number won't change from 04.  I need to change it to 00, since that is what my HA VM is expecting.  I recently ran into this issue after upgrading Unraid.  I can get it to work if I hotplug the USB devices in the correct order, but ideally I would like to set it and forget it like I had it before.  It works when the device is classified as ttyUSB0.  Here is the hardware info when it works:

DEVLINKS: >-
  /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxx-if00-port0
  /dev/serial/by-path/pci-0000:00:07.0-usb-0:1:1.0-port0
DEVNAME: /dev/ttyUSB0
DEVPATH: /devices/pci0000:00/0000:00:07.0/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0
ID_BUS: usb
ID_MODEL: Sonoff_Zigbee_3.0_USB_Dongle_Plus
ID_MODEL_ENC: Sonoff\x20Zigbee\x203.0\x20USB\x20Dongle\x20Plus
ID_MODEL_ID: ea60
ID_PATH: pci-0000:00:07.0-usb-0:1:1.0
ID_PATH_TAG: pci-0000_00_07_0-usb-0_1_1_0
ID_REVISION: '0100'
ID_SERIAL: ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxx
ID_SERIAL_SHORT: xxx
ID_TYPE: generic
ID_USB_DRIVER: cp210x
ID_USB_INTERFACES: ':ff0000:'
ID_USB_INTERFACE_NUM: '00'
ID_USB_MODEL: Sonoff_Zigbee_3.0_USB_Dongle_Plus
ID_USB_MODEL_ENC: Sonoff\x20Zigbee\x203.0\x20USB\x20Dongle\x20Plus
ID_USB_MODEL_ID: ea60
ID_USB_REVISION: '0100'
ID_USB_SERIAL: ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxx
ID_USB_SERIAL_SHORT: xxx
ID_USB_TYPE: generic
ID_USB_VENDOR: ITead
ID_USB_VENDOR_ENC: ITead
ID_USB_VENDOR_ID: 10c4
ID_VENDOR: ITead
ID_VENDOR_ENC: ITead
ID_VENDOR_ID: 10c4
MAJOR: '188'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '1830641'

(replaced actual serial with xxx).

Which port are you using in HA you should map using /dev/serial/by-id rather than tty Id will have qemu in the path.

 

port number is the device port on tbe usb hub within Ha not related to tty name. Only reason to change port would be if you need two devices or another usb device is i. port 4

 

/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.7-4-if00-port0

 

 

 

if ($port == "") $port="04" ;
    usb_manager_log("Info: connect as serial guest port is:".$port);
    $usbstr .= "<serial type='dev'>
    <source path='{$isSerialPath}'/>
    <target type='usb-serial' port='1'>
    <model name='usb-serial'/>
    </target>
    <alias name='ua-serial{$usbbus}{$usbdev}'/>
    <address type='usb' bus='0' port='{$port}'/>
    </serial>" ;
    }

I've run into an entirely new issue.  Now the USB devices will not even attach when the VM starts.  It just shows VM Attach.

 

image.thumb.png.a047965b2674a8bd5f1f51049896550e.png

 

I've tried uninstalling and reinstalling the plugin.  I just recently upgraded to version 6.11.5.  Here are my logs/outputs:

ls /etc/libvirt/hooks/

qemu* qemu.d/

 

ls /etc/libvirt/hooks/qemu.d/

USB_Manager*

 

Unraid Logs:
 

Aug 27 08:40:13 clowncracker-NAS usb_manager: Info: virsh called Home Assistant 001 005 error: Failed to attach device from /tmp/libvirthotplugusbbybusHome Assistant-001-005.xml error: internal error: unable to execute QEMU command 'chardev-add': Failed to add chardev 'charua-serial001005': Could not open '/dev/serial/by-id/': Is a directory  
Aug 27 08:40:16 clowncracker-NAS usb_manager: Info: virsh called Home Assistant 001 002 Device attached successfully  
Aug 27 08:40:17 clowncracker-NAS kernel: TCP: request_sock_TCP: Possible SYN flooding on port 31242. Sending cookies.  Check SNMP counters.
Aug 27 08:44:04 clowncracker-NAS kernel: br0: port 2(vnet4) entered disabled state
Aug 27 08:44:04 clowncracker-NAS kernel: device vnet4 left promiscuous mode
Aug 27 08:44:04 clowncracker-NAS kernel: br0: port 2(vnet4) entered disabled state
Aug 27 08:44:04 clowncracker-NAS kernel: usb 1-1: reset full-speed USB device number 2 using xhci_hcd
Aug 27 08:44:04 clowncracker-NAS kernel: usb 1-14: reset full-speed USB device number 7 using xhci_hcd
Aug 27 08:44:05 clowncracker-NAS kernel: cp210x 1-14:1.0: cp210x converter detected
Aug 27 08:44:05 clowncracker-NAS kernel: usb 1-14: cp210x converter now attached to ttyUSB1
Aug 27 08:44:05 clowncracker-NAS usb_manager: Info: rc.usb_manager tty_add Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_ee3d070e8d94eb1188e236703d98b6d1 /dev/ttyUSB1  
Aug 27 08:44:05 clowncracker-NAS usb_manager: Info: rc.usb_manager Processing tty attach Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_ee3d070e8d94eb1188e236703d98b6d1 /dev/ttyUSB1  
Aug 27 08:44:05 clowncracker-NAS usb_manager: Info: rc.usb_manager  vm_action Home Assistant stopped end -
Aug 27 08:44:05 clowncracker-NAS usb_manager: Info: rc.usb_manager VM Shutdown 001/005 vm: Home Assistant
Aug 27 08:44:05 clowncracker-NAS usb_manager: Info: rc.usb_manager VM Shutdown 001/007 vm: Home Assistant
Aug 27 08:44:05 clowncracker-NAS usb_manager: Info: rc.usb_manager VM Shutdown 001/002 vm: Home Assistant
Aug 27 08:44:05 clowncracker-NAS usb_manager: Info: rc.usb_manager Autoconnect No Mapping found Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_ee3d070e8d94eb1188e236703d98b6d1 /dev/ttyUSB1   port
Aug 27 08:44:32 clowncracker-NAS kernel: br0: port 2(vnet5) entered blocking state
Aug 27 08:44:32 clowncracker-NAS kernel: br0: port 2(vnet5) entered disabled state
Aug 27 08:44:32 clowncracker-NAS kernel: device vnet5 entered promiscuous mode
Aug 27 08:44:32 clowncracker-NAS kernel: br0: port 2(vnet5) entered blocking state
Aug 27 08:44:32 clowncracker-NAS kernel: br0: port 2(vnet5) entered forwarding state
Aug 27 08:44:32 clowncracker-NAS usb_manager: Info: rc.usb_manager  vm_action Home Assistant prepare begin -


If I hit VM Attach manually, the device configured to Serial has a Virsh error:

Unraid Logs:
 

Aug 27 08:48:55 clowncracker-NAS kernel: cp210x ttyUSB1: cp210x converter now disconnected from ttyUSB1
Aug 27 08:48:55 clowncracker-NAS kernel: cp210x 1-14:1.0: device disconnected
Aug 27 08:48:55 clowncracker-NAS usb_manager: Info: virsh called Home Assistant 001 007 Device attached successfully  
Aug 27 08:48:56 clowncracker-NAS usb_manager: Info: connect as serial guest port is:04
Aug 27 08:48:56 clowncracker-NAS usb_manager: Info: virsh called Home Assistant 001 005 error: Failed to attach device from /tmp/libvirthotplugusbbybusHome Assistant-001-005.xml error: internal error: unable to execute QEMU command 'chardev-add': Failed to add chardev 'charua-serial001005': Could not open '/dev/serial/by-id/': Is a directory  
Aug 27 08:48:58 clowncracker-NAS usb_manager: Info: virsh called Home Assistant 001 002 Device attached successfully 

 

ls /dev/serial/by-id

usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_xxx-if00-port0@

 

Edited by clowncracker

  • Author
41 minutes ago, clowncracker said:


So I'm not exactly sure what I should do.  Right now I do have three USB devices hooked up to the VM, but Zigbee only works if it's the first device connected.  Do you want me to add that code somewhere?

In HA do you see a device with the following path in the Hardware details?

 

/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.7-4-if00-port0

 

Use this for the path to the dongle for the integration rather than ttyUSB0

 

image.png

 

What output do you get in system->hardware

 

image.png

3 minutes ago, SimonF said:

In HA do you see a device with the following path in the Hardware details?

 

/dev/serial/by-id/usb-QEMU_QEMU_USB_SERIAL_1-0000:00:07.7-4-if00-port0

 

Use this for the path to the dongle for the integration rather than ttyUSB0

 

image.png

 

What output do you get in system->hardware

 

image.png

Just updated my post, having an entirely different issue now.

  • Author
40 minutes ago, clowncracker said:

Just updated my post, having an entirely different issue now.

Can you provide output of the following

 

 cat  /usr/local/emhttp/state/usb.ini 

Just now, SimonF said:

Can you provide output of the following

 

 cat  /usr/local/emhttp/state/usb.ini 

[001/005]
VM = ""
virsh = "error: Failed to attach device from /tmp/libvirthotplugusbbybusHome Assistant-001-005.xml
error: internal error: unable to execute QEMU command 'chardev-add': Failed to add chardev 'charua-serial001005': Could not open '/dev/serial/by-id/': Is a directory

"
connectmethod = "Manual"
connectmap = "Serial"
virsherror = ""
connected = ""

[001/007]
virsherror = ""
connected = ""
VM = ""
virsh = "Device attached successfully

"
connectmethod = "Manual"
connectmap = "Device"

[001/002]
virsherror = ""
connected = ""
VM = ""
virsh = "Device attached successfully

"
connectmethod = "Manual"

 

  • Author
23 minutes ago, clowncracker said:
[001/005]
VM = ""
virsh = "error: Failed to attach device from /tmp/libvirthotplugusbbybusHome Assistant-001-005.xml
error: internal error: unable to execute QEMU command 'chardev-add': Failed to add chardev 'charua-serial001005': Could not open '/dev/serial/by-id/': Is a directory

"
connectmethod = "Manual"
connectmap = "Serial"
virsherror = ""
connected = ""

[001/007]
virsherror = ""
connected = ""
VM = ""
virsh = "Device attached successfully

"
connectmethod = "Manual"
connectmap = "Device"

[001/002]
virsherror = ""
connected = ""
VM = ""
virsh = "Device attached successfully

"
connectmethod = "Manual"

 

Not sure why this is incorrect.

 

Suggest disconnect USBs from VM and run the following and then post results of file.

 

 /usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager USBMgrBuildConnectedStatus

17 minutes ago, SimonF said:

Not sure why this is incorrect.

 

Suggest disconnect USBs from VM and run the following and then post results of file.

 

 /usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager USBMgrBuildConnectedStatus

The USB devices were disconnected from the VM when I ran that (the VM was off).  Reran it with the VM on (when VM Attach was still showing) and after manually attaching the USB devices in manager, both led to the same output.

Where is the output of that script?  It didn't display anything after running.

Edited by clowncracker

  • Author
2 minutes ago, clowncracker said:

The USB devices were disconnected from the VM when I ran that (the VM was off).  Reran it with the VM on when VM Attach was still showing and after manually attaching the USB devices in manager led to the same output.

Where is the output of that script?  It didn't display anything after running.

No it should rebuild the  /usr/local/emhttp/state/usb.ini  file

 

entries should look like this. Only suggestion I have is to maybe do a reboot if you can?

 

[001/023]
ishub = ""
connected = ""
parents = "1-9,usb1,0000:00:14.0,pci0000:00"
bus = 001
dev = 023
ID_VENDOR_FROM_DATABASE = "Dresden Elektronik"
ID_VENDOR_ID = "1cf1"
ID_MODEL = "ConBee_II"
ID_MODEL_ID = 0030
USBPort = "1-9.3"
class = "interface"
ID_SERIAL = "dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_xx"
isSerial = "1"
isSerialPath = "usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_xx-if00"
bNumInterfaces = 2
isSerialDevPath = "/dev/ttyACM0"

22 minutes ago, SimonF said:

No it should rebuild the  /usr/local/emhttp/state/usb.ini  file

 

entries should look like this. Only suggestion I have is to maybe do a reboot if you can?

 

[001/023]
ishub = ""
connected = ""
parents = "1-9,usb1,0000:00:14.0,pci0000:00"
bus = 001
dev = 023
ID_VENDOR_FROM_DATABASE = "Dresden Elektronik"
ID_VENDOR_ID = "1cf1"
ID_MODEL = "ConBee_II"
ID_MODEL_ID = 0030
USBPort = "1-9.3"
class = "interface"
ID_SERIAL = "dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_xx"
isSerial = "1"
isSerialPath = "usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_xx-if00"
bNumInterfaces = 2
isSerialDevPath = "/dev/ttyACM0"

 

/usr/local/emhttp/state/usb.ini before restarting server:

[001/005]
VM = ""
virsh = "error: Failed to attach device from /tmp/libvirthotplugusbbybusHome Assistant-001-005.xml
error: internal error: unable to execute QEMU command 'chardev-add': Failed to add chardev 'charua-serial001005': Could not open '/dev/serial/by-id/': Is a directory

"
connectmethod = "Manual"
connectmap = "Serial"
virsherror = ""
connected = ""
bus = 001
dev = 005
ID_VENDOR_FROM_DATABASE = ""
ID_VENDOR_ID = "10c4"
ID_MODEL = "Sonoff_Zigbee_3.0_USB_Dongle_Plus"
ID_MODEL_ID = "ea60"
USBPort = "1-9"
class = "interface"
parents = "usb1,0000:00:14.0,pci0000:00"
ID_SERIAL = "ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_12dc1e85c960ec11bd353d7625bfaa52"
isSerial = "1"
isSerialPath = "usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_12dc1e85c960ec11bd353d7625bfaa52-if00-port0"

[001/007]
virsherror = ""
connected = ""
VM = ""
virsh = "Device attached successfully

"
connectmethod = "Manual"
connectmap = "Device"
bus = 001
dev = 007
ID_VENDOR_FROM_DATABASE = ""
ID_VENDOR_ID = "10c4"
ID_MODEL = "CP2102N_USB_to_UART_Bridge_Controller"
ID_MODEL_ID = "ea60"
USBPort = "1-14"
class = "interface"
parents = "usb1,0000:00:14.0,pci0000:00"
ID_SERIAL = "Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_ee3d070e8d94eb1188e236703d98b6d1"
isSerial = "1"
isSerialPath = "usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_ee3d070e8d94eb1188e236703d98b6d1-if00-port0"

[001/002]
virsherror = ""
connected = ""
VM = ""
virsh = "Device attached successfully

"
connectmethod = "Manual"
connectmap = "Device"
bus = 001
dev = 002
ID_VENDOR_FROM_DATABASE = "Cambridge Silicon Radio, Ltd"
ID_VENDOR_ID = "0a12"
ID_MODEL = "CSR8510_A10"
ID_MODEL_ID = 0001
USBPort = "1-1"
class = "interface"
parents = "usb1,0000:00:14.0,pci0000:00"
ID_SERIAL = "0a12_CSR8510_A10"
isSerial = ""
isSerialPath = ""

[001/001]
connected = ""
bus = 001
dev = 001
ID_VENDOR_FROM_DATABASE = "Ports=16
 Speed=480
 Power=0mA
"
ID_VENDOR_ID = "1d6b"
ID_MODEL = ""
ID_MODEL_ID = 0002
USBPort = "1-0"
class = "roothub"
parents = "0000:00:14.0,pci0000:00"
ID_SERIAL = "Linux_5.19.17-Unraid_xhci-hcd_xHCI_Host_Controller_0000:00:14.0"
isSerial = ""
isSerialPath = ""

[001/006]
connected = ""
bus = 001
dev = 006
ID_VENDOR_FROM_DATABASE = ""
ID_VENDOR_ID = "046d"
ID_MODEL = "USB_Receiver"
ID_MODEL_ID = "c52b"
USBPort = "1-13"
class = "interface"
parents = "usb1,0000:00:14.0,pci0000:00"
ID_SERIAL = "Logitech_USB_Receiver"
isSerial = ""
isSerialPath = ""

[001/003]
connected = ""
bus = 001
dev = 003
ID_VENDOR_FROM_DATABASE = ""
ID_VENDOR_ID = "051d"
ID_MODEL = "Back-UPS_RS1000G_FW:868.L5_-P.D_USB_FW:L5_-P"
ID_MODEL_ID = 0002
USBPort = "1-2"
class = "interface"
parents = "usb1,0000:00:14.0,pci0000:00"
ID_SERIAL = "American_Power_Conversion_Back-UPS_RS1000G_FW:868.L5_-P.D_USB_FW:L5_-P_3B1802X19471"
isSerial = ""
isSerialPath = ""

[001/004]
connected = ""
bus = 001
dev = 004
ID_VENDOR_FROM_DATABASE = "Ports=4
 Speed=480
 Power=100mA
"
ID_VENDOR_ID = 05e3
ID_MODEL = ""
ID_MODEL_ID = 0610
USBPort = "1-6"
class = "hub"
parents = "usb1,0000:00:14.0,pci0000:00"
ID_SERIAL = "05e3_USB2.0_Hub"
isSerial = ""
isSerialPath = ""

[002/003]
connected = ""
bus = 002
dev = 003
ID_VENDOR_FROM_DATABASE = ""
ID_VENDOR_ID = "18d1"
ID_MODEL = 9302
ID_MODEL_ID = 9302
USBPort = "2-3"
class = "interface"
parents = "usb2,0000:00:14.0,pci0000:00"
ID_SERIAL = "18d1_9302"
isSerial = ""


I rebooted the server the and USB devices connected correctly.  Go figure sometimes all you need is a reboot.

 

Thanks for the help!

 

EDIT:  I also got the updated serial ID in HA working correctly.  So all of my problems are solved.
 

Edited by clowncracker

  • 4 weeks later...
On 2/12/2023 at 8:42 AM, SimonF said:

Plugins do a re-install at each boot. But found the issue, /etc/libvirt will not be mounted at boot time so will not create qemu.d and at the hooks file. Will look to add the processing when VM manager is started.

So this is still "an issue". From time to time (don't know why yet), when my server goes down unexpectedly, my libvirt image gets corrupted. I recreate it, but after that, I need to reinstall USB manager as devices no longer auto-attach after VM is started. Is there something that can be done about it?

  • Author
7 hours ago, stefan.tomko said:

So this is still "an issue". From time to time (don't know why yet), when my server goes down unexpectedly, my libvirt image gets corrupted. I recreate it, but after that, I need to reinstall USB manager as devices no longer auto-attach after VM is started. Is there something that can be done about it?

You can run install.sh from the directory below.

 

root@computenode:/usr/local/emhttp/plugins/usb_manager/scripts# ls install.sh 
install.sh*
root@computenode:/usr/local/emhttp/plugins/usb_manager/scripts# 

 

 

If you are are on 6.10 or above this will create you could manually to. you may need to create qemu.d directory.

 

root@computenode:/etc/libvirt/hooks/qemu.d# cat USB_Manager 
#!/usr/bin/env php

<?php

#begin USB_MANAGER
if ($argv[2] == 'prepare' || $argv[2] == 'stopped'){
      shell_exec("/usr/local/emhttp/plugins/usb_manager/scripts/rc.usb_manager vm_action '{$argv[1]}' {$argv[2]} {$argv[3]} {$argv[4]}  >/dev/null 2>&1 & disown") ;
}
#end USB_MANAGER
?>
root@computenode:/etc/libvirt/hooks/qemu.d# 

  • 2 weeks later...

does the plugin shows somehow/somewhere what are the actual speeds of connected devices?

  • Author
8 hours ago, ihazcat said:

does the plugin shows somehow/somewhere what are the actual speeds of connected devices?

No but may be able to add. Will need to investigate.

28 minutes ago, SimonF said:

No but may be able to add. Will need to investigate.

wow. good to hear that. i thought that may the plugin shows the hub's speed and/or the exact device (for example a USB drive's) capability. it would be helpful cause sometimes the plastic in the usb connectors are all black while some of them 3.0. and device manufacturers also lazy some cases. it is painful to figure the capabilities.

Edited by ihazcat

  • Author
On 10/4/2023 at 7:19 PM, ihazcat said:

wow. good to hear that. i thought that may the plugin shows the hub's speed and/or the exact device (for example a USB drive's) capability. it would be helpful cause sometimes the plastic in the usb connectors are all black while some of them 3.0. and device manufacturers also lazy some cases. it is painful to figure the capabilities.

Is this the type of info you are looking for? I have added next to class type.

 

image.png

1 hour ago, SimonF said:

Is this the type of info you are looking for? I have added next to class type.

 

image.png

yes! could you please make it a bit compact? because my guess it won't fit well on dashboard. maybe just a column with the actual protocol or icons. and is it possible to detect the connected devices max supported speeds?

  • Author
40 minutes ago, ihazcat said:

yes! could you please make it a bit compact? because my guess it won't fit well on dashboard. maybe just a column with the actual protocol or icons. and is it possible to detect the connected devices max supported speeds?

The usb speed icons are not available in the icons used within unraid.

 

Available values are below, I dont think there is a way to show the max supportable value, just the value it it currently connected at.

 

root@computenode:~# udevadm info -a  --path=/sys/bus/usb/devices/1-13.2

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-13/1-13.2':
    KERNEL=="1-13.2"
    SUBSYSTEM=="usb"
    DRIVER=="usb"
    ATTR{configuration}==""
    ATTR{bMaxPacketSize0}=="64"
    ATTR{bDeviceClass}=="00"
    ATTR{bcdDevice}=="0110"
    ATTR{bNumInterfaces}==" 3"
    ATTR{bConfigurationValue}=="1"
    ATTR{manufacturer}=="Intel Corp"
    ATTR{bNumConfigurations}=="1"
    ATTR{authorized}=="1"
    ATTR{speed}=="12"
    ATTR{idProduct}=="01b5"
    ATTR{urbnum}=="22"
    ATTR{devnum}=="10"
    ATTR{product}=="Intel ARC RGB Controller"
    ATTR{maxchild}=="0"
    ATTR{bmAttributes}=="e0"
    ATTR{bDeviceSubClass}=="00"
    ATTR{bMaxPower}=="100mA"
    ATTR{rx_lanes}=="1"
    ATTR{removable}=="removable"
    ATTR{idVendor}=="2516"
    ATTR{version}==" 2.00"
    ATTR{avoid_reset_quirk}=="0"
    ATTR{bDeviceProtocol}=="00"
    ATTR{tx_lanes}=="1"
    ATTR{ltm_capable}=="no"
    ATTR{devpath}=="13.2"
    ATTR{busnum}=="1"
    ATTR{quirks}=="0x0"
 

  • Author
15 hours ago, ihazcat said:

yes! could you please make it a bit compact? because my guess it won't fit well on dashboard. maybe just a column with the actual protocol or icons. and is it possible to detect the connected devices max supported speeds?

I have moved the location but not sure will be able to put onto dashboard as does not look great or a place to put it.

image.png

image.png

 

So can add as hoover text which would look better.

 

image.png

3 hours ago, SimonF said:

I have moved the location but not sure will be able to put onto dashboard as does not look great or a place to put it.

image.png

image.png

 

So can add as hoover text which would look better.

 

image.png

oh okay. i thought it is easy to add graphical elements or shorter/more relevant strings. is it out or polishing it?

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.