Debian, Bluez and a Sony PS3 Sixaxis Controller

Hi All,

First I want to thank Robert, Jason and everyone that coded/tested to bring Debian to our projects. My life became considerably easier because of those efforts. Magnificent!

The next hurdle for me has been trying to get a Sony PS3 sixaxis controller and the Sony wireless keyboard working with Bluetooth (Bluez). The problem seems to be that when I plug the controller into the USB port, UDEV creates input/js0 and event0

but Dmesg reports-

[15105.669932] input: Sony PLAYSTATION®3 Controller as /devices/ocp.3/47400000.usb/musb-hdrc.1.auto/usb1/1-1/1-1:1.0/input/input2
[15105.671447] usbhid 1-1:1.0: looking for a minor, starting at 96
[15105.672694] sony 0003:054C:0268.0002: input,hiddev0,hidraw0: USB HID v1.11 Joystick [Sony PLAYSTATION®3 Controller] on usb-musb-hdrc.1.auto-1/input0
[15105.675678] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[15105.675776] hub 1-0:1.0: port 1 enable change, status 00000103

but lacks reporting the following

From what I understand there is a patch that went into Linux kernel since 2.6.37 but I could never find it in the changelogs. Does anyone know if this patch carried through to 3.8.13-bone41?

Also the Bluez version we have for Debian seems to be 4.99 and the latest version on www.bluez.org is up to 5.17. Sixaxis looks to be fully supported in that version. Any chance we will be going to a newer version of Bluez in the near future?

Thanks!

I bet if you use bluez 5.14 and later you will have better luck. I run ArchLinux|ARM though but have no issues with upstreams bluez with a DS4 controller

And according to [1] the 6 axis works fine on arch so should be fine on BBB as well. My guess is the old bluez, or the old bluez and the kernel [1]

Hi Don,

Thanks for the pointer!

I have been trying to get Bluez-5.17 to compile without success. L2test.c and SDP.c looks like they were unfinished. Implicit function errors and pointer to int comparison errors.

I upgraded my Debian v3.8 to v3.13.9 so that I could plug a powered USB hub into the BBB USB host so that I could plug a Rocketfish BT dongle and my Sony sixaxis concurrently for pairing. Otherwise you can only plug one device into the USB host at a time. I think there is more to do to support USB. Long story short in Debian v3.8 my Rocketfish dongle was correctly identified. In Debian v3.13.9 I get the following-

root@arm:/# dmesg |tail
[ 1223.364177] usb 2-1: new full-speed USB device number 4 using musb-hdrc
[ 1276.911353] Bluetooth: Core ver 2.17
[ 1276.911471] NET: Registered protocol family 31
[ 1276.911482] Bluetooth: HCI device and connection manager initialized
[ 1276.911532] Bluetooth: HCI socket layer initialized
[ 1276.911549] Bluetooth: L2CAP socket layer initialized
[ 1276.911578] Bluetooth: SCO socket layer initialized
[ 1276.944459] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1276.944480] Bluetooth: BNEP filters: protocol multicast
[ 1276.944530] Bluetooth: BNEP socket layer initialized
root@arm:/# hcitool dev
Devices:
root@arm:/# [ 1349.186393] usb 2-1.1: device v0a5c p4502 is not supported
[ 1349.396415] usb 2-1.2: device v0a5c p4503 is not supported
[ 1349.606618] usb 2-1.3: device v0461 p4d75 is not supported

…Back to the drawing board.

That looks like you didn't copy the modules to the rootfs..

Regards,

It should build could be a few different reasons its failing for you. If I get time I will setup a deb install and see about compiling it. But it for sure builds on Arch.

FYI, I’m running Robert’s latest Debian with beta kernel (3.13.9-bone9), and have compiled and run bluez-5.17 successfully, connecting to BLE devices with an iogear dongle plugged into a hub.

All,

I successfully paired a Sony Dual Shock sixaxis controller -

[    2.185863] usb 1-1.3: New USB device found, idVendor=054c, idProduct=0268
[    2.185875] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.185917] usb 1-1.3: Product: PLAYSTATION(R)3 Controller
[    2.185928] usb 1-1.3: Manufacturer: Sony
[    2.186583] usb 1-1.3: usb_probe_device
[    2.186602] usb 1-1.3: configuration #1 chosen from 1 choice
[    2.186912] usb 1-1.3: adding 1-1.3:1.0 (config #1, interface 0)
[    2.187163] usbhid 1-1.3:1.0: usb_probe_interface
[    2.187179] usbhid 1-1.3:1.0: usb_probe_interface - got id
[    2.193368] sony 0003:054C:0268.0001: Fixing up Sony Sixaxis report descriptor
[    2.224759] input: Sony PLAYSTATION(R)3 Controller as /devices/ocp.3/47400000.usb/musb-hdrc.1.auto/usb1/1-1/1-1.3/1-1.3:1.0/input/input1
[    2.225527] usbhid 1-1.3:1.0: looking for a minor, starting at 96
[    2.226048] sony 0003:054C:0268.0001: input,hiddev0,hidraw0: USB HID v1.11 Joystick [Sony PLAYSTATION(R)3 Controller] on usb-musb-hdrc.1.auto-1.3/input0
[    2.227235] hub 1-1:1.0: state 7 ports 4 chg 0000 evt 0008

with a
Targus USB-BT adapter-
[ 1.999075] usb 1-1.1: New USB device found, idVendor=0a5c, idProduct=21e8
[ 1.999089] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1.999101] usb 1-1.1: Product: BCM20702A0
[ 1.999111] usb 1-1.1: Manufacturer: Broadcom Corp

through a Staples 4 port hub Model (#36302) (generic for NEC product NEC HUB_005A 0x005a USB 2.0 4-Port Hub )-
[ 1.619722] usb 1-1: New USB device found, idVendor=0409, idProduct=005a
[ 1.619734] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 1.620163] usb 1-1: usb_probe_device
[ 1.620181] usb 1-1: configuration #1 chosen from 1 choice
[ 1.620314] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
[ 1.620447] hub 1-1:1.0: usb_probe_interface
[ 1.620460] hub 1-1:1.0: usb_probe_interface - got id
[ 1.620478] hub 1-1:1.0: USB hub found
[ 1.620561] hub 1-1:1.0: 4 ports detected
[ 1.620573] hub 1-1:1.0: standalone hub
[ 1.620583] hub 1-1:1.0: individual port power switching
[ 1.620594] hub 1-1:1.0: individual port over-current protection
[ 1.620604] hub 1-1:1.0: Single TT
[ 1.620615] hub 1-1:1.0: TT requires at most 16 FS bit times (1332 ns)
[ 1.620625] hub 1-1:1.0: Port indicators are supported
[ 1.620635] hub 1-1:1.0: power on to power good time: 100ms
[ 1.620743] hub 1-1:1.0: local power source is good
[ 1.620944] hub 1-1:1.0: enabling power on all ports
[ 1.621456] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[ 1.621489] hub 1-0:1.0: port 1 enable change, status 00000503
[ 1.721197] hub 1-1:1.0: port 1: status 0101 change 0001
[ 1.721402] hub 1-1:1.0: port 3: status 0101 change 0001
[ 1.822691] hub 1-1:1.0: state 7 ports 4 chg 000a evt 0000
[ 1.822785] hub 1-1:1.0: port 1, status 0101, change 0000, 12 Mb/s
[ 1.836392] hub 1-1:1.0: port 1 not reset yet, waiting 10ms

verified the USB-BT adapter via-

root@beaglebone:~# hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:19:0E:15:62:FA ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:1351 acl:0 sco:0 events:60 errors:0
TX bytes:1333 acl:0 sco:0 commands:60 errors:0

root@beaglebone:~# lsusb
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0a5c:21e8 Broadcom Corp.
Bus 001 Device 004: ID 054c:0268 Sony Corp. Batoh Device / PlayStation 3 Controller

I downloaded sixpair.c from the following website

To satisfy the #include <usb.h> I installed libusb-dev

root@beaglebone:~# apt-get install libusb-dev

then compiled sixpair.c and executed-

root@beaglebone:~# ./sixpair
Current Bluetooth master: 00:02:76:1e:bb:e0
Setting master bd_addr to 00:19:0e:15:62:fa

Finally-

root@beaglebone:~# hcitool dev
Devices:
hci0 00:19:0E:15:62:FA
root@beaglebone:~# hcitool scan
Scanning …
00:26:83:36:62:F7 ubuntu-0