Difference between revisions of "PS4"

From GIMX
Jump to: navigation, search
(Bluetooth dongle)
(Dongle + DS4)
Line 29: Line 29:
 
===Dongle + DS4===
 
===Dongle + DS4===
  
 +
Plug the dongle to the PC.
 
Get the dongle bdaddr (bluetooth device address):
 
Get the dongle bdaddr (bluetooth device address):
  

Revision as of 08:46, 6 March 2014

(work in progress)

Hardware requirements

Bluetooth dongle

A bluetooth dongle is needed. The only tested bt chip is the CSR8510 chip.

PC

The only supported OS is Ubuntu 13.10 and its derivate such as Linux Mint 16.

Teensy 2.0

This is a temporary requirement used for pairing the bt dongle with the PS4.

The firmware to load is available at: http://gimx.fr/download/EMUPS4.7z

Compilation & installation

There's no installation package yet, but GIMX can be easily built from the sources.

Refer to the Development_on_Linux page. When typing the git command line, replace 'master' with 'dev'.

Pairing

The paring is quite complex, but it only has to be done once.

Dongle + DS4

Plug the dongle to the PC. Get the dongle bdaddr (bluetooth device address):

 hciconfig -a | grep "BD Address" | cut -f 3 -d ' '

Result example:

 01:02:03:04:05:06

Generate a link key for the DS4:

 date | md5sum | cut -f 1 -d ' '

Result example:

 381f87ef2a59011cb1dd29b7a67529cd

Set the master bdaddr of the DS4:

 ds4tool -m <dongle bdaddr> -l <DS4 link key>

Example with the previous example values:

 ds4tool -m 01:02:03:04:05:06 -l 381f87ef2a59011cb1dd29b7a67529cd

Result example:

 Current Bluetooth master: 00:00:00:00:00:00
 Current Bluetooth Device Address: 07:08:09:0a:0b:0c
 Setting master bdaddr to 01:02:03:04:05:06
 Setting link key to 381f87ef2a59011cb1dd29b7a67529cd

The "Current Bluetooth Device Address" value is the DS4 bdaddr.

Unplug the DS4.

Set the DS4 link key:

 sudo bash -c "echo <DS4 bdaddr> <DS4 link key> 4 0 >> /var/lib/bluetooth/<dongle bdaddr>/linkkeys"

Example with the previous example values:

 sudo bash -c "echo 07:08:09:0a:0b:0c 381f87ef2a59011cb1dd29b7a67529cd 4 0 >> /var/lib/bluetooth/01:02:03:04:05:06/linkkeys"

Dongle + PS4

Plug the teensy to the PC.

Set the device address of the teensy:

 ds4tool -s <dongle bdaddr>

Example with the previous example values:

 ds4tool -s 01:02:03:04:05:06

Result example:

 Current Bluetooth master: 00:00:00:00:00:00
 Current Bluetooth Device Address: 00:00:00:00:00:00
 Setting slave bdaddr to 01:02:03:04:05:06

Plug the teensy to the PS4 and wait a few seconds.

Plug the teensy back to the PC, and type:

 ds4tool

Result example:

Current Bluetooth master: 0a:0b:0c:0d:0e:0f
Current Bluetooth Device Address: 01:02:03:04:05:06
Current link key: 76f5ea4f6205db412f8095094e5414c3

The "Current Bluetooth master" value is the PS4 bdaddr, and the "Current link key" value is the PS4 link key.

Unplug the teensy.

Set the PS4 link key:

 sudo bash -c "echo <PS4 bdaddr> <PS4 link key> 4 0 >> /var/lib/bluetooth/<dongle bdaddr>/linkkeys"

Example with the previous example values:

 sudo bash -c "echo 0a:0b:0c:0d:0e:0f 76f5ea4f6205db412f8095094e5414c3 4 0 >> /var/lib/bluetooth/01:02:03:04:05:06/linkkeys"

Restart the bluetooth service (loads the link keys):

 sudo service bluetooth restart

Start

The bluetooth service has to be stopped before starting GIMX (this allows GIMX to get incoming connections):

 sudo service bluetooth stop
 sudo hciconfig hci0 up pscan

Start GIMX:

 gimx -t DS4 -c <config file> -b <PS4 bdaddr>

Start the DS4. It should connect to GIMX, which in turn should connect to the PS4.

Refer to the Command_line page to learn about the other command line arguments.