Skip to content
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

Uncaught (in promise) DOMException: GATT operation failed for unknown reason. #131

Open
DanieleBenedettelli opened this issue May 11, 2021 · 0 comments

Comments

@DanieleBenedettelli
Copy link

Hi.
I am using your library by adding it like so:

<script src="https://cdn.jsdelivr.net/npm/node-poweredup@latest/dist/browser/poweredup.js"></script>

Then I scan for LEGO BOOST hubs like so:

if (PoweredUP.isWebBluetooth) {
        poweredUP.scan(); // Start scanning for hubs
} else {
    alert("Your browser does not support the Web Bluetooth specification. Maybe you should just forgot https://");
}

Then I use the callback

poweredUP.on("discover", async function(hub) { // Wait to discover hubs
	console.log(" poweredUP on discover");
	await hub.connect(); // Connect to hub
[...]
}

Inside there, I use other handlers:
hub.on("attach", function(device) {
hub.on("disconnect", function() {

I tested my app successfully on Win 10 laptops with Chrome, but on smartphones connecting gives the error:
Uncaught (in promise) DOMException: GATT operation failed for unknown reason.

I had a lot of troubles installing VS to modify the library, otherwise I would have suggested a solution. Maybe, maybe, it's a matter of timing in data exchange, but it's just my hard guess.

Thanks!

antlai added a commit to cafjs/caf_node-poweredup that referenced this issue May 27, 2022
nathankellenicki added a commit that referenced this issue Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant