Wiimote/Drivers

From WiiLi

(Redirected from Wiimote driver)
Jump to: navigation, search

Contents

[edit] Linux Notes

On Linux hosts, the BlueZ bluetooth drivers, included in recent 2.4 and 2.6 kernels, allow communication with Bluetooth devices. The BlueZ stack includes a kernel module, hidp, which connects to Bluetooth HID-capable devices. To instruct the kernel to connect to the Wiimote, you will need the bluez-utils package, which includes the hidd daemon. First put the Wiimote into discoverable mode, by either pressing buttons 1 and 2 on the Wiimote or using the switch hidden near the batteries. Then:

sudo hidd --search

This will scan for all HID-capable devices and connect to them. After receiving the connection, the Player LEDs will continue to blink, but the Wiimote will not power down until the connection is broken. By default, hidd will maintain the connection for 30 minutes beyond the last packet exchange. Received packets can be observed using the hcidump command:

sudo hcidump -X

Sending packets to the Wiimote requires access to the control and interrupt Bluetooth sockets established by hidd. A modified version of hidd is needed to retain these sockets, and a customized version for the Wiimote will be posted soon.

It should be noted that the HIDP driver creates a /dev/input/eventX when the Wiimote connection is established (see dmesg for a message reporting which event device it is). Preliminary tests suggest this interface is unsuitable for accessing the Wiimote because of the unusual HID information it reports. This is why a lower-level userspace daemon is thought to be required to communicate with the Wiimote directly via Bluetooth sockets.

For Mono developers: See the note below in WinXP notes for the managed lib under the .NET framework. Also, there is a Mono wrapper library in cwiid.

[edit] MacOS X Notes

DarwiinRemote 0.6 works pretty well - it allows the Wiimote to pair with OSX, and control the mouse (shakily). It supports IR sensors and accelerometers, the LEDs, rumble, and nunchuk.

See the sourceforge page for details.

There is a known problem where the Wiimote will disconnect within a few seconds of syncing or nearly immediately. This is because the Wiimote identifies itself as a HID compliant device but is not. Upon Apple's Bluetooth stack discovering the Wiimote, it attempts to treat it as a HID, but the Wiimote doesn't act right so the connection is closed. The best way to overcome this issue is to delete the Wiimote from the list of Bluetooth Devices before syncing with DarwiinRemote.

Wiiji uses a modified version of the WiiRemote.framework from DarwiinRemote and aims to make the Wii remote easily used in games. It emulates an HID compliant joystick to the system.

You also have OSCulator, an application which is originally oriented towards music creation, but that is also capable of generating keyboard combos and mouse events. Since version 2.5.1, OSCulator features a technology that solves the Wiimote connection problems, and provides reliable Wiimote discovery.

[edit] Windows XP Notes

There is a Windows "driver" called GlovePIE[1]. It can read the buttons and accelerations, and it can set the leds and the rumble.

The wiimote is accessible exactly like a USB HID device: using Delphi and the TJvHidDeviceController component. You can access all the info with the demo program (ReadWriteDemo\SimpleHIDWrite.dpr). I am using W2K.

The wiimote can be paired with Windows XP and a generic driver is installed. It appears in the game controller's panel but cannot be configured in any way.

Some people have had trouble sending reports to the Wiimote. Some people have got around this by using a different Bluetooth stack. Being unable to send reports to the Wiimote makes it impossible to read the acceleration data. The BlueSoleil Bluetooth stack is most recommended to fix these problems. The problem of sending reports occurs with the TJvHidDeviceController component; this is because the component uses the kernel32 routine WriteFile. You can make it work using HidD_SetOutputReport function (for XP only). The simple Delphi application (SimpleHIDWrite derived) you can download from www.filippoforlani.org/wii.php.

This is probably a bug of the Windows Bluetooth stack. All HID functions are implemented as DeviceIoControl calls to the HID driver. Obviously the Windows HID Bluetooth driver does not implement WriteFile correctly (it probably has been derived from the USB driver). Robert Marquardt 13:11, 28 December 2006 (EST)

There is a ManagedWii lib for use on the .NET framework (and, presumably, adaptable to Mono) for the Wiimote available at Coding4Fun's Managed Library for Nintendo's Wiimote. Brian Peek attributes this site and the WiiBrew wiki as having accomplished 99% of the work needed to determine the data I/O with the Wiimote. This library can be used from any .NET-compliant language, such as C# or Visual Basic. The download includes the library sourcecode in both C# and VB, as well as a test harness sample for both languages.

Brian also suggests that the MSI Star Key 2.0 USB adapter, which uses the WIDCOMM stack instead of the standard Windows Bluetooth stack will work just fine.

[edit] Download Drivers

[edit] Wii Homebrew

[edit] Wiimote Homebrew

  • Wiiewer Python script for plotting motion sensor data.
  • Wiimotecomm Script for connecting to a Wiimote, sending custom data and dumping any incoming data returned by the Wiimote
  • CWiid Linux Wiimote interface written in C
  • Perlwiimote Perl module for interfacing with the wiimote on linux
  • Python_driver Python based driver for OSX supporting the Nunchuck


[edit] External links


Windows
cWiimote | GlovePIE | RMX Automation | Wiim | wiimote-api | WiinRemote | WiimoteLib

Linux
CWiid | WMD | Perlwiimote | libwiimote | lg3d-wii

OSX
DarwiinRemote | Remote Buddy | The Wiinstrument

Multiplatform
OpenPIE | Wiimote_Simple | WiiremoteJ | wiiuse | WiiJuce | WiiuseJ

PyBluez Scripts: Wiiewer | Wiimotecomm


Linux
WiiLi Link | GameCube Linux | Artwork | Wiimux

Hardware
Wiimote (Drivers, Extension Port, Mii Data) | Wii balance board | Classic Controller | Nunchuk | GameCube Controller (Keyboard, GBA) | Nintendo DS
Bluetooth (BlueZ, Devices) | Ethernet Adapter | USB Devices | Wii KeyBoard Compatibility | Modchips

Homebrew
GameCube | Wii | Action Replay

Specs
Wii | Comparison

File System
Wii Optical Disc | Wii Flash Memory | SD Card | Wii Memory block Size List
GameCube Optical Disc | GameCube Memory Card

Personal tools
Online Casino - best online casino reviews.
Facebook Developers - facebook applications, facebook developers, facebook development, social network application development and viral widget social media strategy