https://wiki.archlinux.org/api.php?action=feedcontributions&user=Pythoneater&feedformat=atomArchWiki - User contributions [en]2024-03-29T01:00:46ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Wiimote&diff=153858Wiimote2011-08-28T19:48:51Z<p>Pythoneater: Updated because package was moved to community and added a common issue solution</p>
<hr />
<div>[[Category:Other hardware (English)]]<br />
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.<br />
<br />
==Prerequisites==<br />
* Bluetooth<br />
* cwiid<br />
* Wiimote<br />
<br />
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 is in [[Community]]. 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.<br />
<br />
==Connect the Wiimote==<br />
<br />
First you need to make sure to load the <tt>uinput</tt> module:<br />
<br />
$ sudo modprobe uinput<br />
<br />
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>.<br />
<br />
Thanks to cwiid you can scan for your Wiimote now:<br />
<br />
(press the 1 and 2 buttons on your Wiimote)<br />
$ hcitool scan<br />
Scanning ...<br />
<MAC address> Nintendo RVL-CNT-01<br />
<br />
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.<br />
<br />
==Input Device==<br />
<br />
The Wiimote can act as a regular input device like a mouse using <tt>wminput</tt>. If you have ''no infrared source'' simply run:<br />
<br />
$ wminput -w<br />
<br />
You can control your pointer now by tilting your Wiimote forward, backward or to the sides.<br />
<br />
If you ''have an infrared source'' run:<br />
<br />
$ wminput -c ir_ptr -w<br />
<br />
===Infrared Sources===<br />
<br />
Possible infrared sources are<br />
<br />
* Nintendo Wii Sensor Bar<br />
* Wireless sensor bar - check eBay!<br />
* Small candles (should have about 30cm distance)<br />
* Home made sensor bar ([http://doctabu.livejournal.com/64758.html])<br />
<br />
===Configuration===<br />
<br />
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:<br />
<br />
Wiimote.Button = KEY_ON_KEYBOARD<br />
<br />
All possible values for Wiimote.Buttons can be found here: [http://abstrakraft.org/cwiid/browser/doc/wminput.list], the possible values for KEY_ON_KEYBOARD in <tt>/usr/include/linux/input.h</tt>.<br />
<br />
==Troubleshooting==<br />
<br />
===Unable to open uinput===<br />
If wminput gives this error, leaving you unable to use the wiimote, try the following:<br />
<br />
1. Create a new file in <tt>/etc/udev/rules.d/</tt> (It doesn't matter what the name or extension of the file is)<br />
<br />
2. Add the following to the file:<br />
KERNEL=="uinput", GROUP="wheel", MODE:="0660"<br />
<br />
3. Reboot<br />
<br />
This should solve the problem. Solution was found in the forums [https://bbs.archlinux.org/viewtopic.php?id=104348 here].</div>Pythoneater