Reputation: 845
I have a PWA using Web Serial on those devices where it is supported (Chromium based Desktop Browsers), on all other devices (basically Android) I try to fall back to Web USB via web serial polyfill.
This is working great for most devices, but on some (at leas one) Android devices I can not claim the device:
NetworkError: Unable to claim interface.
The interesting thing is that native apps can claim that device without issues. The device in question is a Samsung Galaxy A5 running Android 8.
I checked chrome://device-log/
everything is looking fine there:
[20:49:05] USB device added: id=1005 vendor=1155 "Betaflight", product=22336 "Betaflight STM32F411", serial="0x8000000", guid=9fa08f79-df5e-45bd-b757-c32ab1065bf9
[20:42:42] USB device removed: id=1004 guid=175af943-14ed-4591-a85b-b916a3a5584e
[20:40:42] USB device added: id=1004 vendor=1155 "Betaflight", product=22336 "Betaflight STM32F411", serial="0x8000000", guid=175af943-14ed-4591-a85b-b916a3a5584e
I then checked with this tool https://larsgk.github.io/webusb-tester/ and it confirms that there are two interfaces and neither of them is claimed:
2: Betaflight STM32F411 - VID: 0x0483, PID: 0x5740, S/N: 0x8000000
Interface 0 claimed: false
Interface 1 claimed: false
Unfortunately, or fortunately I could not find any other device where this is happening, but since it is happening on one device, it will happen on other devices.
I am not entirely sure what is happening, especially since native apps can claim the device.
The only related issue I could find id this one - and from what I can see, there does not really seem to be a solution, if I understood correctly.
Is there any way to see what claims a device on Android? Is there anything I can do to force claiming a device on Android?
Upvotes: 0
Views: 1682
Reputation: 6093
I believe this is a duplicate of that issue and automatically detaching drivers on Android (tracked by Chromium issue 1099521) will resolve the problem.
Upvotes: 1