Git Product home page Git Product logo

joycontrol's Introduction

joycontrol

Emulate Nintendo Switch Controllers over Bluetooth.

Tested on Ubuntu 19.10, and with Raspberry Pi 3B+ and 4B Raspbian GNU/Linux 10 (buster)

Features

Emulation of JOYCON_R, JOYCON_L and PRO_CONTROLLER. Able to send:

  • button commands
  • stick state
  • nfc data (removed, see #80)

Installation

  • Install dependencies

Ubuntu: Install the dbus-python and libhidapi-hidraw0 packages

sudo apt install python3-dbus libhidapi-hidraw0

Arch Linux Derivatives: Install the hidapi and bluez-utils-compat(AUR) packages

  • Clone the repository and install the joycontrol package to get missing dependencies (Note: Controller script needs super user rights, so python packages must be installed as root). In the joycontrol folder run:
sudo pip3 install .
  • Consider to disable the bluez "input" plugin, see #8

Command line interface example

  • Run the script
sudo python3 run_controller_cli.py PRO_CONTROLLER

This will create a PRO_CONTROLLER instance waiting for the Switch to connect.

  • Open the "Change Grip/Order" menu of the Switch

The Switch only pairs with new controllers in the "Change Grip/Order" menu.

Note: If you already connected an emulated controller once, you can use the reconnect option of the script (-r "<Switch Bluetooth Mac address>"). This does not require the "Change Grip/Order" menu to be opened. You can find out a paired mac address using the "bluetoothctl" system command.

  • After connecting, a command line interface is opened. Note: Press <enter> if you don't see a prompt.

Call "help" to see a list of available commands.

  • If you call "test_buttons", the emulated controller automatically navigates to the "Test Controller Buttons" menu.

Issues

  • Some bluetooth adapters seem to cause disconnects for reasons unknown, try to use an usb adapter instead
  • Incompatibility with Bluetooth "input" plugin requires a bluetooth restart, see #8
  • It seems like the Switch is slower processing incoming messages while in the "Change Grip/Order" menu. This causes flooding of packets and makes pairing somewhat inconsistent. Not sure yet what exactly a real controller does to prevent that. A workaround is to use the reconnect option after a controller was paired once, so that opening of the "Change Grip/Order" menu is not required.
  • ...

Thanks

Resources

Nintendo_Switch_Reverse_Engineering

console_pairing_session

joycontrol's People

Contributors

mart1nro avatar grelca avatar thisiscam avatar juanpotato avatar jackbdu avatar jessemillar avatar tenkoni avatar peterjc avatar tedzhu avatar tylercarberry avatar wenyu avatar spacemeowx2 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.