First plug in the dongle, then we need to install some utilities to get bluetooth working.
apt-get install bluez-utils
Now we need to make sure that things are working properly at this point between the pi and dongle.
sudo service bluetooth status
Now we install the event client for kodi.
sudo apt-get install kodi-eventclients-wiiremote
Now Kodi needs to know what to do when the buttons are pressed on the wiimote, it parses xmls in the keymaps, so lets make a file to let it know what it needs to do. Replace vi with nano if you prefer it .
and place these contents into the file.
Now we need to get the unique address of the wiimote you want to be using for this implementation.
sudo hcitool scan
and press 1 and 2 on the wiimote while it is scanning and it will spit out an address of the device you put into discovery mode. We're going to launch the wiimote-eventclient and force it to bind to that address. We are going to modify the Start script from my previous post a bit to get the wiimote integrated to Kodi, if you don't have that script in place don't worry I'll just copy what the whole thing should look like into this block below. The one thing you will need to change is the address after --btaddr, again this needs to be the address that we've just found with hcitool.
And put the following in.
#Start Kodi in the background and grab its pid
#Start the Kodi Wiimote event client
/usr/bin/kodi-wiiremote --btaddr 00:1F:32:A2:6D:81 &
# enters a loop while Kodi is running to watch the log and kill it when the exit command is found.
while kill -0 $PID1 2> /dev/null
kill=`tail ~/.kodi/temp/kodi.log | grep "remove window"`
if [[ -z $kill ]] ; then
Now when you run the script above you should see it start kodi and you should see your adapter light up and you should also notice a notification in the bottom right that says that it has found a new connection for wiimotes. Now take the same wiimote you used earlier and press 1 and 2 at the same time, it should connect to your pi and you should see a notification on the screen that it has found the remote and give you a battery percentage read out and you should see solid lights on the wiimote. Congratulations you can now use your wiimote with Kodi. When you are done doing things you can press and hold the power button on the wiimote to turn it off and conserve battery, when you want to do stuff again just press the 1 and 2 button at the same time again and it will reconnect.
If you would like to customize your keymap for the wiimote please see the documentation at http://kodi.wiki/view/EventServer for button number reference and see the keymap.xml options at http://kodi.wiki/view/Keymap.xml.
Thats it for now, good luck!