PLAYSTATION 3 Bluetooth Remote driver for Linux

This script, written in Python, enables you to control a Linux-based PC using Sony’s PLAYSTATION 3 remote (capitalization theirs not mine). For a video of the remote in action, see here. Python’s certainly not my language of choice, but it is based on a previous script downloaded from here, which itself is based on a previous script for the Nintendo Wii remote from here.

Download Cakemote for Linux

7 Responses to “PLAYSTATION 3 Bluetooth Remote driver for Linux”

  1. Hi,

    If this works for me i buy you a virtual beer :-)

    Br, iljusu

    [reply]

  2. I’m unable to pair the Sony BD remote. Here’s a diff of the code I used:

    $ diff -urN cakemote.py cakemote.local.py
    — cakemote.py 2008-01-06 17:38:50.000000000 +0200
    +++ cakemote.local.py 2008-01-06 17:57:20.000000000 +0200
    @@ -529,23 +529,27 @@
    #### MANUAL PS3-MOTE ADDRESS GOES BELOW!!!
    ####
    #### Type ‘hcitool scan’ at a terminal prompt to get the address.
    -
    - # Manual Input of PS3 Remote address required for now.
    - w=Ps3mote(“00:19:C1:4E:DA:53″,0)
    -
    - w.connect()
    -print “Connection to remote established.”
    -
    -print “Initializing uinput device.”
    -fd = init_uinput(uinput_dev)
    -
    -print “Press any key on the remote to test, or the circle key to exit.”
    +name = “BD Remote Control”
    +address = None
    +nearby_devices = bluetooth.discover_devices()
    +
    +for bdaddr in nearby_devices:
    + if name == bluetooth.lookup_name( bdaddr ):
    + address = bdaddr
    + break
    +
    +if address is not None:
    + print “Found remote at address %s” % address
    + w=Ps3mote(address)
    + w.connect()
    +else:
    + print “Could not find target bluetooth device nearby”
    + sys.exit(1)

    try:
    - last=time.time()
    - while not w.done:
    - w._getpacket()
    -
    + last=time.time()
    + while not w.done:
    + w._getpacket()
    finally:
    w.disconnect()
    destroy_uinput(fd)

    $ ./cakemote.local.py
    Found uinput dev at /dev/input/uinput
    Scanning for PS3 remote.
    Press Start+Enter to make your remote discoverable.
    Found remote at address xx:xx:xx:xx:xx:xx
    Attempting to pair with remote xx:xx:xx:xx:xx:xx
    Traceback (most recent call last):
    File “./cakemote.local.py”, line 544, in
    w.connect()
    File “./cakemote.local.py”, line 423, in connect
    self.rx.connect((self.addr,19))
    File “”, line 5, in connect
    bluetooth.BluetoothError: (111, ‘Connection refused’)

    Relevantish hcidump output:

    > HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0×00 handle 43
    Features: 0xbc 0×02 0×04 0×38 0×08 0×00 0×00 0×00
    > ACL data: handle 43 flags 0×02 dlen 16
    L2CAP(s): Connect rsp: dcid 0×0000 scid 0×0040 result 2 status 0
    Connection refused – PSM not supported
    > HCI Event: Remote Name Req Complete (0×07) plen 255
    status 0×00 bdaddr xx:xx:xx:x:xx:xx name ‘BD Remote Control’
    < HCI Command: Disconnect (0×01|0×0006) plen 3
    handle 43 reason 0×13
    Reason: Remote User Terminated Connection

    Any idea what I’m doing wrong? :)

    P.S. I’ve tried fiddling with differend hcid.conf options, but to no avail.

    [reply]

  3. here is my driver for LIRC: http://antst.mine.nu/linuxdriverforsonybdremote

    Not a script. Normal C daemon.

    [reply]

  4. You, mister Antst, are a very sexy individual! I’ll give this a shot myself. The Python “driver” was only ever a dirty hack

    [reply]

  5. Has this script worked for anyone yet ???

    [reply]

  6. This worked great for me using Mythbuntu 8.10. I would be nice to not have to push enter+start to pair it on reboot though. I tried the bdremoted first but could not get it working on 8.10. Thanks for the great work.

    [reply]

  7. thanks for the script :)
    is their a way to turnoff the multi key actions — this is causing crazy stuff with mythtv
    thanks

    [reply]

Leave a Reply