[Plugin] USB_Manager


SimonF

Recommended Posts

4 hours ago, SimonF said:

If you hover over the error it will say most proberly already inuse.

 

Yes you dont need them on the VM so they can be removed.

 

I am looking for a way to identify allocation/usage outside of my plugin but not found an easy way as yet.

 

I have removed the USB X from the VM UI but I can see some USB settings in the XML view?

 

image.thumb.png.b396346f37f293f6c86a0c54a1ab31a0.png

 

Also here if I try to detach and retach the USB

image.thumb.png.27622dfcccd98dfebcde36a390907aff.png

 

Another thing is that this plugin doesn't list the USB name of the Z-wave stick but I dont think thats related to the error?

 

image.thumb.png.77a4d9074fc18cf654ee5a0b2da9b167.png

 

The plugin shows the Sigma as:

image.thumb.png.20a3dc6db5c397f0ed11a0ea40a94e2b.png

 

Should I bind the driver before using the tool to attach the usb to the VM?

Link to comment

Thanks! seems to be working 🙂

 

 

After first reboot it only mapped one of the USB drives but after the secound it looks to be fine, both are mapped:

image.thumb.png.1ae178c4a61e1ef95dc68be1303fefc8.png

 

Under the VM's and the USB manager Sigma designs is listed as 1-11 0658_0200 but all others USB's use the vendor name?

Could this have anything to do with this one not being attached after reboot?

 

image.thumb.png.58fd710dc92d646a89272332a62f152b.png

Link to comment

Hi @casperse

 

it shouldn't make any difference. That is the serial number provided which I use for the key from udev.

 

I can look to use the Model from Database on the Vendor:Product Column.

 

Have you tried setting the Automapping on the device or port? Then you dont need to manual hotplug. Toggle the switch to enable.

image.png.521eac5d3e2fc73ad08c57857db311d2.png

 

 

image.thumb.png.35f8038f683bb5efe04614500b4f0789.png

Link to comment
On 12/23/2021 at 1:48 PM, SimonF said:

Hi @casperse

 

it shouldn't make any difference. That is the serial number provided which I use for the key from udev.

 

I can look to use the Model from Database on the Vendor:Product Column.

 

Have you tried setting the Automapping on the device or port? Then you dont need to manual hotplug. Toggle the switch to enable.

image.png.521eac5d3e2fc73ad08c57857db311d2.png

 

 

image.thumb.png.35f8038f683bb5efe04614500b4f0789.png

Perfect! - Sorry for the late answer I had to many Christmas duties LOL

I didn't find this option before? I have now done this for both USB needed in the Home assistant!

Guess this will  solve all my problems thanks allot! This is a great plugin for Unraid

image.thumb.png.166d3267f6fb32e3294d87da1b7fc35d.png

 

 

Edited by casperse
Link to comment
7 minutes ago, casperse said:

This is a great plugin for Unraid

Thanks for the feedback and glad is working for you.

 

Also I have change the product to use the data base so in a future release you should see 

 

Sigma Designs, Inc.:Aeotec Z-Stick Gen5 (ZW090) - UZB

  • Thanks 1
Link to comment

I have been adding functions to allow a hub to be setup and any device connecting to the HUB can be added to the VM. The physical hub is not connected but processes each attached device and maps to VM.

 

To enable you need to enable Hub process in Settings.

image.thumb.png.b185cf9fbde8248c3c74741d398db245.png

 

You define a port mapping at the Hub level and any devices connecting will be mapped to the VM. It will only process one level so if you have a hub connected to a hub it will not process the second hub.

image.thumb.png.39db01a1665dc81a5f3a7781cc54e6ca.png

 

I expect to add to the main release in the next week or so.

Link to comment

I’m running Home Assistant in a VM on my unRAID server. Every time I have to shutdown the server the device number changes for USB devices connected to the VM and I have to use lsusb to find the new device numbers and then edit the VM to add them. Can I use this plugin to automatically take care of this? Most of the discussion in this thread is way over my head.😁

Link to comment
2 hours ago, wgstarks said:

I’m running Home Assistant in a VM on my unRAID server. Every time I have to shutdown the server the device number changes for USB devices connected to the VM and I have to use lsusb to find the new device numbers and then edit the VM to add them. Can I use this plugin to automatically take care of this? Most of the discussion in this thread is way over my head.😁

Yes it should and should be straight forward. Install the plugin You dont need to enable USBIP in the settings.

 

You will need to remove the allocation from the Vm Template.

 

On the main page you need to add a mapping: You can select based on the port or device using the first two icons

 

image.thumb.png.12604c248ea639139b6abe6026442d8c.png

 

You will be prompted with the following

 

image.png.a4faca10d3de3a524f67bb98a010f4b3.png

 

Select you VM and more the switches to Connect at plugin and VM Start and you should be set.

 

 

Edited by SimonF
Link to comment
9 minutes ago, wgstarks said:

When I use the detach button I get an error-

error: Failed to detach device from /tmp/libvirthotplugusbbybusDebian.xml
error: device not found: host usb device 003.004 not found

 

 

545345661_ScreenShot2022-01-04at4_55_23PM.thumb.png.b1ee18bf6e51264acfb627c6e9b75b22.png

Are you able to provide a screen print of the main usb page next to main on the menu bar.

Link to comment

I think maybe I got it by manually editing the VM???

 

310903478_ScreenShot2022-01-04at5_11_59PM.thumb.png.b41b3a526d0f94cd15f432b92dc732e1.png

 

Not sure if this right or not since I didn't get the prompt you mentioned. I edited the VM and then attached the USB device in the hot plug section on the VM tab (I didn't see the new USB tab at first). After that I used the icons on the USB tab to set auto connect prefs.

 

Not sure what this Virsh Error is though-

2082309393_ScreenShot2022-01-04at5_16_46PM.thumb.png.f51fadca943edad80a05dfa3c19e6c58.png

 

There is a popup that says something about failed to detach from the debian hot plug but I can't see the entire message. It runs off the edge of the browser.

Edited by wgstarks
Correct spell check
Link to comment
5 minutes ago, wgstarks said:

I think maybe I got it by manually editing the VM???

 

310903478_ScreenShot2022-01-04at5_11_59PM.thumb.png.b41b3a526d0f94cd15f432b92dc732e1.png

 

Not sure if this right or not since I didn't get the prompt you mentioned. I edited the VM and then attached the USB device in the hot plug section on the VM tab (I didn't see the new USB tab at first). After that I used the icons on the USB tab to set auto connect prefs.

 

Not sure what this Virus Error is though-

2082309393_ScreenShot2022-01-04at5_16_46PM.thumb.png.f51fadca943edad80a05dfa3c19e6c58.png

 

There is a popup that says something about failed to detach from the debian hot plug but I can't see the entire message. It runs off the edge of the browser.

I think it maybe you detached a none attached device.

 

You only need the device or port mapping. It wont hurt as device is action first.

Link to comment
19 minutes ago, wgstarks said:

So everything is good?

When the server is rebooted or the Array is stopped and started the error should be reset.

 

But if you want to tidy it up you can edit the state file /usr/local/emhttp/state/usb.ini

 

Find the section that matches the serial number 0557_2419 and set the virsherror="" should say =1

 

I am planning to change the hotplug page to only allow you do detached attached devices at somepoint.

 

Here is an example on my test machine for the keyboard.

 

image.thumb.png.ba12bb045aa917ca2676ee32a3f94e04.png

  • Thanks 1
Link to comment

New Release planned for this weekend.

 

It will include HUB processing

Will report use of a device outside of USB Manager.

Shows if the device is a Bluetooth controller. Looking to see if adding Pairing/Firmware updates could be added, Maybe as a tab for BT.

 

Connected(Outside) - Device is attached via VM Template or Manual connection to VM.

Inuse Mounted - Device has been mounted, i.e. with UD

Inuse ZFS - Device is being used within a ZFS Array.

Inuse Unraid - Device is being used in a Pool etc.

 

Dashboard wll be updated to match new status and hub processing.

 

Looking to create a How to Guide, but may not be complete this weekend.

 

Please let me know any Future additions people would like.

 

 

image.thumb.png.2c51ad91f96a52438599464170074a60.png

 

  • Like 1
Link to comment

Hi, Just wanted to say I love the plugin and to report a bug and request an adjustment.

The bug @#$%#@ the flash drive which you can see from the image, I have had this happen twice in the last week... But I couched it up to me rebuilding my array and doing alot of changes at the moment while testing out 6.10.RC2... If it happens again I'll try to narrow down to what I was doing at the time.

I like the changes to the "STATUS" column with color.

I'd like to see "VM STATE" intagrated with the "VM" column in the same way or some small visual / icon instead of the text, and then maybe the "STATUS" column with the small visual / icon too.

The purpose is to reduce the overall width of the table and then also make the status visually easier to identify.

Also the "SERIAL NUMBERS" column could be added as hover over effect to the "VENDOR:PRODUCT" column or a switch at the TOP.

Untitled.thumb.png.a544006d02ce878cdfad801d64688884.png

Edited by CIA
Link to comment
2 hours ago, CIA said:

Hi, Just wanted to say I love the plugin and to report a bug and request an adjustment.

The bug @#$%#@ the flash drive which you can see from the image, I have had this happen twice in the last week... But I couched it up to me rebuilding my array and doing alot of changes at the moment while testing out 6.10.RC2... If it happens again I'll try to narrow down to what I was doing at the time.

I like the changes to the "STATUS" column with color.

I'd like to see "VM STATE" intagrated with the "VM" column in the same way or some small visual / icon instead of the text, and then maybe the "STATUS" column with the small visual / icon too.

The purpose is to reduce the overall width of the table and then also make the status visually easier to identify.

Also the "SERIAL NUMBERS" column could be added as hover over effect to the "VENDOR:PRODUCT" column or a switch at the TOP.

Untitled.thumb.png.a544006d02ce878cdfad801d64688884.png

Thanks for reporting the issue with flash drive, I will look into it. Can you enable hub processing in the settings to see if the issue appears with that setting also? Can you confirm if you see the same issue on the dashboard view?

 

I like the suggestions for enhancements and will review.

 

Edited by SimonF
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.