derkyjadex / M8WebDisplay

Display for headless M8 tracker
https://derkyjadex.github.io/M8WebDisplay/
MIT License
196 stars 39 forks source link

Failed to connect with WebUSB #25

Closed nnbveh closed 1 year ago

nnbveh commented 1 year ago

I'm able to connect using ONE of my two user accounts on PC running the client on the Edge browser. When i try to connect from another user account on windows 11 OR from the android phone (Samsung) the client detects the device but fails to connect to it...I can only guess it has something to do with some sort of permissions or something....

derkyjadex commented 1 year ago

For your multiple Windows users situation, is there any chance that you still have the browser open for one user when you switch over to the second user? Just double-checking, because that would definitely cause a problem. Otherwise, I can't think of any good reason for it not to work.

For Android, I've been able to quickly test on a Samsung phone and I think I'm getting the same result as you. The M8 shows up in the list when I tap Connect, but then it fails to connect. This appears to be specific to some recent Samsung phones and is related to this issue: https://bugs.chromium.org/p/chromium/issues/detail?id=1099521#c21.

From what I understand, the firmware on those phones has extra drivers enabled that claim the USB Serial device (even though Android itself doesn't actually have a Serial API). When the web display running on Chrome tries to open the device using the lower level WebUSB (since that's the only available option), it fails because the device has already been claimed.

Unfortunately there's nothing I can do about that one; it's up to Google (or possibly Samsung) to fix that issue. I will update the documentation and error message with more info about this.

derkyjadex commented 1 year ago

I've updated the docs with some information about Samsung phones. Hopefully that Chromium bug will be fixed at some point.