Wiimote linux tutorial

From WiiLi

Jump to: navigation, search

Greetings from Poland!

This step-by-step tutorial is designed to be as user-friendly as I can make it at the current stage, upon making further changes the final version will be posted on some wikis on the internet in the coming weeks. The outcome will be the ability to use the Wii Remote as a mouse in Linux through WMD. Remember that the Wii Remote needs between 2 and 4 sources of Infrared radiation in order to find its position in front of the TV/monitor, I used 2 lit candles. The distributions I tried are the GNOME Ubuntu Feisty and KDE OpenSuSE 10.2 and 10.3 Alpha 4.

I will be saying „become root“, what this means is that the following steps require SuperUser privilages, use 'sudo' in front of the required steps in Ubuntu, or just press 'su' in OpenSuSE. In SuSE you will remain superuser until you close the Konsole session, you can create tabs in Konsole just like in Konqueror and Firefox, among others. Console refers to Terminal in Ubuntu and Konsole in OpenSuSE, you may use others.

Before we start: Please remember that Linux is a server OS that has been ported to work on the Desktop. Linux IS user friendly, it is just very particular with whom it makes friends with, do not fear the Penguin.

The steps we will take are as follows; 1) Fulfill dependencies 2) Check if Bluetooth works 3) Install WMD


1) Firstly the dependency hell:


Required dependencies for WMD: Bluez pyBluez Python X Library 0.13 Matplotlib PyOSD 0.2.14 OSD 1.0

Most of these can be downloaded through YaST or Synaptic Package Manager if you have the required repositories enabled. Make sure you have met all dependencies. If you have fast internet access, download all Python packages just to be sure. Here are further instructions for packages that may not be available:

PyBluez: download from http://org.csail.mit.edu/pybluez/download.html extract become root python setup.py install

Remember that in the konsole in KDE you can press the Tab key in order to complete the name of the file or folder in the directory, to enter setup.py for example might be done just by pressing 'set TAB'. Pressing Tab twice will give you a list of the files that begin with 'set'.

MatPlotLib and libWiiMote can be downloaded from here: http://matplotlib.sourceforge.net/ http://repose.cx/pyosd/ http://libwiimote.sourceforge.net/

MatPlotLib and PyOSD can be installed the same as PyBluez; python setup.py install


2) Finding if the Wii Remote is recognised:


Turn on Bluetooth, an icon should appear in the taskbar. If you have a Bluetooth-enabled phone, you can try experimenting if it works with your computer. I have a Samsung X820 and am able to transfer files to and from with little difficulity.

We need to find the adress of the Wii Remote so that we can connect it to the computer. In the console, type the following: hcitool scan Press Enter and press the red button in the battery compartament of the Wii Remote, batteries plugged in, naturally.

the Wii Remote should be recognised as Nintendo RVL-CNT-01 or similar. Please copy the Bluetoth adress and keep it in a seperate file for future reference.

Next do: hidd –search (that's 2 – 's in front of 'search') To enable discovery mode, press buttons 1 & 2 on the Wii Remote. This should give the output „ connecting to device XYZ“

And then: hcidump -X You should be connected, pressing a button on the Wii Remote should give a response on the console.

You should see flashing LED's on the Remote, take out battery and close the console to kill the Bluetooth connection.


3) Wiiwanna Motte Dammiit WMD version 0.1.2 can be downloaded from here: http://forthewiin.org/ . Bush can't find his WMD's, I hope you can.

Now the juicy part: Once extracted, navigate to /wmd-0.1.2/wmd. Use Gedit or Kwrite to edit Config.py.

Insert the adress of your Wii Remote into line 15

Next step that has caused me to delay this tutorial by a few days, I apologise sincerely, I had problems with finding the directory of uinput in openSuSE, which turned out to be the same as in Feisty. Once you are sure you have uinput installed on your computer (should be pre-compiled in Ubuntu and OpenSuSE):

in line 37, change 'UINPUT_DEV': "/dev/misc/uinput", to 'UINPUT_DEV': "/dev/input/uinput", save the file and exit


Exclamation The following step can be risky, if it fails, you will not log on your computer to a window manager. I then changed xorg.conf to acommodate the Wii Remote as an input device. I have not done it any other way, so please try to ommit this step and tell me if it worked without changing xorg.conf.

cd /etc/X11 (for the record, a shortcut I took was by pressing the Tab key, as in; cd /e TAB X TAB) become root cp xorg.conf xorg.conf.backupBeforeWii (making a copy of xorg.conf is always recommended, if X fails after your reboot, just reverse this step as root: cp xorg.conf.backupBeforeWii xorg.conf) Gedit or Kwrite xorg.conf

in Section "ServerLayout" , after the keyboard and mice, add: InputDevice "Wiimote" "AlwaysCore"

after the last Section "InputDevice" add: Section "InputDevice" Identifier "Wiimote" Driver "evdev" Option "Name" "Nintendo Wiimote" EndSection

save, exit and restart your machine. Exclamation


Open the console, cd to the folder /wmd-0.1.2, become root, type: modprobe uinput python WMD.py press buttons 1+2 on the Wii Remote with the batteries inserted.

Remember about the 2-4 sources of Infrared radiation I mentioned in the beginning. You can create an infrared LED bar by following guides in wiili.org forums.


If all went well, you should be a proud owner of a cool gadget to impress friends with. I justified this expense as a tool to navigate slides while doing presentations Smile


cWiid is an interface GUI for the Wii Remote. It also allows you to see the battery charge, accelometer, IR and nunchuk data. Ubuntu has a .deb package that can be accessed fom the top menu bar.

Otherwise, from: http://abstrakraft.org/cwiid/

become root and do: ./configure make make install

With all dependencies fulfilled, you can execute the program by typing wmgui.

Personal tools
Online Casino - best online casino reviews.
Facebook Developers - facebook applications, facebook developers, facebook development, social network application development and viral widget social media strategy