Talking to a Wiimote in Ubuntu 8.10

To add Wiimote support on Ubuntu 8.10, start by running the command “sudo apt-get install wminput wmgui lswm” to install the CWiid library and associated software.

If you’re using a desktop machine, you probably don’t have Bluetooth capability. If you run the program “lswm” and see the message “No Bluetooth interface found” then you need to get a Bluetooth adapter, which is a dongle that uses a USB port to add Bluetooth abilities. I bought the IOGear GBU421 because it seems to be well-supported in Linux and only costs about $20. It’s also so tiny that it’s cute. It looks like this:

IO Gear GBU 421

I told you it was cute. πŸ™‚ Now put your Wiimote in discoverable mode by pressing the 1+2 buttons at the same time and then within 15-20 seconds, run “lswm” again and you’ll get a Bluetooth identifier back:

Put Wiimotes in discoverable mode now (press 1+2)…

Congrats, your Linux machine can see the Wiimote! Now run the “wmgui” program to get a very nice user interface that will show you the sensor readings on your Wiimote:

wmgui with a Wiimote

That’s really all there is to it. Once your Ubuntu machine can see the Wiimote, you can do all sorts of tricks with it. You could do head tracking, camera tracking, control MythTV with it, etc. Linux/Ubuntu 8.10 handles the IOGear GBU421 plus a Wiimote really well.

Update: I made a video of using a Wii mote with Ubuntu if you’d like to watch:

30 Responses to Talking to a Wiimote in Ubuntu 8.10 (Leave a comment)

  1. Dave (originial)

    You know your’e a Geek when you find inanimate objects for Computers “Cute”. πŸ™‚

  2. Hey Matt. Thanks for putting this post together, I plan on linking my Wiimote up sometime this weekend. You mention a number of uses for the Wiimote at the end of your article…have you found any good walkthroughs (other than MythTV) for taking advantage of the new capabilities?

    I would love to simply program a few keyboard buttons (media specific, i.e. play/pause, rewind/advance, volume etc) to the Wiimote so I can control my media from across the room.

    Kyle Wegner
    Linux hacking noob

  3. Kyle Wegner, the direction that I’ve been moving in is the Wii Balance Board, so I’m not sure I can help that much with just the Wiimote.

  4. Here’s the tutorial on the Ubuntu Forums on setting up the Wiimote (and using it as a mouse, remote, etc):

    In general, the buttons can be configured by editing config file for wminput. Found some suggestions here:

    Again, YMMV. Hope it helps.

  5. Tuxracer on the Balance Board would be great πŸ˜€

  6. Kyle:

    Once you’ve hooked up a Wiimote following matt’s instructions, your Wiimote will act like a mouse from nearly any distance to the TV/Monitor/Computer in use. So for example to control MythTV or ANY media player, you would just point and click. (I think by default one of the buttons is right click, etc etc)

  7. That’s really incredible, I’m going to have to setup a partition for ubuntu just to try this.

  8. Wii Balance board? Like the ultimate human iPod shuffle!

    You’ve got me thinking now, whether I can use a Wiimote with some sort of synth program. Might see if I can do it myself, make some sort of oscillator like a theramin…

  9. Hi,
    I am chancing my arm a bit here a bit, but I have a question that needs urgent answering so hopefully if you are an employee at Google you might know of someone you can forward this to:

    As a developer for Fife Council, Scotland I would like to use Google Analytics as part of an analytical mix but my IT department have told me that as part of security if a site needs to be bypassed the proxy it has to be checked first. No problem with that, but it was indicated that Google couldn’t be bypassed because the employer wouldn’t know if any employee rights were being abused by making iregular searches.

    So the question is: Can Google Analytics and Google Search be differentiated by url or IP etc, so that the Analytics could be used?

  10. Ha. My wife agrees it’s cute too! ha.

  11. So it seems to me you could put a wii controller in a model airplane running ubuntu an use the x, y, z pitch roll and accelerometer to basically have a less than $100 autopilot.

    Seem possible to anyone else?

  12. Matt, thanks a lot for this! It’s exactly what I’ve been looking for. However, does this include the IR functionality so it can point at the screen? I’m building a HTPC for my dad and I need it to be as close to the TV experience as possible.

  13. @Miles

    I’d be very interested to know if you end up with anything cool. Drop me a line: tom AT tdwright DOT co DOT uk.

  14. Very interesting – I’ve been working on a gaze tracking system, but having issues when the user moves their heads too much – I might go out and get a wiimote to see if I can tie that in.

  15. Hi Matt, thanks for the article!
    You mentioned the Wii Fit in your comments but not in the main article. Does that software work with the Wii Fit as welll?

  16. That is really cool and the installation package makes it easy for even avg users.

    As an aside, with no offense to the writer, it is ironical that a device like the wiimote would get the full GUI treatment while configuration of normal mouse buttons require users to go through manual detection via the terminal. Except for btnx, which was conveniently made unusable in Ubuntu 8.10, there is no easy way to detect mouse btns beyond left+right btns + wheels.

    Wouldn’t it be good if more development effort went into making normal input devices easier to use on the desktop? Devices like mouses that avg users use? πŸ™‚

  17. Wii Balance Board, eh? Did you see what David Phillip Oster put together for Google Earth at MacWorld?

  18. Hey Matt,
    Interesting post. Does this Wii hack break any TOS related to your WII hardward?

  19. Nice demo Matt,

    I still can’t believe how much stuff is packed into that tiny Wiimote and how open Nintendo made it. I look forward to seeing your other Wii related hacks. πŸ™‚

  20. How much stuff?! Theres not much at all to the WiiMote.

    The WiiMotes technology is all old nothing is that new. What is new and groundbreaking (And why its became a sucess is the use they’ve put the technology to.

    All it is is a bluetooth chip, an accelerometer, an eeprom, an integrated IR object tracker chip, some buttons and a speaker.

    All of the parts you can buy, the exception obviously is the camera tracker chip which hasn’t been make in mass production anywhere else so the most economical way is to take one out a WiiMote.

    WiiMote isn’t advanced in any technological way, its groundbreaking in the way mature technology has been put to use in a way that hasn’t been seen before.

    P.s I dont know what the point of this reply is to be honest, im just bored waiting for a design to synthesize.

    P.p.s. thanks for the guide!

  21. Hmmm…. google is one up on microsoft in this race… I had a heck of a time connecting a wii-mote to my iogear, which insisted on a password to pair, and I can’t get into the iogear site to get the latest drivers. I gave my beloved Zoom, which worked perfectly, to my sister in Canada. (I am based in Madrid, Spain.)

    Have you seen any linux wii programs that get close to Boon Jin’s Smoothboard? (a further development of JC Lee’s whiteboard. It is a program that makes me kinda *like* microsoft, and it is written in net, but dunno if it can work in linux with mono, I am out of my depth there.)

    If there was a linux supergenious who could make it work in Mono, there would be a lot of underfunded schools in Spain and elsewhere that would very much appreciate it…

  22. Hey everyone. I am a temple electrical engineering student and we are using the Wiimote in our senior design. I am excited about everything I’ve read here and am hoping that all this openess can continue. We are planning on using the Wiimote for handicapped children as an interface for a microcontroller. Hoping the students can use it to affect their environment and give them some fun activities in the process. If anyone has any input… throw it out there. Keep in mind that the children are severely mentally, physically, or both impaired…

  23. Howdy, does anyone know how to configure this program to write an output file of acceleration data? I am trying to perform an experiment in which two Wiimotes are attached to the arms of a double pendulum. I need to save the acceleration data to something like a text file.

    In the past I was able to do this with DarwiinRemote but the latest version no longer supports this feature.

    Thank you for any help you can provide,

  24. Hi All,

    In Fedora 12:
    #sudo yum install cwiid cwiid-utils cwiid-wminput cwiid-python2

  25. Hi everybody…I don’t know if anyone ever looks here anymore but I can’t get this guide to work. I’m new to anything Linux, help would be appreciated. Thanks!

  26. Jaideep Khandelwal

    Oh ! that’s really cool , I was just wondering for some Linux Based Gui for Wii-motes . Great Work!!

  27. Most of the connection tutorials I have read told me to press both the (1) and (2) buttons down while connecting to bluetooh. This did not work for me, my controllers have a red “sync” button located in the battery compartment of the wiimote. I spent and hour holding down the two buttons wondering why it would not work, so I hope this information helps saves someone some time.
    I created a few tutorials on the page below!

  28. Clarissa Womack

    Hi Matt

    I really like your guide which tells you how to connect to the wiimote via Cwiid in Linux. For an assignment at university, I would like to create a game (using pygame) or program in python which communicates with the Wii remote. Now, I know that you can import Cwiid into python, your balance board example shows that it can be done but I cannot seem to find documentation on the python module cwiid-python or cwiid. I want to know what the functions are to communicate with the wii remote and nunchuk so I can create a game based on the user pressing buttons and moving the wii remote and nunchuk . If I can implement the wii remote and nunchuk, then I will look towards integrating the balance board as well. Could you offer me any advice how to achieve my aims? I have tried multiple Google searches but to no avail.

    Thanks for your advice
    Clarissa Womack
    1st year BE/BSc student studying software engineering, maths and computational science

  29. Hi there, thanks for posting this. I just have a few questions.
    1) Where does your sensor bar go, and where do you plug it in?
    2) What happens when you plug in the nunchuk?
    3) Once you’ve programmed the Wiimote to your OS, does your mouse still work?
    4) Will it work any longer on your Wii?
    I’m interested in playing FPS games like Half-Life with my Wii zapper, as well as other types of games. Thanks again.

  30. One of the best tutorials out there.. the visual help from the video was great, thank you! You made this really easy for me. And YES, I thought it was kind of cute too!!