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

[update]

Meanwhile I have validated these instructions on a different machine, testing it on a desktop PC running openSuSE 42.2.  Everything worked as expected and I was able to remap the keys of my PS3 controller with QJoyPad in order to ‘translate’ the PS3 input to keyboard commands.

The instructions above also worked on Raspbian/Pi2 with an updated version of Retropie (3.7 -> 3.8, as well as 3.8 -> 4.1 ). Many users reported problems with the internal Pi3 bluetooth device. It appears to be fixed on Raspbian, but other distributions may still fail. In any case you have to make sure that your system is up-to-date (sudo apt-get update && apt-get upgrade).

In case that you follow the discussion thread on the RetroPie forum, you probably have read, that there are some issues with other brands of PS3 controllers. The instructions above do not work for SZMY-POWER PS3 clones. However, these controllers seem to work with the sixaxis-sixad daemon.

[Troubleshooting]

I receive a lot of messages from users, telling me that the instructions above do not work and their PS3 controllers do not pair. As I’ve been in touch with many users (see discussion below), most problems are related to previous pairing attempts using the RetroPie configuration script.

Therefore, I strongly recommend to start from scratch, i.e. to work on a freshly installed Raspbian image. Follow the guide above to install blueZ, then install Retropie using the RetroPie setup script. However, do not use the setup script to pair your PS3 controller! Retropie makes use of the sixaxis-sixad daemon. Be aware that sixad and blueZ cannot not run at the same time!

Please include console output of the step you got stuck with, otherwise troubleshooting will be difficult.

[Debugging]

For debugging you should collect as much information as possible about your controller. Run ‘hcidump -x’ and press the PS3 button on your controller. With a Shanwan controller, I can see the following output (when pairing was successful):

HCI sniffer - Bluetooth packet analyzer ver 5.41
device: hci0 snap_len: 1500 filter: 0xffffffff
> HCI Event: Connect Request (0x04) plen 10
 bdaddr 01:B6:52:85:63:25 class 0x000540 type ACL
> HCI Event: Command Status (0x0f) plen 4
 Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
 status 0x00 handle 11 bdaddr 01:B6:52:85:63:25 type ACL encrypt 0x00
> HCI Event: Command Status (0x0f) plen 4
 Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
 status 0x00 handle 11
 Features: 0xff 0xff 0x8d 0x7a 0x98 0x1f 0x78 0x83
> HCI Event: Command Status (0x0f) plen 4
 Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> HCI Event: Read Remote Extended Features (0x23) plen 13
 status 0x00 handle 11 page 1 max 1
 Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> HCI Event: Command Status (0x0f) plen 4
 Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> HCI Event: Remote Name Req Complete (0x07) plen 255
 status 0x00 bdaddr 01:B6:52:85:63:25 name 'PLAYSTATION(R)3Conteroller-PANHAI'
Subscribe
Notify of
117 Comments
Inline Feedbacks
View all comments
Andreas
7 years ago

Hello everyone. Thank you for that great work. I have a little problem with detecting my PS3 Controller. When i try to get informations about my Controller, dmesg shows nothing about my controller. I use “dmes | grep input” command, but only my keyboard will displayed. What i am doing wrong?

Matt
7 years ago

Hi luetzel, I have a new problem for another image I’m trying to fix. At step 5, I downloaded and extracted QtSixA but: pi@retropie:/QtSixA-1.5.1 $ patch -p1 < compilation_sid.patch patching file sixad/shared.h pi@retropie:/QtSixA-1.5.1 $ sudo make make -C qtsixa make[1]: Entering directory '/QtSixA-1.5.1/qtsixa' pyuic4 -o ./gui/ui_qtsixa_mainw.py ./gui/ui/qtsixa_mainw.ui make[1]: pyuic4: Command not found Makefile:7: recipe for target 'build' failed make[1]: *** [build] Error 127 make[1]: Leaving directory '/QtSixA-1.5.1/qtsixa' Makefile:6: recipe for target 'build' failed make: *** [build] Error 2 pi@retropie:/QtSixA-1.5.1 $ make make -C qtsixa make[1]: Entering directory '/QtSixA-1.5.1/qtsixa' pyuic4 -o ./gui/ui_qtsixa_mainw.py ./gui/ui/qtsixa_mainw.ui make[1]: pyuic4: Command not found Makefile:7: recipe for… Read more »

Matt
7 years ago
Reply to  luetzel

The link could be corrupt:

After this operation, 123 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main libgstreamer1.0-0 armhf 1.4.4-2
404 Not Found [IP: 93.93.128.193 80]

Matt
7 years ago

I have problems with step 4
pi@retropie: /bluez $ make -j3
Make: *** No targets specified and no makefile found. stop

Matt
7 years ago
Reply to  luetzel

Unfortunately it does not depend on the directory. Cd bluez and i send the command ./configure –prefix = / usr –mandir = / usr / share / man –sysconfdir = / etc –localstatedir = / var –enable-sixaxis starts checking and in the last Line I have this error: configure: error: libical is required. From the blues folder i write make -j3 but the answer is makefile not found…

Matt
7 years ago
Reply to  luetzel

Connected! You’re great. Thank you very much

Matt
7 years ago
Reply to  luetzel

Pairing accomplished!!! You have been very kind. thank you so much

Dan
7 years ago

Hi Luetzel, I am trying to connect a shanwan ps3 gamepad to my old laptop running Ubuntu 16.04. The gamepad seems to be stuck in some reconnection loop. All LEDs blink continuously but never settle on a number.

This is the hcidump after disconnecting: https://pastebin.com/a6WmTX5E The log repeats itself as the gamepad keeps trying to connect and disconnect.

Sixpair works fine and correctly shows the device: https://pastebin.com/88em69qy

The same gamepad connects to a rPi3 running retropie so the controller should be working fine. Any ideas what is going on?

Dan
7 years ago
Reply to  luetzel

Thanks for the help! I finally figured out what went wrong. There were issues with my laptop’s broadcom bluetooth. After getting a bluetooth dongle, I finally managed to connect my ds3 controllers wirelessly

Dan
7 years ago
Reply to  luetzel

I managed to get more fake controllers. This time its a SZMY-POWER CO.,LTD. PLAYSTATION(R)3 Controller. Unlike the panhai garbage, this one has a working tilt/accelerometer sensors!
It works great over cable and jstest can read all the axis including the tilt+accel. Unfortunately, it doesnt work with bluez. I managed to connect wirelessly with retropie’s “shanwan” ps3 driver but the tilt sensor no longer shows up. The controller definitely broadcasts tilt data. When logging bt data with hcidump -R, the values change as I rotate the controller. Is there a way to get bluez working with this controller?

Julian
7 years ago

How can I do that?

In case that it shows version 5.23, reboot the system and check it again. If it still shows the wrong version, you must change your
–prefix=/usr
./configure option to the installation path of your distribution’s bluez package.

ferenczb
7 years ago

Hi Luetzel! Thanks for all the time you are spending with this. I have similar problem with a SHANWAN controller as some of the other commenters before: the controller connects, but it simple won’t pair. From bluetoothctl: [NEW] Controller A0:2C:36:6F:24:16 raspberrypi [default] [NEW] Device 05:37:96:52:63:25 PLAYSTATION(R)3 Controller [bluetooth]# info 05:37:96:52:63:25 Device 05:37:96:52:63:25 Name: PLAYSTATION(R)3Conteroller-PANHAI Alias: PLAYSTATION(R)3Conteroller-PANHAI Class: 0x000540 Icon: input-keyboard Paired: no Trusted: yes Blocked: no Connected: no LegacyPairing: no [CHG] Device 05:37:96:52:63:25 Connected: yes [PLAYSTATION(R)3Conteroller-PANHAI]# pair 05:37:96:52:63:25 Attempting to pair with 05:37:96:52:63:25 Failed to pair: org.bluez.Error.AuthenticationFailed [CHG] Device 05:37:96:52:63:25 Connected: no Sixpair: pi@raspberrypi:~/QtSixA-1.5.1/utils/bins $ sudo ./sixpair Current Bluetooth master:… Read more »

Nicholas Womack
7 years ago

Hello, I get to step 4, I just cloned your Already patched version, and first line works but make -j3 doesn’t work nor does sudo make install. I also get this when doing service status pi@raspberrypi:~ $ sudo service bluetooth status ● bluetooth.service – Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled) Active: failed (Result: exit-code) since Sat 2017-02-18 11:32:46 MST; 38min ago Docs: man:bluetoothd(8) Process: 1362 ExecStart=/usr/lib/bluetooth/bluetoothd (code=exited, status=203/EXEC) Main PID: 1362 (code=exited, status=203/EXEC) Feb 18 11:32:46 raspberrypi systemd[1]: Starting Bluetooth service… Feb 18 11:32:46 raspberrypi systemd[1]: bluetooth.service: main process exited, …EC Feb 18 11:32:46 raspberrypi systemd[1]: Failed to start Bluetooth… Read more »

Nicholas Womack
7 years ago
Reply to  luetzel

Thank you for that I got almost to the end here. I know the rest just need it to connect. So I did an hcidump and it looks good. Handshake success connection complete. Sixpair shows same address for current and setting master which is my RPi3 bt mac. First it was the aa:aa etc so I did what was advised then this shows up so I figure I’ll try sudo Bluetoothctl instead. I did trust on Gasia Ps gamepad that says Playstation(R)3 controller. It says conceded yes. I enter pair and get authCancel. It shows up in emulationstation with USB… Read more »

Nicholas Womack
7 years ago
Reply to  luetzel

They are both at 0. I did see that in previous comment. I don’t think it timesout because it did say success and all green in hcidump. Maybe faulty controller is my only conclusion. I was also unsuccessful at pc and Ubuntu pairing using all available solutions. I did get it to Bluetooth pair a few times with scl on pc but it will rumble forever with light 1 on. So my only conclusion is possible faulty bluetooth on gamepad. Cheers

Nicholas Womack
7 years ago

Hello again. So i finally got it to work and the solution was simple. One was I didn’t do sudo CHMOD 755 sixpair and move it. But, I totally forgot about the little Reset button on the back. After deleting trust mac of PS3, rebooting and then starting over to pair and trust, it was successful. All i did was hold that down with PS button for 30 seconds. First time I just tapped it and it connected but no input was detected so I held it before disconnecting usb then hitting PS button and success. I did dmesg and… Read more »

slav
7 years ago

Hello, So I tried everything in your guide on my rp3 with retropie 4.1. , Had all sort of issues mentioned in here along the way witch I managed to sort out thanks to your advice. I did all of that on a fresh install, and my Gasia Controller still doesn’t pair. When I do “hcidump -x” I get this: > HCI Event: Connect Request (0x04) plen 10 bdaddr 00:26:5C:10:1D:B6 class 0x000540 type ACL > HCI Event: Command Status (0x0f) plen 4 Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1 > HCI Event: Connect Complete (0x03) plen 11 status 0x08… Read more »

jojoly
7 years ago

It seems to be connected but the device just keep blinking and I get no input.
Any tips ? Here is the log :

kernel: input: Gasia Co.,Ltd PS(R) Gamepad as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/0003:054C:0268.0028/input/input44
kernel: sony 0003:054C:0268.0028: input,hiddev0,hidraw3: USB HID v1.11 Joystick [Gasia Co.,Ltd PS(R) Gamepad] on usb-0000:00:1d.0-2/input0
bluetoothd[821]: sixaxis: compatible device connected: PLAYSTATION(R)3 Controller (054C:0268)
bluetoothd[821]: sixaxis: setting up new device
kernel: usb 2-2: USB disconnect, device number 13
kernel: input: PLAYSTATION(R)3 Controller as /devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/bluetooth/hci0/hci0:69/0005:054C:0268.0029/input/input45
kernel: sony 0005:054C:0268.0029: input,hidraw3: BLUETOOTH HID v0.00 Joystick [PLAYSTATION(R)3 Controller] on 00:1a:7d:da:71:04
bluetoothd[821]: sixaxis: compatible device connected: PLAYSTATION(R)3 Controller (054C:0268)