====== How to add support for a Wii remote (aka wiimote) to your eeePC ====== ===== Introduction ===== This page describes how to use a wiimote with an eeePC using the standard Xandros operating system. (for the techies: this installs the CWiid driver + associated utilities). It assumes that you have some knowledge with the unix command line.\\ Note that all changes you make to your system based upon this page are at your own risk. You are strongly encouraged to read the complete page before making any changes to your system. Also if you do not feel comfortable making these changes, then please seek help with a more skilled unix/linux user. ===== Required hardware and software ===== * A wii remote (wiimote) * A USB bluetooth dongle (can be found cheaply on eBay etc for under £3) * wii.tgz (this one can be downloaded from [[http://www.effem.110mb.com/|eFfeM's eeePC download page]]). On this page it is assumed this file is at /home/user/wii.tgz ===== Installing the software ===== Installing the software can be done with the text below. Text that you have to type literally in a command window is in **bold** * Boot your eeePC * If you haven't done so: add the debian feeds to your sources.list. See [[howto:adddebianfeeds]] on how to do this. * Get a terminal window. With standard Xandros this can be done by typing CTRL+ALT+T. All further commands are to be entered in this terminal window. * **sudo bash**\\ This will mean that all of the following commands are executed as superuser. * **tar xvfz /home/user/wii.tgz** This will install the following files: /lib/modules/2.6.21.4-eeepc/kernel/drivers/input/misc/uinput.ko /usr/lib/python2.4/site-packages/cwiid.so /usr/lib/libcwiid.so /usr/lib/libcwiid.so.1 /usr/lib/libcwiid.so.1.0 /usr/lib/libcwiid.a /usr/lib/cwiid/plugins/nunchuk_acc.so /usr/lib/cwiid/plugins/acc.so /usr/lib/cwiid/plugins/ir_ptr.so /usr/local/share/doc/cwiid/wminput.list /usr/local/share/doc/cwiid/Xmodmap /usr/local/share/man/man1/wminput.1 /usr/local/share/man/man1/wmgui.1 /usr/local/bin/lswm /usr/local/bin/wminput /usr/local/bin/wmgui /usr/local/include/cwiid.h /usr/local/etc/cwiid/wminput/default /usr/local/etc/cwiid/wminput/nunchuk_acc_ptr /usr/local/etc/cwiid/wminput/neverball /usr/local/etc/cwiid/wminput/ir_ptr /usr/local/etc/cwiid/wminput/gamepad /usr/local/etc/cwiid/wminput/buttons /usr/local/etc/cwiid/wminput/acc_ptr Note that the tar file uses absolute paths. * **apt-get install libbluetooth2 bluez-utils mouseemu** * optionally if you want to run wmgui:\\ * **apt-get install libatk1.0-0 libbluetooth2 libcairo2 libfontconfig1 libglib2.0-0 libgtk2.0-0 libpango1.0-0 libx11-6 libxcursor1 libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1**\\ (Note: it is possible that this list contains superfluous pagckages). * **depmod -a**\\ This makes the module uinput.ko known * **modprobe uinput**\\ This will load the uinput module. This is needed for wminput. Optionally, you can edit the file /etc/modules using the command **sudo nano /etc/modules**. If you add a line with the single word //uinput//, you do not need to use **modprobe uinput** after a reboot. ===== Testing your work, getting things working ===== To test whether things are working, perform the following steps (still logged in as superuser: * insert your bluetooth dongle. * **hciconfig hci0 up** This starts up the bluetooth stack. It is probably possible to automate this step. * **lswm** This command will reply //Put Wiimotes in discoverable mode now (press 1+2)...// after you have done that the program will respond with the address of the wii remote and exit. E.g. //00:1C:BE:F0:BF:0C// * **wminput** This will prompt you to put your wiimote in discoverable mode. It will automatically connect to the first wiimote found. If the connection fails, try the following: * **wminput XX:XX:XX:XX:XX:XX** (where XX:XX:XX:XX:XX:XX is the address of your wiimote, found using **lswm**). You will be prompted to put your wiimote in discoverable mode again. This mode allows you to use the wiimote without a sensor bar attached and will just use the accelerometer. To move the pointer left and right, tilt the wiimote from side to side. Up and down movements will move the pointer vertically. If you have a sensor bar or other infrared source (such as an infrared led, a candle or even a remote control with one of the buttons taped down), then you can use the following command to use the wiimote's infrared camera: * **wminput -c ir_ptr** This means that the wiimote will work as it usually does on the Wii, eg. moving the wiimote horizontally and vertically. Generally tracking is not very good, unless you keep the wiimote pointing to your sensor bar (hint: on eBay you can get fairly cheap so-called //wireless sensor bar//s. In fact, the sensor bar is nothing more than a few infra-red leds. There is no active communication between the sensor bar and the Wii.\\ Note that if wminput gives you the error message //unable to open uinput// then you haven't loaded the uinput module (the step //modprobe uinput// above). wmgui will give you some graphical feedback on what is detected when you use your wii remote. wminput also comes with some extra config files that can be used with your wiimote. They are located as follows: * /usr/local/etc/cwiid/wminput/default * /usr/local/etc/cwiid/wminput/nunchuk_acc_ptr * /usr/local/etc/cwiid/wminput/neverball * /usr/local/etc/cwiid/wminput/ir_ptr * /usr/local/etc/cwiid/wminput/gamepad * /usr/local/etc/cwiid/wminput/buttons * /usr/local/etc/cwiid/wminput/acc_ptr You can open and edit these with nano in the terminal using **sudo nano /usr/local/etc/cwiid/wminput/default** etc. To use them in wminput, use the following command: * **wminput -c default** (where default is the name of the config file you wish to use). You can also create your own config files - information on this is available [[http://www.wiili.org/index.php/Wminput|here]]. That's it. Now enjoy using your wiimote with your eeePC (and if you find a very good application be sure to report it on forum.eeeuser.com). ===== Links ===== [[http://forum.eeeuser.com/viewtopic.php?id=6642|eeeuser discussion thread]]\\ [[http://www.wiili.org/index.php/CWiid|wiili.org page on CWIid]] ===== Copyright ===== This page was originally authored by eFfeM on wiki.eeeuser.com, eFfeM holds the copyright to this.\\ You are free to use or improve this page provided that: * you leave this copyright message and all attributions intact * you clearly identify the parts that you modified or that you used from this (a wiki history trail and adding your name to Authors suffices) * if you copy the page: you provide a note that you copied it and a link to the place you copied it from. ===== Authors ===== This page is created by eFfeM\\ Modifications by: * ichbinbored [[http://www.portabilite.info|rio b and you]] [[http://www.obtenir-rio.info|sfr]]