Bluetooth controller auto connect
-
Pi 5 (Canakit with SSD)
RetroPie Version 4.8
Built From: On top of Full Raspberry Pi OS 64 bit using Imager
USB Devices connected: one SNES style USB wireless controller that shows up as an XBox controller when configuring buttons.
Controller used: AceGamer for PS4 Controller, wireless (Bluetooth)
Error messages received: auto connects with white light (lost connection) instead of blue or red light showing player 1 or 2
Guide used: I attempted a few different methods and this worked the best... https://retropie.org.uk/forum/topic/31160/solved-can-i-pair-a-ps4-dualshock-controller-with-two-pi-4s/16?_=1687103003103
File: /opt/retropie/configs/all/autostart.sh
sudo bluetoothctl remove [Mac Address]
sudo timeout 6 bluetoothctl scan on
sudo bluetoothctl connect [Mac Address]
sudo bluetoothctl trust [Mac Address]
emulationstation #auto
How to replicate the problem: I can manually add the controller via the Bluetooth configuration and then configure the buttons okay, but upon restart I have to reaccomplish all of that. I attempted the modification to the autostart.sh above but that only gets it to connect with a solid white light (lost connection). I would like for it to be able to reconnect on reboot, and better yet already have the buttons configured if possible.
I did attempt the process here https://retropie.org.uk/docs/Bluetooth-Controller/
and Step 2.5 the last command gave me a sudo systemctl enable "bad message" error -
Usually it's not necessary to do anything special to make a controller re-connect when using Bluetooth. Once paired - either through RetroPie's Bluetooth setup or through OS's Bluetooth pairing utility - they should re-connect when started again.
if
When you say 'upon restart I have to reaccomplish all of that`, is this the restart of the Pi or the controller ? Some controllers may have issues reconnecting to the OS if the OS is restarted, but they work if they're stopped and started again.I don't understand why the buttons need re-configuring, since the configuration is saved by EmulationStation and it should recognize the controller once it's paired (even if the controller is re-configured) - did you modify any of the EmulationStation configuration files manually ?
I'd advise to remove any commands from
autostart.sh
and redo the pairing vie Bluetooth again. Make sure the controller is configured ok (in EmulationStation) and then - when the reconnection doesn't work - try to re-connect the controller from RetroPie's Bluetooth menu.If that doesn't work, you should enable debugging (see https://wiki.archlinux.org/title/Bluetooth, on the debugging section) and post the error/info messages shown by
bluetoothd
.
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.