Dropped "run_test_controller_buttons.py" script in favor of command line interface.

This commit is contained in:
Robert Martin
2020-04-11 15:08:48 +09:00
parent 04c2d6d9ac
commit feb82a1fd0
5 changed files with 194 additions and 165 deletions
+21 -7
View File
@@ -1,10 +1,6 @@
# joycontrol
Emulate Nintendo Switch Controllers over Bluetooth.
Work in progress.
Pairing works, emulated controller shows up in the "Change Grip/Order" menu of the Switch.
Tested on Ubuntu 19.10 and with Raspberry Pi 4B Raspbian GNU/Linux 10 (buster)
## Installation
@@ -18,17 +14,35 @@ sudo pip3 install .
```
- Disable the bluez "input" plugin, see [#8](https://github.com/mart1nro/joycontrol/issues/8)
## "Test Controller Buttons" example
## Command line interface example
- Run the script
```bash
sudo python3 run_test_controller_buttons.py
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 emulated controller should pair with the Switch and automatically navigate to the "Test Controller Buttons" menu
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
- When using a Raspberry Pi 4B the connection drops after some time. Might be a hardware issue, since it works fine on my laptop. Using a different bluetooth adapter may help, but haven't tested it yet.
- Incompatibility with Bluetooth "input" plugin requires a bluetooth restart, see [#8](https://github.com/mart1nro/joycontrol/issues/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.
- ...