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/
I was searching the net for sixaxis on pi, and there is only your article ;)
AntwortenLöschenthe only thing you forgot (maybe you got it installed previously) is that you have to install pkg-config, otherwise the make fails.
Anyway, thanks for your help
how do you install pkg config?
AntwortenLöschenHi, unfortunately I don't know, I don't have rpi anymore.
Löschenhttp://forum.stmlabs.com/showthread.php?tid=5123
AntwortenLöschenThis worked great for me! I had to run "sudo apt-get update" first for everything to install correctly.
AntwortenLöschenHow can I run qtsixa ??? Please answer me
AntwortenLöschenSorry, I don't really know what you mean.
LöschenI dont knot the terminal command to start the qtsixa gui
AntwortenLöschenhow can i start qtsixa ???
you need compile it first, the instruction is in INSTALL file, inside of archive, but I think you need install "python-qt4-dev" using apt-get for dependency first. After install just type qtsixa in terminal.
LöschenThanks you helped me very very thanks again
LöschenHmm, can I somehow use this without the bluetooth dongle, that is via USB?
AntwortenLöschenYou can't... PS3 controllers only speak Bluetooth. The USB port is only for charging and pairing the controller.
Löschenyes you can, plug usb and linux (or windows or mac) simply recognize the controller as a game controller.
Löschenusb work normally.
how to disable accelerometers?.. the profile on MAC address of the SIXAXIS controller doesn't disable it.. worked before on XBMCbuntu. But on the Raspberry Pi I can't get it to work.
AntwortenLöschenStarting daemon in "Legacy" mode should disable accelerometers, check sixad manual for more info: http://qtsixa.sourceforge.net/manual.pdf
LöschenHi, after get bluetooth working and sixpair compiled, I execute and i get that error message:
AntwortenLöschensudo ./sixpair
No controller found on USB busses.
Any idea?
Thanks!
Solved! was problem about the cable!
LöschenJust as a note, there is a space after the / in the jstest command, and it caused an error. Just for anybody who was confused like me.
AntwortenLöschenDieser Kommentar wurde vom Autor entfernt.
LöschenDieser Kommentar wurde vom Autor entfernt.
AntwortenLöschenhaving trouble connecting 2 ps3 controlers.. any help?
AntwortenLöschencan somebody help me please?
AntwortenLöschendesktop@steamos:~/QtSixA-1.5.1/sixad$ make
mkdir -p bins
g++ -O2 -Wall -Wl,-Bsymbolic-functions sixad-bin.cpp bluetooth.cpp shared.cpp textfile.cpp -o bins/sixad-bin `pkg-config --cflags --libs bluez` -lpthread -fpermissive
/bin/sh: 1: pkg-config: not found
sixad-bin.cpp: In function 'int main(int, char**)':
sixad-bin.cpp:84:20: warning: taking address of temporary [-fpermissive]
sixad-bin.cpp:89:18: error: 'close' was not declared in this scope
sixad-bin.cpp:100:20: error: 'sleep' was not declared in this scope
sixad-bin.cpp:109:22: error: 'close' was not declared in this scope
sixad-bin.cpp:117:22: error: 'close' was not declared in this scope
sixad-bin.cpp:140:18: error: 'close' was not declared in this scope
sixad-bin.cpp:144:14: error: 'close' was not declared in this scope
bluetooth.cpp: In function 'void do_connect(int, bdaddr_t*, bdaddr_t*, int)':
bluetooth.cpp:104:30: error: 'close' was not declared in this scope
bluetooth.cpp:110:24: error: 'dup2' was not declared in this scope
bluetooth.cpp:111:22: error: 'close' was not declared in this scope
bluetooth.cpp: In function 'int l2cap_listen(const bdaddr_t*, short unsigned int, int, int)':
bluetooth.cpp:148:17: error: 'close' was not declared in this scope
bluetooth.cpp:162:17: error: 'close' was not declared in this scope
bluetooth.cpp: In function 'void l2cap_accept(int, int, int, int, int)':
bluetooth.cpp:195:26: error: 'close' was not declared in this scope
bluetooth.cpp:201:26: error: 'close' was not declared in this scope
bluetooth.cpp:221:26: error: 'fork' was not declared in this scope
bluetooth.cpp:228:32: error: 'dup2' was not declared in this scope
bluetooth.cpp:229:30: error: 'close' was not declared in this scope
bluetooth.cpp:242:57: error: 'execve' was not declared in this scope
bluetooth.cpp:254:26: error: 'close' was not declared in this scope
bluetooth.cpp: In function 'int l2cap_connect(bdaddr_t*, bdaddr_t*, short unsigned int)':
bluetooth.cpp:274:25: error: 'close' was not declared in this scope
bluetooth.cpp:291:25: error: 'close' was not declared in this scope
make: *** [sixad_bins] Error 1
try install pkg-config.
Löschensudo apt-get install pkg-config
don't work
Löschenwell, as I understand steamos doesn't have some dependencies for compiling sixad. Try this guide instead http://www.reddit.com/r/SteamOS/comments/1svnfx/ps3_controller_
Löschenthat don't work also because he work with debian on a virtualmachine
Löscheni can connect my contreoller but don't have interface for controlls
Löschenwhen i put
AntwortenLöschenwget http://www.pabr.org/sixlinux/sixpair.c
gcc -o sixpair sixpair.c -lusb
it says wget: --level: invalid number 'usb'.
it's two different commands.
Löscheni fixed thde first one but sixpair is a text file and it wont run
AntwortenLöschenYou need to make the text file into an executable file (the line starting gcc below) :
Löschenwget http://www.pabr.org/sixlinux/sixpair.c
gcc -o sixpair sixpair.c -lusb
this is from here
http://kearnesrpi.blogspot.co.uk/2013/06/mame-and-ps3-dualshock-controller.html
I hope this helps! I'm new to this and have been trying to mak my os3 work for 3 days now ...and still haven't had any success!