Search:  
Gentoo Wiki

HOWTO_Configure_a_Wiimote_as_an_Electronic_Whiteboard

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Introduction

Inspired by this video about using a Wiimote, an infrared pen, and a Bluetooth-enabled computer running Windows for a low-cost, multi-touch electronic whiteboard, this howto explains how to set up most standard Gentoo installations to do the same.

Getting Organized

Because two of these packages are not in portage (yet), I created a folder called Wiimote Whiteboard in my home folder to house the software.

$ mkdir Wiimote\ Whiteboard
Note: The '$' denotes commands issued as a normal user, and the '#' denotes commands issued as a superuser. Alternatively, any command prefaced by '#' can be issued using 'sudo' as a normal user, if the user has permission. Do NOT include '$' or '#' in the commands, as you will receive error messages.

Kernel Configuration

All you should need in your kernel is USB and Bluetooth support, namely:

Linux Kernel Configuration: Bluetooth support
 Device Drivers --->
  USB Support --->
   <*> Support for Host-side USB
 Networking --->
  <M> Bluetooth subsystem support --->
    <M> L2CAP protocol support

Dependencies and Source

You will need to emerge the latest libsdl, libXext, and bluez-libs packages.

# emerge -av libsdl libXext bluez-libs

You will also need to download, make, and install version 0.600 of CWiid from http://abstrakraft.org/cwiid/downloads/cwiid-0.6.00.tgz. Since the file unpacks its own directory, I unpacked it directly into Wiimote Whiteboard, changed to that directory, and followed the instructions.

$ cd Wiimote\ Whiteboard
$ wget http://abstrakraft.org/cwiid/downloads/cwiid-0.6.00.tgz
$ tar -xvf cwiid-0.6.00.tgz
$ cd cwiid-0.6.00
$ ./configure
$ make
# make install

Note that people with amd64 processor should do the following instructions instead :

$ cd cwiid-0.6.00
$ ./configure --libdir=/usr/lib64
$ make
# make install

Finally, with your method of choice, download the trunk folder from the SVN at http://linux-whiteboard.googlecode.com/svn directly to Wiimote Whiteboard. Of course, read all of the pertinent README files.

Installing the Linux Whiteboard

The SDL libraries and development files are needed.

It should compile without errors.

$ make

If all goes well, a new executable named demo will have appeared in that folder. You can copy this to /usr/bin as any name you would remember.

# cp demo /usr/bin/wiiwhiteboard

Setting up the Wiimote

In the latest version as of this writing, there is only one real installation requirement after compiling. Make sure your Bluetooth dongle is plugged in (or, if internal, that the Bluetooth is active) and press the 1 and 2 buttons on your Wiimote when starting the program. The screen should then go black with white crosses at the four corners and a central white square. Here is where we need the infrared pen discussed in the video.

Position the Wiimote as discussed in the video. When you activate the pen, a white dot will appear within the white square to represent where the Wiimote sees your pen in its IR-camera's view. For the highest resolution, position the Wiimote so that when you activate your pen at your screen corners, the white dots are as close to the white square's corners as possible. Next, focus your pen on the upper left cross, activate it, and press the spacebar. The blinking white square around that cross should move to the next cross. Continue this process through the fourth cross, after which the screen should return to normal. Your Wiimote should now be configured into an electronic whiteboard, ready for use with any mouse-compatible Linux program.

Note: This program is still in its rapid development phase and these instructions may go out of date soon.

Closing Thoughts

These instructions are adapted from this blog post to work on Gentoo.

For a more in-depth discussion on making Bluetooth work with Gentoo and compiling the kernel, see Mobile Phone/Bluetooth. If there are any changes to the software that renders this guide erroneous, please contact the developer(s) on the Linux Whiteboard project here first, and then update this page accordingly.


Troubleshooting

If you get an error message like this

$ ./demo
sizex = 1280
sizey = 800
mac = ANY
Put Wiimote in discoverable mode now (press 1+2)...
socket 3, bd_str 00:1E:35:0E:1A:3C
connect() failed: Software caused connection abort
0:Socket connect error (control channel)
Unable to connect to wiimote

make sure auth and encryp is disabled in /etc/bluetooth/hcid.conf!

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Configure_a_Wiimote_as_an_Electronic_Whiteboard"

Last modified: Wed, 27 Aug 2008 01:30:00 +0000 Hits: 5,802