Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Failed to execute 'open' on 'USBDevice': Access denied."

Windows 8

I have tried both a Wemos D1 R32 and a ESP32 UWB, but I can't open a device using WEBUSB

My code is

document.getElementById('getDevices').addEventListener('click', (event) => {
      navigator.usb.requestDevice({
        filters: []
      }).then(function (device) {
        console.log(device);
        return device.open(); // Begin
      })
      .catch(error => {
        console.error(error);
     });
});

The device appears and then when selected the error is

DOMException: Failed to execute 'open' on 'USBDevice': Access denied.

It is currently using the "Silicon Labs CP210x USB to UART Bridge" device driver.

I followed the instructions on this question but when I update the device driver software to point at this inf file I get the message

---------------------------
Select Device
---------------------------
The folder you specified doesn't contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with Windows for x64-based systems.
like image 332
P Hemans Avatar asked Sep 20 '25 13:09

P Hemans


1 Answers

Rather than trying to use the WebUSB API, since your system already has the right UART driver installed, try using the Web Serial API.

like image 175
Reilly Grant Avatar answered Sep 22 '25 10:09

Reilly Grant