[Plugin] USB_Manager


SimonF

Recommended Posts

6 minutes ago, ich777 said:

Don't followed the whole conversation,

I'm using a PHP/Apache container. I think the "www" user doesn't have access to it within the container.

After "chmod 777" within the container  i can then send my command through the device.

However.... Now is everything running as it should. I put "docker exec Apache-PHP bash -c "chmod 777 /dev/ttyUSB0" in my script which I run to connect the device via usbip to unraid an configure the serial port. Just added a few seconds of sleep to it after array starts.

Link to comment
2 minutes ago, SimonF said:

I'm using a PHP/Apache container. I think the "www" user doesn't have access to it within the container.

As said above if you add the "www" user (whoever this is) to the dailout group he would have access and you don't need to deal with permissions, but you can also do it like this. ;)

Link to comment
  • 1 month later...
  • 2 weeks later...
2 hours ago, zelet said:

I'm having an issue where if I click on "edit device settings" in the USB tab it goes to a blank settings page (see screenshot). Any idea what's happening? I don't see anything in the Unraid logs. 

 

Screen-Shot-2021-09-30-at-2-19-06-PM.png

what vers of unraid and plugin do you have. do you see the same result going via the settings page. 

 

can you provide a copy of the plugin config file from the boot drive.

 

has it worked before?

 

i think it may be that you dont have vms enabled in settings I will look at a fix over weekend to show vms not enabled.

Edited by SimonF
Link to comment

Unraid 6.9.2

USB Manager 2021.09.18

usb_manager.cfg

 

It hasn't worked before. The page in settings only has 3 settings Enable USB on dashboard, enable USB manager hotplug on VM page, and Enable USBIP. Nothing else is on the page. But it does say "Status: stopped"

 

My use case is to manage a USB device that's used for backups in Unraid - not in virtual machines. Is that the wrong use case? I currently only have docker containers, no VMs. 

 

 

Link to comment
8 hours ago, zelet said:

Unraid 6.9.2

USB Manager 2021.09.18

usb_manager.cfg 65 B · 2 downloads

 

It hasn't worked before. The page in settings only has 3 settings Enable USB on dashboard, enable USB manager hotplug on VM page, and Enable USBIP. Nothing else is on the page. But it does say "Status: stopped"

 

My use case is to manage a USB device that's used for backups in Unraid - not in virtual machines. Is that the wrong use case? I currently only have docker containers, no VMs. 

 

 

Yes this plugin is for auto attaching devices to VMs when a device is connected and when the VM starts without having to specify within the VM template. It also supports devices of same vendor/product.

 

Link to comment
6 hours ago, knights_of_pine said:

Hello all,

 

i think this plugin is just what i need.  is there a guide to use this?  youtube video or whatever, for dummies?  thank you!

 

in addition i am seeing the error on the photo attached. any idea what this means and how i can remedy it?

Screenshot 2021-09-30 172206 - Copy.png

There is not a guide at present, what do you need to do? Can you see the end of the Error line?

 

If you cannot see it cat /usr/local/emhttp/state/usb.ini will have the error message. Do you have it selected on the VM Template? if so it will try to connect it again. Rest of error message will say in use.

 

[SIGMACHIP_USB_Keyboard]
connected = 1
bus = 001
dev = 003
ID_VENDOR_FROM_DATABASE = ""
ID_VENDOR_ID = "1c4f"
ID_MODEL = "USB_Keyboard"
ID_MODEL_ID = 0016
USBPort = "1-7"
virsherror = ""
VM = "Ubuntu"
virsh = "Device attached successfully

Link to comment
  • 1 month later...

@SimonF  Sorry for the intrusion, just curious of what version driver you're using for the AQC111U plug-in you have?  I'm having a strange issue with the device going offline with load, it doesn't happen on a Windows PC running driver 1.8.0 so I'm fairly certain it isn't the device itself.   I need to test on a Linux box just to rule that out.

 

Any help would be appreciated.

 

Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd9470 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd9480 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd9490 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd94a0 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd94b0 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0

 

Link to comment
11 hours ago, vcdx said:

@SimonF  Sorry for the intrusion, just curious of what version driver you're using for the AQC111U plug-in you have?  I'm having a strange issue with the device going offline with load, it doesn't happen on a Windows PC running driver 1.8.0 so I'm fairly certain it isn't the device itself.   I need to test on a Linux box just to rule that out.

 

Any help would be appreciated.

 

Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd9470 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd9480 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd9490 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd94a0 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 13
Nov 13 13:49:42 unraid kernel: xhci_hcd 0000:03:00.0: Looking for event-dma 00000000fffd94b0 trb-start 00000000fffd9450 trb-end 00000000fffd9450 seg-start 00000000fffd9000 seg-end 00000000fffd9ff0

 

Hi @vcdx The version is specific to the kernel so was complile using  Linux 5.10.28 the errors look like usb subsystem rather than the driver. I am using a QNAP 5Gb adapter but doesn't drop out, but found I cannot use as part of a bond etc.

 

Let me know if you are doing any think specific that causes the drops and I will see if I can replicate. At present I am having to use a only NIC on a new 12600K setup as the onboard is not working under RC2.

 

I had the driver added in Stock Unraid for 6.10 as I wasn't able to make primary using the plugin due wo the driver wasn't being loaded earlier enough in the boot cycle.

 

Also my NIC is only running at 1Gb.

Edited by SimonF
Link to comment
9 hours ago, SimonF said:

Hi @vcdx The version is specific to the kernel so was complile using  Linux 5.10.28 the errors look like usb subsystem rather than the driver. I am using a QNAP 5Gb adapter but doesn't drop out, but found I cannot use as part of a bond etc.

 

Let me know if you are doing any think specific that causes the drops and I will see if I can replicate. At present I am having to use a only NIC on a new 12600K setup as the onboard is not working under RC2.

 

I had the driver added in Stock Unraid for 6.10 as I wasn't able to make primary using the plugin due wo the driver wasn't being loaded earlier enough in the boot cycle.

 

Also my NIC is only running at 1Gb.

 

@SimonF I think you're right, it does be tied specifically to xhci_hcd.  I've created a Ubuntu VM and passed through the adapter directly with no issue, so I think it is related to a xhci_hcd driver baked into the unraid kernel.  The subsystem is a ASM1142, which a quick search shows some old issues with the same exact symptoms. 

How can I check to see which version of xhci_hcd is being used/updates?

Link to comment
On 11/14/2021 at 2:47 PM, SimonF said:

likely to be in tree driver for kernel vers. modinfo will display details.

 

It looks like there may be an DMA issue with the ASM1142 and the xhci driver, looks like suggestion is to add quirks xhci_no_64bit_support to the xhci driver, but I have no idea how to do this with unraid... Guessing a custom compiled kernel?

Link to comment
On 11/16/2021 at 10:40 PM, vcdx said:

quirks xhci_no_64bit_support

Which vers of unraid are you running.

 

the following code is in the driver source

 

	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
	    (pdev->device == PCI_DEVICE_ID_ASMEDIA_1142_XHCI ||
	     pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI ||
	     pdev->device == PCI_DEVICE_ID_ASMEDIA_3242_XHCI))
		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;

And looks like it was committed in July 2020. https://github.com/torvalds/linux/commit/ec37198acca7b4c17b96247697406e47aafe0605#diff-6e5a133643ea3ef17671812939ac61a3c952c2cf5fcbc5acc3d0c50190b7f3a9

Edited by SimonF
Link to comment
8 hours ago, SimonF said:

Which vers of unraid are you running.

 

the following code is in the driver source

 

	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
	    (pdev->device == PCI_DEVICE_ID_ASMEDIA_1142_XHCI ||
	     pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI ||
	     pdev->device == PCI_DEVICE_ID_ASMEDIA_3242_XHCI))
		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;

And looks like it was committed in July 2020. https://github.com/torvalds/linux/commit/ec37198acca7b4c17b96247697406e47aafe0605#diff-6e5a133643ea3ef17671812939ac61a3c952c2cf5fcbc5acc3d0c50190b7f3a9

 

Thanks for researching, I came to the same conclusion... This is strange because my symptoms are the exact reason why this change was implemented. I've considered just looking for a new board with USB3.1 that isn't ASMedia. 

Link to comment
50 minutes ago, glockmane said:

Sorry for the dumb question, but can I use this to share a usb device attachted to the unraid server with my notebook running a usb/ip client?

Yes you could. You use the Bind option to attach the server device to USBIP and then you should be able to see on your notebook.

Link to comment
55 minutes ago, Gershy13 said:

Is it possible to reverse the USB IP? And host a device on something like a raspi, and have unraid be the client? 

Yes it is

 

You need to install usbip on the PI

 

Below are the commands that bind the Alcor USB Flash Drive.

 

image.thumb.png.ab6e36392550c8bbbcc8eb0361101688.png

 

You need to install the addon module in the settings and set just vhci_hcd to be loaded.

 

image.thumb.png.cae94bfa8c2e3126ced2475430f2dcae.png

 

 

Then in the main USB page you can add a remote system and the devices you bound show and you can attach. You will also notice the USB also shows as port 3-1 in unraid,

image.thumb.png.6c3d16c095a1fb60182c23f9d713338d.png

 

and it shows as dev2 in my unassigned devices.

image.thumb.png.2f01d9f8a407138c915a432a27f03088.png

 

Link to comment
  • SimonF changed the title to [Plugin] USB_Manager
7 hours ago, Telcar said:

If you have this plugin do you still need the libvirt vm hotplug plugin?

No you don't but they can co-exist. If enabled in the settings there is a USB Manager Hotplug section in the VM Tab. 

 

But this plugin will do automatic hotplugin.

 

image.thumb.png.99ee1685ed126c4d68500f9b58ad0f1a.png

  • Thanks 1
Link to comment

This is a Great application!

Having Home assistant on a VM with USB's for Zigbe and Z-wave is very troublesome!

I have never gotten the VM setting to work? after every reboot I needed another plugin to detach and re-attach the USB's

image.png.10d570c3532ba6b228cfe0c231a04c34.png

 

I now have your plugin installed and it seems to work but I have warnings here:

image.thumb.png.adeec6a45dfe320698c25a22b83c4b53.png

 

Should I just remove all USB settings from the VM config and let the plugin handle things?

What does the warning mean?

 

Again thanks for creating this app its very cool!

Link to comment
8 minutes ago, casperse said:

What does the warning mean?

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.

  • Like 1
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.