google / web-serial-polyfill

Apache License 2.0
108 stars 28 forks source link

serial api(polyfill) show "access Denied" in windows and android chrome. #39

Open tejas297 opened 2 years ago

tejas297 commented 2 years ago

**I am using this API in windows and android based chrome browser. while I am connecting my serial device the error shown in the console that "access denied"(attached images below ).

Screenshot 2022-05-17 100859

the error is on this line. Screenshot 2022-05-17 101800**

reillyeon commented 2 years ago

On Windows, opening a USB device requires the system to have loaded the "WinUSB" device driver. Since Windows comes with serial drivers already, you have to manually replace this driver in order to test the polyfill on this platform. You can do that using the Zadig tool.

If you are hitting the same issue on Android then you are probably running into the issue I mentioned on Stackoverflow where Android is loading drivers for the device even though there's no API for an Android app to actually communicate with the device through that driver. We're tracking a potential fix for that in https://crbug.com/1099521.

arcbtc commented 1 year ago

Is there a fix for this yet? Having web-dev serial available for android creates a whole load of interesting uses for microcontrollers. Webbdev nfc is available, and is useful.

brandonros commented 1 year ago

Is there a fix for this yet? Having web-dev serial available for android creates a whole load of interesting uses for microcontrollers. Webbdev nfc is available, and is useful.

Sounds like not. The only idea I can think of is to make an Android APK that is basically a WebView with some kind of bridge for IPC?

That's assuming the Android app/APK will be able to call this "detach kernel module" function for USB devices.

rfermontero commented 1 year ago

I'm not able to use it from an android webview either. Seems API does not exists because is always undfefined.

reillyeon commented 1 year ago

I'm not able to use it from an android webview either. Seems API does not exists because is always undfefined.

WebUSB support for Android WebView is tracked in crbug.com/933055. Please star that issue to show you are interested in it being developed.