Difference between revisions of "XWiimote"

From ArchWiki
Jump to: navigation, search
(Prerequisites: Add link to troubleshooting BlueZ and fix kernel config options)
(Connect the Wii Remote: Clarify what bluez wiimote plugin does)
Line 20: Line 20:
 
==Connect the Wii Remote==
 
==Connect the Wii Remote==
  
You can connect to your Wii Remote like any other Bluetooth device. See [[Bluetooth|Bluetooth article]] about information on pairing Bluetooth devices. The Wii Remote does not need special handling anymore.
+
You can connect to your Wii Remote like any other Bluetooth device. See the [[Bluetooth|Bluetooth article]] about information on pairing Bluetooth devices. The Wii Remote does not need special handling anymore. The BlueZ wiimote plugin handles all peculiarities in the background for you.
 +
 
 +
If you are asked for PIN input while bonding the devices, then your BlueZ bluetoothd daemon does not include the wiimote plugin. See [[#BlueZ does not include the wiimote plugin|Troubleshooting BlueZ]] for more information. If this does not help, you can still connect to your wiimote without pairing/bonding (i.e. not using authentication with a PIN). This should work with any BlueZ version. See [[#I cannot connect my wiimote|Troubleshooting Pairing]] if you still cannot connect your wiimote.
  
 
==Device Handling==
 
==Device Handling==

Revision as of 12:28, 28 December 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

This article is about the Nintendo Wii Remote Linux kernel driver. This driver is part of upstream Linux since version 3.1. It is an easy to use drop-in replacement for the older user-space drivers like cwiid. You can use your Wii Remote for all purposes with this driver, for instance as an X input device or joystick controller for your Linux games.

Prerequisites

  • Bluetooth
  • xwiimote kernel driver
  • Wii Remote hardware

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. Most recent bluez package in Arch Linux includes the wiimote plugin. See Troubleshooting BlueZ to make BlueZ include the wiimote plugin.

The kernel driver is part of upstream Linux since version 3.1. The module is called Template:Codeline. If it is not available in your kernel, you need to compile the module yourself. The Arch Linux kernel includes it starting with version 3.1.

Lastly you will need a Wii Remote, this can include (although, are not required) the Nunchuk and Classic Controller attachments.

If your kernel does not include the Template:Codeline module, you can enable it with Template:Codeline. The module needs Template:Codeline, Template:Codeline, Template:Codeline and Template:Codeline embedded in your kernel or as modules, previously loaded. Starting with kernel version 3.3 there is an additional config option Template:Codeline which is enabled by default. It controls whether wiimote extensions like Nunchuck and Classic Controller should be supported.

Connect the Wii Remote

You can connect to your Wii Remote like any other Bluetooth device. See the Bluetooth article about information on pairing Bluetooth devices. The Wii Remote does not need special handling anymore. The BlueZ wiimote plugin handles all peculiarities in the background for you.

If you are asked for PIN input while bonding the devices, then your BlueZ bluetoothd daemon does not include the wiimote plugin. See Troubleshooting BlueZ for more information. If this does not help, you can still connect to your wiimote without pairing/bonding (i.e. not using authentication with a PIN). This should work with any BlueZ version. See Troubleshooting Pairing if you still cannot connect your wiimote.

Device Handling

If your Wii Remote is connected, it will appear with several input devices inside Template:Filename. You can list all Wii Remotes with:

ls /sys/bus/hid/devices

Then you can get additional device details with:

ls /sys/bus/hid/devices/<devid>/

The default mapping for the input-keys of the Wii Remotes are not very useful. Userspace applications that re-map the Wii Remote input to more useful keys/actions are still under development [1] - available in AUR Template:Package AUR

Infrared Sources

The Wii Remote includes an infrared camera. To use this camera as a pointer input device, you need an IR-rack as an infrared source. Possible infrared sources are:

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

Troubleshooting

The input mapping is very weird

The default mapping maps the Wii Remote keys to the the key-constants which resemble the Wii Remote's buttons best. This mapping is quite useless by default. To get better mappings, use the xwiimote userspace tools.

BlueZ does not include the wiimote plugin

Upstream BlueZ includes the optional wiimote plugin since version 4.96. However, it must be enabled explicitely with Template:Codeline during compilation. The archlinux package includes the wiimote plugin since Template:Codeline. If you are unsure whether your package includes the wiimote plugin, use:

grep wiimote $(which bluetoothd)

This should say:

Binary file /usr/sbin/bluetoothd matches

You probably need to run this as root because the bluetoothd daemon resides in /usr/sbin on archlinux or simply use:

grep wiimote /usr/sbin/bluetoothd

If this matches, then your BlueZ includes the wiimote plugin and no more user-interaction is needed. If this does not match, you need to enable it yourself or work without it. If you do not want to compile your own bluez package, then you can use the wiimote without this plugin by connecting without pairing/bonding. For instance, when using Template:Codeline or Template:Codeline you need to select Template:Codeline when adding a new device.

If you want to compile the module on your own, then add Template:Codeline to your configure flags and proceed as usual. See the bluez PKGBUILD for further information.

See also