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
Hjalte
8 years ago

Hi.
Thanks a lot for the detailed walkthrough, i’ve followed every step. I’ve purchased a ‘golden ps3 controller’ on eBay, it shows up in dmesg as: “input: SHANWAN PS3 GamePad as /devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/0003:054C:0268.001C/input/input44”. bluetoothctl can see the BT MAC addr, but for the life of me i can’t make it pair/connect. I rumbles constantly when plugged into USB. sixpair shows to lines: current and setting bt addr, both being written as my usb bt dongle mac. Any tips on what I could try or some output I could post here to help you help me. Thanks a lot in advance

Hjalte
8 years ago
Reply to  luetzel

Hej igen! Thanks a lot for your quick reply. For testing purposes I’m on my laptop with lubuntu (16.04 LTS 4.4.0-34-generic). BT dongle is: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode). I have been testing both with sixad for Shanwan and the patched bluez you provide. I’ve had one controller (out of two) connected once with bluetoothctl by running $connect “bt addr”. After the one successfull bt connection the name changed to [NEW] Device 04:43:6D:A5:63:25 PLAYSTATION(R)3Conteroller-PANHAI (yes with a spelling mistake in controller). Sometimes when i try sixad it hangs at: sixad-bin[2943]: One event received sixad-bin[2943]: unable… Read more »

Hjalte
8 years ago
Reply to  Hjalte

Oh, and the extra “usb_control_msg returned: 8” is just me adding a printf to sixpair.c to check the return value during pairing.

Hjalte
8 years ago
Reply to  luetzel

Thanks a lot again, hope you had fun here in DK 🙂 bluez version did indeed check out to 5.40, thanks for the tip. I tried enabling debugging, so far dmesg give me some timeouts on Bluetooth: hci0 command 0x0408 tx timeout (also on 0x0405 and 0x0409 occasionally). Furthermore service bluetooth status gives me the following errors when trying to pair and connect: bluetoothd[1968]: sixaxis: compatible device connected: PLAYSTATION(R)3 Controller (054C:0268) bluetoothd[1968]: Can’t get HIDP connection info bluetoothd[1968]: connect error: Connection refused (111). hciconfig gives UP RUNNING PSCAN, but not the ISCAN you have in the tutorial output. Can’t do… Read more »

noname
8 years ago

Thanks a lot for your work. Got my shanwan clone paired on pi3 with internal bluetooth. Now got it paired on gentoo system with usb-bt.

In both cases it did not work out of the box. sixpair was always ok, but no bt-pairing.

I only got it working after running sixad (killing bluetooth) and qtsixa.

gentoo wiki says clones not working, but they do with your bluez.

Josh
8 years ago

Martin,

Your guides seem to be the most thorough explanation of these issues. I’ve tried to follow your instructions to the T, including redoing a Pi3 with retropie, bluez, QtSixA. I can get SixPair to give me a good MAC address output.

But then I can’t pair. If I go into bluetoothctl it can see the controller, and will “connect” when I press the PS button such that it is on. But it won’t ever pair…. Any thoughts on this or how to debug?

Thanks

8 years ago

Hello leronardo and everyone here . could someone please guide me in this tutorial ?
I’m totally lost in this tutorial , I’m noob with RP .

I have 3 ps3 shawman controls and can not use any = (

somebody help me, please

8 years ago
Reply to  luetzel

I stopped in step 2 , I am in doubt which part is the operating system and which part is the raspberry

Leonardo
8 years ago

thanks, it worked fine! 😉

Stevo
8 years ago

Hi Luetzel, when I am getting stuck when I try to make the sixpair utils. When I run make, I get:

gcc -Wall -O2 hidraw-dump.c -o bins/hidraw-dump
gcc -Wall -O2 sixad-jack.c -o bins/sixad-jack -ljack -lm
gcc -Wall -O2 sixpair.c -o bins/sixpair -lusb
sixpair.c:9:17: fatal error: usb.h: No such file or directory
#include
^
compilation terminated.
Makefile:8: recipe for target ‘tools’ failed
make: *** [tools] Error 1

Any ideas how get past this?

Stevo
8 years ago
Reply to  luetzel

You are a champion Martin! That seems to have worked beautifully now on my Pi3 and RetroPie 3.8.1 build!

I’ve now gotten both Shanwan controllers to pair and they both seem to still work after a full shutdown. (I’ve had other experiences when they would pair – but need to be re-paired after a reboot).

Now, we just need to ensure all this good work of yours make it into the RetroPie 4.0 build.

Again…Thank you! Thank you! Thank you!

Cheers
Steve 🙂

auwear
8 years ago

Thank you for this tutorial but I am still having issues connecting 2 controllers at the same time, and I can’t stop the controllers vibrating when I connect them via USB to charge. Can you please help me at all?

acdc go
8 years ago

Also be sure that: sixad-sixaxis have appropiate permissions:
cd /usr/sbin/
chmod 755
sudo reboot

this worked for me.

trev E
8 years ago

awesome stuff, thanks for the guide!
my 2 PS3 Shanwan controllers now work via BT- but the gasia doesnt.. guessing cant get both working together?

Trev
8 years ago

Ha took me 10 mins to spot the typo! sudo service bluetooh restart should read “bluetooth”

1 2 3 4