Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

NotSupportedError: GATT operation failed for unknown reason #352

Open
harshjv opened this issue May 16, 2019 · 12 comments
Open

NotSupportedError: GATT operation failed for unknown reason #352

harshjv opened this issue May 16, 2019 · 12 comments

Comments

@harshjv
Copy link
Contributor

harshjv commented May 16, 2019

I am using Ledger Nano X with;

Lib/App Version
Secure Element 1.2.4.1
Micro controller 2.8
Bitcoin App 1.3.8
Ethereum App 1.2.3
@ledgerjs libs 4.56.0

Unfortunately, web-ble doesn't work in Chrome for Android v74. It throws this error;

NotSupportedError: GATT operation failed for unknown reason

Although same works with Chrome on Desktop.

Demo: https://cross-chain-playground.harshjv.com/wallet/btc/bitcoin (select Ledger Nano X on Chrome for Android)

@gre
Copy link
Contributor

gre commented May 16, 2019

Hi @harshjv, really cool demo BTW!

I'll give a try ASAP. Maybe something the current implementation doesn't do correctly for Chrome Android to support it 🤔

Side question: were you able to make WebUSB working on Chrome Android? I think it works last time I tried.

thanks

gre added a commit that referenced this issue May 16, 2019
@jafri
Copy link

jafri commented Jun 10, 2019

This issue is not just on Chrome Android, seeing same issue on all Android Browsers

Here is some more data:

ledgererror

@jafri
Copy link

jafri commented Jul 26, 2019

Any updates on this?

@gre
Copy link
Contributor

gre commented Dec 22, 2019

There is no update yet, the conclusion is this bug happens when you fall into a known bug with the current firmware, you need in that case to Reset Pairings on the NanoX and forget on the phone/computer side. You also should not install too much apps on the device (no more than 50 for instance) because we've seen it's more likely you fall into the problem.

This will require a new firmware.

@gre gre closed this as completed Dec 22, 2019
@gre gre reopened this Dec 22, 2019
@ben-oxley
Copy link

Sorry to drop in on this un-invited. I came across this whilst encountering similar issues with web-bluetooth for a website I'm implementing. It worked well in Win 10 chrome, but had issues on Android Chrome throwing NotSupportedError. Anyway, the solution for me was to sort out my charateristic notification subscriptions to correctly return promises all the way through the chain and to make sure subscriptions happened serially rather than in parallel. If you want to see what I'm talking about, have a look here: https://github.com/SGSVertigo/vertigo-web/commits/master at commits 86fd91df96adbf52a6e2a56c2176103560cee5f9 and f62bad57d21a8ea0515ea7ceedf8d78018d175c4. My theory is that android fails when it is trying to execute notification subscriptions in parallel. I can't see where in your code base you're implementing it, but the symptoms sounds similar!

@gre
Copy link
Contributor

gre commented Dec 29, 2019

@ben-oxley are you talking about working with a Ledger device or something else? because we have a bug in our current firmware that can make this error appearing in some circumstance, our firmware team is working on fixing it.

@ben-oxley
Copy link

No, just a very similar bug I've been investigating with some unrelated hardware (microchip rn Bluetooth module) but I think actually the bug and limitation is the pc side, a mix of os and chrome. Might be unrelated but I know how long I've been banging my head against the wall trying to solve it.

@arthare
Copy link

arthare commented Apr 18, 2020

I have also seen this occur on some hardware where the promises for various web-BLE operations return instantly rather than when the BLE radio is ready to send again.

So if I had:

await char.writeValue();
await char.writeValue(); // fails because the 1st one isn't actually done yet
await char.writeValue(); // fails because the 1st one isn't actually done yet

I have fixed it with:

await char.writeValue();
await promiseThatResolvesWithADelay(100); // wait 100ms
await char.writeValue(); // succeeds now!
await promiseThatResolvesWithADelay(100); // wait 100ms
await char.writeValue(); // succeeds now!

In particular, I've seen this instant-promise-resolution on my Pixel 3A XL, one particular model of macbook, and both were fixed by inserting delays.

@My1
Copy link

My1 commented Nov 28, 2020

There is no update yet, the conclusion is this bug happens when you fall into a known bug with the current firmware, you need in that case to Reset Pairings on the NanoX and forget on the phone/computer side. You also should not install too much apps on the device (no more than 50 for instance) because we've seen it's more likely you fall into the problem.

This will require a new firmware.

@gre and when could we expect that to happen? the Nano X firmware sadly isnt open source (website of ledger clearly says proprietary) so we cant really see anything, and there were Updates to the Nano X since your comment, and considering that BT is one of the big things the nano X offers it should kinda work and not be lying around as a known issue for 11 months by now.

@aleksre
Copy link

aleksre commented Jul 12, 2021

@gre Any updates on this? It's been over two years and our users are still unable to use the their Ledger on the go via Bluetooth.

@teacoat
Copy link

teacoat commented Oct 29, 2021

+1 I am also encountering this

My specific error is: Error: NetworkError: GATT Server is disconnected. Cannot retrieve services. (Re)connect first with device.gatt.connect.

@lodotek
Copy link

lodotek commented Mar 10, 2022

Bump, same here...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants