About the author
Boaz I'm a software developer, working at a small company in the Netherlands. Currently I'm mostly using techniques like .NET, C#, SQL and jQuery, but I have experience with JAVA and PHP as well.

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

My Raspberry pi is used almost daily with Raspbmc, and I mostly control it with my android phone. I had some Wiimotes laying around and an old bluetooth device so i thought it would be nice to be able to use the those as an alternative.

First I started with a program called wminput, but I couldn't get it to work in XBMC, only in the console (what is pretty much useless). But then I read somewhere that I sould have used WiiUse_WiiRemote of which the source is in the XMBC repository. So I decided to try to build it and guess what? It works!

Here are the steps I executed to make the Wiimote work with Raspbmc:

First of all we need a USB bluetooth device and get it to work. Once you plugged in the device the output of the lsusb command should contain a bluetooth device.

Now we have to make the device work, run:
sudo apt-get update
sudo apt-get install bluez
If this gives you an error you can fix this by running:
sudo update-rc.d -f dbus defaults
Now we have to get the XBMC source to compile WiiRemote, run:
sudo apt-get install libbluetooth-dev g++ libcwiid1 xbmc-eventclients-common make git-core
mkdir /usr/local/src/xbmc
git clone git://github.com/xbmc/xbmc.git /usr/local/src/xbmc
cd /usr/local/src/xbmc/tools/EventClients/Clients/WiiRemote
Now we have to do a small modification to the Makefile:
modify MakeFile to add "-l bluetooth" on the line "$(OBJS) -o $(BIN)"
$(OBJS) -o $(BIN) -l bluetooth
Now we can build it by running:
sudo make
We are ready to test if our setup works, to do this we stop XBMC and restart it when the Wiimote is connected run:
sudo initctl stop xbmc
/etc/init.d/bluetooth restart
cd /usr/local/src/xbmc/tools/EventClients/Clients/WiiRemote
./WiiUse_WiiRemote
Now press button 1 and 2 on the Wiimote to connect and when only the first led is on run:
sudo initctl start xbmc
Congratulations, you should now be able to control Raspbmc with your Wiimote! The only thing left to do is make it start when you power on your Raspberry pi and optionally, only allow certain Wiimotes to operate Raspbmc.

Therefore we have to find the bluetooth address of the Wiimote, we can do this by running:
hcitool scan
We create a file that will be run at startup:
nano /home/pi/wiimote.sh
The contents will be:
#!/sbin/sh
/etc/init.d/bluetooth restart
sleep 2
cd /usr/local/src/xbmc/tools/EventClients/Clients/WiiRemote
./WiiUse_WiiRemote --btaddr XX:XX:XX:XX:XX:XX
Where XX:XX:XX:XX:XX:XX is your Wiimotes bluetooth address.

Give the file execute permissions:
chmod +x /home/pi/wiimote.sh
And edit rc.local to run it at start up:
sudo nano /etc/rc.local
Just before the last line that reads "exit 0" add:
sh /home/pi/wiimote.sh &
January 23, 2013 - Comments [16] - Posted in Raspberry pi | Raspbmc
Saturday, 29 June 2013 00:59:58 UTC
Why do you restart the bluetooth device after bootup? What would that accomplish?
Thanks for the guide by the way. Very helpful!
Jonas
Monday, 02 September 2013 11:02:48 UTC
Awesome, it worked like a charm!
"do a small modification to the Makefile", did you try to pull request? It could be nice for your tutorial!
At the beginning, it gave me an error also, why don't you say to execute this piece of code :
sudo update-rc.d -f dbus defaults
directly? (What is it for exactly, I didn't get this line.)
Thanks again for this awesomeness!
Monday, 09 September 2013 00:22:07 UTC
Tante grazie funziona benissimo ..
Thanks for the guide by the way. Very helpful!
mikys
Sunday, 03 November 2013 19:17:42 UTC
Thank you so much! After struggling to get many different versions of openelec, raspbmc, xbian, to work with the Wiimote this finally did the trick. Works perfectly.
sm1400
Thursday, 13 March 2014 08:15:41 UTC
Does anyone else find that raspbmc really slows down when wiiuse_wiiremote is running?
Jim
Friday, 16 May 2014 22:22:45 UTC
Thank you for this guide. I stumbled upon it a few weeks ago. I got it up and running using all the commands, i.e locking the MAC address and so on. I was using a bluetooth dongle that originally belonged to a Logitech Dinovo keyboard but I had to hold the button every time I connected it/started the Pi.
Today I got a new dongle and unfortunately I am having the same issues as with the Dinovo dongle.
At the startup I can connect the Wiimote just fine, but I would like to turn it off to not drain the battery. This works for a while but if the Wiimote is kept off for a longer period of time (say 30-60 minutes) I am not able to reconnect it without having to restart the Pi first. Then it works fine again.
Do you have any suggestions to what I can do?
FudgeUnPacker
Monday, 07 July 2014 06:17:13 UTC
Hi, you need a couple of lines sudo'd:
mkdir /usr/local/src/xbmc
git clone git://github.com/xbmc/xbmc.git /usr/local/src/xbmc
also, got a little stumbled here:
modify MakeFile to add "-l bluetooth" on the line "$(OBJS) -o $(BIN)"
$(OBJS) -o $(BIN) -l bluetooth
thought that was commands for a minute. might be helpful to show with a nano command?
Cheers though, works great! Got to buy another Wii remote now!
Andy
Wednesday, 06 August 2014 05:11:37 UTC
Your tutorial is great. And by making some mistakes and researching about the actual meaning of what all your steps are doing I have learned a bunch. But unfortunately one step doesn't work for me, and I couldn't get my head around it, it would be great if you could help me out here.
When I type in
$(OBJS) -o $(BIN) -l bluetooth
the BASH OBJS and BIN no such command error appears.
Would you let me know, what I can do about it?
Thanks in advance.
Cheers
OrdH
OrdH
Thursday, 07 August 2014 15:38:01 UTC
Alright alright,
I figured it out, that I have to open the "Makefile" with nano editor and add "-l bluetooth" to the last line. :)
After I was done, I had it connected whilst in command line window, when I reboot the RPI though, the Wiimote cannot connect, it is searching for a bluetooth receiver but unfortunately in vain. Anyone else having trouble?
OrdH
Friday, 20 February 2015 16:52:29 UTC
无法安装,缺少依赖关系,python-qt3也安装不上++++++++++++++++++++++++++++++++++++++++++++++++++++++++++有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件包尚未被创建或是它们已被从新到(Incoming)目录移出。下列信息可能会对解决问题有所帮助:下列软件包有未满足的依赖关系: xbmc : 依赖: xbmc-bin (>= 2:11.0~git20120321.14feb09-0ubuntu1~ppa1~oneiric) 但是它将不会被安装 依赖: xbmc-bin (< 2:11.0~git20120321.14feb09-0ubuntu1~ppa1~oneiric.1~) 但是它将不会被安装 推荐: phyton-qt3 但无法安装它E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
Tuesday, 03 March 2015 00:21:41 UTC
Thanks for that! It's just the answer I needed.
Tuesday, 24 March 2015 01:16:46 UTC
Can you please exlpian why the New Year starts on the 4th Day after Equinox? and why there are 30,30,31 etc would this not make the Calendar have more days than the 364?
Thursday, 16 April 2015 15:32:42 UTC
Anonymouse...regarding number 7, that&#39;s GM AND Chrysler. No, Obama doesn&#39;t get all the credit, but a Republican would have let those companies and their tens(hundreds?) of thousands of manufacturing jobs disappear. At a time when the economy was already teetering on the brink. He deserves a lot of credit for making the smart move.As far as 14, yes, student loans are still a problem, but getting the vampire squid banks out of the mix is a good start.
Tuesday, 09 June 2015 07:56:50 UTC
Pretty great post. I just stumbled upon your blog and wanted eeedckeccbbf
Johnb7
Tuesday, 01 November 2016 00:29:42 UTC
kybclgmtfkrvdicvzjvxbpotp
Tuesday, 01 November 2016 00:29:56 UTC
fsriocyqgbhtpfctpw
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Live Comment Preview