Let me know if something is missing in this guide. I whipped it up pretty quickly. If all else fails, you can click on the first link in sources at the bottom and that will get you hooked up with 1 controller.

This guide assumes you already have a Raspberry Pi with RetroPie installed and starting on boot. If not, check out this guide http://supernintendopi.wordpress.com/

Turn on your pi and press ‘f4’ to exit RetroPie.

Make sure your Pi is configured to your liking. I’m playing psx games with mine, so this is how I set mine up:

sudo raspi-config

Expand the file system to fill the SD card.

If you are from the US, change keyboard to US

Change the memsplit to 256 (only recommended if you are using a 512mb pi and playing psx games)

Overclock. I’m at 950mhz, you don’t necessarily need to though. Do at your own risk!

Enable overscan if you have your pi hooked up to a tv and part of the command line is off the screen

Reboot

Again, press f4 to get to the command line. Update your sources and upgrade all applications you have installed to minimize problems down the road. Then install the bluetooth software and dependencies you will need to hook up a PS3 controller.

sudo apt-get update sudo apt-get upgrade sudo apt-get install bluez-utils bluez-compat bluez-hcidump libusb-dev libbluetooth-dev joystick git dialog -y

Once everything is installed, check to see if your bluetooth dongle is recognized



hciconfig

You should get something similar to this output:

hci0: Type: BR/EDR Bus: USB

BD Address: 00:02:72:BF:BC:8F ACL MTU: 1022:8 SCO MTU: 121:3

UP RUNNING PSCAN

RX bytes:16777722 acl:289271 sco:0 events:116 errors:0

TX bytes:2561 acl:53 sco:0 commands:56 errors:0

If you don’t get something like that, you may have an incompatible bluetooth dongle.

Now you want to download and install sixpair. Sixpair is the application that pairs your Pi with the PS3 controller.



wget http://www.pabr.org/sixlinux/sixpair.c gcc -o sixpair sixpair.c -lusb

Download and install sixad, the controller manager.

wget http://sourceforge.net/projects/qtsixa/files/QtSixA%201.5.1/QtSixA-1.5.1-src.tar.gz sudo tar xfvz QtSixA-1.5.1-src.tar.gz cd QtSixA-1.5.1/sixad sudo make sudo mkdir -p /var/lib/sixad/profiles sudo checkinstall

Run controller manager at boot

sudo update-rc.d sixad defaults

Now we are going to pair the controllers by plugging it into your USB port with a mini-usb cable. I would recommend you get 1 controller completely connected, then go back and connect the 2nd one. Reboot the computer and turn the controllers on. Turn player 1 on first and then player 2, otherwise it will kind of screw up your keymapping.

sudo ./sixpair

You’ll get something similar to the following output:

Current Bluetooth master: 00:10:60:57:15:C7

Setting master bd_addr to: 00:10:60:57:15:C7

Start controller manager now and connect for the first time.



sudo service sixad start

Unplug your controller and press the PS button. The lights will just be flashing and you won’t get a confirmation that it connected. If you want confirmation, you can run:

jstest /dev/input/js01

Create a sixad profile for the controller

sudo nano /var/lib/sixad/profiles/default

Add the following content:

enable_leds 1 enable_joystick 1 enable_input 0 enable_remote 0 enable_rumble 1 enable_timeout 0 led_n_auto 1 led_n_number 1 led_anim 1 enable_buttons 1 enable_sbuttons 1 enable_axis 1 enable_accel 0 enable_accon 0 enable_speed 0 enable_pos 0

Now reboot your Pi

sudo reboot

Exit the emulator with f4, press the PS button on your controller, wait a couple seconds and start the emulator.



emulationstation

Enter anything for default controls and then press f4 on your keyboard. You are just making the outline for the configuration file now so you can go in and edit it. If you really are planning on getting 2 controllers connected, I would recommend having this in the es_input file twice. It will not ask you to initialize again as long as an es_input.cfg file exists.



nano ./.emulationstation/es_input.cfg

<inputConfig type=”joystick” deviceName=”Sony Computer Entertainment Wireless Controller”>

<input name=”a” type=”button” id=”13″ value=”6″ />

<input name=”b” type=”button” id=”14″ value=”5″ />

<input name=”down” type=”button” id=”6″ value=”2″ />

<input name=”left” type=”button” id=”7″ value=”3″ />

<input name=”menu” type=”button” id=”16″ value=”7″ />

<input name=”pagedown” type=”button” id=”10″ value=”9″ />

<input name=”pageup” type=”button” id=”11″ value=”10″ />

<input name=”right” type=”button” id=”5″ value=”4″ />

<input name=”select” type=”button” id=”12″ value=”8″ />

<input name=”up” type=”button” id=”4″ value=”1″ />

</inputConfig>[/code]Run jstest to determine what your Pi put each controller down as. Run the code below, see if it responds when one of the controllers presses buttons. If it responds, that controller is 0 or 1 or 2 or whatever number you put after the js in the code below.

jstest /dev/input/js0

Configure controller with the actual emulators themselves. P is the player number (just start at 1 and count up), and j is your controller number which you determined with jstest.

cd ~/RetroPie/emulators/RetroArch/tools ./retroarch-joyconfig -o p1.cfg -p 1 -j 0 ./retroarch-joyconfig -o p2.cfg -p 2 -j 1 cat p*.cfg >> ~/RetroPie/configs/all/retroarch.cfg sudo nano RetroPie/configs/all/retroarch.cfg

Verify that this was put at the end of your retroarch.cfg file. If it’s not the same, just edit it.

input_player1_a_btn = "13" input_player1_b_btn = "14" input_player1_x_btn = "12" input_player1_y_btn = "15" input_player1_l_btn = "10" input_player1_r_btn = "11" input_player1_l2_btn = "8" input_player1_r2_btn = "9" input_player1_l3_btn = "1" input_player1_r3_btn = "2" input_player1_start_btn = "3" input_player1_select_btn = "0" input_player1_left_btn = "7" input_player1_up_btn = "4" input_player1_right_btn = "5" input_player1_down_btn = "6" input_player1_l_x_plus_axis = "+0" input_player1_l_y_plus_axis = "+1" input_player1_l_x_minus_axis = "-0" input_player1_l_y_minus_axis = "-1" input_player1_r_x_plus_axis = "+2" input_player1_r_y_plus_axis = "+3" input_player1_r_x_minus_axis = "-2" input_player1_r_x_minus_axis = "-3" input_player2_a_btn = "13" input_player2_b_btn = "14" input_player2_x_btn = "12" input_player2_y_btn = "15" input_player2_l_btn = "10" input_player2_r_btn = "11" input_player2_l2_btn = "8" input_player2_r2_btn = "9" input_player2_l3_btn = "1" input_player2_r3_btn = "2" input_player2_start_btn = "3" input_player2_select_btn = "0" input_player2_left_btn = "7" input_player2_up_btn = "4" input_player2_right_btn = "5" input_player2_down_btn = "6" input_player2_l_x_plus_axis = "+0" input_player2_l_y_plus_axis = "+1" input_player2_l_x_minus_axis = "-0" input_player2_l_y_minus_axis = "-1" input_player2_r_x_plus_axis = "+2" input_player2_r_y_plus_axis = "+3" input_player2_r_x_minus_axis = "-2" input_player2_r_x_minus_axis = "-3"

I also added this line to the bottom so you can press the PS button to exit the emulator and return to the emulationstation screen.

input_exit_emulator_btn = "16"

You should now be able to reboot, and test them out. You may need to exit emulationstation, let the controllers connect, and re-run it. Alternatively, I hear some people are putting ‘sleep 15’ in the script that starts emulationstation, which should give you time to get the controllers connected before emulationstation starts. I haven’t tried it because I don’t want to wait an additional 15 seconds for my Pi to boot.

Sources:

http://mypiandi.blogspot.com/2012/12/retropie-sixaxis-over-bluetooth.html

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=78&t=13552&start=50

Click to access manual.pdf