This was tested with a fresh install using a Pi2
Start by SSH or Terminal into your Raspberry Pi.
- Install xboxdrv
sudo apt-get install xboxdrv
- Find the correct device-name for your specific controller.
sudo xboxdrv
You should get a output similar to this
Quote:pi@raspbmc:~$ sudo xboxdrv
xboxdrv 0.8.4 - http://pingus.seul.org/~grumbel/xboxdrv/
Copyright  2008-2011 Ingo Ruhnke <grumbel@gmx.de>
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain
conditions; see the file COPYING for details.
Controller: Microsoft Xbox 360 Wireless Controller
Vendor/Product: 045e:0291
USB Path: 001:004
Wireless Port: 0
Controller Type: Xbox360 (wireless)
As you can see my device is called…
“Microsoft Xbox 360 Wireless Controller”
We need to remember this, but for now simply Ctrl-X out so you can type in the terminal again.
IF you get a error similar to…
> -- [ ERROR ] ------------------------------------------------------
> Error couldn't claim the USB interface: LIBUSB_ERROR_BUSY
> Try to run 'rmmod xpad' and then xboxdrv again or start xboxdrv with the option --detach-kernel-driver.
Just run
sudo rmmod xpad
sudo xboxdrv
Now we need to tell xboxdrv what the different buttons should do inside of XBMC.
We do this by creating a file called xbmc.ini.
`sudo nano /home/osmc/xbmc.ini`
Then simply copy and paste the code bellow and save your way out of there (Ctrl-x)
Note very important here to edit the line device-name = “” to match your controller name.
(Remember to put the name between the quotation marks!)
Code:
# XBMC Configuration
# ==================
#X1: 0 Y1: 0 X2: 0 Y2: 0 du:0 dd:0 dl:0 dr:0 start:0 back:0 TL:0 TR:0 A: 0 B: 0 X: 0 Y: 0 black: 0 white: 0 LT: 0 RT: 0
[xboxdrv]
#ui-clear = true
extra-devices = false
extra-events = false
deadzone = 6000
device-name = "Microsoft Xbox 360 Wireless Controller"
[ui-buttonmap]
# Face buttons
A = KEY_ENTER
B = KEY_BACKSPACE
X = KEY_X
Y = KEY_ESC
# D-Pad
du = KEY_UP
dd = KEY_DOWN
dl = KEY_LEFT
dr = KEY_RIGHT
# Start / Back buttons
start = KEY_SPACE
back = KEY_L
# Bumper Left / Right
white = KEY_C
black = KEY_I
# Stick buttons
TL = BTN_RIGHT # Left stick buttons
TR = BTN_LEFT # Right stick buttons
# Triggers Right / Left
RT = KEY_EQUAL # Right trigger
LT = KEY_MINUS # Left trigger
[ui-axismap]
#x2=REL_RX:10
#y2=REL_RY:-10
x1=REL_X:10
y1=REL_Y:10
# The resp filter moves the neutral position to zero to work around a
# bug in XBMC, that causes bogus events when neutral position is
# elsewhere. It loses a bit of precision in the trigger as result, but
# that isn't noticeable.
LT^resp:127:255=ABS_Z
RT^resp:127:255=ABS_RZ
# EOF #
Next we need to make an .sh script that starts xboxdrv.
sudo nano /home/osmc/start.sh
Then insert…
#!/bin/bash
rmmod xpad
modprobe uinput
modprobe joydev
/usr/bin/xboxdrv --config /home/osmc/xbmc.ini --silent --autofire RT=25 --autofire LT=25 --autofire du=200 --autofire dd=200 --autofire dl=500 --autofire dr=500 &
Save your way out of nano again (Ctrl-O + Ctrl-X
Almost done!
Just need to change some permissions and tell Linux to run the .sh script at boot start-up.
Run
sudo chmod 777 /home/osmc/start.sh
sudo chmod 777 /home/osmc/xbmc.ini
Open rc.local
sudo nano /etc/rc.local
Set start.sh to start at boot.
Add this before the exit 0
/home/osmc/start.sh
Now run
sudo reboot
.
Thats it, have fun!
Controller Layout in XBMC
[Image: 289lzy8.png]
Face buttons
A = Select
B = Back
X = Stop
Y = Home screen
Start / Back buttons
start = Pause/Play
back = Next subtitle
Bumper
Right = Info
Left = Contextual menu
Triggers
Right = Volume up
Left = Volume down
Note if you run into issues do something for me and I will try to help, start ssh
run sudo xboxdrv
paste output
then run
sudo ./start.sh
paste output
I hope this helps, mostly all credit goes to Alza! Thanks man you’re epic!