XBMC with WiiMote

A real media centre need a remote control, right? Since I have 2 WiiMotes, I’ll not mind sharing one with the media centre ;-)

First, we need to install few packages:

> sudo aptitude install libcwiid1 lswm wmgui wminput

Load the driver:

> sudo modprobe uinput

And try to get connected:

> sudo wminput

If everything went smoothly you should now be able to tilt the WiiMote to control your mouse pointer and use the A and B buttons as replacement for left and right mouse click, respectively.

We need to change the default button definition to be able to use it properly with XBMC. For this we will change the content of the /etc/cwiid/wminput/buttons to read:

Wiimote.B = KEY_ESC
Wiimote.Up = KEY_UP
Wiimote.Down = KEY_DOWN
Wiimote.Left = KEY_LEFT
Wiimote.Right = KEY_RIGHT
Wiimote.Minus = KEY_KPMINUS
Wiimote.Plus = KEY_KPPLUS
Wiimote.Home = KEY_M
Wiimote.1 = KEY_SPACE
Wiimote.2 = KEY_S

This makes my Wiimote work like this in XBMC:

  • A for OK/forward, B for cancel/back
  • Use the D-pad for navigating and it functions as forwarding/rewinding/skip when playing stuff
  • + / will increase or decrease the volume, respectively
  • Home will bring forth the menu where you can pause, set subtitles, change audio, etc when viewing videos
  • 1 for pausing
  • 2 pops out the “exit menu” where you can shutdown XBMC, and restart/suspend etc. the machine

To make it work at startup, we need to allow the user to be able to access the uinput, as the wminput shouldn’t be run as root:

> sudo sh -c ‘echo “KERNEL==”uinput”, GROUP=”admin”” > /etc/udev/rules.d/50-cwiid-input.rules’
> sudo /etc/init.d/udev restart

Edit /etc/rc.local file by adding the following lines just before the last line (with exit 0):

sudo modprobe uinput
sleep 2
sudo wminput -dc buttons &

Save and is all set… All you need to do is once the system restart and you have the XBMC interface on the screen, press 1 and 2 on the remote control to pair your remote with your Media Centre, then everything will work, including the mouse emulation (a bit complicate to control when you use it first time). Have fun! :-)


7 thoughts on “XBMC with WiiMote

    • Hi Sparky, yes you are right :) Unfortunately, I am keeping the Ubuntu 9.04 due so many issues on setting the bluetooth and graphic card… For what i need it does the job very well.
      With a proper graphic card I can run 1080p at ~30 fps with 30% CPU… FYI, I am using a Sempron 2100+ as CPU ;-)
      Same box is running this webserver, my XBMC and other many applications…

  1. This WAS gerat, but my old 9.04 started to fail so I reinstalled with a later version from xbmcfreak (10.00 dharma Beta3). Now when I try to get and install the packages, I get that they can’t be found. So… Maybe because I’m on beta, or have they gone..? Do you know?

  2. Great guide thank you :) I was looking for an alt to xbmc event client as the controls never leave xbmc. This is perfect for emulators and running other apps via the adv launcher addon.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s