Difference between revisions of "Wiimote"

From ArchWiki
Jump to: navigation, search
m (Prerequisites: de-link "Enabling community" article)
(translated the text from the german wiki)
Line 2: Line 2:
 
This article will go through the basic steps required to have a working Wiimote in Linux for general use. It won't go into much detail for some steps as there are many guides already written for some parts already.
 
This article will go through the basic steps required to have a working Wiimote in Linux for general use. It won't go into much detail for some steps as there are many guides already written for some parts already.
  
=Setup=
 
 
==Prerequisites==
 
==Prerequisites==
 
* Bluetooth
 
* Bluetooth
Line 8: Line 7:
 
* Wiimote
 
* Wiimote
  
The most important piece required is [[Bluetooth]], this must already be configured and running without the help of this guide. This should be simple enough with any guide found on the internet. The 'cwiid' package must be installed from the community repository. This package contains all libraries and programs required for basic use of the Wiimote. Lastly you will need a Wiimote, this can include (although are not required) the Nunchuk and Classic Control attachments.
+
The most important piece required is [[Bluetooth]], this must already be configured and running without the help of this guide. This should be simple enough with any guide found on the internet. The 'cwiid' package must be installed from the [[AUR]]. This package contains all libraries and programs required for basic use of the Wiimote. Lastly you will need a Wiimote, this can include (although are not required) the Nunchuk and Classic Control attachments.
  
==cwiid==
+
==Connect the Wiimote==
cwiid is incredibly easy to get running on any system with working Bluetooth support. Once it has been installed from the community repository you should make sure your Wiimote is detected by your Bluetooth system:
+
 
 +
First you need to make sure to load the <tt>uinput</tt> module:
 +
 
 +
$ sudo modprobe uinput
 +
 
 +
You should have a device in <tt>/dev/misc/uinput</tt> now. For permanent use you can add it to the modules section in your <tt>/etc/rc.conf</tt>.
 +
 
 +
Thanks to cwiid you can scan for your Wiimote now:
  
 
  (press the 1 and 2 buttons on your Wiimote)
 
  (press the 1 and 2 buttons on your Wiimote)
Line 18: Line 24:
 
         <MAC address>      Nintendo RVL-CNT-01
 
         <MAC address>      Nintendo RVL-CNT-01
  
Once your Wiimote has been detected you can test if it's working by running the command 'wmgui' and testing out various buttons and sensors through that interface.
+
Once your Wiimote has been detected you can test if it's working by running the command <tt>wmgui</tt> and testing out various buttons and sensors through that interface.
 +
 
 +
==Input Device==
 +
 
 +
The Wiimote can act as a regular input device like a mouse using <tt>wminput</tt>. If you have ''no infrared source'' simply run:
 +
 
 +
$ wminput -w
 +
 
 +
You can control your pointer now by tilting your Wiimote forward, backward or to the sides.
 +
 
 +
If you ''have an infrared source'' run:
 +
 
 +
$ wminput -c ir_ptr -w
 +
 
 +
===Infrared Sources===
 +
 
 +
Possible infrared sources are
 +
 
 +
* Nintendo Wii Sensor Bar
 +
* Wireless sensor bar - check eBay!
 +
* Small candles (should have about 30cm distance)
 +
* Home made sensor bar ([http://doctabu.livejournal.com/64758.html])
 +
 
 +
===Configuration===
 +
 
 +
The default configuration files are in <tt>/etc/cwiid/wminput/</tt>. They are a good starting point for your customized settings in <tt>~/.cwiid/wminput</tt> or <tt>/usr/local/etc/cwiid/wminput</tt>. The general syntax is:
 +
 
 +
Wiimote.Button = KEY_ON_KEYBOARD
 +
 
 +
All possible values for Wiimote.Buttons can be found here: [http://abstrakraft.org/cwiid/browser/trunk/doc/wminput.list], the possible values for KEY_ON_KEYBOARD in <tt>/usr/include/linux/input.h</tt>.

Revision as of 13:35, 2 February 2009

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Wiimote#)

This article will go through the basic steps required to have a working Wiimote in Linux for general use. It won't go into much detail for some steps as there are many guides already written for some parts already.

Prerequisites

  • Bluetooth
  • cwiid
  • Wiimote

The most important piece required is Bluetooth, this must already be configured and running without the help of this guide. This should be simple enough with any guide found on the internet. The 'cwiid' package must be installed from the AUR. This package contains all libraries and programs required for basic use of the Wiimote. Lastly you will need a Wiimote, this can include (although are not required) the Nunchuk and Classic Control attachments.

Connect the Wiimote

First you need to make sure to load the uinput module:

$ sudo modprobe uinput

You should have a device in /dev/misc/uinput now. For permanent use you can add it to the modules section in your /etc/rc.conf.

Thanks to cwiid you can scan for your Wiimote now:

(press the 1 and 2 buttons on your Wiimote)
$ hcitool scan
Scanning ...
       <MAC address>       Nintendo RVL-CNT-01

Once your Wiimote has been detected you can test if it's working by running the command wmgui and testing out various buttons and sensors through that interface.

Input Device

The Wiimote can act as a regular input device like a mouse using wminput. If you have no infrared source simply run:

$ wminput -w

You can control your pointer now by tilting your Wiimote forward, backward or to the sides.

If you have an infrared source run:

$ wminput -c ir_ptr -w

Infrared Sources

Possible infrared sources are

  • Nintendo Wii Sensor Bar
  • Wireless sensor bar - check eBay!
  • Small candles (should have about 30cm distance)
  • Home made sensor bar ([1])

Configuration

The default configuration files are in /etc/cwiid/wminput/. They are a good starting point for your customized settings in ~/.cwiid/wminput or /usr/local/etc/cwiid/wminput. The general syntax is:

Wiimote.Button = KEY_ON_KEYBOARD

All possible values for Wiimote.Buttons can be found here: [2], the possible values for KEY_ON_KEYBOARD in /usr/include/linux/input.h.