Getting Sony Dualshock 3 gamepad to work in Raspberry Pi on Raspbian (Debian Wheezy).
First of all, I'll need a bluetooth dongle, since Raspbery Pi doesn't have built-in one, listing of compatible dongle you can find here.
So, install dependencies first
sudo apt-get install bluez-utils bluez-compat bluez-hcidump checkinstall libusb-dev libbluetooth-dev joystick
It takes a while.
After all type "hciconfig" in console, you should see something like this.
pi@raspberrypi ~ $ hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:1F:81:00:06:20 ACL MTU: 1021:4 SCO MTU: 180:1
UP RUNNING PSCAN
RX bytes:1260 acl:0 sco:0 events:46 errors:0
TX bytes:452 acl:0 sco:0 commands:45 errors:0
if not, your dongle seems not to be recognized by system.
So now, we need to pairing the dongle with the gamepad using this tool.
download and compile it.
wget http://www.pabr.org/sixlinux/sixpair.c
gcc -o sixpair sixpair.c -lusb
After this you should have a executable file "sixpair".
Now connect your Dualshock via a USB cable to Raspberry Pi and launch this file with sudo.
sudo ./sixpair
Current Bluetooth master: DE:AD:BE:EF:00:00
Setting master bd_addr to: 00:1F:81:00:06:20
If you see this, it was successful.
Install a Sixaxis Joystick Manager. Download a last archive and compile only important for us part.
wget http://sourceforge.net/projects/qtsixa/files/QtSixA%201.5.1/QtSixA-1.5.1-src.tar.gz
tar xfvz QtSixA-1.5.1-src.tar.gz
cd QtSixA-1.5.1/sixad
make
sudo mkdir -p /var/lib/sixad/profiles
sudo checkinstall
the last command make automatically a package for you, so you can later simple uninstall it, if you won't it or use a different system, type "sudo make install" instead of "sudo checkinstall"
Now test it, for this launch temporary a sixad daemon.
sudo sixad --start
Then press a "PS" button on Dualshock gamepad, if you feel a vibration, it works, congratulations!
After all you can make "sixad" daemon starting at boot time.
sudo update-rc.d sixad defaults
reboot
If you have any trouble with recognition, you can debug your Dualshock controller with "jstest".
sudo jstest /dev/input/js0
P.S. Thanks goes to http://blog.onsw.net/yuta/
First of all, I'll need a bluetooth dongle, since Raspbery Pi doesn't have built-in one, listing of compatible dongle you can find here.
So, install dependencies first
sudo apt-get install bluez-utils bluez-compat bluez-hcidump checkinstall libusb-dev libbluetooth-dev joystick
It takes a while.
After all type "hciconfig" in console, you should see something like this.
pi@raspberrypi ~ $ hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:1F:81:00:06:20 ACL MTU: 1021:4 SCO MTU: 180:1
UP RUNNING PSCAN
RX bytes:1260 acl:0 sco:0 events:46 errors:0
TX bytes:452 acl:0 sco:0 commands:45 errors:0
if not, your dongle seems not to be recognized by system.
So now, we need to pairing the dongle with the gamepad using this tool.
download and compile it.
wget http://www.pabr.org/sixlinux/sixpair.c
gcc -o sixpair sixpair.c -lusb
After this you should have a executable file "sixpair".
Now connect your Dualshock via a USB cable to Raspberry Pi and launch this file with sudo.
sudo ./sixpair
Current Bluetooth master: DE:AD:BE:EF:00:00
Setting master bd_addr to: 00:1F:81:00:06:20
If you see this, it was successful.
Install a Sixaxis Joystick Manager. Download a last archive and compile only important for us part.
wget http://sourceforge.net/projects/qtsixa/files/QtSixA%201.5.1/QtSixA-1.5.1-src.tar.gz
tar xfvz QtSixA-1.5.1-src.tar.gz
cd QtSixA-1.5.1/sixad
make
sudo mkdir -p /var/lib/sixad/profiles
sudo checkinstall
the last command make automatically a package for you, so you can later simple uninstall it, if you won't it or use a different system, type "sudo make install" instead of "sudo checkinstall"
Now test it, for this launch temporary a sixad daemon.
sudo sixad --start
Then press a "PS" button on Dualshock gamepad, if you feel a vibration, it works, congratulations!
After all you can make "sixad" daemon starting at boot time.
sudo update-rc.d sixad defaults
reboot
If you have any trouble with recognition, you can debug your Dualshock controller with "jstest".
sudo jstest /dev/input/js0
P.S. Thanks goes to http://blog.onsw.net/yuta/