Go Back  
Reply
 
Thread Tools
Old 05-04-2008   #1
jorg
Member
 
jorg's Avatar
 
Join Date: Dec 2007
Location: The lions den
Posts: 474
Likes: 24
Liked 34 Times in 24 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
[Tutorial]How to get SixAxis Bluetooth to work in Linux

taken from here:Using the PlayStation 3 controller in Bluetooth mode with Linux

Note:The use of Bluetooth authentication and encryption has not been investigated yet.

Running in non-secure mode, as described in this document, might be inappropriate for some applications, and may also make the host computer temporarily vulnerable to attacks.

*Requirements


linux-2.6.21 or later . Earlier kernels do not support Bluetooth HID devices in "Report Protocol" mode.


patch-hidd-3.9-pabr3(http://www.pabr.org/sixlinux/patch-hidd-3.9-pabr3) or patch-hidd-3.19-pabr3(http://www.pabr.org/sixlinux/patch-hidd-3.19-pabr3) . This patch causes the Linux Bluetooth HIDP daemon (hidd) to send a special command to the SIXAXIS when it connects. Sony already published a similar patch for enabling reporting in USB mode.


sixpair.c.(http://www.pabr.org/sixlinux/sixpair.c) (Only required if the SIXAXIS is to be used with a non-PS3 Bluetooth master.) The SIXAXIS apparently does not support the standard Bluetooth pairing procedure; instead, pairing is done over USB, which is arguably simpler and more secure. This command-line utility searches USB buses for SIXAXIS controllers and tells them to connect to a new Bluetooth master.


Alternatively, it might be possible to support the Bluetooth HID "Report Protocol" on older kernels by using bthid instead of hidd, with a similar patch.

Besides, the new "input service" (bluetoothd-service-input), which replaces hidd in recent versions of bluez-utils, should support the SIXAXIS without any patch. However, since it does not accept connections from unknown Bluetooth devices, authorizations must be set-up by another utility, such as a udev plugin, as suggested in this discussion(Gmane Loom).

Note. Bluetooth experts use the word "controller" to refer to the Bluetooth network adapter inside the host or the PS3, whereas everybody else thinks "game controller" (a.k.a. joystick). This sometimes causes confusion.


Operation

Ensure /etc/bluetooth/hcid.conf contains:

Code:
iscan disable;
pscan enable;
#auth enable;                                        
#encrypt enable;
Enable Bluetooth:

Code:
# service bluetooth restart
If the host is not the PS3, pairing is required:



Connect the SIXAXIS with a USB cable.


Run sixpair:
Code:
 # gcc -o sixpair sixpair.c -lusb
      # ./sixpair
      Current Bluetooth master: xx:xx:xx:xx:xx:xx
      Setting master bd_addr to xx:xx:xx:xx:xx:xx
Disconnect the USB cable.



Run the HIDP daemon:

Code:
# hidd --server --nocheck -n
(Note: --nocheck is only required for the first connection.)


Optionally run hcidump in another shell, for troubleshooting and comparison with this successful trace(Online.net Hébergement Mutualis&eacute Professionnel

Code:
# hcidump -t -V -x
Press the PS button on the SIXAXIS.


hidd should report:
Code:
# hidd --server --nocheck -n
hidd[8332]: Bluetooth HID daemon
hidd[8332]: New HID device 00:19:C1:xx:xx:xx (Sony Computer Entertainment Wireless Controller)
/var/log/messages should report:

Code:
input: Sony Computer Entertainment Wireless Controller as /class/input/inputX
Check that the SIXAXIS is recognized as a joystick:

Code:
# modprobe joydev
# jstest /dev/js0      # or jstest /dev/input/js0
jstest should report buttons being pressed and sticks being moved.


After testing, restore the security settings in /etc/bluetooth/hcid.conf:

Code:
auth enable;                                        
encrypt enable;
and apply them with:
Code:
# service bluetooth restart

Using inertial sensors with the hidraw interface

The Linux joystick interface
Code:
(joydev.ko, /dev/input/js*)
does not report inertial measurements from the accelerometers and gyro. The hidraw interface can be used instead. It transfers raw HID input reports to user-space and works identically in USB mode and in Bluetooth mode.

Requirements

A kernel with
Code:
CONFIG_HIDRAW
enabled.


patch-bluetooth-hidraw-pabr1. Adds hidraw support to hidp.ko for use in Bluetooth mode. Not required in USB mode.

Operation


Connect the device with a USB cable and press PS. dmesg should report:

Code:
input,hidraw1: USB HID v1.11 Joystick [Sony PLAYSTATION(R)3 Controller] on usb-xxxx:xx:xx.x-x

and /dev/hidraw1
(or another minor number) should be created automatically.


In Bluetooth mode, a
Code:
 /dev/hidrawX
device is created as well, but dmesg does not report its minor number.


Raw input reports can be read from /dev/hidraw1:

Code:
# hexdump -v -e '48/1 "%02x " "\n"' < /dev/hidraw1
00 00 00 00 00 74 7b 7c 7c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 ee 10 00 00 00 00 02 b2 77 01 81 02 05 01 ed 01 a4 00 02
sixhidtest.c(http://www.pabr.org/sixlinux/sixhidtest.c) decodes inertial measurements:

Code:
# gcc -o sixhidtest sixhidtest.c
# ./sixhidtest < /dev/hidraw1
ax= 517 ay= 493 az= 420
xsixhidtest.c(http://www.pabr.org/sixlinux/xsixhidtest.c) graphically displays speed, position and orientation derived from accelerometer measurements. High-pass filtering is used to control integration drift; this works well for fast periodic signals, e.g. circular motion. In this simple example, no attempt is made to track simultaneous translations and rotations, nor rotations around the vertical axis.

Code:
# gcc -o xsixhidtest xsixhidtest.c -lX11 -lm
# ./xsixhidtest < /dev/hidraw1
Known issues


A 2.0 Bluetooth adapter is recommended. Otherwise, incoming input reports may be truncated to 12 bytes.


On some PS3 hosts, hcidump shows "Role Change" "Role: Master" and dmesg reports "hci_acldata_packet: hci0 ACL packet for unknown connection handle". Upgrading to linux-2.6.23 or later should solve this problem.


The Bluetooth adapter in the PS3 supports remote wake-up. This has not been tested with Linux.


Bluetooth authentication and encryption have not been investigated. This probably requires a key exchange procedure over USB.


The LEDs are not supported. /dev/js0 should have the first LED turned on, and so on.


Hand-over between USB mode and Bluetooth mode is not transparent for applications.


Monitoring of battery status is not implemented.

refer to website for demos and videos
Using the PlayStation 3 controller in Bluetooth mode with Linux
__________________
3®D®lCH

Last edited by jorg; 05-05-2008 at 12:30 PM.
jorg is offline   Reply With Quote
Old 05-04-2008   #2
uncholowapo
Member
 
uncholowapo's Avatar
 
Join Date: Apr 2008
Location: Ga, USA
Posts: 788
Likes: 0
Liked 36 Times in 31 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Send a message via MSN to uncholowapo Send a message via Yahoo to uncholowapo
You forgot to give the proper credit where you took this from.
uncholowapo is offline   Reply With Quote
Old 05-04-2008   #3
jorg
Member
 
jorg's Avatar
 
Join Date: Dec 2007
Location: The lions den
Posts: 474
Likes: 24
Liked 34 Times in 24 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
your rite my bad
*also fixed headers essier to read
*inserted code boxes
*general clean up on my sloppy/rushedness
__________________
3®D®lCH

Last edited by jorg; 05-05-2008 at 12:31 PM.
jorg is offline   Reply With Quote
Old 05-04-2008   #4
uncholowapo
Member
 
uncholowapo's Avatar
 
Join Date: Apr 2008
Location: Ga, USA
Posts: 788
Likes: 0
Liked 36 Times in 31 Posts
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Send a message via MSN to uncholowapo Send a message via Yahoo to uncholowapo
Ok now for my original question: When I did the command:

Code:
hidd --server --nocheck -n
My controller is recognized after pressing the PS button but when I do the joystick test:

Code:
jstest /dev/js0
no buttons are registering in the terminal when I press them. Any ideas?
uncholowapo is offline   Reply With Quote
Old 05-05-2008   #5
Pirate
 
Pirate's Avatar
 
Join Date: Feb 2007
Posts: 6,932
Likes: 370
Liked 7,995 Times in 1,235 Posts
Mentioned: 568 Post(s)
Tagged: 0 Thread(s)
Originally Posted by jorg View Post
your rite my bad
*also fixed headers essier to read
Can you [CODE] the information that is actually code, and fix it up so it is easier to read than one long jumbled up post?

Code:
This is how code box looks like
__________________


Please do not PM me with help/questions (I will not reply). Use this for your questions.
PS3 Hacks
Pirate is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get your Sixaxis to work on Vista uncholowapo Other/Misc Tutorials 11 11-22-2008 05:33 AM
Just an idea (sixaxis bluetooth question?) madshaun1984 PS3 | Help 0 07-18-2008 07:52 AM
For what does PS3 App maker work? dxc PS3 | Jailbreak & Custom Firmware 0 07-13-2008 12:02 AM
Getting The Sixaxis Motion Sensing to work on YDL6 uncholowapo Linux Tutorials 9 06-09-2008 01:04 PM



PS3Hax.net is Copyright © 2010-2013.
Use of this site is governed by our Terms of Use and Privacy Policy. All Trademarks and images are owned by their respected owners.
Posts and links are subject to each author on this forum and are no way affiliated with the operations and/or opinions of ps3hax.net
All times are GMT -5. The time now is 06:25 AM.