[Plugin] USB_Manager


SimonF

Recommended Posts

45 minutes ago, BurntOC said:

Greetings, all.  I have a Home Assistant VM running and I've been passing my Z-wave and Zigbee dongles to it successfully for a long time.  Now Zigbee2MQTT is getting twitchy, which appears to be an open issue with the newer versions and my hardware, but I am trying to minimize any hiccups.  As passing both dongles seem to work whether or not I map them both as ports, both as devices, or one of each (even though they both show as CP210N UART Bridges in the USB Manager mapping, my question is this:

 

Is one of those configurations preferable over the others?  Even when I pass as port I set the devices /dev/serial/by-id in Home Assistant, so it doesn't seem to matter but I just wanted to double-check.

No both ways work the same its just the a usb connected to that port will be passed through to a VM, but if you change the device it would pass that new device. With name its does not matter which port you connect it do it will map it to the VM.

 

So if they stay in the same ports either can work.

  • Thanks 1
Link to comment
2 hours ago, SimonF said:

No both ways work the same its just the a usb connected to that port will be passed through to a VM, but if you change the device it would pass that new device. With name its does not matter which port you connect it do it will map it to the VM.

 

So if they stay in the same ports either can work.

 

That's what I figured as I worked my slow mind through it, but I'm glad I asked to be sure.  Thanks for the response, and for the great plugin.

  • Thanks 1
Link to comment
3 hours ago, mikeyosm said:

Is it possible to use this plugin to 'share' a webcam connected to my desktop PC with a VM running on UNRAID?

As Kilrah said yes if you usbip. You will need software on the desktop to share the usb webcam via usbip. Not sure how good the stream will be.

Link to comment

My syslog is full of these messages. Many per second. Is this just debug logging, and doesn't indicate a problem? How do I switch debug logging off? I couldn't see it in the gui or by searching around. Thanks

 

Jan 12 21:25:56 Tower kernel: vhci_hcd: unlink->seqnum 223034811
Jan 12 21:25:56 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034817
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034823
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034829
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034835
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104

 

Link to comment
15 minutes ago, al_uk said:

My syslog is full of these messages. Many per second. Is this just debug logging, and doesn't indicate a problem? How do I switch debug logging off? I couldn't see it in the gui or by searching around. Thanks

 

Jan 12 21:25:56 Tower kernel: vhci_hcd: unlink->seqnum 223034811
Jan 12 21:25:56 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034817
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034823
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034829
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104
Jan 12 21:25:57 Tower kernel: vhci_hcd: unlink->seqnum 223034835
Jan 12 21:25:57 Tower kernel: vhci_hcd: urb->status -104

 

I would say something is erroring, are you using the USBIP part of the plugin. If not you can disable the vhci module in the settings.

Link to comment
4 minutes ago, SimonF said:

I would say something is erroring, are you using the USBIP part of the plugin. If not you can disable the vhci module in the settings.

Thank you for replying. I have a Pi running dietpi and usbip with 2 usb devices attached. On Unraid I have passed those devices to a VM. This is all working fine.

Here's a screenshot of my USBIP page. Is it set correctly?

image.thumb.png.bc9985493ffacfc012a4fedf42c23ea0.png

image.thumb.png.8d34b4bbca45d05e4830e7b2203f7e8e.png

 

 

Link to comment
16 hours ago, al_uk said:

Any pointers to help me diagnose the log entries would be much appreciated please 🙂

 

Not found any issues running same config my side,No options I know of to stop the logs as looks like a connection is failing. USBIP Debug is not enabled in the Kernel.

Link to comment
  • 2 weeks later...

I'm attempting to connect a built-in bluetooth device on a separate PC via usbipd/usb_manager so that I can map it to my Home Assistant Docker. I have usbipd win installed on the "remote" PC (same LAN) and have the following settings configured. When I click attach in USB Manager, I get the following in the logs. Any ideas? I've Googled for an hour.

 

Jan 28 11:32:25 arcturus kernel: vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(8)
Jan 28 11:32:25 arcturus kernel: vhci_hcd vhci_hcd.0: devid(65539) speed(2) speed_str(full-speed)
Jan 28 11:32:25 arcturus kernel: vhci_hcd vhci_hcd.0: Device attached
Jan 28 11:32:26 arcturus kernel: vhci_hcd: vhci_device speed not set
Jan 28 11:32:26 arcturus kernel: usb 5-1: new full-speed USB device number 17 using vhci_hcd
Jan 28 11:32:26 arcturus kernel: vhci_hcd: vhci_device speed not set
Jan 28 11:32:26 arcturus kernel: usb 5-1: SetAddress Request (17) to port 0
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Found device firmware: intel/ibt-20-1-3.sfi
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Boot Address: 0x24800
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Firmware Version: 255-255.255
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: vhci_hcd: connection reset by peer
Jan 28 11:32:26 arcturus kernel: vhci_hcd: stop threads
Jan 28 11:32:26 arcturus kernel: vhci_hcd: release socket
Jan 28 11:32:26 arcturus kernel: vhci_hcd: disconnect device
Jan 28 11:32:26 arcturus kernel: usb 5-1: USB disconnect, device number 17
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: FW download error recovery failed (-19)
Jan 28 11:32:26 arcturus usb_manager: Info: rc.usb_manager usb_add 8087_0029 /dev/bus/usb/005/017 005 017
Jan 28 11:32:26 arcturus usb_manager: Info: rc.usb_manager Autoconnect No Mapping found 8087_0029 /dev/bus/usb/005/017 005 017 port 
Jan 28 11:32:26 arcturus usb_manager: Info: rc.usb_manager usb_remove  8087_0029 /dev/bus/usb/005/017 005 017 

 

2024-01-28 11_39_35-arcturus_USBManagerSettings.png

2024-01-28 11_39_11-Quick Assist.png

Link to comment
2 hours ago, crimson said:

I'm attempting to connect a built-in bluetooth device on a separate PC via usbipd/usb_manager so that I can map it to my Home Assistant Docker. I have usbipd win installed on the "remote" PC (same LAN) and have the following settings configured. When I click attach in USB Manager, I get the following in the logs. Any ideas? I've Googled for an hour.

 

Jan 28 11:32:25 arcturus kernel: vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(8)
Jan 28 11:32:25 arcturus kernel: vhci_hcd vhci_hcd.0: devid(65539) speed(2) speed_str(full-speed)
Jan 28 11:32:25 arcturus kernel: vhci_hcd vhci_hcd.0: Device attached
Jan 28 11:32:26 arcturus kernel: vhci_hcd: vhci_device speed not set
Jan 28 11:32:26 arcturus kernel: usb 5-1: new full-speed USB device number 17 using vhci_hcd
Jan 28 11:32:26 arcturus kernel: vhci_hcd: vhci_device speed not set
Jan 28 11:32:26 arcturus kernel: usb 5-1: SetAddress Request (17) to port 0
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Found device firmware: intel/ibt-20-1-3.sfi
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Boot Address: 0x24800
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Firmware Version: 255-255.255
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: Received unexpected HCI Event 0x00
Jan 28 11:32:26 arcturus kernel: vhci_hcd: connection reset by peer
Jan 28 11:32:26 arcturus kernel: vhci_hcd: stop threads
Jan 28 11:32:26 arcturus kernel: vhci_hcd: release socket
Jan 28 11:32:26 arcturus kernel: vhci_hcd: disconnect device
Jan 28 11:32:26 arcturus kernel: usb 5-1: USB disconnect, device number 17
Jan 28 11:32:26 arcturus kernel: Bluetooth: hci0: FW download error recovery failed (-19)
Jan 28 11:32:26 arcturus usb_manager: Info: rc.usb_manager usb_add 8087_0029 /dev/bus/usb/005/017 005 017
Jan 28 11:32:26 arcturus usb_manager: Info: rc.usb_manager Autoconnect No Mapping found 8087_0029 /dev/bus/usb/005/017 005 017 port 
Jan 28 11:32:26 arcturus usb_manager: Info: rc.usb_manager usb_remove  8087_0029 /dev/bus/usb/005/017 005 017 

 

2024-01-28 11_39_35-arcturus_USBManagerSettings.png

2024-01-28 11_39_11-Quick Assist.png

Using bluetooth on unraid can be a challenge due to firmware etc. Best to passthru into a VM. Maybe look at some bluetooth to mqtt type process.

Link to comment
11 hours ago, SimonF said:

Using bluetooth on unraid can be a challenge due to firmware etc. Best to passthru into a VM. Maybe look at some bluetooth to mqtt type process.

 

Ended up getting this to work via USB Manager. Thanks Simon for the excellent plugin! Leaving all my notes here for future me or others:

 

Steps to use USB Manager to connect a remote Bluetooth USB dongle to a Home Assistant docker running on Unraid

  1. Install usbipd-win on the remote Windows 11 PC host that we want to passthrough following instructions here ignore the parts about WSL.
  2. Bind the device using 

    usbipd bind --busid=<BUSID>

  3. Install USB Manager plugin on Unraid enabling HUB Processing, vhci_hcd, and Run USBIPD Daemon.

  4. Install the NerdTools plugin to add BlueZ to Unraid host.

  5. Add the remote host under the USB tab in Unraid and then Attach the shared device.

  6. Check logs and determine driver being used? See my initial errors above.
  7. Install the iwlwifi-cc-a0-77.ucode driver from Intel directly to /lib/firmware and rename the (original driver shown in logs) /lib/firmware/intel/ibt-20-1-3.sfi to /lib/firmware/intel/ibt-20-1-3.sfi.bak.
  8. Attach the shared device again and should look something more like below.
  9. Map the path /run/dbus container to /run/dbus as Read Only in my Home Assistant Docker. (no need to passthrough the actual device).

On restart of the HA docker, the device was automatically detected in the Devices & services menu. And it immediately detected the Airthings Radon BLE device that I started this adventure over.

 

This is what my logs showed when successfully connecting.

Jan 29 01:35:06 arcturus kernel: vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(8)
Jan 29 01:35:06 arcturus kernel: vhci_hcd vhci_hcd.0: devid(65539) speed(2) speed_str(full-speed)
Jan 29 01:35:06 arcturus kernel: vhci_hcd vhci_hcd.0: Device attached
Jan 29 01:35:06 arcturus kernel: vhci_hcd: vhci_device speed not set
Jan 29 01:35:06 arcturus kernel: usb 5-1: new full-speed USB device number 23 using vhci_hcd
Jan 29 01:35:06 arcturus kernel: vhci_hcd: vhci_device speed not set
Jan 29 01:35:06 arcturus kernel: usb 5-1: SetAddress Request (23) to port 0
Jan 29 01:35:06 arcturus usb_manager: Info: rc.usb_manager usb_add 8087_0029 /dev/bus/usb/005/023 005 023
Jan 29 01:35:06 arcturus kernel: Bluetooth: MGMT ver 1.22
Jan 29 01:35:06 arcturus bluetoothd[64428]: Battery Provider Manager created
Jan 29 01:35:06 arcturus kernel: NET: Registered PF_ALG protocol family
Jan 29 01:35:07 arcturus usb_manager: Info: rc.usb_manager Add device with more than one interface & connect serial   .
Jan 29 01:35:07 arcturus usb_manager: Info: rc.usb_manager Autoconnect Parent usb5
Jan 29 01:35:07 arcturus usb_manager: Info: rc.usb_manager Autoconnect No Mapping found 8087_0029 /dev/bus/usb/005/023 005 023 port 5-1

 

hciconfig seems to indicate that the device is seen, but I'm unsure where to go from here on troubleshooting.

 

hciconfig -a
hci0:   Type: Primary  Bus: USB
        BD Address: 80:38:FB:E4:72:11  ACL MTU: 1021:4  SCO MTU: 96:6
        UP RUNNING 
        RX bytes:1030 acl:0 sco:0 events:68 errors:0
        TX bytes:2311 acl:0 sco:0 commands:68 errors:0
        Features: 0xbf 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH SNIFF 
        Link mode: PERIPHERAL ACCEPT 
        Name: 'BlueZ 5.71'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous, 
        HCI Version: 5.2 (0xb)  Revision: 0x20f9
        LMP Version: 5.2 (0xb)  Subversion: 0x20f9
        Manufacturer: Intel Corp. (2)

 

2024-01-29 01_47_15-Clipboard.png

Link to comment
  • 3 weeks later...
  • 2 weeks later...

Anyone having a problem with devices auto-attaching on server or VM start?  I've had it configured that way since Day 1 and it worked great for almost a year, but the last couple of months it seems to ignore that setting and I still have to go in to click "VM ATTACH" to get my Zwave and Zigbee sticks to show up in my HA VM.  Maybe something got corrupted when I was tweaking to switch my Zigbee stick out for a newer one with a better chipset.

Open to any fixes, even blowing it away and starting over but IIRC I tried that from the GUI about 6 weeks ago and it didn't resolve this for me.

Link to comment
36 minutes ago, BurntOC said:

Anyone having a problem with devices auto-attaching on server or VM start?  I've had it configured that way since Day 1 and it worked great for almost a year, but the last couple of months it seems to ignore that setting and I still have to go in to click "VM ATTACH" to get my Zwave and Zigbee sticks to show up in my HA VM.  Maybe something got corrupted when I was tweaking to switch my Zigbee stick out for a newer one with a better chipset.

Open to any fixes, even blowing it away and starting over but IIRC I tried that from the GUI about 6 weeks ago and it didn't resolve this for me.

Which vers of the plug and unraid are you running

 

Does this file exist 

root@computenode:~# cat /etc/libvirt/hooks/qemu.d/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:~# 

Link to comment
19 minutes ago, SimonF said:

Which vers of the plug and unraid are you running

 

Does this file exist 

root@computenode:~# cat /etc/libvirt/hooks/qemu.d/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:~# 

 

@SimonF Thanks for the quick response. Under hooks I don't have any subfolders - qemu.d or otherwise - so that cat command is giving me an error.  Only thing there atm is a qemu file. I checked one of my other servers and it actually doesn't even have the hooks folder under libvirt (but it's not running USB Manager either, just an FYI).

Link to comment
9 minutes ago, BurntOC said:

 

@SimonF Thanks for the quick response. Under hooks I don't have any subfolders - qemu.d or otherwise - so that cat command is giving me an error.  Only thing there atm is a qemu file. I checked one of my other servers and it actually doesn't even have the hooks folder under libvirt (but it's not running USB Manager either, just an FYI).

if you are running < 6.10 the lines are added to qemu in the hooks dir.

 

it should have the code inserted near the top.

 

#begin USB_MANAGER\nif ($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

 

Also check the permission on the file that it is execurtable. ls -l you have the x in the flags.

 

can you also check usb.ini in /usr/local/emhttp/state/ 

 

Entries should look similar to this 

 

[001/111]
ishub = ""
connected = ""
parents = "1-9,usb1,0000:00:14.0,pci0000:00"
bus = 001
dev = 111
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_DE"
isSerial = "1"
isSerialPath = "usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE-if00"
bNumInterfaces = 2
isSerialDevPath = "/dev/ttyACM1"

Link to comment

This server, and the other  one I referenced, are on 6.12.8.

 

I checked the usb.ini file and I think it looks okay (pasted code block below).   I'm not sure I follow on the USB Manager code block.  Are you suggesting I copy the code from one or both of the replies above into a manually created path and file, then assign the executable permission?   If I uninstalled the plugin altogether and reinstalled, would I be able to get it to automatically create the startup stuff and restore my current assignments?

 


[001/002]
connected = ""
bus = 001
dev = 002
ID_VENDOR_FROM_DATABASE = "Ports=4
 Power=0mA
"
ID_VENDOR_ID = "0bda"
ID_MODEL = ""
ID_MODEL_ID = 5411
USBPort = "1-1"
class = "hub"
parents = "usb1,0000:00:15.0,pci0000:00"
ID_SERIAL = "Generic_4-Port_USB_2.0_Hub"
isSerial = ""
isSerialPath = ""

[001/004]
connected = 1
bus = 001
dev = 004
ID_VENDOR_FROM_DATABASE = "Silicon Labs"
ID_VENDOR_ID = "10c4"
ID_MODEL = "CP2102N_USB_to_UART_Bridge_Controller"
ID_MODEL_ID = "ea60"
USBPort = "1-1.1"
class = "interface"
parents = "1-1,usb1,0000:00:15.0,pci0000:00"
ID_SERIAL = "Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_5e2708b05fbcea11944693e368aed703"
isSerial = 1
isSerialPath = "usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_5e2708b05fbcea11944693e368aed703-if00-port0"
virsherror = ""
VM = "Home Assistant"
virsh = "Device attached successfully

"
connectmethod = "Manual"
connectmap = "Device"

[001/006]
connected = 1
bus = 001
dev = 006
ID_VENDOR_FROM_DATABASE = "Silicon Labs"
ID_VENDOR_ID = "10c4"
ID_MODEL = "SkyConnect_v1.0"
ID_MODEL_ID = "ea60"
USBPort = "1-1.2"
class = "interface"
parents = "1-1,usb1,0000:00:15.0,pci0000:00"
ID_SERIAL = "Nabu_Casa_SkyConnect_v1.0_9c33dedc57e2ed11b233ec5162c613ac"
isSerial = 1
isSerialPath = "usb-Nabu_Casa_SkyConnect_v1.0_9c33dedc57e2ed11b233ec5162c613ac-if00-port0"
virsherror = ""
VM = "Home Assistant"
virsh = "Device attached successfully

"
connectmethod = "Manual"
connectmap = "Device"

[002/001]
connected = ""
bus = 002
dev = 001
ID_VENDOR_FROM_DATABASE = "Ports=7
 Power=0mA
"
ID_VENDOR_ID = "1d6b"
ID_MODEL = ""
ID_MODEL_ID = 0003
USBPort = "2-0"
class = "roothub"
parents = "0000:00:15.0,pci0000:00"
ID_SERIAL = "Linux_6.1.74-Unraid_xhci-hcd_xHCI_Host_Controller_0000:00:15.0"
isSerial = ""
isSerialPath = ""

[002/002]
connected = ""
bus = 002
dev = 002
ID_VENDOR_FROM_DATABASE = "Ports=4
 Power=0mA
"
ID_VENDOR_ID = "0bda"
ID_MODEL = ""
ID_MODEL_ID = 0411
USBPort = "2-1"
class = "hub"
parents = "usb2,0000:00:15.0,pci0000:00"
ID_SERIAL = "Generic_4-Port_USB_3.0_Hub"
isSerial = ""
isSerialPath = ""

[002/003]
connected = ""
bus = 002
dev = 003
ID_VENDOR_FROM_DATABASE = "Ports=2
 Power=0mA
"
ID_VENDOR_ID = "0bda"
ID_MODEL = ""
ID_MODEL_ID = 0415
USBPort = "2-6"
class = "hub"
parents = "usb2,0000:00:15.0,pci0000:00"
ID_SERIAL = "Generic_2-Port_USB_3.0_Hub"
isSerial = ""
isSerialPath = ""

[004/001]
ishub = 1
connected = ""
parents = "vhci_hcd.0,platform"
bus = 004
dev = 001
ID_VENDOR_FROM_DATABASE = "Linux Foundation"
ID_VENDOR_ID = "1d6b"
ID_MODEL = "USB_IP_Virtual_Host_Controller"
ID_MODEL_ID = 0003
USBPort = "usb4"
class = ""
ID_SERIAL = "Linux_6.1.74-Unraid_vhci_hcd_USB_IP_Virtual_Host_Controller_vhci_hcd.0"
isSerial = ""
isSerialPath = ""
bNumInterfaces = ""

 

Link to comment
37 minutes ago, SimonF said:

if you are running < 6.10 the lines are added to qemu in the hooks dir.

 

it should have the code inserted near the top.

 

#begin USB_MANAGER\nif ($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

 

Also check the permission on the file that it is execurtable. ls -l you have the x in the flags.

 

can you also check usb.ini in /usr/local/emhttp/state/ 

 

Entries should look similar to this 

 

[001/111]
ishub = ""
connected = ""
parents = "1-9,usb1,0000:00:14.0,pci0000:00"
bus = 001
dev = 111
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_DE"
isSerial = "1"
isSerialPath = "usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE-if00"
bNumInterfaces = 2
isSerialDevPath = "/dev/ttyACM1"

No that is the code for pre 6.10 that gets inserted into the qemu file.

 

If you run the following it should create the hooks

/usr/local/emhttp/plugins/usb_manager/scripts/install.sh 

 

Looks like it is not recreating at boot because lbvirt is not mounted until services start will look into it.

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.