Setting up PS3 controllers on Retropie (Gasia/ Shanwan clones)

Step 1:
Download the source-code of bluez (version 5.39 at the time of writing). Extract the archive and create a subfolder named ‘patches‘ within the bluez directory.

Step 2:
Change into the ‘patches‘ directory and download all bluez patches found at:

https://github.com/OpenELEC/OpenELEC.tv/tree/openelec-7.0/packages/network/bluez/patches

Please note that you have to download these files in ‘raw mode’, otherwise HTML tags will remain and patch will complain about the garbage within the files.

While being in the bluez folder apply all patches with:

patch -p 1 < patches/bluez-01_add-obexd-policy.patch
patch -p 1 < patches/bluez-02_obexd-use-system-bus.patchpatch -p1 < patches/bluez-03_storagedir.patch
...

Step 3:
Navigate to the bluez/src subdirectory and edit the file ‘bluetooth.ver’. Add this line into the ‘global:’ block:

sdp_*;

Alternatively, download the already patched bluez source code from my github repo:

 git clone https://github.com/luetzel/bluez

I will try to keep my repo in sync with future releases of bluez and patches to support other PS3 clones than Gasia/Shanwan. Current version of patched blueZ is 5.43.

Step 4:
Change into the bluez folder, then, configure, compile and install bluez:

./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-sixaxis

 make -j3

 sudo make install

Be aware that this will overwrite your distribution’s bluetooth/bluez package. It is highly recommended to purge/uninstall your distributions bluez package prior to the installation of patched bluez in order  to avoid version conflicts.

Now, restart the bluetooth daemon with:

sudo systemctl daemon-reload
sudo systemctl start bluetooth

On distributions without systemd, you have to use:

sudo service bluetooth restart

If this doesn’t work or if you are unable to pair your controller in the following steps,  reboot your Pi after installation of patched bluez!

Subscribe
Notify of
117 Comments
Inline Feedbacks
View all comments
ChickenDinner
7 years ago

I still have problems pairing my gasia controllers with this guide. I did everything step by step and still no connection.

sudo bluetoothctl gives me the following:
[NEW] Controller 00:15:83:6D:34:6C retropie [default]
[NEW] Device 00:26:5C:10:53:A7 PLAYSTATION(R)3 Controller
[NEW] Device 00:26:5C:10:57:B6 PLAYSTATION(R)3 Controller

I think the controllers are being recognized, but they won’t pair.
Any idea?

ChickenDinner
7 years ago
Reply to  luetzel

Thanks for your reply. I am on a pi2 model b using an usb dongle already. I also tried to trust the controllers, tried to remove them and pair them again, that didn’t work. I don’t know if i’m doing something wrong, or if it’s just the controllers (maybe newer version than supported or whatever). All i can say is that this guide didn’t work for me.

ChickenDinner
7 years ago
Reply to  luetzel

Hi again, i got 2 gasia controllers, exact name as shown in dmesg is ” Gasia Co.,Ltd PS(R) Gamepad”. Strange thing is that i was able to pair 1 controller, that one now works like a charm. Still struggeling with the second one, it won’t pair no matter what i try. This is going to drive me crazy, because one controller is working. Forgot to say that I’m on raspbian.

ChickenDinner
7 years ago
Reply to  luetzel

Thanks for your advise, but i think i found the reason why the second one isn’t connecting. I shouldn’t have put my trust in chinese products, so i opened the faulty controller and what i saw was clear. There was a short due to a bad solder joint.

ChickenDinner
7 years ago
Reply to  luetzel

Hi, i’ve been able to fix the joint, the controller connected once but no chance to pair it again. “sudo bluetoothctl” shows the mac-adress correctly as before, but it won’t pair. I really have no idea what to try next.

ChickenDinner
7 years ago
Reply to  luetzel

The dongle is working and doesn’t go into standby, i ended up buying 2 Sony DS3 Controllers, already spent too much time on this. Thanks for your kind help, but i think the controller is defective in some way.

phody
7 years ago

Hi Luetzel, First of all I would like to thank you for the some much effort you put in creating this guide. I wanted to create a fresh installation from scratch on my Pi3 with Retropie and pairing my bluetooth PS3 controller to it via the onboard BT of Pi3. I have started the procedure with upgrading Retropie to the latest version. After that I have followed your step-by-step procedure which worked fine in most cases. Whoever there were some steps where I got stuck with the compilation of QtSixA. Google told me that the errors are referring to that… Read more »

Alex
7 years ago

Hi luetzel,

Your guide is fantastic! Thank you very-very much! 🙂
I’ve just made it to connect via BT to my Ubuntu machine.

I just have one question. I have a Shanwan controller and the mapping is really messed up in Steam. What would you suggest I use to properly remap the controller?

Alex
7 years ago
Reply to  luetzel

Thanks for the quick reply.
I figured out how to do the remapping in Steam. And probably because it’s not an original one, all games have it either not mapped at all or in a wrong way. Anyway, it’s something I can figure out.

Again, thanks a lot! Your guide is actually the only one on the Internet that is helpful. I thought I was screwed with this Shanwan gamepad. 🙂

Duncan
7 years ago

If I do an install from scratch starting with rasbian. Do I follow your instructions and only install retropie after completing your instructions. I have a pi 2 and a Shanwan controller.

Duncan
7 years ago

If I download your patched blues source code do I still need to do steps 1-3? or can I just start with step 4?

Duncan
7 years ago

When doing step 4 I get the message
Configure: error: libical is required.
What is libical and how do I aquire it?

Max
7 years ago

I tried linking /etc/firmware but that doesn’t seem to be the problem. I still get aa:aa:aa:aa:aa:aa. Also it worked the first time its only after the restart that it fails. Since I already paired once I can see it in bluetoothctl it’s just no able to reconnect when I hit the PS button.

In my ignorance it feels like something hasn’t restarted correctly. This was a vanilla install of Rasbian (2016-11-25), on a PI 3 using the built in bluetooth. I wonder if something changed in that version.

Max
7 years ago

Thanks for the excellent work. The instructions worked and I was able to set up two controllers on a fresh install of raspbian. However after reboot the controllers failed to reconnect.

After reboot hciconfig is not showing ISCAN, my two controllers are shown as paired in bluetoothctl and the service is running your patched bluez (I have tried repeating make install just to be sure). Here is the formatted output of a few commands. At the end if I try hcidump -x and press try to pair from the controllers I see no pairing attempt made.

http://pastebin.com/5m2N1xCE

Machado
8 years ago

Hi all,

i use an old netbook, toshiba NB505 2GB/Ram and Intel Atom N455,

i use Lakka for retrogaming, i have a P3 shanwan that i wold like to use through bluetooth, is it possible to apply this pach in that system?