Nintendo Wii Remote

Alternative Hardware:

Sony Playstation Move To buy it in Germany:

building the Sensor Bar

WiiPresent (for / Evince / Adobe Reader)

sudo aptitude install bluez bluez-compat

cd ~/Downloads
tar -xf libwiimote-0.4.tgz
cd libwiimote-0.4

change hci_remote_name to hci_read_remote_name in the following two files:

  1. src/wiimote_link.c

and compile:

sudo make install
sudo ln -s /usr/local/lib/ /usr/local/lib/
sudo ldconfig

cd ~/Downloads
svn checkout wiipresent

or get a specific version:

cd ~/Downloads
tar -xf wiipresent-0.7.2.tar.bz2
cd wiipresent-0.7.2
mv wiipresent-0.7.2 wiipresent

cd ~/Downloads/wiipresent
gedit Makefile

replace the path /usr/include/libcwiimote with /usr/local/include/libcwiimote-0.4.0/libcwiimote

sudo aptitude install libxtst-dev
sudo aptitude install asciidoc

asciidoc is optional to generate documentation for the application.

sudo make install


first step

hcitool scan.

Press buttons 1 and 2 of the remote (maybe you have to press the sync button found unter the battery cover) search for an entry of the following form:

00:22:4C:72:9D:F1   Nintendo RVL-CNT-01

now run wiipresent:

wiipresent -b <wiimote bluetooth address> -r &

Press buttons 1 and 2 of your wiimote. if the command above does not work you might try

wiipresent -l 45 -r -t -v

and press buttons 1 and 2 of your wiimote.

Now open an application like OpenOffice Presentation and control it using the wiimote.


The following keys are mapped in NORMAL mode, depending on the application that has the focus this may vary.

  • Left/Right buttons: change slide, change channel, change tab
  • Up/Down buttons: change volume, change links
  • -/+ buttons: change volume, zoom out/in
  • A button: toggle play/pause, change source
  • 1 button: toggle fullscreen
  • 2 button: change aspect ratio
  • home button: go back, home key
  • exit button: exit wiipresent (not implemented yet due to libwiimote bug)


The following keys are mapped in WINDOW mode, depending on the application that has the focus this may vary. The B button is pressed together with the buttons below.

  • Up/Down buttons: scroll up/down
  • Left/Right buttons: switch between applications (window manager)
  • -/+ buttons: change workspace
  • A button: toggle MOUSE mode
  • 2 button: blank screen, mute audio (censor info)


The following keys are mapped in MOUSE mode, depending on the application that has the focus this may vary. MOUSE mode is toggled by pressing the A button and B button at the same time.

  • Up/Down buttons: scroll up/down
  • Left/Right buttons: switch between applications
  • -/+ buttons: left/right mouse buttons
  • A button: left mouse button

CWiid (and wminput)

CWiid is a collection of Linux tools written in C for interfacing to the Nintendo Wiimote. CWiid consists of three components:

  1. libcwiid - API to integrate the Wii Remote into your application
  2. wmgui - a graphical representation of all the a data gathered by the Wii Remote
  3. wminput - event/mouse/joystick driver that allows you to emulate mouse joystick and keyboard events

On Ubuntu / Debian, the installation is very simple:

sudo aptitude install wmgui wminput

load module uinput

sudo modprobe uinput

or add uinput to /etc/modules for having it loaded at every system startup.

Start wmgui by typing 'wmgui'. Connect the Wii Remote via File → Connect, then set all mark under the 'Settings' menu.


run using

sudo wminput -w

include the ir sensor for moving the mouse:

sudo wminput -c ir_ptr -w

create a menu entry for wminput:

Save the following Application Link as /usr/share/applications/wminput_noIR.desktop and put wii.png to /usr/share/pixmaps :

[Desktop Entry]
Name=wminput acc
Comment=Use your Wii Remote to control the mouse
Exec=bash /usr/share/wminput/

you also need the startup script sudo gedit /usr/share/wminput/

sudo modprobe uinput 2> /dev/null ; sudo wminput -w

configure keys using

sudo gedit /etc/cwiid/wminput/buttons

Available keynames are defined in (republished on

GUI for wminput: gwminput

to press configure the keys in an advanced kind: sudo gnome-keybinding-properties

Program using CWiid

  • freej: Vision Mixer. Provides Java Script WiiController() Object to setup interactive video installations etc.
  • TransferMii: a simple mii transfer program with a GUI (latest : v0.6.1 (2008/03/05)).
  • Wii-lla: Allows control of DMX lighting using the Wii Remote.
  • Wiimote PD external: Allows for using WII mote inside puredata.
  • Wiimote Pan Tilt Control: Controls a pan tilt camera using the wiimote.
  • Qwiimote: This is a simple and non elegant frontend for Cwiid using python and qt.
  • wiiosc: a simple program to get Wii Data as OSC, and control LEDs and rumble via OSC
  • SuperCollider: Allows for using WII mote inside supercollider through the wiimote class.
  • 3D IR Detection: Uses two wiimotes to determine the 3d position of an IR source. It's fun too.
  • WairGlove: Allows you to control the mouse in the air with a glove and the Wiimote.
  • Wiimote Head Tracking: Allows you to track you head using the Wiimote to provide an immersive 3D experience (based on the idea by Johnny Chung Lee)
  • Wiimote Head Tracking in Avogadro: Avogadro is a molecular editor. There are some wiimote plugin tools in the wiimote branch and there is a head tracking extension in trunk.
  • Wiimotedev: Manage your pc remotely. GUI based on Qt4.

Wiigee - gesture recognition

How it works: scroll to system components on

Wiigee is a wiimote library written in Java that can learn and identify gestures. A demo application is available for download, and source is included in the jar file.

sudo aptitude install libbluetooth libbluetooth-dev

bluecove binaries

Download the the bluecove libraries (I used version 2.1.0)


bluecove sourcecode

The bluecove (not the gpl module) needs to have the L2CAP validation removed (apparently the wii mote uses non-standard ports)

sudo aptitude install maven2

cd ~/Downloads
tar -xf bluecove-2.1.0-sources.tar.gz

cd ~/Downloads/bluecove-2.1.0/
gedit ./src/main/java/com/intel/bluetooth/

mvn -Dmaven.test.skip=true -e

Install Java 3D and

cd ~/Downloads
cd j3d-1_5_2-linux-amd64
sudo cp lib/ext/* /usr/lib/jvm/java-6-sun/jre/lib/ext/
sudo cp lib/amd64/* /usr/lib/jvm/java-6-sun/jre/lib/amd64/

get the wiigee demogui:

cd ~/Downloads
mkdir wiigee-demogui
cd ~/Downloads/wiigee-demogui

the wiigee library:

cd ~/Downloads

Usage with the bluecove binaries

cd ~/Downloads
java -cp bluecove-2.1.0.jar:bluecove-gpl-2.1.0.jar:wiigee-demogui/wiigee-gui.jar wiigeegui.wiigeemain

usage with the bluecove self compiled bluecove-2.1.0.jar:

java -cp bluecove-2.1.0/target/bluecove-2.1.0.jar:bluecove-gpl-2.1.0.jar:wiigee-demogui/wiigee-gui.jar wiigeegui.wiigeemain

or add bluecove-2.1.0.jar and bluecove-gpl-2.1.0.jar to your classpath and run:

cd ~/Downloads/wiigee-demogui
java -jar wiigee-gui.jar

WiiGLE - win software for gestures

WiiGLE is an environment to record gestures, calculate features, train classifiers, and use the Wiimote for online gesture recognition based on accelerometer data. Up to date information on how to use WiiGLE can be found on the WiiGLE Wiki.


  • Tetriis (only 32 bit)

needs cwiid...

cd ~/Downloads
tar -xf tetriis10b1linux.tar.gz



sudo aptitude install libbluetooth3 libbluetooth-dev


cd ~/Downloads
mkdir wii_ks
cd wii_ks
tar -xf wiimote.tar.gz

and compilation and installation:

cd ~/Downloads/wii_ks
sudo insmod wii_ks.ko
sudo chmod a+rwx /dev/wiimote
./wii_us /dev/wiimote 00:22:4C:72:9D:F1 &

my own calibration:


As explained on

"The four bytes starting at 0x0016 and 0x0020 store the calibrated zero offsets for the accelerometer (high 8 bits of X,Y,Z in the first three bytes, low 2 bits packed in the fourth byte as --XXYYZZ). Apparently, the four bytes at 0x001A and 0x24 store the force of gravity on those axes."

So my 8 calibration bytes are: 0x82 0x81 0x7D 0x01 0x9C 0x9B 0x97 0x00 0x40 0xE4 In binary notation this is: 10000010 10000001 01111101 00000001 10011100 10011011 10010111 00000000 01000000 11100100 And in integer notation (base 10): 130 129 125 1 156 155 151 0 64 228

so my calibration values are: (with respect to 1byte values): zeroX = 130 zeroY = 129 zeroZ = 125.25

oneX = 156 oneY = 155 oneZ = 151

so I have to adjust the values in ./wii_ks/wii_us.c to:

    calx = 130.f;
    caly = 129.f;
    calz = 125.25f;

or to have an automatic calibration to the values of your wii: change in ./wii_ks/wii_us.c:

        if(buff[0] != 0xA1 && buff[1] != 0x33)


        if(buff[0] == 0xA1 && buff[1] == 0x21) {
            calx = (float)buff[7];
            caly = (float)buff[8];
            calz = (float)buff[9];
        } else if(buff[0] != 0xA1 && buff[1] != 0x33)


#define WII_BLK_LEN                        0x07


#define WII_BLK_LEN                        0x0A

and set default calibration data:

calx = 128.f;
caly = 128.f;
calz = 128.f;

to set the LEDs automatically on startup add the following lines to wii_us.c :

#define SET_LEDS     { 0x52, 0x11, 0xF0 } // LEDs all on (F) and rumble off (0) -> F0

inside wii_connect add:

    static unsigned char wii_led_data[] = SET_LEDS;


    err = write(sock_ctrl, wii_led_data, sizeof(wii_led_data));
    if(err < 0){
        return err;

wiimotecomm (PyBluez Script)

This has been found on The site, however, does not exist anymore.

A tiny script for testing communication with a Wiimote by sending custom data over a L2CAP connection.

sudo aptitude install python-bluez

Usage examples

./wiimotecomm discover "52 15 00"
[Searching for Wiimotes...]
[Found Wiimote at address 00:22:4C:72:9D:F1]
[Connected to Wiimote at address 00:22:4C:72:9D:F1]
Send:    (52) 15 00
Receive: (A1) 20 00 00 02 00 00 9C
  1. Search for a Wiimote that is in discoverable mode
  2. Connect to it and send byte sequence "0x52 0x15 0x00" (0x52: (HID)SET_REPORT, 0x15: "Controller status", 0x00: Payload) to the Wiimote
  3. (Disconnect and Terminate)

    ./wiimotecomm 00:22:4C:72:9D:F1 5211F1 wait:1000 521110 52120031 wait:30000 [Connected to Wiimote at address 00:22:4C:72:9D:F1] Send: (52) 11 F1 Receive: (A1) 20 00 00 02 00 00 9E Receive: (A1) 30 00 00 Send: (52) 11 10 Send: (52) 12 00 31 Receive: (A1) 31 00 00 85 81 98 Receive: (A1) 31 40 00 84 81 98 Receive: (A1) 31 60 00 83 81 99 Receive: (A1) 31 00 40 84 82 9A Receive: (A1) 31 60 60 84 82 9B Receive: (A1) 31 00 20 86 81 9A ... (More button and motion sensor data) Receive: (A1) 31 60 40 84 81 98 Receive: (A1) 31 00 60 84 81 9A Receive: (A1) 31 60 60 84 82 9B [Disconnected]

  4. Connect to Wiimote at bluetooth address 00:22:4C:72:9D:F1

  5. Send byte sequence "0x52 0x11 0xF1" (0x52: (HID)SET_REPORT, 0x11: Set LEDs/Rumble, 0xF1: All LEDs and rumble on)
  6. Wait for 1 second (1000 milliseconds)
  7. Send byte sequence "0x52 0x11 0x10" (0x52: (HID)SET_REPORT, 0x11: Set LEDs/Rumble, 0xF1: LED 1 on, rumble off)
  8. Send byte sequence "0x52 0x12 0x00 0x31" (0x52: (HID)SET_REPORT, 0x12: Set Report ID, 0x00: No rumble, no continuous output, 0x31: Choose report ID 0x31 = Buttons and Motion Sensing)
  9. Wait for 30 seconds (30000 milliseconds), dump any incoming data
  10. (Disconnect and Terminate)

here is the ./wiimotecomm:

Wiiewer (PyBluez Script)


Linux::Input::Wiimote - is a perl module that interfaces to the libcwiimote API. It can access most of the functions of the wiimote including: D-pad, wiimote buttons, nunchuck buttons, nunchuck joystick, axis and tilt data on both wiimote and nunchuck, and rumble.



sudo aptitude install libbluetooth-dev libxtst-dev
sudo aptitude install libsdl-dev freeglut3-dev
cd ~/Downloads
tar -xf XWii_2.8_source.tar.gz
cd XWii_2.8_source

The make command make compiles the source code of xwii into an executable program (this way, people on 64-bit architecture, etc. can use the same archive. a version of wiiuse (the library xwii is based on) is included. This requires the necessary BlueZ bluetooth libraries to be available on your system. runs a python script that lets you select one of the available profiles (a profile defines mappings of the wii remote buttons, joysticks, etc. to mouse/keyboard input) for xwii to use. This requires python to be installed on your system.

Problems when not connecting: add memset(&addr, 0, sizeof (addr)); at the line 174 of io_nix.c

start XWii:

xwii path/to/config/file.xwii

XWii config files are made up of BBCode style “tags” like this: [a]KEYBOARD Return[/a] for the A button.