Nick Carroll, PhD

Metabolising caffeine into code

Archive for the ‘CWiiD’ tag

Wiimote on Ubuntu Gutsy Gibbon

with 2 comments

I wrote earlier about using Mingle on a Nintendo Wii as an Agile project management tool. I figured it would be cumbersome to lug around a data projector, laptop, Airport Express, and Nintendo Wii to every meeting in which you want to use Mingle, such as a Showcase or technical stand-up. Not to mention the setup time in establishing a connection between the Wii and your Wi-Fi access point. So wouldn’t it be nice to remove the Nintendo Wii and the Airport Express from the equation and just use the Wiimote with your laptop? Well you can do just that, and it is really easy to setup on Ubuntu!

You find where download mp3 music on player, You need mp3 music download from online mp3 archive

You can follow these instructions or just run the following in a terminal.

  • Install Wiimote drivers using apt-get. Could it be any easier?
    $ sudo apt-get install libcwiid0 lswm wmgui wminput
  • Test Wiimote connection with your Bluetooth dongle. You should just plug in your USB Bluetooth dongle and Bluez will enable Bluetooth for you, assuming it has a driver that can support your dongle. I just have a run-of-the-mill ASUS Bluetooth dongle.
    $ wmgui
    Select Connect from the menu and hold buttons 1 and 2 on your Wiimote to make it discoverable. You may need to do this a couple of times before wmgui picks up your Wiimote before timing out. Once connected, wmgui allows you to test the inputs of your Wiimote. You can enable rumble and accelerometer inputs from the menus.
  • Run the mouse emulator.

    $ sudo modprobe uinput
    $ sudo wminput

    Then put your Wiimote into discoverable mode by holding buttons 1 and 2 together again.
  • The man pages for wminput does not recommend running wminput as root. So run the following command so that you can gain access to /dev/input/uinput without having to use sudo.
    $ sudo sh -c 'echo "KERNEL==\"uinput\", GROUP=\"admin\"" > /etc/udev/rules.d/50-cwiid-input.rules' /etc/init.d/udev restart

You should now be able to move the cursor around using your Wiimote, and using the A and B buttons as left and right clicks respectively. However, using the accelerometer alone for moving the cursor around does not make for a great user experience. The wminput driver is configured by default for the accelerometer, and if you want to move windows around with your Wiimote, then you’ll need to use the IR configurations instead. Simply replace the default soft link to the accelerometer config file with the ir_ptr config file.

  • $ cd /etc/cwiid/wminput
  • $ sudo rm default
  • $ sudo ln -s ir_ptr default

The Wiimote now needs a point of reference to use when sending coordinates back to the CWiiD driver. This is what the Sensor Bar is for. The Sensor Bar is simply an array of infra red LEDs that creates a plane for the Wiimote as a point of reference. The plane is used for rotation instructions such as the rotating hand effect on the Wii. You can’t use the Wii Sensor Bar with your laptop as it doesn’t have USB or a compatible connector with the laptop. I ended up building my own USB Sensor Bar, and will write about my experience in a later post. It was relatively simple and works quite well. However, it does require doing a bit of soldering, so if you aren’t comfortable with DIY electronics then I would recommend getting a Nyco battery powered Sensor Bar from eBay.

Testing USB Sensor Bar

Now you should be able to fire up Mingle and start moving those story cards around on your laptop with just your Wiimote!

If you are using a Mac then you might want to try Darwin Remote [Free] or Remote Buddy [Not Free]. Windows users can use GlovePie or WiinRemote.

Written by Nick

March 6th, 2008 at 8:23 am

Posted in Programming

Tagged with , , ,