Page 1 of 25 12311 ... LastLast
Results 1 to 10 of 243

Thread: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

  1. #1
    Join Date
    Apr 2008
    Location
    In front of my iMac...
    Beans
    364
    Distro
    Ubuntu 10.04 Lucid Lynx

    HOWTO: Wii Remote in Ubuntu (8.04-10.04)

    Introduction

    **UPDATE**: If you want an easier way to make you wiimote work with Ubuntu go read my newest tip on the "Tips and Advices" section.

    Hello all! I know that many people liked Rhubarb's HOWTO about using the wiimote in Ubuntu but are confused on how to make it possible in other versions of K/Ubuntu. So, I decided to make this guide, to help out Rhubarb and everyone else here in the forums!

    (To avoid common mistakes and extra work I'll use some snippets from Rhubarb's original guide.)

    This HOWTO should help you get a Wii remote working as a mouse / keyboard / joystick in 32bit or 64bit (still untested in Intrepid) Ubuntu intrepid Ibex 8.10.
    There is no compiling required, you only need to download a few packages, and configure a few text files.

    Changelog
    (Here I'll post minor and important updates made to the guide, make sure you read this first to know what's new on the guide.)

    0 - November 25, 2008 = I started the guide.
    1 - November 27, 2008 = Added the Special Thanks and Conclusion sections and fixed some text formatting.
    2 - November 30, 2008 = Fixed some typos and changed the instructions for autostarting uinput on each boot for a much cleaner and nicer way (Thanks to Rhubarb for the tip!).
    3 - December 11, 2008 = Added the Wiimote Whiteboard section (which is still on BETA state).
    4 - December 14, 2008 = Added a few tips and advices.
    5 - December 15, 2008 = Fixed the Wiimote Whiteboard section of the guide (thanks to Rhubarb for the detailed compiling process).
    6 - January 1, 2009 = Added a link to download a .deb for installing the Whiteboard. (Thanks again to Rhubarb for this )
    7 - February 10, 2009 = Added an "IMPORTANT NOTE" (which is just a little reminder) on the Infra Red section.
    8 - February 14, 2009 = Added an alternative to restarting when installing wminput and the necessary packages.
    9 - -July 5, 2009 = Fixed some boo-boos on the HOWTO's grammar and added a new tip [Check the Tips and Advices section to see it!]. I also fixed the command to execute wminput for IR Tracking while using gksudo[It needed to be wrapped in quotes for it to work. Thanks to everyone who noticed this, including zbeekman. I don't use IR tracking mode so to me it was irrelevant in some way].
    10 - June 14, 2010 = Just a quick update: today (after almost a year of absence from this tutorial) I tried it with Ubuntu Lucid Lynx (10.04) and everything works. I still haven't tried the whiteboard part, but as far as I've tested, everything is working. So I'll be renaming this tutorial. I also added a new tip.

    Requirements

    Your computer must have a known working bluetooth adapter, a Wii remote.
    An infra-red light source is required if you wish to use your Wii remote to behave like a mouse from an IR light source, such as the Wii sensor bar, some candles, an incandescent light, etc.
    An IR LED pen is required if you wish to setup a whiteboard with your Wii remote.

    Install the needed packages

    Open up a terminal (Applications --> Accessories --> Terminal) and paste this in:

    Code:
    sudo aptitude install wminput wmgui lswm
    Next, we need to find the bluetooth device address of your Wii remote, this will allow you to connect to your Wii remote faster in future, and will let you know if your system can connect to your Wii remote via bluetooth.

    In a terminal type this in:

    Code:
    lswm
    And press buttons 1 & 2 on your wiimote to put it in discovery mode.

    If you don't see something that looks like 00:2A:34:95:FE:B0 then keep on running lswm / pressing buttons 1 + 2 on your Wii remote until you do.

    Please note down the number that lswm returns (that looks similar to 00:2A:34:95:FE:B0), this is your Wii remote bluetooth address (Keep in mind that the number given here is an example).

    Check to see if all the capabilities of your Wii Remote (and extra controllers) work:

    Start up wmgui (Applications --> Accessories --> Wmgui).
    wmgui is an easy application that's good to use for simple diagnostics on your wiimote, nunchuk and classic controller.

    Allow your Wii remote to be a keyboard / mouse / joystick:

    Unless you want to run sudo modprobe uinput every time you start Ubuntu, it's recommended that you make it automatically run upon Ubuntu start up.

    Open a terminal and type:

    Code:
    gksudo gedit /etc/modules
    Insert this line at the end of the file:

    Code:
    uinput
    So the whole file should look exactly like this:

    Code:
    # /etc/modules: kernel modules to load at boot time.
    #
    # This file contains the names of kernel modules that should be loaded
    # at boot time, one per line. Lines beginning with "#" are ignored.
    
    fuse
    lp
    sbp2
    uinput
    You have to restart your computer for the settings to take effect.

    Alternately, you can just open a terminal and type:

    Code:
    sudo modprobe uinput
    (This method although accepted is not my favorite way of doing this.)

    Using your Wii remote as a mouse using acceleration data:

    If you want to use your Wii remote as a mouse by tilting your Wii remote, then press buttons 1 + 2 on your Wii remote and from a terminal run this:

    Code:
    gksudo wminput <your wiimote's bluetooth address>
    Please use your bluetooth device address for your Wii remote (the one that lswm returned).

    Using your Wii remote as a mouse using an Infra-Red light source:

    IMPORTANT NOTE: To use the wiimote in Infrea-Red mode you need an Infra-Red source, like: incandescent candles, flashlights or a Wireless Wii Sensor Bar. I personally use the Wireless Sensor Bar and it's pretty cool. You won't need to experiment making your own bars, if you don't want to. You can find "sensor bars" in lots of places, including online stores. Keep in mind that the sensor bar is nothing more than a few LED lights and some plastic to make it look pretty. Ask on this thread for suggestions about where to buy or how to make your own sensor bar.

    There's a configuration file that you must first edit before this is possible.
    From a terminal, type this in:

    Code:
    gksudo gedit /etc/cwiid/wminput/ir_ptr
    Find these lines:

    Code:
    Plugin.ir_ptr.X    = ~ABS_X
    Plugin.ir_ptr.Y    = ~ABS_Y
    and replace it with:
    Code:
    Plugin.ir_ptr.X    = ABS_X
    Plugin.ir_ptr.Y    = ABS_Y
    To get your Wii remote to track IR light sources, press buttons 1 + 2 on your Wii remote and from a terminal run this:

    Code:
    gksudo "wminput -c ir_ptr <your wiimote's bluetooth address>"
    Please use your bluetooth device address for your Wii remote.

    Swapping default left and right mouse buttons:


    If you prefer the left mouse button to be button B (the trigger) on your Wii remote, and the right mouse button to be button A on your Wii remote, then from a terminal run this:
    Code:
    gksudo gedit /etc/cwiid/wminput/buttons
    Find these lines:
    Code:
    Wiimote.A        = BTN_LEFT
    Wiimote.B        = BTN_RIGHT
    and replace it with:
    Code:
    Wiimote.A        = BTN_RIGHT
    Wiimote.B        = BTN_LEFT

    Using your Wii remote and IR LED pen as a whiteboard:


    This can be done by compiling in Intrepid...because the .deb package for Hardy doesn't work on Intrepid due to an incompatibility in some dependencies.

    UPDATE: A .deb package was made! The link is below!

    HARD WAY: (NOTE:Ubuntu 64-bit users have to compile the whiteboard thmselves because there's no .deb for 64-bit at the moment.)

    Open up a terminal (Applications --> Accessories --> Terminal)
    To install the needed packages type the following in:

    Code:
    sudo aptitude install libcwiid1-dev libsdl1.2-dev libxext-dev libbluetooth-dev libxtst-dev subversion lswm libcwiid1 libbluetooth3 libtool libcwiid1-dev libgtkmm-2.4-dev libglademm-2.4-dev libxtst-dev libcairomm-1.0-dev libsigc++-2.0-dev libgnome2-dev intltool libbluetooth-dev
    You'll be prompted to enter in your password after entering the above command.

    Now download the latest wii whiteboard from subversion:

    Code:
    svn checkout http://linux-whiteboard.googlecode.com/svn/branches/cpp/ linux-whiteboard-read-only
    Change to the newly downloaded sources directory

    Code:
    cd ~/linux-whiteboard-read-only/
    Configure it

    Code:
    ./autogen.sh
    Compile it

    Code:
    make
    Install it

    Code:
    sudo make install
    Then you can run it

    Code:
    whiteboard
    This has been tested by Rhubarb in Intrepid and it works. If someone is not able to make it work, simply post your situation here.

    EASY WAY:


    There's a .deb package here - - > http://code.google.com/p/linux-white...downloads/list Enjoy!

    Using your Wii remote for watching DVDs, Elisa Media Center, Music Players, etc:

    I've setup on my system 2 icons in my gnome panel that I can click on if I want to connect to my Wii Remote and use it's IR light tracking ability as a mouse, and the other to turn off the wminput daemon that I started on the other icon.

    Right click on an empty part of the Gnome panel and select "Add to Panel...", then "Custom Application Launcher" then press the "+Add" button.

    Type in a name for it, for the command, use this:
    Code:
    gksudo "wminput -d -c ir_ptr <your wiimote's bluetooth address here>"
    For IR mode. If you want to use ACC (accelerometer mode) the command should be:

    Code:
    gksudo wminput <your wiimote's bluetooth address here>

    The gksudo is important because if you use sudo only, you won't see any prompt to type in your password, and in Intrepid it IS necessary to be root to activate wminput.


    Select a nice icon for it if you wish, then press close.

    To create another icon to kill all running wminput processes, do the same as above, but for the command use this:

    Code:
    gksudo killall wminput
    Use gksudo here too because you might need to type in your password again.

    The advantage of using these two icons to run wminput, is that you can turn off your Wii remote (by pressing and holding the power button on your Wii remote) when you start watching a DVD / listening to music to save battery power, then if you wish to start using your Wii remote again, simply press buttons 1 + 2 on your Wii remote and Ubuntu will automatically connect to your Wii remote again as before without having to pick up a keyboard or mouse to do so.

    Remapping the buttons / axis on your Wii remote / classic controller / nunchuck:


    All the files you would want to change and experiment with are located in /etc/cwiid/wminput/
    A list of all possible axis / keyboard / mouse / joystick / gamepad / steering wheel buttons you can bind your Wiimote to:

    http://abstrakraft.org/cwiid/browser/trunk/wminput/action_enum.txt

    If you don't understand something or have questions just ask! And I'll gladly try to help.

    Tips and Advices:

    - If you're not using your nunchuck or classic controller you must comment (add a # before each button entry on /etc/cwiid/wminput/buttons for the nunchuck and classic controller.

    - Make sure you write down your Wiimote's bluetooth address and store it in a safe place to avoid having to use lswm each time you have to install wminput and cwiid (as in a fresh install of Ubuntu).

    - Make sure you have all the latest updates for Intrepid to avoid corruption and/or bugs.

    - Remember to use gksudo for wminput commands, since Intrepid asks for root privileges while using wminput.

    - If your bluetooth adapter is not working unplug and re-plug it in different USB ports to see if Ubuntu recognizes it.

    - In ACC (accelerometer mode) the wiimote's movement might be erratic. For moving the cursor up and down you tilt the wiimote up and down respectively. But for moving the cursor sideways you have to twist your wiimote left or right respectively. In IR (Infra-Red) mode you simply move your wiimote up, down, left , right, just like when playing Wii.

    - Keep in mind that if you have a Wii and your Ubuntu computer in the same room and you use the wiimote's power button to turn it off, you'll end up turning on the Wii. And the Wii will automatically take over the wiimote.

    - I tested XWii and it works flawlessly with Ubuntu 9.10 and 10.04. Here's a pre-made (completely safe) .deb package for the newest build of XWii. Just install it and run it on a terminal by typing: "xwii" without quotes and selecting a profile. I'll be adding a little more info on XWii's profiles soon. It's very useful and easy to setup, not to mention that the profiles are a breeze to make and it has some sweet capabilities that CWiiD/wminput doesn't have. Enjoy!

    - If your bluetooth dongle doesn't work with your wiimote but does recognize the wiimote's bluetooth address fine, don't waste time reinstalling and fiddling with wminput or any other software. Simply try to find another dongle to test the wiimote. I have received multiple posts of people having non-working dongles and it turns out that there's no way to go around that, they just don't work! I have also received notice that Bluesoleil dongles don't work with wiimotes, go figure! They don't even work correctly in Windows, try to stay away from these dongles.

    - If you have multiple Wiimotes and don't want to write down all of their addresses you can use this command:

    Code:
    gksudo "wminput -d -c ir_ptr $(lswm)"
    This way lswm will search the Wiimote's bluetooth address at the same time as wminput connects to the Wiimote. Remember to press 1 + 2 on the Wiimote while executing this command!

    Thanks to zbeekman for this!

    Special Thanks

    To Rhubarb for making the original guide for Hardy Heron and giving me advice for this guide.

    Conclusion

    Well, for now that's it. If I wasn't clear enough just let me know and I'll fix anything that needs fixing. And if you have suggestions for my guide simply post them here. Just like Rhubarb I'll do my best to keep this guide up to date with new updates in Ubuntu.

    If you want to serve as a tester for using the wiimote in other Linux flavors (Kubuntu, Xubuntu, openSUSE, Fedora, etc) then we'll be very grateful if you post back your feedback on how it works.

    That's All Folks! But stay tuned!
    Last edited by Toshibawarrior; June 14th, 2010 at 03:58 PM.
    7$]-[!8@\|//\Rr!0|2!!!
    =D>
    My Little Ubuntu Blog!

  2. #2
    Join Date
    Sep 2008
    Location
    London, ON
    Beans
    38
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    AWESOME!!

    I'm totally going to try to make this work this weekend.

    I've heard a little bit about it from some friends, but didn't believe that it had actually been done, and that it was this easy.

    Thanks for the post!!


    /thanks Toshibawarrior

  3. #3
    Join Date
    Apr 2008
    Location
    In front of my iMac...
    Beans
    364
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    Hey Coreo, glad to know you liked it! It's pretty easy as you can see. And the best part is that if you (or anyone else) doesn't understand something you can freely ask for help here and I'll help as fast as I can.

    Keep checking frequently for updates!
    7$]-[!8@\|//\Rr!0|2!!!
    =D>
    My Little Ubuntu Blog!

  4. #4
    Join Date
    Sep 2008
    Location
    London, ON
    Beans
    38
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    Well it's kind of a weird coincidence that I stumbled on this this week...
    The past few days/week I've been looking into the LIRC (Linux Infrared Remote Control) project.
    My computer doesn't come with a media remote, and I find them kind of restrictive anyway. That project seems to be fairly expandable, just like this one...oh the possibilities. Lol.

    I just haven't had much time to look into it more and try it out.
    But now that I've found this....I might make a bit more progress with both ideas!

  5. #5
    Join Date
    Feb 2008
    Location
    Wedel
    Beans
    9
    Distro
    Xubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    Hi all,
    sorry for posting this message not in the proper thread primarily. Thanks to toshibawarrior I was reminded to put it here:

    Great tutorial. Would have saved me a lot of time if I could have started with your tutorial.

    @all
    As to the point of having to run wminput as sudo in Intrepid. The following steps fixed that on my system so that it can be called now as non-root in Intrepid:

    1.)
    create a file in /etc/udev/rules.d
    somewhat along the lines suggested by clockware in http://sudan.ubuntuforums.com/showth...535659&page=12
    I named it "50-cwiid.input.rules" and included the single line:

    KERNEL=="uinput", MODE="0666"

    to make uinput accessible to any user (can alternatively be done a bit safer by assigning access only to a special group).

    2.)
    Then from a Terminal type: "sudo /etc/init.d/udev restart"

    then I could call wminput successfully as normal user.


    regards
    micha137

  6. #6
    Join Date
    Aug 2006
    Location
    Australia
    Beans
    1,438

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    Nice work there Toshibawarrior

    It is possible to get wii whiteboard working easily enough.
    To do this it must be compiled. I can't specify the steps to do this just yet, as I'm moving house this weekend, and I've got myself a job.
    So needless to say I'm quite busy.

    The main reason why the wii whiteboard can't be installed from the debs here:
    http://code.google.com/p/linux-whiteboard/
    Is because they where built for Ubuntu 8.04, and not 8.10.
    The main difference between the two is that 8.10 comes with libbluetooth3, and 8.04 comes with libbluetooth2.
    Installing with the deb file expects to see libbluetooth2.
    When compiling the wii whiteboard source it compiles and works nicely with libbluetooth3.

    When I get time I'll post here / let Toshibawarrior know; to update this nice howto here.
    Work smart, not hard.

  7. #7
    Join Date
    Apr 2008
    Location
    In front of my iMac...
    Beans
    364
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    Thanks a lot Rhubarb! I'll update my guide as soon as I/you find something! As I said on your guide, I'd like to keep Hardy stuff on yours and Intrepid in mine, to keep it more organized !

    Thanks again!
    7$]-[!8@\|//\Rr!0|2!!!
    =D>
    My Little Ubuntu Blog!

  8. #8
    Join Date
    Aug 2006
    Location
    Australia
    Beans
    1,438

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    A more elegant way of making "sudo modprobe uinput" automatically start, is to:-

    Edit your /etc/modules file:-
    Code:
    gksu gedit /etc/modules
    The add an extra line to the end of the file:-
    Code:
    uinput
    So /etc/modules should look something like this:-
    Code:
    So the whole file should look like this:
    # /etc/modules: kernel modules to load at boot time.
    #
    # This file contains the names of kernel modules that should be loaded
    # at boot time, one per line. Lines beginning with "#" are ignored.
    
    fuse
    lp
    sbp2
    uinput
    Work smart, not hard.

  9. #9
    Join Date
    Nov 2008
    Location
    Vancouver BC
    Beans
    30

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    Hi, thanks for this tutorial.

    I'm having problems with my wii remote connected to the computer. I'm using a USB bluetooth dongle. I think it is working because when I plug it in, a bluetooth notification icon appears in the upper right corner. I've gotten as far as entering lswm in a terminal. The wii remote is not getting discovered. I think 1 time it almost worked, this was when I powered on the wii remote at the same time as entering lswm. The address 00:1B:7A:349:84 was returned and the four lights on the bottom of the remote kept flashing. Eventually the lights returned to a single blue. I went to wmgui and it says there isn't anything connected. I haven't been able to have the remote discovered since them.

    Any ideas on what I can try?

    thanks

  10. #10
    Join Date
    Nov 2008
    Location
    Vancouver BC
    Beans
    30

    Re: HOWTO: Wii Remote in Ubuntu Intrepid Ibex (8.10)

    Hmm, actually it looks like I have it. I was trying to power on the remote first then press 1+2. Instead I had the remote turned off (or at least there were no lights on), then pressing 1 + 2 got the remote connected.

    cheers!

Page 1 of 25 12311 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •