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

Get input when joycon is connected to switch #28

Open
krzysztofkrzeslak opened this issue May 24, 2022 · 2 comments
Open

Get input when joycon is connected to switch #28

krzysztofkrzeslak opened this issue May 24, 2022 · 2 comments

Comments

@krzysztofkrzeslak
Copy link

Hello,
Have some unusual use-case for this library and wondering if this is possible. I want make it work in a way that I'll be still able to get joycon inputs while they connected to the Switch.
As you might know, it's possible to install L4T Linux/Ubuntu on Switch which I already did and was able to connect joys using this library via Bluetooth, but problem is that they're working only in "detached" mode, which means when they're disconnected from the console, as soon I connect them I get the following message:

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/krzysiek/moje/tello/joycon-python/pyjoycon/joycon.py", line 115, in _update_input_report
    report = self._read_input_report()
  File "/home/krzysiek/moje/tello/joycon-python/pyjoycon/joycon.py", line 72, in _read_input_report
    return bytes(self._joycon_device.read(self._INPUT_REPORT_SIZE))
  File "/home/krzysiek/.local/lib/python3.6/site-packages/hid/__init__.py", line 163, in read
    size = self.__hidcall(hidapi.hid_read, self.__dev, data, size)
  File "/home/krzysiek/.local/lib/python3.6/site-packages/hid/__init__.py", line 148, in __hidcall
    raise HIDException(err)
hid.HIDException: Input/output error

My use case is to make a Python script running on a Linux switch within which I can control some external device(ex. drone), but I would like to use it with Joycons connected to the console.
I know that L4T Linux has a possibility to work in attached mode as they can be used as a mouse even, below is some example:
https://www.youtube.com/watch?v=nhN4vtMYqzA

Maybe you have some ideas on how to make communication via this library work in "attached" mode?

@pbsds
Copy link
Contributor

pbsds commented May 24, 2022

You most likely can't have two separate drivers/daemons handshake and communicate with the joycons and the same time.

I have no clue how L4T does things, but there is a possibility they've merged and rely on nintendo-hid by DanielOgorchock. Perhaps have a look at joycond?

@krzysztofkrzeslak
Copy link
Author

Hi, thanks for response, this library which you provided seems promising, but I found also another library that is able to read joycon via serial python-evdev so maybe I'll be able to use this library for bluetooth mode and evdev for docked mode :)

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