The iPhone and iPad are fantastic gaming devices, but unfortunately a lot of games still try to emulate gamepads with onscreen buttons on the touch screen and it just doesn’t work that well. Thankfully, a jailbreak app called Blutrol lets you turn a handful of different gamepads into controllers for any game with touchscreen buttons. Here’s how to set it up.
We’ve talked about turning your Android or iOS device into a portable retro game arcade before, and while you can still use those tricks, this method makes it so you can use a bunch of different controllers for any game on iOS, not just emulators and the handful of games that support controllers. While it might sound a little fishy, it works incredibly well and isn’t that hard to set up.
What You’ll Need
You don’t need much to make this work, just a single app, some games, and little patience:
– jailbroken iPad, iPhone, or iPad Touch.
– Blutrol ($6.99) from the BigBoss Repository on Cydia.
– A PS3 Dualshock controller (note: you also need the SixPair tool for Mac or the SixaxisPairTool for Windows to pair the PS3 controller with your iOS device), Bluetooth Keyboard, Wiimote, Phonejoy, iCade, iControlPad, or iMpulse controller.
That’s it. Now we just need to get your controller paired up with your device and working with your games.
Pair You Gamepad with Your iOS Device
First things first, we need to get the gamepad paired with your iOS device. We’ll be using a PS3 controller, which takes an extra step. So, if you’re using a different gamepad, skip this part.
How To Setup A PS3 Controller
The PS3 controller takes one additional step to get it working with your iOS device, but it’s not complicated, and you only have to do it once. When you’re done, your controller is paired with your iOS device every time.
On Windows
Download and run SixaxisPairTool.
Connect your iOS device to your computer with the lightning cable or 30-pin cable.
Connect your PS3 controller to your computer with a USB cable and wait for the Bluetooth address to come up.
Once it’s paired with your computer, get your iOS device’s Bluetooth address by heading into Settings > About > Bluetooth. Enter that address into SixaxisPairTool and click update. Now your iOS device should be linked to your PS3 controller.
On Mac
Download SixPair Tool and run the app.
Connect your iOS device to your computer with the lightning cable or 30-pin cable.
Connect your PS3 controller to your Mac with a USB cable.
Click the “Pair Controller to iPad” button.
When it’s successful, open Blutrol on your iOS device, tap the controller tab, select the PS3 controller, and tap “Connect.” When it’s connected, you can disconnect the PS3 controller from your Mac.
Now you can select your PS3 controller inside Blutrol as a Bluetooth device (if it doesn’t appear right away, head into Settings > BTStack and select “BTStack” as the active Bluetooth system).
Pair Other Controller to Your iOS Device
Thankfully, other controllers don’t take the extra step that a PS3 controller does. For the rest of the supported devices, just follow the directions for pairing that are included with the device (or just head into Settings > General > Bluetooth and make sure they’re already recognized). Then open the Blutrol app, tap “Controller” and select your gamepad.
Set Up Blutrol for Any Game
Now that your iOS and gamepad are paired up together it’s time to start playing games. Thankfully, this part’s easy too, and you only have to do this once for each game.
1.) Open up the game you want to use the controller for (obviously it makes the most sense to pick a game with onscreen buttons. We’ll be using Sonic CD).
2.) Take a screenshot of the game when the controls are displayed (tap the home button and power button at the same time).
3.) Exit the game and open up Blutrol.
4.) Tap the “Games” tab, and then the “+” sign.
5.) Select the game you just took a screenshot of.
6.) Tap either portrait or landscape (depending on how you took the screenshot), and
7.) select the screenshot you just took.
8.) Tap “Add,” select the controller of your choice, and then tap either landscape or portrait.
You’ll now see your screenshot with your gamepad’s buttons laid over it. Here, you’re essentially assigning a button combination, so when you push a button on the controller, it “taps” the screen for you. Move the gamepad buttons to cover up the on-screen controls however you like (you can also resize the analog stick or d-pad with pinch and zoom). When you’re happy with the setup, tap “done.”
9.) Now open up the game again, and start playing the game with the controller (if it has trouble, just force-quit the game and start over).
That’s it! From now on you’ll be able to easily pair your controller with your iOS device and start playing games. Just don’t tell any of your friends on the leaderboards why you’re doing so well. It also works with any app you want (not just games), so you might be able to come up with some other creative uses.
Web Controller
- Download SixPair 2. Connect both your PS3 controller and your iOS device to your Mac 3. Click the Pair controller button 4. Disconnect your controller.
- Blutrol is a universal iOS app. This means it runs on your iPhone, on your iPod touch and on your iPad. IOS 4-7 is required iOS 7.1 support is unclear yet.
- /. 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.
– A PS3 Dualshock controller (note: you also need the SixPair tool for Mac or the SixaxisPairTool for Windows to pair the PS3 controller with your iOS device), Bluetooth Keyboard, Wiimote, Phonejoy, iCade, iControlPad, or iMpulse controller. Now we just need to get your controller paired up with your device and working with your. PS3 Controller: If the controller hasn't been paired with your device yet, using your PC, launch a pairing app while the controller is connected via a USB cable (Linux: use sixpair, Windows/Mac: use tools here) to associate it with the device's Bluetooth adapter. With the controller unplugged, select 'Scan for PS3 Controller', then push.
The default controller to drive the car with your phone or browser. This has a web live preview of camera. Control options include:
- A virtual joystick
- The tilt, when using a mobile device with supported accelerometer
- A physical joystick using the web adapter. Support varies per browser, OS, and joystick combination.
- Keyboard input via the 'ikjl' keys.
Note: Recently iOS has disabled default Safari access to motion control.
RC Controller
If you bought an RC car then it might have come with a standard 2.4GHz car radio and receiver as shown in picture below. This can be used to drive the car.
You can also use the RaspberryPi pins to output directly to the car's servo and motor controller, without the need for an I2C servo driver board. A full tutorial on doing this is here.
Joystick Controller
Many people find it easier to control the car using a game controller. There are several parts that provide this option.
The default web controller may be replaced with a one line change to use a physical joystick part for input. This uses the OS device /dev/input/js0 by default. In theory, any joystick device that the OS mounts like this can be used. In practice, the behavior will change depending on the model of joystick ( Sony, or knockoff ), or XBox controller and the Bluetooth driver used to support it. The default code has been written and tested with a Sony brand PS3 Sixaxis controller. Other controllers may work, but will require alternative Bluetooth installs, and tweaks to the software for correct axis and buttons.
These joysticks are known to work:
- Sony PS3 Sixaxis OEM (Not compatible with Jetson Nano)
- SteelSeries Nimbus (works only on TX2 jetpack 4.2+, may work on the Nano)
These can be enabled by finding the CONTROLLER_TYPE in your myconfig.py and setting it to the correct string identifier ( after disabling the comment ).
These can be used plugged in with a USB cable. It's been much more convenient to setup Bluetooth for a wireless control.
There are controller specific setup details below.
Note: If you have a controller that is not listed below, or you are having troubles getting your controller to work or you want to map your controller differently, see Creating a New or Custom Game Controller.
Change myconfig.py or run with --js
Will enable driving with the joystick. This disables the live preview of the camera and the web page features. If you modify myconfig.py to make USE_JOYSTICK_AS_DEFAULT = True
, then you do not need to run with the --js
.
PS3 Controller
Bluetooth Setup
Follow this guide. You can ignore steps past the 'Accessing the SixAxis from Python' section. I will include steps here in case the link becomes stale.
Reboot after changing the user group.
Plug in the PS3 with USB cable. Hit center PS logo button. Get and build the command line pairing tool. Run it:
Use bluetoothctl to pair
Unplug USB cable. Hit center PS logo button.
To test that the Bluetooth PS3 remote is working, verify that /dev/input/js0
exists:
Troubleshooting
In case the BT connection on the Raspberry Pi does not work, you see might something like this in bluetoothctl
:
Try updating the Linux kernel and firmware by running:
And then reboot:
Charging PS3 Sixaxis Joystick
For some reason, they don't like to charge in a powered USB port that doesn't have an active Bluetooth control and OS driver. This means a phone type USB charger will not work. Try a powered Linux or mac laptop USB port. You should see the lights blink after plugging in and hitting center PS logo.
After charging, you will need to plug-in the controller again to the Pi, hit the PS logo, then unplug to pair again.
New Battery for PS3 Sixaxis Joystick
Sometimes these controllers can be quite old. Here's a link to a new battery. Be careful when taking off the cover. Remove 5 screws. There's a tab on the top half between the hand grips. You'll want to split/open it from the front and try pulling the bottom forward as you do, or you'll break the tab off as I did.
PS3 Mouse problems on Linux
Sometimes when you plug-in the PS3 joystick it starts taking over your mouse. If you want to prevent that, you can run this:
PS4 Controller
The following instructions are based on RetroPie and ds4drv.
Install ds4drv
Running on your pi over ssh, you can directly install it:
Grant permission to ds4drv
Run ds4drv
If you see Failed to create input device: '/dev/uinput' cannot be opened for writing
, reboot and retry. Probably granting permission step doesn't take effect until rebooting.Some controllers don't work with --hidraw
. If that's the case try the command without it. --led 00ff00
changes the light bar color, it's optional.
Start controller in pairing mode
Press and hold Share button, then press and hold PS button until the light bar starts blinking. If it goes green after a few seconds, pairing is successful.
Run ds4drv
in background on startup once booted
paste:
Save and exit. Again, with or without --hidraw
, depending on the particular controller you are using.
To disconnect, kill the process ds4drv
and hold PS for 10 seconds to power off the controller.
XBox One Controller
bluetooth pairing
This code presumes the built-in linux driver for 'Xbox Wireless Controller'; this is pre-installed on Raspbian, so there is no need to install any other drivers. This will generally show up on /dev/input/js0. There is another userland driver called xboxdrv; this code has not been tested with that driver.
The XBox One controller requires that the bluetooth disable_ertm parameter be set to true; to do this:
- edit the file
/etc/modprobe.d/xbox_bt.conf
(that may create the file; it is commonly not there by default) - add the line:
options bluetooth disable_ertm=1
- reboot so that this takes affect.
- after reboot you can verify that
disable_ertm
is set to true entering this command in a terminal:
bash cat /sys/module/bluetooth/parameters/disable_ertm
- the result should print 'Y'. If not, make sure the above steps have been done correctly.
Sixpair Mac
Once that is done, you can pair your controller to your Raspberry Pi using the bluetooth tool. Enter the following command into a bash shell prompt:
Sixpair Tool Mac
That will start blue tooth pairing in interactive mode. The remaining commands will be entered in that interactive session. Enter the following commands:
That last command will start the Raspberry Pi scanning for new bluetooth devices. At this point, turn on your XBox One controller using the big round 'X' button on top, then start the pairing mode by pressing the 'sync' button on the front of the controller. Within a few minutes, you should see the controller show up in the output something like this;
Write down the MAC address, you will need it for the following steps. Enter this command to pair with your controller:
where YOUR_MAC_ADDRESS
is the MAC address you copied previously. If it does not connect on the first try, try again. It can take a few tries. If your controller connects, but then immediately disconnects, your disable_ertm setting might be wrong (see above).
Once your controller is connected, the big round 'X' button on the top of your controller should be solid white. Enter the following commands to finish:
Sixpair Download Mac
Now that your controller is trusted, it should automatically connect with your Raspberry Pi when they are both turned on. If your controller fails to connect, run the bluetoothctl steps again to reconnect.
Creating a New or Custom Game Controller
Sixpair For Mac
To discover or modify the button and axis mappings for your controller, you can use the Joystick Wizard. The Joystick Wizard will write a custom controller named 'my_joystick.py' to your mycar folder. To use the custom controller, set CONTROLLER_TYPE='custom'
in your myconfig.py.