Sony DualShock

This article describes the use of Sony DualShock 3 / Sixaxis and DualShock 4 PlayStation controllers via USB and Bluetooth.

Prerequisites
This article assumes that USB and Bluetooth have been previously configured.

Hardware

 * DualShock 3 / Sixaxis:


 * DualShock 4:

Kernel
The recommended minimum version of Linux to use is 3.15. This release adds full support for the DualShock 4. This release also fixes the DualShock 3 blinking LED issue when connected via Bluetooth. Newer revisions of the DualShock 4 require Linux 4.5 when connected via Bluetooth.

USB

 * Connect the DualShock to the system using a USB cable and press the button.


 * Turn the DualShock off when it's no longer in use by pressing and holding the button for 10 seconds.


 * Press the button to use the DualShock again.

Bluetooth
The recommended minimum version of BlueZ to use is 5.14. This release adds full support for the DualShock 4. This release also incorporates DualShock 3 setup and pairing support which was added in BlueZ 5.12. It is possible to use the DualShock 3 with earlier versions of BlueZ (including BlueZ 4), but the sixpair utility would then be required to pair with the DualShock 3.

DualShock 3

 * Start bluetoothctl:


 * Enable the agent and set it as default:


 * Power on the Bluetooth controller, and set it as discoverable and pairable:


 * Connect the DualShock 3 to the system using a USB cable and press the button.


 * Discover the DualShock 3 MAC address:


 * Disconnect the USB cable from the DualShock 3:


 * Allow the service authorization request:


 * Trust the DualShock 3:


 * The DualShock 3 is now paired:


 * Turn the DualShock 3 off when it's no longer in use by pressing and holding the button for 10 seconds.


 * Press the button to use the DualShock 3 again.

DualShock 4

 * Start :


 * Enable the agent and set it as default:


 * Power on the Bluetooth controller, and set it as discoverable and pairable:


 * Scan for devices:


 * Put the DualShock 4 into pairing mode by pressing and holding the and  buttons until the light bar starts flashing.


 * Discover the DualShock 4 MAC address:


 * Pair with the DualShock 4:


 * Allow the service authorization request:


 * Trust the DualShock 4:


 * The DualShock 4 is now paired:


 * Turn the DualShock 4 off when it's no longer in use by pressing and holding the button for 10 seconds.


 * Press the button to use the DualShock 4 again.

Battery charge level
The DualShock battery charge level can checked with sysfs:

The battery charge level for the DualShock 3 will reported as either 100%, 75%, 50% or 25% remaining. These values correspond to 3, 2, 1, and 0 bars respectively when checked with the PlayStation 3. The battery charge level for the DualShock 4 will be reported in the range of 100% to 0% remaining, at intervals of 10%.

The battery charge level can also be checked with. First, list available devices:

Next, display the DualShock power information:

Troubleshooting

 * Imitation DualShock 3 controllers are not supported by BlueZ and will not work via Bluetooth.

External resources

 * Sixaxis via bluetooth