Closed teije closed 8 months ago
From all your steps it looks like you did everything correctly, so I do not have any good explanation why it doesn't work in your case :(
Thanks for your quick response!
Too bad you have no further insights. Perhaps if I get a better understanding of how passthrough is done, from Unraid -> Docker container -> Windows, I can narrow down the problem.
Could you explain how I can determine if the device is properly passed through to the docker container?
And could you explain how I can see how the Docker container forwards the passthrough to the Windows VM?
I have successfully used USB passthrough, although not on Unraid
your ARGUMENTS environment variable should look like this:
-e ARGUMENTS="-device usb-host,vendorid=0x1a86,productid=0x55d4"
Also make sure you are passing through the host usb device:
--device=/dev/bus/usb
I have also managed to passthrough a usb port, rather than a specific device using:
-e ARGUMENTS="-usb -device usb-host,hostbus=1,hostport=1.3"
[You need to do an lsusb -t to work out the host bus and host port numbers]
You might want to try passing through a simple memory stick that Windows has drivers for to make sure its working and then try the ESP. I think you need drivers for the USB >> UART on most ESP boards.But remember each USB device has its own vendor/product IDs
@avoiceofreason: thank you so much! My ESP32 is now detected!
Adding the usb as device as shown (in addition to the existing ARGUMENTS variable) in this screenshot:
One downside is that upon reboot the bus-id and device-id might change, which breaks the usb mapping. This is easy to spot, because the container will fail to start when this is the case.
@kroese: You talk about this issue in your FAQ, but there the suggestion is to set ARGUMENTS to use the vendorid and productid, which I already am. Do you hapen to know how I can rework this device mapping to one that is based on vendorid and productid?
Anyways; now that it got detected properly I was able to flash the ESP32, but the serial monitor did not output anything:
Flashing OK
This comment helped me get the proper serial monitor output:
https://community.platformio.org/t/cant-get-output-from-serial-monitor/15533/19
In theory passing these 2 lines in combination should always find the same usb device every boot:
-e ARGUMENTS="-device usb-host,vendorid=0x1a86,productid=0x55d4" --device=/dev/bus/usb
While these 2 lines would always find USB bus 1 and port 1.3:
-e ARGUMENTS="-usb -device usb-host,hostbus=1,hostport=1.3" --device=/dev/bus/usb
This does work on Ubuntu, so maybe its a Unraid thing...
Should I leave out the port and device number from the /dev/bus/usb
line? That might be where my error is located.
Small update: I have changed the /dev/bus/usb/003/004
bit in the Unraid device section to /dev/bus/usb
.
This works and seems to not break when the id's change!
Thanks @kroese & @avoiceofreason ! As far as I can see now, the passthrough of the ESP32 works good now!
@kroese: Maybe it is useful to update de FAQ with a concise version of @avoiceofreason 's solution to my USB passthrough issue? This issue sounds like it might apply to more people than just me, it sounding like a fairly generic issue.
@teije I dont see any difference between what @avoiceofreason proposed and what was already in the Readme? It tells you to include /dev/bus/usb
in the compose file, and the line with the pid/vid is also the same.
@kroese : You are right, upon reading the FAQ again I release that I should have rtfm a bit better. Once again thanks for the help and effort you put into this project!
I have attempted to passthrough a USB connected ESP32.
TL:DR; As far as I understand I have correctly executed all steps already described in Issue #140, but no luck so far.
Does anyone have any tips on how to get this to work?
Steps taken so far:
I have identified it to be device on:
Bus003 Device005
with thevendorid:productid
being:1a86:55d4
When I run
lsusb
on the Unraid host machine I get:When I run
lsusb
on the 'WindowsinDocker'-container I get: (Should the container be able to see these devices? I read something about being in priviledged mode, I am not quite sure what this is, I did run this lsusb command with sudo)I have attempted to use the /dev/bus/usb/bus-id/device-id ARGUMENTS configuration:
-device usb-host,hostdevice=/dev/bus/usb/003/005
❯ ERROR: qemu-system-x86_64: -device usb-host,hostdevice=/dev/bus/usb/003/005: failed to open /dev/bus/usb/003/005: No such file or directory
I have attempted to use the vendorid:productid ARGUMENTS configuration:
-device usb-host,vendorid=0x1a86,productid=0x55d4