Sixpair Mac

Download and start the SixPair tool. Then, connect your iOS device and the PS3 controller using USB cables to your Mac. Now, the SixPair tool will show a pairing button. Press the button and you're done. /. sixpair.c version 2007-04-18. Compile with: gcc -o sixpair sixpair.c -lusb. This program is free software; you can redistribute it and/or modify. it under the terms of the GNU General Public License as published by. the Free Software Foundation; version 2.

  1. Sixpair For Mac
  2. Sixpair Tool Mac
  3. Sixpair Tool Mac

If you’re building a robot you will at some point probably want a way to manually drive it around. The Playstation3controller, also known as the SixAxis, makes for a great option - it connects over bluetooth, has a bundle of differentbuttons, sticks and motion sensors, and is readily available. You’ll probably google for how to make it work with theRaspberry Pi and then, if your experience is anything like mine, you’ll find that every single online guide is a) a copyof one original document and b) doesn’t work. Having solved all these problems, I thought I’d be nice and write themethod down here in the hope that no-one else has to waste the time I’ve just spent on it...

Sixpair

A note on pairing¶

One of the reasons the SixAxis isn’t as easy as it could be to use is how pairing works. Normal bluetooth devices willestablish a link between the device and the host once, then the host can initiate connection using this previouslystored information. In the case of the SixAxis, it’s actually the controller that initiates the process, so we have todo some setup beforehand. We need to tell the controller to which bluetooth host it should attempt to connect, and weneed to tell the host (the Pi) that it should allow the controller’s connection.

Hardware¶

This guide assumes you’re using a Raspberry Pi (I’m using a Pi 2, but there’s no reason this wouldn’t work with olderones). You’ll also need a USB bluetooth dongle and, obviously, a SixAxis controller. I’ve only tried this with genuineSony ones, many of the cheaper ones you’ll find online are clones, they should work but YMMV.

Bluetooth dongles¶

Some people are finding this guide does not work. I suspect this is down to the bluetooth dongle, having eliminatedeverything else in the process. The one I’m using is an Asus USB-BT400, it’s tiny and supports all the current Bluetoothstandards. If you get this to work with a different dongle can you let me know on twitter at @approx_eng_ and I’ll addit to this list:

  • Asus USB-BT400

Software¶

Note 1 - this assumes you’ve set up git and installed a public key with github, you don’t have to do this but you’llneed to modify some of the git commands below if you haven’t. You can set up public keys using the instructions athttps://help.github.com/articles/generating-ssh-keys/#platform-all

Note 2 - this is also assuming you’re starting from a clean installation of the latest Jessie based Raspbian. Otherdistributions may need varying combinations of dev libraries etc. For testing I was using the minimal installation withfilename 2015-11-21-raspbian-jessie-lite.zip but these instructions should apply to any recent version. As always,it’s not a bad idea to run sudoapt-getupdate and sudoapt-getupgrade to get any changes to packages sinceyour distribution was built.

You’ll need to install some packages on your Pi first, and enable the bluetooth services:

You also need to add the default user to the bluetooth group:

You must now power cycle your Pi. Do not just reboot, actually shut down, pull the power, wait a few seconds andreconnect. This may be overkill, but it’s been the best way I’ve found to consistently have the next steps succeed.

Pairing¶

Get and build the command line pairing tool:

Firstly we need to tell the controller the address of the bluetooth dongle. To do this you need to connect thecontroller to your Pi with a mini-USB cable. Also make sure your Pi is powered from an external supply - the extrapower needed when you connect the controllers can be too much for a laptop USB socket and you’ll get random errors orthe process won’t work at all. The ‘sixpair’ command, run as root, updates the controller’s bluetooth master address:

You should see a message indicating that the bluetooth master address on the controller has been changed (you canspecify the address to which it should change, the default with no arguments is to use the first installed bluetoothadapter, which is what you want unless for some reason you’ve got more than one plugged in). The controller will nowattempt to connect to your bluetooth dongle when you press the PS button (don’t do this just yet, it won’t work). Theexample above shows that no change has been made, as this particular controller had been paired with the dongle before,but you should see two different addresses - the first is the address the controller was trusting, the second is the oneit now trusts.

Next we need to configure the bluetooth software on the Pi to accept connections from the controller.

Disconnect your controller from the USB port, and run the ‘bluetoothctl’ command as a regular user (you don’t need tobe root for this):

Now re-connect your controller with the mini-USB cable. You should see messages in the terminal indicating thatsomething has connected (but don’t worry if you don’t, as long as something useful appears in the next step!)

Type ‘devices’ in the terminal. You will see a list of possible devices, including at least your SixAxis controller.You need to take note of the MAC address of the controller for the next step:

Type ‘agent on’ and then ‘trust MAC’, replacing MAC with the MAC address you noted in the previous step (they won’tbe the same as mine!). Quit the tool once you’re done.

Sixpair

Disconnect your controller, you should now be able to connect wirelessly. To check this, first list everything in/dev/input:

Now press the PS button, the lights on the front of the controller should flash for a couple of seconds then stop,leaving a single light on. If you now look again at the contents of /dev/input you should see a new device, probablycalled something like ‘js0’:

Sixpair tool mac

If a new device has appeared here then congratulations, you have successfully paired yourdongle and SixAxis controller. This will persist across reboots, so from now on you can just connect by pressing the PSbutton on the controller. Pressing and holding this button will shut the controller down - at the moment there’s notimeout so be sure to turn the controller off when you’re not going to be using it for a while.

Accessing the SixAxis from Python¶

You now have a joystick device in /dev/input, but how do you use it in your Python code?

There are two different approaches I’ve tried. You can use PyGame - this has the advantage that you might be using italready (in which case it’s the simplest solution) and it’s already installed in the system Python on your Pi. It hasthe drawback though that it requires a display - while I’m aware there are workarounds for this they’re not reallyvery satisfactory. The second option is to use the Python bindings for evdev - this is lightweight, but has drawbackof being more complex to use and only working on linux, even if you’re on a unix-like system such as OSX you can’t useit whereas PyGame is generally suitable for cross-platform use. Because I only want to run this on the Pi and because Ireally need it to work cleanly in a headless environment I’ve gone with evdev, but there are arguments for both.

Actually using evdev isn’t trivial, the best documentation I have is the code I wrote to handle it. I’ve created aPython class triangula.input.SixAxis and corresponding resource triangula.input.SixAxisResource tomake this simpler to work with. The class uses asyncore to poll the evdev device, updating internal state within theobject. It also allows you to register button handlers which will be called, handles centering, hot zones (regions inthe axis range which clamp to 1.0 or -1.0) and dead zones (regions near the centre point which clamp to 0.0).

By way of an example, the following code will connect to the controller (you’ll get an exception if you don’t have oneconnected) and print out the values of the two analogue sticks:

You’re welcome to pick up Triangula’s libraries, they’re uploaded to PyPi semi-regularly (get with ‘pip installtriangula’) or from github. In either case you’ll need to install one extra package first, without which the evdevmodule won’t build:

Now you can get Triangula’s code from github and build it to acquire the triangula.input module, you can then use thisin your own code (there’s nothing particularly specific to Triangula in it)

Sixpair For Mac

This will set up the libraries in develop mode, creating symbolic links into your python installation (I’m assuming herethat you’re using a virtual environment, because you should be - if you’re not you’ll need to run some of thesecommands as root)

As accessory manufacturers are struggling to turn a profit designing and selling third-party controllers for iOS gamers, a new Cydia tweak is making waves offering full support for existing PlayStation 3 controllers.

If you’re a gamer, chances are you already own a PS3 DualShock 3 controller.

Thanks to a new Cydia tweak called Controllers for All, you can now use that gamepad to play some of your favorite iOS games, including Grand Theft Auto, Need for Speed, Tomb Raider, Sky Gamblers, The King of Fighters, Call of Duty, and dozens more.

Sixpair

According to the developer, “Controllers for All already supports every game that’s been updated with iOS 7 controller support in mind, and does it with an extremely simple setup, one time pair using your computer and you’re done! No other configurations ever needed again.”

Full instructions on how to pair your PS3 controller to your iPhone or iPad can be found below for Mac, Windows, and Linux. The process seems fairly simple and straightforward, but note that you will need a jailbroken device to make it work.

Mac OS X:

1. Download SixPair2. Connect both your PS3 controller and your iOS device to your Mac3. Click the Pair controller button4. Disconnect your controller.Done!

Windows:

1. Download and install SixaxisPairTool2. Connect both your iOS device and PS3 controller to your Windows computer3. Run SixaxisPairTool and insert your iOS device Bluetooth address (you can find it in Settings > General > About > Bluetooth)4. Click Update and disconnect your controller.Done!

Linux:

Sixpair Tool Mac

Sixpair mac download

1. Download and compile sixpair2. Connect both your iOS device and PS3 controller to your Linux PC3. Run sixpair and give it your iOS device Bluetooth address as the first CLI parameter4. Disconnect the controllerDone!

For Linux users in particular, a set of advanced instructions is available.

Sixpair Tool Mac

AirPlay is supported, meaning you can play your games on the big screen too (if you have an Apple TV). Controllers for All sells for $1.99 (€1.47) and currently supports only PS3 controllers, but its creator promises to add support for more soon.