Saturday, 17 March 2018

How to make a cheap ripoff PS3 controller work as a Bluetooth joystick under Linux

The device was sold as a PS3 controller. I don't have a PS3, I wanted it to control a robot (obviously).

The device in question identifies over USB as "Gasia Co.,Ltd PS(R) Gamepad"

BUT the software support is terrible. I did some of the following things, and it eventually worked.

Get qtsixa from here: https://github.com/supertypo/qtsixa.git - there are other branches available , this one has hacks for cheapo devices.

* Do not bother trying to pair it with sixpair utility - the cheapo PS3 controller rip-off does not remember the paired device.
* Instead, use sixpair to see what device it expects to be paired with, and change the host's bluetooth address accordingly.

I'm using a Raspberry Pi, so I hacked this file:

/usr/bin/btuart

This file is specific to Raspberry Pi and is run on startup. Normally this file uses the Raspberry Pi serial number to generate a bluetooth address somehow.

So I just hacked it to use the address 00:12:34:56:78:9b instead, which is the one the controller expects. Then reboot.