Wii Remote with XBMC on RaspBMC

From KlavoWiki
Jump to navigationJump to search

I followed the instructions on this page. I have duplicated here for convenience and if the page should no longer be available.

Install Bluetooth Driver

sudo apt-get update  
sudo apt-get install bluez

If Install Errors

If the install fails installation run the following command and then try the above again.

sudo update-rc.d -f dbus defaults

WiiRemote Source

sudo apt-get install libbluetooth-dev g++ libcwiid1 xbmc-eventclients-common make git-core
sudo mkdir /usr/local/src/xbmc
sudo git clone git://github.com/xbmc/xbmc.git /usr/local/src/xbmc
cd /usr/local/src/xbmc/tools/EventClients/Clients/WiiRemote

Modify MakeFile

vi MakeFile

locate the text

 $(OBJS) -o $(BIN)

and suffix -l bluetooth

$(OBJS) -o $(BIN) -l bluetooth

Build WiiRemote

sudo make

Stop XBMC

sudo initctl stop xbmc  

Restart Bluetooth Service

/etc/init.d/bluetooth restart  

Start WiiRemote

cd /usr/local/src/xbmc/tools/EventClients/Clients/WiiRemote
./WiiUse_WiiRemote
  • Power on the Wii Remote
  • Press button 1 and 2 to start pairing
  • When the service runs pay attention to the MAC address of the Wii Remote which will be displayed.
  • Once you have the MAC address break the application by pressing <Control C>

Shell Script

vi /home/pi/wiimote.sh

Copy the following contents into this new file

#!/sbin/sh
cd /usr/local/src/xbmc/tools/EventClients/Clients/WiiRemote
./WiiUse_WiiRemote --btaddr XX:XX:XX:XX:XX:XX

Replace XX:XX:XX:XX:XX:XX with the MAC address of your Wii Remote.

Make Script Execuatable

chmod +x /home/pi/wiimote.sh  

Execute on Boot

sudo vi /etc/rc.local  

before the last line

exit 0

add the line

sh /home/pi/wiimote.sh &

Start XBMC

sudo initctl start xbmc


Notes

I have found that although this works I need to pair the remote to the system on every boot by powering on the remote and pressing the 1 and 2 buttons. The remote will vibrate indicating a pair and will then function as expected until the system is rebooted.