![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Fresh Brewed Ubuntu
![]() Join Date: Aug 2006
Location: Australia
Beans: 1,320
Kubuntu 9.10 Karmic Koala
|
HOWTO: Wii remote in Ubuntu 8.04 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. Last edited by Rhubarb; November 30th, 2008 at 03:03 AM.. |
|
|
|
|
|
#2 |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2008
Location: In front of my Laptop...
Beans: 356
Ubuntu 9.04 Jaunty Jackalope
|
Re: HOWTO: Wii remote in Ubuntu 8.04
Rhubarb you are my hero! Thanks so much for this How-To...I read it and it seems to be easy enough...I just have two little questions before tampering with my Wiimote and my "current flawlessly working keyboard+mouse configuration"...
If I download all these packages and make these configurations...will my Wiimote still work on my Wii?...I know the configs are on Ubuntu, and the Wiimote is not supposed to be changed in any way, but I want to make 100% sure... And, if I follow this How-To, will my keyboard+mouse combo will suffer any changes, other than the specified on your How-To (the one about the mouse dying when you type on the keyboard)? (BTW I have an integrated touchpad on my laptop (as all of them do, and an external USB wireless mouse...will they be changed?...or it's configs?) Thank you so much for this! ![]() I also posted this message on the old Wiimote thread... BTW this How-To is great, very complete and easy-to-follow...
__________________
7 $]-[!8@\|//\Rr!0|2!!!![]() Toshiba Satellite A135 S4527-Intel Pentium Dual Core 1.73 Ghz.-2GB DDR2 RAM![]() Last edited by Toshibawarrior; June 22nd, 2008 at 04:02 PM.. |
|
|
|
|
|
#3 |
|
5 Cups of Ubuntu
![]() Join Date: May 2008
Beans: 24
|
Re: HOWTO: Wii remote in Ubuntu 8.04
you, good sir, are phenomenal. thank you. ill be doing this tonight after work!
|
|
|
|
|
|
#4 | |
|
A Carafe of Ubuntu
![]() |
Re: HOWTO: Wii remote in Ubuntu 8.04
Quote:
|
|
|
|
|
|
|
#5 | |
|
A Carafe of Ubuntu
![]() |
Re: HOWTO: Wii remote in Ubuntu 8.04
Quote:
The way you worded this part makes it seem like this will magically make Ubuntu automatically connect if I press 1+2 and disconnect if I press the power button. I didn't think this would happen, and it didn't. Is there a way (i.e. something else I have to do) to get Ubuntu to automatically recognize these button presses? |
|
|
|
|
|
|
#6 |
|
A Carafe of Ubuntu
![]() |
Re: HOWTO: Wii remote in Ubuntu 8.04
Answered my own questions on automatically disconnect/reconnect. The -d option makes it stay in memory so you can connect/disconnect. Aha!
I still can't get all the button maps to work, though. |
|
|
|
|
|
#7 |
|
A Carafe of Ubuntu
![]() |
Re: HOWTO: Wii remote in Ubuntu 8.04
Sorry for so many posts... I'm having fun with this tonight. I just found out, it's not necessary to specify your bluetooth address. wminput will use hci_inquiry to find an active bluetooth device and pick the first one. My panel button is now simply wminput -d and it works fine.
|
|
|
|
|
|
#8 |
|
Fresh Brewed Ubuntu
![]() Join Date: Aug 2006
Location: Australia
Beans: 1,320
Kubuntu 9.10 Karmic Koala
|
Re: HOWTO: Wii remote in Ubuntu 8.04
Toshibawarrior: Your Wiimote should still work on your Wii just fine.
While I don't own a Wii myself, I could possibly be wrong here - but I have not heard of anyone having problems with using their wiimote on Ubuntu and their Wii. Your keyboard+mouse combo will not suffer any changes (you must fix up the bug I described in my howto). I have tested this on 3 different Ubuntu 8.04 computers - 2 64bit Desktops and 1 32bit Laptop. Everything works fine. TrashmanL: True it's not necessary to specify your bluetooth address, but it does allow Ubuntu to connect to your wiimote a lot faster. Thanks for pointing out the problem with binding buttons using wminput / wminput -c acc_ptr. I didn't realise that there's a bug with this. Binding different buttons does work fine when you use: wminput -c ir_ptr or wminput -c buttons I will experiment a bit and update my howto accordingly. *Updated 6-Aug-2008: Attached are my original icons you may all use, they are 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.
__________________
Work smart, not hard. Last edited by Rhubarb; August 5th, 2008 at 11:48 AM.. Reason: Please ignore my text in Red, this is no longer a problem and has been updated in my howto. |
|
|
|
|
|
#9 |
|
A Carafe of Ubuntu
![]() |
Re: HOWTO: Wii remote in Ubuntu 8.04
My last post of the night, I swear...
Confirmed. Just some more info to narrow down. The buttons did map correctly with ir_ptr and buttons used directly. Not only did acc_ptr not work, but nunchuk_acc_ptr did not work, either. As a test, I tried to put Plugin.acc.X = REL_X Plugin.acc.Y = REL_Y in buttons directly. wminput -c buttons no longer worked to remap the buttons. This tells me the bug happens whenever REL_X and/or REL_Y are called (as opposed to being in the include statement - but I suppose that was obvious in that ir_ptr worked). You probably already though of this, but just in case you didn't, I figured I'd share my observations. |
|
|
|
|
|
#10 | |
|
Fresh Brewed Ubuntu
![]() Join Date: Aug 2006
Location: Australia
Beans: 1,320
Kubuntu 9.10 Karmic Koala
|
Re: HOWTO: Wii remote in Ubuntu 8.04
I've come to a similar conclusion TrashmanL.
It seems to me whenever REL_X or REL_Y is called it becomes impossible to map keyboard buttons to other wiimote buttons. Interestingly this functions exactly like a joystick (it appears as a joystick and works in google earth), and the buttons work fine: Code:
Plugin.acc.X = ABS_X Plugin.acc.Y = ABS_Y Code:
Plugin.acc.X = ABS_X Plugin.acc.Y = ABS_Y Wiimote.B = BTN_LEFT Code:
Plugin.acc.X = REL_X Plugin.acc.Y = REL_Y http://abstrakraft.org/cwiid/wiki/wminput Quote:
This possibly can be proven by (I'm a bit confused here) Code:
Plugin.acc.X = ~ABS_X Plugin.acc.Y = ~ABS_Y I haven't compiled the latest development version CWiid to test any further. If anyone here knows how to fix this bug please let me know.
__________________
Work smart, not hard. Last edited by Rhubarb; June 29th, 2008 at 11:43 AM.. Reason: Please ignore this post, as it is no longer a problem and has been updated in my howto. |
|
|
|
|
| Bookmarks |
| Tags |
| cwiid, nintendo, wii, wiimote |
| Thread Tools | |
| Display Modes | |
|
|