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

Then, check whether your bluetooth.service  is up and running. Also check the bluetooth daemon version (5.44), that should now match the blueZ release which you have downloaded  and compiled:

 Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled)
 Active: active (running) since Sun 2017-03-05 19:18:36 CET; 2 days ago
 Docs: man:bluetoothd(8)
 Main PID: 481 (bluetoothd)
 Status: "Running"
 CGroup: /system.slice/bluetooth.service
 └─481 /usr/libexec/bluetooth/bluetoothd

Mar 05 19:18:36 raspi5 bluetoothd[481]: Bluetooth daemon 5.44
Mar 05 19:18:36 raspi5 systemd[1]: Started Bluetooth service.
Mar 05 19:18:36 raspi5 bluetoothd[481]: Starting SDP server
Mar 05 19:18:37 raspi5 bluetoothd[481]: Bluetooth management interface 1.10 initialized

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.

It is important to check, whether your bluetooth dongle or build-in bluetooth (Pi3)  is visible and pair-able for other BT devices. ‘hciconfig’ should result in ‘UP RUNNING PSCAN ISCAN’ as shown below:

sudo hciconfig
hci0: Type: Primary Bus: USB
 BD Address: 00:1B:10:00:2A:EC ACL MTU: 1017:8 SCO MTU: 64:1
 UP RUNNING PSCAN ISCAN
 RX bytes:591 acl:0 sco:0 events:36 errors:0
 TX bytes:2795 acl:0 sco:0 commands:36 errors:0

In case that your bluetooth dongle is DOWN or powered OFF, enable it using the command:

sudo hciconfig hci0 up piscan

Step 5:

Download and compile QtSixA.

[Update: 2017-01-07]

Meanwhile, I received some user feedback concerning errors occurring during the compilation of QtSixA-1.5.1 (comments by phody: see discussion below).  For successful compilation from source, make sure to have the following packages installed:

sudo apt-get install pyqt4-dev-tools qt4-designer libjack-dev

Then, download, extract, change into the QtSixA-1.5.1 folder, patch and compile qtsixa:

wget http://downloads.sourceforge.net/project/qtsixa/QtSixA%201.5.1/QtSixA-1.5.1-src.tar.gz
tar xvfz QtSixA-1.5.1-src.tar.gz
cd QtSixA-1.5.1
wget https://launchpadlibrarian.net/112709848/compilation_sid.patch
patch -p1 < compilation_sid.patch
make

Note that you’ll only need the ‘sixpair’ program, which is located in the ‘QtSixA-1.5.1/utils/bins’ folder. If you want to make it available for all users, ‘chmod 755 sixpair’ and move it to the /usr/local/bin directory.

Step 6:
In order to pair the controller, connect it to your Pi using an USB cable. Wait for a few seconds until it is recognized as an input device (check with “dmesg”). You should be able to see something like this:

[11658.272017] usb 4-1: new full-speed USB device number 3 using uhci_hcd
[11658.454057] usb 4-1: New USB device found, idVendor=054c, idProduct=0268
[11658.454061] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[11658.454064] usb 4-1: Product: PS(R) Ga`epad
[11658.454066] usb 4-1: Manufacturer: ShanWan
[11662.009025] input: ShanWan PS(R) Ga`epad as /devices/pci0000:00/0000:00:1d.1/usb4/4-1/4-1:1.0/0003:054C:0268.0005/input/input23
[11662.009613] sony 0003:054C:0268.0005: input,hiddev0,hidraw2: USB HID v1.10 Joystick [ShanWan PS(R) Ga`epad] on usb-0000:00:1d.1-1/input0

117
Leave a Reply

40 Comment threads
77 Thread replies
6 Followers
 
Most reacted comment
Hottest comment thread
32 Comment authors
  Subscribe  
Notify of
Andreas

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

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

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

Dan

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?

Julian

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

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

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 »

slav

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

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)