-
Notifications
You must be signed in to change notification settings - Fork 3
Ready made input devices
This article gives examples of how to use common console Game Controller hardware device like a Wiimote or PS3 controller on PC hardware or Embedded devices
Recent versions of Linux should work just fine with the controller directly attached over USB, but it depends on the software recognising the input controls.
NB:
- earlier Linux versions needed the xboxdrv driver package installing
- some people recommend using the QTSixA utils if the game does not recognise controls
- see SixAxis below
This is using a Sony DualShock 3 Controller for the PlayStation (model number CECHZC2E which was sold as an authentic device).
NB: Two important steps with pairing your controller over Bluetooth
- Remove all power to your PS3 console
- or do this far enough away
- so it can't interfere with the pairing and connection process
- Connect the PS3 controller in using a USB cable
- it needs to be directly connected to recognise and authenticate the specific controller
See the ELinux list of USB Bluetooth Adapters for guidance on compatible hardware.
If you want to be sure what hardware your adapter is, run lsusb before and after inserting the dongle, to check which line appears.
Some distros, like the Ubuntu family, already have the Bluetooth stack installed.
# Do I have the Bluetooth stack installed?
bluetoothctl -v
If you get a version number, not an error, then skip the install below
Example to diagnose more about your system
# This page uses Raspbian Wheezy on a Raspberry Pi 2
sudo apt-get install -y lsb-release
lsb_release -d
# Description: Debian GNU/Linux 7.8 (wheezy)
cat /proc/cpuinfo|grep Revision
# Revision : a21041 indicates Raspberry Pi 2
# help - http://elinux.org/RPi_HardwareHistory
# Install the drivers you need to use bluetooth (including the GUI tools)
sudo apt-get update
sudo apt-get install -y bluetooth bluez-utils blueman
# credit - https://www.thinkpenguin.com/gnu-linux/bluetooth-usb-adapter-setup-raspbian-raspberry-pi
# check it's working
hciconfig -a | grep UP
# UP RUNNING PSCAN
# check the bluetooth group is present
cat /etc/group |grep blu
# and permit the pi user to change settings
sudo usermod -aG bluetooth pi
groups pi
This is rather a heavyweight solution, with loads of libraries being installed.
# credit [https://www.piborg.org/rpi-ps3-help]
sudo apt-get -y install libusb-dev joystick python3-pygame
cd ~
wget http://www.pabr.org/sixlinux/sixpair.c
gcc -o sixpair sixpair.c -lusb
Once installed, the article [https://www.piborg.org/rpi-ps3-help] guides you through:
- Connecting the Controller over USB to the Pi
- using
sixpair
to make our Pi bluetooth the master of this controller - using
bluetoothctl
to:- set the Bluetooth discoverable
- identify the MAC address of the controller
- try to connect
- trust (pair with) the controller
- test the inputs to see which controls you're pressing
Ubuntu instructions:
# credit https://askubuntu.com/a/823220
sudo apt-get update&&sudo apt-get install git dialog build-essential pyqt4-dev-tools libusb-dev libjack-dev libbluetooth-dev python-dbus -y&&git clone https://github.com/falkTX/qtsixa.git&&cd qtsixa&&make&&sudo make install
Raspberry Pi instructions:
At the time of writing QtSixA was still not available in the list of Packages in the Raspbian archive (and using Debian / Ubuntu PPAs is hit and miss) so it's gonna have to be a compile from source...
- concise independent blog article on DualShock 3 and Pi using sixpair and QtSixA (Sixaxis Joystick Manager)
- and another almost the same but mentions a PPA that no longer works
- Pi Forums article refers to sixpair and QtSixA but identifies possible issues (and solves some)
- RetroPie distro wiki on PS3 controllers explains how RetroPie 3.0+ has everything you need build in (and then repeats the same instructions for older versions)
- blog article on multiple controllers for RetroPie gives detailed config details to tell QtSixA's sixad utilities how to distinguish between controllers
see also:
- [https://github.com/artmg/MuGammaPi/wiki/CamJam-Robotics-Kit]
- example of using pygame to control a Raspberry Pi robot with PS3 over bluetooth
-
instructions on PS3 Bluetooth
- to Install and Pair a PS3 controller in RetroPie
For using console remote hardware see also:
- https://www.reddit.com/r/xbmc/comments/3z7n7z/can_i_control_kodi_with_a_wiimote/
- http://forum.kodi.tv/showthread.php?tid=60621
- http://kodi.wiki/view/Keymap
Force-feedback steering wheel with pedals and optional gear stick/shift
e.g. G25 or G29
FYI G2x is for Playstations and PC, Gxx0 for Xbox and PC
For game compatibility see https://www.logitechg.com/en-gb/products/driving/driving-force-racing-wheel.html
VID / PID = 046D / C294
- Power on wheel and plug in USB
- in Device Manager you should see a 'HID-compliant game controller' appear
- See the Wheel Tester app in the Microsoft Store
- If that does not recognise your device consider Docklight below
This is a limited Evaluation software that allows you to monitor HID input
- Download Docklight Scripting
- Expand All and Setup/Install
- Run Docklight Scripting
- Tools / Project Settings
- On the field Send / Recieve on Comm Channel enter:
- USBHID:vvvv:pppp
- where vvvv is the VID and pppp is the PID from Device Manager
- Now click Scripting / Run (the Play button)
- You should see inputs as you manipulate the device
- for more see https://docklight.de/dl_faq047/