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

NotAllowedError Failed to open the device #3

Closed
derwehr opened this issue Apr 13, 2021 · 7 comments
Closed

NotAllowedError Failed to open the device #3

derwehr opened this issue Apr 13, 2021 · 7 comments

Comments

@derwehr
Copy link

derwehr commented Apr 13, 2021

When trying out any of the 2 demos, after clicking connect on the webBluetooth dialog, I always get the following Output in the Console:

HID connected: Joy-Con (L)

Uncaught (in promise) DOMException: Failed to open the device.

NotAllowedError Failed to open the device.
connectJoyCon @ index.js:42

(I did connect to JoyCon to my Computer via my computer's bluetooth settings before, otherwise they don't show up in the webBluetooth dialog.)

The JoyCon I'm using is brand-new and hasn't been connected to a switch before, do I have to install some kind of firmware on the JoyCon first or should the demos work with devices right out of the box?

@tomayac
Copy link
Owner

tomayac commented Apr 13, 2021

It may be that the controller needs a firmware update. Try connecting it to a Switch and checking for firmware updates. Can you then also try the demo linked from the article (Glitch seems to have a Bad Gateway issue at the moment) and let me know if it worked?

@tomayac
Copy link
Owner

tomayac commented Apr 13, 2021

(After connecting the controllers to the Switch, be sure to turn the Switch off or turn on airplane mode, else, the Switch won't let you connect to the controller with your computer and instead stay connected to it.)

@derwehr
Copy link
Author

derwehr commented Apr 13, 2021

It may be that the controller needs a firmware update. Try connecting it to a Switch and checking for firmware updates. Can you then also try the demo linked from the article (Glitch seems to have a Bad Gateway issue at the moment) and let me know if it worked?

Thanks for the fast response.
I get the same error on the demo mentioned above:

script.js:67 Uncaught (in promise) DOMException: Failed to open the device.
openButton.onclick @ script.js:67
async function (async)
openButton.onclick @ script.js:52

I'll try to get my hands on a switch to update the Joy-Cons firmware and give you an update then.

@derwehr
Copy link
Author

derwehr commented May 1, 2021

The issue persisted after connecting my joy-cons to a switch and updating their firmware.
However, I found out that this isa Linux issue. The Demo works fine on a windows machine.

@tomayac
Copy link
Owner

tomayac commented May 3, 2021

Thanks for updating the issue. In this case we can close it here, and you should report it as a new Linux issue. If you let me know the bug ID here, I can help triage.

@tomayac tomayac closed this as completed May 3, 2021
@derwehr
Copy link
Author

derwehr commented Oct 15, 2021

I figured out how to use the JoyCons on Linux. For anyone stumbling upon this:
You have to configure a udev rule, making the JoyCons writable. To do so, follow the steps below.

  1. Create a file /etc/udev/rules.d/10-joycon.rules
  2. paste the following rules into it
# Switch Joy-con (L) (Bluetooth only)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:057E:2006.*", MODE="0666"

# Switch Joy-con (R) (Bluetooth only)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:057E:2007.*", MODE="0666"

# Switch Pro controller (USB and Bluetooth)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", MODE="0666"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:057E:2009.*", MODE="0666"

# Switch Joy-con charging grip (USB only)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="200e", MODE="0666"
  1. Save the file and reload udev rules using sudo udevadm control --reload-rules

@tomayac
Copy link
Owner

tomayac commented Oct 18, 2021

Thank you <3 for sharing the solution. I'll point to here from the README.

tomayac added a commit that referenced this issue Oct 18, 2021
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

2 participants