WICG / webusb

Connecting hardware to the web.
https://wicg.github.io/webusb/
Other
1.3k stars 127 forks source link

Windows not recognizing devices in WebUSB #143

Closed BonelessPig closed 2 years ago

BonelessPig commented 5 years ago

My computer just received a windows update and now cannot recognize the microcontroller i have programmed via Arduino IDE. It is a Sparkfun Breakout ATmega32u4 programmed as a Arduino Micro. I works fine on a Mac but is not recognized on Windows. I am using chrome for testing through localhost:8000. My microcontroller is also not recognized following the instructions on the demo anymore. Is anyone else having this problem and is their a solution. I was thinking maybe thee was a problem with the serial drivers.

karelbilek commented 5 years ago

This is not related to the spec probably, but - what Windows do you use?

We found out that there is an issue with Windows 7 and WinUSB/WCID (which you need for driverless use and the Arduino example is using), particularly if the Windows 7 have disabled automatic updates (usually when cracked, but some other reasons too).

Try to install WinUSB drivers manually with Zadig - https://zadig.akeo.ie/ . If you want to automate this, for example in the installer, you will need to build this tool

https://github.com/pbatard/libwdi/blob/master/examples/wdi-simple.c

philshem commented 5 years ago

I also have issues connecting to Windows (10) for a GPS tracker (MTK 3329 chipset). Zadig works when installing the libusbK driver - something determined by trial and error.

What's interesting is that libusbK is an older protocol (from Windows 8), and the default driver that Windows installs for my device (usbser.inf) is preferred by windows (discussion).

I've posted to the SuperUser forum - here's the thread, in case it's relevant


FYI - here's our webusb code for this GPS chipset. Works fine on Mac OS X. Windows is hit or miss with drivers. https://github.com/skunksports/webusb-mtk

reillyeon commented 5 years ago

@philshem The Windows driver stack does not allow any application to connect to a device at the USB level if the WinUSB or libusbk driver is not bound to the device. The usbser driver is a USB serial driver and takes over the device in order to provide a virtual COM port, blocking access to the device at a USB level. For devices you don't have control over you will constantly be fighting the OS for control of the device. We are working on the Serial API as a way to connect to devices that the OS is exposing as a COM port.

deviousasti commented 5 years ago

Any workarounds for this? Is WebUSB unusable as of now?

reillyeon commented 5 years ago

@deviousasti, it really depends on the device you are trying to use the API to connect to. As mentioned above, devices implementing the USB serial protocol have always been difficult to use, which is why webusb/arduino provides a library to modify the interface into one that isn't claimed by the operating system's USB serial class drivers. The Serial API will help alleviate this problem by providing an API that works for USB (and other types of) serial devices.

anotherglitchinthematrix commented 4 years ago

Enabling new usb backend for Windows on Chrome flag solved the problem for us, chrome://flags/#new-usb-backend

TamtamHero commented 3 years ago

Disabling instead of enabling new usb backend for Windows on Chrome flag solved the problem for me, chrome://flags/#new-usb-backend

7ombie commented 2 years ago

Disabling the new backend made my device show up on macOS 12.