
Flash Advertise
| HOWTO: Wii remote in Ubuntu 8.04 |
| From: ubuntuforums.org read times: 1239 |
Provided by yangyi at 2009-02-10 23:50:40 |
Introduction:- This howto should help you get a Wii remote working as a mouse / keyboard / joystick in 32bit or 64bit Ubuntu Hardy Heron 8.04 There is no compiling required, you only need to download a few packages, and configure a few text files. I'd like to thank leffect for posting http://ubuntuforums.org/showthread.php?t=535659 and all the contributors too. I'd also like to thank Cyborg_572 for clearing up a mouseemu related bug that used to effect this howto. Hopefully I'll update https://help.ubuntu.com/community/CWiiD to reflect this howto as well. 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. For the Ubuntu Intrepid Ibex 8.10 Wii remote guide, follow the following link: http://ubuntuforums.org/showthread.php?t=993376 Install Packages:- Bring up a terminal (Applications --> Accessories --> Terminal), and install these packages: Code:
sudo aptitude install wminput wmgui lswm Press buttons 1 + 2 on your Wii remote Then in a terminal, type in: Code:
lswm Please note down the number that lswm returns (that looks similar to 00:1F:32:95:EF:B0), this is your Wii remote bluetooth device address. 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. 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 recommend you make it automatically run upon Ubuntu start up. Code:
gksudo gedit /etc/modules Code:
uinput 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 Code:
sudo modprobe uinput 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:
wminput 00:1F:32:95:EF:B0 Using your Wii remote as a mouse using an Infra-red light source:- 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 Code:
Plugin.ir_ptr.X = ~ABS_X Plugin.ir_ptr.Y = ~ABS_Y Code:
Plugin.ir_ptr.X = ABS_X Plugin.ir_ptr.Y = ABS_Y Code:
wminput -c ir_ptr 00:1F:32:95:EF:B0 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 Code:
Wiimote.A = BTN_LEFT Wiimote.B = BTN_RIGHT Code:
Wiimote.A = BTN_RIGHT Wiimote.B = BTN_LEFT Using your Wii remote and IR LED pen as a whiteboard:- If you wish to use your Wii remote and an IR LED pen to make up a cheap touch screen / interactive whiteboard, then download and install the appropriate package from here: http://code.google.com/p/linux-white...downloads/list Once installed, you can find the Wiimote Whiteboard application in Applications --> Accessories --> Wiimote Whiteboard. Using your Wii remote for watching DVDs, Elisa media center, 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:
wminput -d -c ir_ptr 00:1F:32:95:EF:B0 To create another icon to kill all running wminput processes, do the same as above, but for the command use this: Code:
killall wminput I have attached two icons to this post that I have created myself that you may use for this. 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...ction_enum.txt If I've left anything out let me know, I'll endeavor to keep this updated. *Updated 24-Jun-2008: Cyborg_572 has found that mouseemu isn't required which fixes up a bug that did affect this howto. *Updated 6-Aug-2008: leffect has kindly donated the icons attached for us all to use and share - under a "Creative Commons Attribution-Share Alike" license, which essentially means you can use them wherever you like, but if you do, or you change them, let other people have them too. *Updated 29-Nov-2008: Added link to Toshibawarrior's Ubuntu 8.10 Wii remote guide. *Updated 30-Nov-2008: Changed the auto startup line for the uinput module from /etc/rc.local to a much more appropriate place for modules in /etc/modules
__________________
Work smart, not hard. Original link: http://ubuntuforums.org/showthre... |