All Projects → Brikwerk → joyconpi

Brikwerk / joyconpi

Licence: GPL-3.0 license
An attempt at emulating a Nintendo Switch Joy-Con controller with a Raspberry Pi

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to joyconpi

nxbt
Control your Nintendo Switch through a website, terminal, or macro.
Stars: ✭ 340 (+1316.67%)
Mutual labels:  hid, controller, bluetooth, nintendo-switch
stadiacontroller
Command line application that emulates an Xbox 360 controller from a wired Stadia controller on Windows.
Stars: ✭ 142 (+491.67%)
Mutual labels:  hid, controller
Pedalinomini
Same features of Pedalino™ in a compact form.
Stars: ✭ 139 (+479.17%)
Mutual labels:  controller, bluetooth
Node Elgato Stream Deck
A Node.js library for interfacing with the Elgato Stream Deck.
Stars: ✭ 359 (+1395.83%)
Mutual labels:  hid, controller
Keymapper
📱 An Android app that maps any keys to actions.
Stars: ✭ 207 (+762.5%)
Mutual labels:  bluetooth, nintendo-switch
DualSenseWindows UE4
Unreal Engine 4 port of the Windows API for the PS5 DualSense controller created at Ohjurot/DualSense-Windows
Stars: ✭ 25 (+4.17%)
Mutual labels:  controller, bluetooth
BlueRetro
Multiplayer Bluetooth controllers adapter for retro video game consoles
Stars: ✭ 520 (+2066.67%)
Mutual labels:  hid, bluetooth
switch joy con as mouse for macos
Tool to use Nintendo Switch Joy-Con as a mouse for macOS
Stars: ✭ 19 (-20.83%)
Mutual labels:  bluetooth, nintendo-switch
Hidapi
A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac and Windows.
Stars: ✭ 465 (+1837.5%)
Mutual labels:  hid, bluetooth
joycon-rs
Joy-Con library for Rust 🦀 🎮
Stars: ✭ 104 (+333.33%)
Mutual labels:  bluetooth, nintendo-switch
Bthidhub
Bluetooth HID hub
Stars: ✭ 65 (+170.83%)
Mutual labels:  hid, bluetooth
Switch Remoteplay
NOT AN OFFICIAL NINTENDO PRODUCT - Control your Switch remotely (no hacking required)
Stars: ✭ 170 (+608.33%)
Mutual labels:  bluetooth, nintendo-switch
Betterjoy
Allows the Nintendo Switch Pro Controller, Joycons and SNES controller to be used with CEMU, Citra, Dolphin, Yuzu and as generic XInput
Stars: ✭ 1,352 (+5533.33%)
Mutual labels:  bluetooth, nintendo-switch
Borealis
Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx).
Stars: ✭ 135 (+462.5%)
Mutual labels:  controller, nintendo-switch
Joycontrol
Emulate Nintendo Switch Controllers over Bluetooth
Stars: ✭ 667 (+2679.17%)
Mutual labels:  bluetooth, nintendo-switch
Pedalino
Smart wireless MIDI foot controller for guitarists and more.
Stars: ✭ 105 (+337.5%)
Mutual labels:  controller, bluetooth
BetterJoyForDolphin
Allows the Nintendo Switch Pro Controller and Joycons to be used with the Dolphin Emulator
Stars: ✭ 44 (+83.33%)
Mutual labels:  bluetooth, nintendo-switch
joycon
Device access library for Joycon(Nintendo Switch)
Stars: ✭ 59 (+145.83%)
Mutual labels:  bluetooth, nintendo-switch
Mac Precision Touchpad
Windows Precision Touchpad Driver Implementation for Apple MacBook / Magic Trackpad
Stars: ✭ 5,107 (+21179.17%)
Mutual labels:  hid, bluetooth
Authorizer
Authorizer is a Password Manager for Android. It emulates an HID keyboard over USB and enters your credentials on your target device. Additionally it supports OTP 🔑📴
Stars: ✭ 172 (+616.67%)
Mutual labels:  hid, bluetooth

JoyConPi

An attempt at creating a Nintendo Switch Joy-Con emulator with a Raspberry Pi.


This project does not function and is not being developed

Please see NXBT for a working variant of this project

This is likely due to incompatibilities with the Joy-Con's usage of Bluetooth 3.0's High Speed Connection. This might not be a surmountable issue.

Problems currently arise after the Nintendo Switch connects to the Raspberry Pi's open sockets (control, interrupt, and sdp sockets). After this point, the two devices are unable to communicate (bits are sent to the Switch, however, no bits are received).

If you have any ideas on how to improve this code, please open an issue or leave a PR!


Getting Started

1. Install the Prerequisites

Run "setup.sh" as root to install the prerequisites needed to configure your Pi. Please review the contents of the script carefully since you'll be executing this code with a high level of privilege.

sudo ./setup.sh

2. Enable BlueZ compatibility mode

Due to some antiquated methods existing within PyBlueZ at the current time, BlueZ compatibility mode needs to enabled to allow for usage of certain functions (advertisement, etc). This can be done by adding the "-C" flag to the ExecStart property in the bluetooth service configuration.

To do so, edit the following file:

sudo nano /lib/systemd/system/bluetooth.service

Find the line "ExecStart=/usr/lib/bluetooth/bluetoothd" and change it to:

ExecStart=/usr/lib/bluetooth/bluetoothd -C

3. Disable all unused BlueZ plugins to fix communication issues

Open up the main configuration file for BlueZ by entering the following command:

sudo nano /etc/bluetooth/main.conf

Add the following line to the main.conf file:

DisablePlugins = network,input,audio,pnat,sap,serial

Restart the bluetooth daemon to apply these changes

sudo invoke-rc.d bluetooth restart

4. Update the Raspberry Pi's Response

Run the following command to get your MAC address

hciconfig hcio | awk '/BD Address: /{print $3}'

The MAC address should be in the form of XX:XX:XX:XX:XX:XX and have a mixture of letters and numbers.

The first packet sent to the Switch contains the Joy-Con's MAC address. For this project the MAC address sent in the packet will need to be updated manually. Automatic construction of this packet is a TODO once communication issues are resolved.

To update the MAC address with your Pi's own, open up the "responses.py" file and change the marked characters to the MAC address you obtained previously:

# This line needs to be changed. Change the chars marked with # to the letters of your MAC address.
REPLY02 = b'\x21\x05\x8E\x84\x00\x12\x01\x18\x80\x01\x18\x80\x80\x82\x02\x03\x48\x01\x02\x##\x##\x##\x##\x##\x##\x01\x01'

# EX: For a MAC address of B8:27:EB:27:B8:5E the response would be
REPLY02 = b'\x21\x05\x8E\x84\x00\x12\x01\x18\x80\x01\x18\x80\x80\x82\x02\x03\x48\x01\x02\xB8\x27\xEB\x27\xB8\x5E\x01\x01'

5. Start the Joy-Con emulation server

Run "start.sh" as root. Again, please remember to carefully check over all code being run due to the high level of privilege. This will create a Tmux session with the various debugging outputs for the Pi's bluetooth + the Joy-Con emulation server.

sudo ./start.sh

6. Make your Pi discoverable

Access the currently running Tmux session (if you haven't already) and run the following commands to make your Pi discoverable as a Joy-Con.

Access the session:

tmux attach -t joyconpi

Once in the session, switch to the right pane (running bluetoothctl). This can be done by pressing the prefix (default Ctrl + b) and using the arrow keys to navigate the panes. Once at the bluetoothctl pane, enter the following commands:

agent on
default-agent
scan on
discoverable on

Your Pi should now be discoverable as a Joy-Con! Your Switch should now try to initiate a connection if you open the controllers menu and attempt to pair a new controller.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].