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

unable to get joycon status #23

Open
bldintheplacetobe opened this issue Jun 23, 2021 · 3 comments
Open

unable to get joycon status #23

bldintheplacetobe opened this issue Jun 23, 2021 · 3 comments

Comments

@bldintheplacetobe
Copy link

Hi,

This is probably a basic question, but I'm struggling to get status from my joycon. I have a joycon (purple) connected to a pi with bluetooth. It shows connected in the pi gui, however the joycon's flashing lights continue to flash from left to right continuously

When I run the basic commands listed to get status, I'm getting an invalid vendor error as follows:

from pyjoycon import JoyCon, get_R_id
joycon_id = get_R_id()
joycon = JoyCon(*joycon_id)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/dist-packages/pyjoycon/joycon.py", line 25, in init
raise ValueError(f'vendor_id is invalid: {vendor_id!r}')
ValueError: vendor_id is invalid: None

What have I missed?

Thanks!

@pbsds
Copy link
Contributor

pbsds commented Jun 27, 2021

The lights won't change until you instruct them to change.

What is the output of get_R_id() ? Have you tried get_L_id? If none of them return any devices, ensure you can see the joycon with a separate tool such as lshid. you may need to run as root to access hid devices.

@gdcgunther4
Copy link

I have the same problem on the same setup (just knockoff joycons). I ran the status program with sudo, but I got the same message. I tried using lshid, and it showed up, but I get the same error message. I made the udev rules like the readme said. Do I need to change the rules?

Thanks

@krzysztofkrzeslak
Copy link

In case someone will experience the same problem I have some tips as I also struggled a long time to make it work.

  1. use hid instead of hidapi:
    pip3 install hid
  2. use udev rules from here
  3. not sure if this if required but I also added such line to udev rules
    KERNEL=="js0", SUBSYSTEM=="input", MODE="0666"
  4. (!) Most important I think, hid library is using system libhidapi-hidraw0 and you can encounter message like no such symbol get_hid_report() or something like that, so you're probably using ubuntu 18.04 where default version of this lib is actually not containing this function, so to fix that:
    sudo apt remove libhidapi-hidraw0
    wget http://archive.ubuntu.com/ubuntu/pool/universe/h/hidapi/libhidapi-hidraw0_0.10.1+dfsg-1_amd64.deb
    sudo dpkg -i libhidapi-hidraw0_0.10.1+dfsg-1_amd64.deb

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

4 participants