sixaxis on bluetooth

YDL running on the Sony Playstation 3

Moderator: billb

sixaxis on bluetooth

Postby agentn2o » 24 Mar 2008, 18:12

OK, so I have been messing around with the sixaxis controller and have managed to get it to be recognized as being turned on and off in bluetooth but the next step eludes me. Here is a summary of my progress:

I was following the instructions on this site: http://www.pabr.org/sixlinux/sixlinux.en.html and I have downloaded compiled and installed the latest bluetooth libraries and utilities from this site: http://www.bluez.org/download.html

I compiled and installed the lib, utils, and hcidump using:

./configure --prefix=/usr

make clean

make all

make install

on each. I patched the utils with:

wget http://www.pabr.org/sixlinux/patch-hidd-3.19-pabr3

patch ./bluez-utils-3.19/hidd/main.c patch-hidd-3.19-pabr3

before I built that code.

Now, when all of that is done I can stop the bluetooth and hidd services:

su -

service bluetooth stop

service hidd stop

I edit the /etc/bluetooth/hcid.conf to ensure it contains:

iscan disable;
pscan enable;
#auth enable;
#encrypt enable;

then restart the services (order is important, hidd should start first, then stopped otherwise you'll get an error):

service hidd start

service bluetooth start

service hidd stop

then run the hidp daemon:

hidd --server --nocheck -n

So after all this when I press the PS button on the controller (not plugged in) I can see that the controller is recognized by the hidd:

# hidd --server --nocheck -n
hidd[3218]: Bluetooth HID daemon
hidd[3218]: New HID device 00:16:FE:D7:3A:E6 (Sony Computer Entertainment Wireless Controller)

but I cannot get anything else. It registers as a joystick and creates a js0 file in /dev but when I run try to test it with:

jstest /dev/js0

I get nothing. Bluetooth only seems to register it on and off (hold PS button for ~10 secs to turn off, on with PS again). Actually the bluetooth service doesn't seem to do anything here as I achieve the same results with that service completely down (using only hidd).

The step I was not able to achieve was to compile and run the sixpair.c program from those instructions. The code is here: http://www.pabr.org/sixlinux/sixpair.c

But... when I try to compile that code with the command line:

gcc -o sixpair sixpair.c -L/usr/lib -lusb

I get a bunch of errors. Has anyone been able to compile and run the sixpair program on the PS3? I see from other sites that other linux & windows users have been able to get this to work so it sucks that we cannot get our own controller working properly. Anyone have any ideas on how to get sixpair to run?

EDIT: got it to work... I didn't have the libusb-devel package installed. Now to play some more. Here's a dump:

# gcc -o sixpair sixpair.c -L/usr/lib -lusb
# sudo ./sixpair
Current Bluetooth master: 00:1a:80:39:4a:05
Setting master bd_addr to 00:1a:80:39:4a:05
User avatar
agentn2o
ydl lover
ydl lover
 
Posts: 67
Joined: 24 Feb 2008, 02:07
Location: Victoria, BC, Canada

Postby agentn2o » 24 Mar 2008, 19:49

Some success except my output MAC addresses don't match heres the output:

sudo ./sixpair
Current Bluetooth master: 00:1a:80:39:4a:05
Setting master bd_addr to 00:1a:80:39:4a:05
# hidd --server --nocheck -n
hidd[5660]: Bluetooth HID daemon
hidd[5660]: New HID device 00:1B:FB:3B:4B:EE (Sony Computer Entertainment Wireless Controller)

Same joystick but the address for sixpair is 00:1a:80:39:4a:05 and is reported in hidd as: 00:1B:FB:3B:4B:EE ... anyone have an idea here?
User avatar
agentn2o
ydl lover
ydl lover
 
Posts: 67
Joined: 24 Feb 2008, 02:07
Location: Victoria, BC, Canada

Postby sb81 » 24 Mar 2008, 20:33

agentn2o wrote:Some success except my output MAC addresses don't match heres the output:

sudo ./sixpair
Current Bluetooth master: 00:1a:80:39:4a:05
Setting master bd_addr to 00:1a:80:39:4a:05
# hidd --server --nocheck -n
hidd[5660]: Bluetooth HID daemon
hidd[5660]: New HID device 00:1B:FB:3B:4B:EE (Sony Computer Entertainment Wireless Controller)

Same joystick but the address for sixpair is 00:1a:80:39:4a:05 and is reported in hidd as: 00:1B:FB:3B:4B:EE ... anyone have an idea here?


Current Bluetooth Master sounds like it would be the BT device in the PS3 itself.

I believe the sixaxis.c is for non-ps3 systems. The missing thing here seems to be something the PS3 sends the controller after it connects to it. Possibly which controller it is 1-7.
sb81
ydl beginner
ydl beginner
 
Posts: 34
Joined: 07 Mar 2008, 18:05

Postby keefy » 24 Mar 2008, 21:39

Keep investigating, we need them to work :)
keefy
ydl lover
ydl lover
 
Posts: 80
Joined: 07 Mar 2008, 15:30

Postby agentn2o » 24 Mar 2008, 22:01

Current Bluetooth Master sounds like it would be the BT device in the PS3 itself.

I believe the sixaxis.c is for non-ps3 systems. The missing thing here seems to be something the PS3 sends the controller after it connects to it. Possibly which controller it is 1-7.


Yeah, I think you are right... from the way the LEDs blink when you press the PS button (and connection confirmed with HIDD) the sixaxis seems to be waiting for a controller number that it is not getting. The lights just sit there blinking rapidly (faster than when plugged in USB).

I am wondering if there are settings that might help in the /etc/bluetooth/hcid.conf or /etc/conf.d/bluetooth files that may help. I have been trying various things to no avail.

I do notice that the order in which hidd & bluetooth services start affects whether hidd will start properly. If hidd is not first the bluetooth service seem to hog the HID control address.

Mysteries upon mysteries...

EDIT:

went to edit the /etc/conf.d/bluetooth file (I have been making many edits to the /etc/bluetooth/hcid.conf file) only to discover there is no such file. Maybe that is the problem with hidd / bluetooth compatibility. I will have to find a suitable version of /etc/conf.d/bluetooth and try that angle.

EDIT 2:

Found a etc/conf.d/bluetooth file:

# Bluetooth configuraton file
# Start of hcid (allowed values are "true" and "false")
HCID_ENABLE=true
# Config file for hcid
HCID_CONFIG=“/etc/bluetooth/hcid.conf”
# Start sdpd (allowed values are "true" and "false")
SDPD_ENABLE=true
# Start hidd (allowed values are "true" and "false")
HIDD_ENABLE=true
# Arguments to hidd
HIDD_OPTIONS=“--nocheck”
# Run hid2hci (allowed values are "true" and "false")
HID2HCI_ENABLE=false
# Bind rfcomm devices (allowed values are "true" and "false")
RFCOMM_ENABLE=true
# Config file for rfcomm
RFCOMM_CONFIG=“/etc/bluetooth/rfcomm.conf”
# Start dund (allowed values are "true" and "false")
# If you want to use dund, you must install: net-dialup/ppp .
DUND_ENABLE=true
# Arguments to dund
DUND_OPTIONS=“–listen –persist –msdun call dun”
# Start pand (allowed values are "true" and "false")
PAND_ENABLE=true
# Arguments to pand
PAND_OPTIONS=“–listen –role NAP”


Still no joy / FUBAR'd ... :evil:
User avatar
agentn2o
ydl lover
ydl lover
 
Posts: 67
Joined: 24 Feb 2008, 02:07
Location: Victoria, BC, Canada

Postby agentn2o » 26 Mar 2008, 20:42

Current Bluetooth Master sounds like it would be the BT device in the PS3 itself.


yes so this is the bluetooth controller within the system itself, with the bluez-utils you can get more info by typing hciconfig:

# hciconfig hci0 -a
hci0: Type: USB
BD Address: 00:1A:80:39:4A:05 ACL MTU: 384:8 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:3175 acl:39 sco:0 events:99 errors:0
TX bytes:2150 acl:39 sco:0 commands:43 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'BlueZ (0)'
Class: 0x000104
Service Classes: Unspecified
Device Class: Computer, Desktop workstation
HCI Ver: 2.0 (0x3) HCI Rev: 0xe18 LMP Ver: 2.0 (0x3) LMP Subver: 0xe18
Manufacturer: Cambridge Silicon Radio (10)


And I can turn on and off the bluetooth controller by:

hciconfig hci0 down
hciconfig hci0 up

Interesting that when I do that, the sixaxis stops flashing (assuming the PS button was previously pushed). I can ping the sixaxis since I know the MAC address from the hidd:

# hidd
00:1B:FB:3B:4B:EE Sony Computer Entertainment Wireless Controller [054c:0268] connected
# l2ping 00:1B:FB:3B:4B:EE
Ping: 00:1B:FB:3B:4B:EE from 00:1A:80:39:4A:05 (data size 44) ...
4 bytes from 00:1B:FB:3B:4B:EE id 0 time 23.92ms
4 bytes from 00:1B:FB:3B:4B:EE id 1 time 24.64ms
4 bytes from 00:1B:FB:3B:4B:EE id 2 time 24.13ms
3 sent, 3 received, 0% loss


But still no connection is being made. I tried to bind to the sixaxis using the rfcomm as has been suggested for other BT devices but I notice that the rfcomm service is not running (or installed). Is this, perhaps, part of the reason. In my services list when I select bluetooth it shows:

hcid (pid 3550) is running...
sdpd (pid 3554) is running...

but no rfcomm... it seems to me this is an essential part of the bluetooth package, does anyone know more about this?

I can manually bind the device from the command line like so:

rfcomm bind 0 00:1B:FB:3B:4B:EE 1

but it seems that the implementation of the YDL bt manager does not involve rfcomm. And while I might be barking up the wrong tree, I am thinking that since others flavours of PS3 linux are able to use the sixaxis that the issue is in the YDL implementation of bluetooth. Anyone have any ideas on the matter? Cheers.
User avatar
agentn2o
ydl lover
ydl lover
 
Posts: 67
Joined: 24 Feb 2008, 02:07
Location: Victoria, BC, Canada

Postby dedpunx » 29 Mar 2008, 18:03

hi , i see you where able to disable /enable bluetooth in YDL, have you been able to do this on the Gameos?

the reason i ask is that bluetooth gives me headaches

:cry: :cry:

i want to buy ps3 for blue ray drive and to mod but the bluetooth issue is literally a sore one to overcome!

cheers

Jim
dedpunx
ydl newbie
ydl newbie
 
Posts: 6
Joined: 29 Mar 2008, 14:53

many have tried...

Postby javon27 » 02 Apr 2008, 20:10

none have succeeded. hate to bust your bubbles, you just might be the one to crack it. all of us have went down that same route you're taking, even me. i only got as far ast getting it recognized and having the buttons being recognized but no way to get it recognized as a game controller in snes9x or sdlmame. i believe some programming is required. have you checked out what the fedora folks have done? i think they were able to do it in their forums. and if i remember correctly there was some coding/scripting required. i don't have a link, but since you were able to find that pabr.org, i'm sure you can find it.

best of luck! and keep us posted, we all want this!!! :D
javon27
ydl lover
ydl lover
 
Posts: 70
Joined: 02 Jan 2008, 18:00

Postby agentn2o » 02 Apr 2008, 23:18

You were able to get buttons recognized in BT mode? How did you do that? I got the hidd recognition and the creation of a js0 device but running jstest gave me nothing as far as button presses in BT mode. Can you outline how you managed to get that to work? Thanks.
User avatar
agentn2o
ydl lover
ydl lover
 
Posts: 67
Joined: 24 Feb 2008, 02:07
Location: Victoria, BC, Canada

Postby karusher » 06 Apr 2008, 13:53

I was able to get Bluetooth working with YDL 6.0.

I built the libraries and hcidump with version 3.30. However, I used version 3.19 to build the utilities.

When I first tried, I used version 3.30 to build the utilities but I discovered that that version does not build hidd.
karusher
ydl newbie
ydl newbie
 
Posts: 4
Joined: 06 Apr 2008, 13:47

Postby billb » 06 Apr 2008, 15:30

karusher wrote:I was able to get Bluetooth working with YDL 6.0.

I built the libraries and hcidump with version 3.30. However, I used version 3.19 to build the utilities.

When I first tried, I used version 3.30 to build the utilities but I discovered that that version does not build hidd.


That's great! Vague, but great! :D
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
User avatar
billb
Site Admin
Site Admin
 
Posts: 5222
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Postby karusher » 06 Apr 2008, 15:38

Let me add more details:

1) Download the following items:
http://ftp.osuosl.org/pub/nslu2/sources ... .19.tar.gz
http://www.bluez.org/redirect.php?url=h ... .30.tar.gz
http://www.bluez.org/redirect.php?url=h ... .41.tar.gz

2) Extract

3) Apply patch to utils

patch ./bluez-utils-3.19/hidd/main.c patch-hidd-3.19-pabr3

4) Build and install each package with
./configure --prefix=/usr
make
make install

5) Restart services

/sbin/service hidd stop
/sbin/service/bluetooth stop
/sbin/service hidd start
/sbin/service/bluetooth start

I should also mention that I am using YDL 6.0 and I have rebuilt my kernel from http://lwn.net/Articles/267731/.

I think the thing that really made it work was using the same version that of Bluez utils that was described on http://www.pabr.org.

I found that it was unnecessary to edit configuration files.
Last edited by karusher on 06 Apr 2008, 15:45, edited 1 time in total.
karusher
ydl newbie
ydl newbie
 
Posts: 4
Joined: 06 Apr 2008, 13:47

Postby billb » 06 Apr 2008, 15:42

karusher wrote:Let me add more details:


Excellent -- haven't tried it yet, but I'm sure we'll all appreciate the added info. Thanks!
PS3 60GB [CECHA01], FW 3.15, YDL 6.2, Samsung T260HD @ 1920x1200
User avatar
billb
Site Admin
Site Admin
 
Posts: 5222
Joined: 24 May 2007, 20:30
Location: Eastern NC, USA

Postby agentn2o » 06 Apr 2008, 19:39

karusher wrote:I should also mention that I am using YDL 6.0 and I have rebuilt my kernel from http://lwn.net/Articles/267731/.

@karusher?: good work! :D

Hey, if it is not too much trouble maybe you could mention how you compiled your kernel. I have followed instructions for fc8 and they have succeeded... those found here (section 4b):
http://www.bohmer.net/ps3_stuff/install-fedora-8-on-PS3.html

But the same steps did not work for fedora 7 and I haven't even attempted ydl6. :?

I found another article on compiling kernels for ps3 here:

http://julipedia.blogspot.com/2007/03/building-updated-kernel-for-ps3.html

I figure the kernel is likely the key step as I tried the other steps you describe for activating BT sixaxis without success!

I appreciate any other help you can give wrt kernel compiling. Cheers.
User avatar
agentn2o
ydl lover
ydl lover
 
Posts: 67
Joined: 24 Feb 2008, 02:07
Location: Victoria, BC, Canada

Postby badfish591 » 06 Apr 2008, 21:38

i just started installing emulators on ydl, i know getting the sixaxis to work wirelessly is still a bit off but is there a way to have it recognized wired? i would accept that for now if anyone knows how.
User avatar
badfish591
ydl addict
ydl addict
 
Posts: 105
Joined: 04 Apr 2008, 14:43
Location: pineapple pork florida

Next

Return to Playstation 3

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 10 guests