-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
open() fails with NetworkError: Unable to claim interface #14
Comments
This library is a polyfill for the Serial API on platforms which do not have drivers for a USB serial port. If your system is detecting the device and creating /dev/ttyACM0 then you can use the real Serial API implementation in your browser. Enable it for development purposes using chrome://flags/#enable-experimental-web-platform-features or sign up for the Origin Trial here: https://developers.chrome.com/origintrials/#/view_trial/2992641952387694593 #10 tracks work to make the polyfill and browser implementations integrate more seamlessly. |
OK - thanks for your feedback. |
Hi, I am using this library to open a Serial connection on an Angular app running Chrome for Android and I'm getting a similar error. I was able to connect to the equipment using the WebUSB API, but that didn't provide the Serial connection, and the Serial API is not supported on Android, as far as I understand (even if enabling experimental features). `import * as Serial from 'web-serial-polyfill';
` |
If you are hitting an error claiming an interface on Android you are probably running into the case where the Android system has loaded a driver for the device even though it doesn't provide an API for applications to use that driver. We're looking at a solution for this in Chromium issue 1099521 but haven't had time to finish the implementation. |
Hi !
I like to use the linked npm package in an Angular application but I'm not able to open the serial port.
This is the test code:
The requestPort() function is working (permission access dialog is shown and populated with the device):
SerialPort {serialOptions_: {…}, device_: USBDevice} device_: USBDevice {configurations: Array(1), deviceClass: 2, deviceProtocol: 0, deviceSubclass: 2, deviceVersionMajor: 2, …} serialOptions_: {baudrate: 115200, databits: 8, stopbits: 1, parity: "none", buffersize: 255, …} transferInterface_: USBInterface {alternates: Array(1), claimed: false, interfaceNumber: 1, alternate: null} __proto__: Object
but the following open() function always fails:
What's the exact meaning of "Unable to claim interface" ?
The device shouldn't be blocked by an other application. It's listed under /dev/ttyACM0 and I can open it with a serial terminal program like cutecom without problems.
Thanks for any help !
Best regards,
Michael.
The text was updated successfully, but these errors were encountered: