Difference between revisions of "Wiimote"

From ArchWiki
Jump to: navigation, search
m (+ related)
(Unable to open uinput)
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Other hardware (English)]]
+
[[Category:Other hardware]]
{{i18n|Wiimote}}
+
 
+
 
This article will go through the basic steps required to have a working Wiimote in Linux for general use. It will not 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 will not go into much detail for some steps as there are many guides already written for some parts already.
 +
 +
{{Note|The approach shown on this page is based on software which is no longer developed upstream. There is a new effort on creating a Wii Remote driver based on the new Linux kernel Wii Remote driver. See [[XWiimote]] if you want to test the new Wii Remote software stack.}}
  
 
==Prerequisites==
 
==Prerequisites==
 
* Bluetooth
 
* Bluetooth
* {{Package Official|cwiid}}
+
* {{Pkg|cwiid}}
 
* Wiimote
 
* Wiimote
  
Line 13: Line 13:
 
==Connect the Wiimote==
 
==Connect the Wiimote==
  
First you need to make sure to load the {{Codeline|uinput}} module:
+
First you need to make sure to load the {{Ic|uinput}} module:
  
 
  $ sudo modprobe uinput
 
  $ sudo modprobe uinput
  
You should have a device in {{Filename|/dev/misc/uinput}} now. For permanent use you can add it to the modules section in your [[rc.conf]].
+
You should have a device in {{ic|/dev/misc/uinput}} now. For permanent use you can add it to the modules section in your [[rc.conf]].
  
 
Thanks to cwiid you can scan for your Wiimote now:
 
Thanks to cwiid you can scan for your Wiimote now:
Line 26: Line 26:
 
         <MAC address>      Nintendo RVL-CNT-01
 
         <MAC address>      Nintendo RVL-CNT-01
  
Once your Wiimote has been detected you can test if it is working by running the command {{Codeline|wmgui}} and testing out various buttons and sensors through that interface.
+
Once your Wiimote has been detected you can test if it is working by running the command {{Ic|wmgui}} and testing out various buttons and sensors through that interface.
  
 
==Input Device==
 
==Input Device==
  
The Wiimote can act as a regular input device like a mouse using {{Codeline|wminput}}. If you have ''no infrared source'' simply run:
+
The Wiimote can act as a regular input device like a mouse using {{Ic|wminput}}. If you have ''no infrared source'' simply run:
  
 
  $ wminput -w
 
  $ wminput -w
Line 43: Line 43:
  
 
Possible infrared sources are
 
Possible infrared sources are
 
+
bulbs
 
* Nintendo Wii Sensor Bar
 
* Nintendo Wii Sensor Bar
 
* Wireless sensor bar - check eBay!
 
* Wireless sensor bar - check eBay!
 +
* Normal light bulbs
 
* Small candles (should have about 30cm distance)
 
* Small candles (should have about 30cm distance)
 
* Home made sensor bar ([http://doctabu.livejournal.com/64758.html])
 
* Home made sensor bar ([http://doctabu.livejournal.com/64758.html])
Line 51: Line 52:
 
===Configuration===
 
===Configuration===
  
The default configuration files are in {{Filename|/etc/cwiid/wminput/}}. They are a good starting point for your customized settings in {{Filename|~/.cwiid/wminput}} or {{Filename|/usr/local/etc/cwiid/wminput}}. The general syntax is:
+
The default configuration files are in {{ic|/etc/cwiid/wminput/}}. They are a good starting point for your customized settings in {{ic|~/.cwiid/wminput}} or {{ic|/usr/local/etc/cwiid/wminput}}. The general syntax is:
  
 
  Wiimote.Button = KEY_ON_KEYBOARD
 
  Wiimote.Button = KEY_ON_KEYBOARD
  
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 {{Filename|/usr/include/linux/input.h}}.
+
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 {{ic|/usr/include/linux/input.h}}.
  
 
==Troubleshooting==
 
==Troubleshooting==
Line 62: Line 63:
 
If wminput gives this error, leaving you unable to use the wiimote, try the following:
 
If wminput gives this error, leaving you unable to use the wiimote, try the following:
  
1. Create a new file in {{Filename|/etc/udev/rules.d/}} (It does not matter what the name of the file is, so long as the extension is .rules)
+
1. Create a new file in {{ic|/etc/udev/rules.d/}} (It does not matter what the name of the file is, so long as the extension is .rules)
  
 
2. Add the following to the file:
 
2. Add the following to the file:
Line 70: Line 71:
  
 
This should solve the problem. Solution was found in the forums [https://bbs.archlinux.org/viewtopic.php?id=104348 here].
 
This should solve the problem. Solution was found in the forums [https://bbs.archlinux.org/viewtopic.php?id=104348 here].
 +
 +
Solution 2:
 +
 +
1. edit the {{ic|/etc/mkinitcpio.conf}} add "uinput" in MODULES:
 +
MODULES="uinput ...."
 +
 +
2. as needed and re-generate the initramfs image with:
 +
# mkinitcpio -p linux
 +
 +
3. Reboot
  
 
==See also==
 
==See also==
 
*[[XWiimote]]
 
*[[XWiimote]]

Revision as of 14:03, 26 December 2012

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

Note: The approach shown on this page is based on software which is no longer developed upstream. There is a new effort on creating a Wii Remote driver based on the new Linux kernel Wii Remote driver. See XWiimote if you want to test the new Wii Remote software stack.

Prerequisites

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.

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 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 is 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 bulbs

  • Nintendo Wii Sensor Bar
  • Wireless sensor bar - check eBay!
  • Normal light bulbs
  • 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.

Troubleshooting

Unable to open uinput

If wminput gives this error, leaving you unable to use the wiimote, try the following:

1. Create a new file in /etc/udev/rules.d/ (It does not matter what the name of the file is, so long as the extension is .rules)

2. Add the following to the file:

KERNEL=="uinput", GROUP="wheel", MODE:="0660"

3. Reboot

This should solve the problem. Solution was found in the forums here.

Solution 2:

1. edit the /etc/mkinitcpio.conf add "uinput" in MODULES:

MODULES="uinput ...."

2. as needed and re-generate the initramfs image with:

# mkinitcpio -p linux

3. Reboot

See also