Bluetooth controller auto-connect and auto-re-pair
-
Hi all,
tl;dr: Sharing a script [1] which might improve reliability of auto-connecting to paired Bluetooth controllers and the option to automatically re-pair controllers which repeatedly fail to connect. This is particularly helpful if you use your controllers with multiple consoles.
In more detail: I am currently using RetroPie 4.7 on a Raspberry Pi 4B and Pi 2B installed via SD card image and updated to version 4.7.19.
With this installation I am using two Nintendo Pro Controllers and two Nintendo Joy-Cons using the recommended drivers [2]. Those are the only input devices connected to the Raspberry Pi(s).
Using this setup I repeatedly face the following issues:
- Sometimes Bluetooth auto connect options on the RetroPie (on boot/ in background) are not consistently re-connecting to paired devices and I am left with no available/ working input option.
- If the Pro- /Joy-Controllers had been connected to the Nintendo Switch, they have to be (manually) re-paired on the RetroPie.
- Connecting to paired devices sometimes repeatedly fails for unknown reasons. Deleting and re-pairing the device usually solves the problem.
- Manually connecting and/ or pairing a controller is not trivial, especially if you have no second input device that is currently connected. This leaves you with either having to attach a wired keyboard and/ or logging in via ssh to re-pair at least one of your controllers.
In order to address these problems I started scripting an alternative auto-connect [1] script with the following features:
- Define a list of owned devices based on a simple text file
- Try to connect to an owned and paired device if it comes online
- Try to automatically re-pair an owned device if connect fails repeatedly.
This has given me some very good results over the past months, so I would like to share with you. Using the tool I never have to log in manually to fix an issue with a Bluetooth device. Maybe it can be useful for some of you who are also not that happy with the reliability of Linux <-> Bluetooth connections. Also If you had similar issues with Bluetooth controllers and/ or specifically Pro Cons, and know of a different approach to solve it, I'd be happy to hear from you.
Last, I will also check out latest vanilla RetroPie 4.8 and see how Bluetooth works there. But likely the problem with having to re-pair Pro controller after use with the Switch will remain in any case.
If you found this information useful, feel free to check out the script(s) under:
https://github.com/eberhab/bluetooth-repair
Enjoy!
Best
Benjamin[1] https://github.com/eberhab/bluetooth-repair
[2] https://retropie.org.uk/docs/Nintendo-Switch-Controllers/ -
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.