Retropie-setup: Newer & simpler method to associate Wiimote

Created on 18 Jan 2014  路  31Comments  路  Source: RetroPie/RetroPie-Setup

Hi there,

while trying to associate a non official wiimote classic controller, I found this: http://github.com/dvdhrm/xwiimote
Since recent kernel releases (including the one used by RetroPie), an optional module, hid-wiimote can be loaded using modprobe hid-wiimote, then you use sudo hidd --search to find the wiimote without a pin (bluez is not good at this, asking for a pin), and in the syslog :

Jan 18 21:55:21 raspberrypi hidd: New HID device 00:18:00:B2:F5:35 (Nintendo RVL-CNT-01)
Jan 18 21:55:21 raspberrypi kernel: [168934.199087] wiimote 0005:057E:0306.0007: hidraw0: BLUETOOTH HID v3a.1c Gamepad [Nintendo RVL-CNT-01] on 00:1A:7D:DA:71:13
Jan 18 21:55:21 raspberrypi kernel: [168934.200264] input: Nintendo Wii Remote Accelerometer as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/hci0:71/0005:057E:0306.0007/input/input30
Jan 18 21:55:21 raspberrypi kernel: [168934.201753] input: Nintendo Wii Remote IR as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/hci0:71/0005:057E:0306.0007/input/input31
Jan 18 21:55:21 raspberrypi kernel: [168934.213406] input: Nintendo Wii Remote as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/hci0:71/0005:057E:0306.0007/input/input32
Jan 18 21:55:22 raspberrypi kernel: [168935.216422] input: Nintendo Wii Remote Extension as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/hci0:71/0005:057E:0306.0007/input/input33
Jan 18 21:55:22 raspberrypi kernel: [168935.223466] input: Nintendo Wii Remote Motion+ as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/hci0:71/0005:057E:0306.0007/input/input34
Jan 18 21:55:22 raspberrypi kernel: [168935.224051] wiimote 0005:057E:0306.0007: New device registered

You can run test with evtest or xwiishow.

I wanted to share this, as it seems much simpler & integrated than the method proposed in the wiki (https://github.com/petrockblog/RetroPie-Setup/wiki/Wiimotes-with-classic-controllers).

Most helpful comment

All 31 comments

Thanks for sharing - I have just added this information to the wiki (https://github.com/petrockblog/RetroPie-Setup/wiki/Wiimotes-with-classic-controllers)!

Actually, the hid-wiimote included in 3.6.y kernel is buggy.
Here's the version I use : https://github.com/Alex131089/raspberrypi-linux/compare/raspberrypi:rpi-3.6.y...rpi-3.6.y-hid-wiimote
But to make the classic controller work with my remote (http://www.thinkgeek.com/product/f3a7/) I had to force ext as WIICLASSIC, so it's a bit hacky for this part ; the rest is only bug fix (from 3.11 version) / adaptation to be working with RetroArch (D-Pad).

Also, while a simple hidd --search handle the connection, it doesn't handle the Wii leds numerotation, I'll try to write a script that continuously search for specified Wiimote (or all) and set the right leds.

Thanks for the info - I have added that to the wiki entry for now.

I made the script, you'll find it here :
https://github.com/Alex131089/Super-RPi/blob/master/etc/profile.d/wiimote.sh
https://github.com/Alex131089/Super-RPi/tree/master/home/pi (Wiimote*)
It handle the connection and Wiimote numerotation (even on reconnect).

I also included some configuration file.
Exemple in video : http://youtu.be/YNwIkufAeeU

hid-wiimote have big changes in 3.11 kernel (extension detection, short update messages support, .. even Wiimote numerotation I think), but this kernel seems to be still under development.
Also, my modifications on the D-Pad keys (BTN instead of UP..) might be to be reapplied when adopted (or need find a way to make it work with RetroArch).

I really think this method should be used with future kernel 3.11.

@Alex131089 That looks very interesting! Could you give some instructions about the usage from your point of view?

Yep :)
I'm slowly testing the usage (mostly because I have no screen to connect to) but I'll think to make a feedback when I can then ;)
About the Connect script, the "listed MAC" method (that I wanted to avoid the Pi to pair with unwanted devices) might not be optimal, as even SSH seems to be slow when I don't pair remotes (there is n, 3 in my case, "hidd --connect" process running) :/

Hi, I'm wondering if there has been any update to this. I found that using hidd works great. Seems the 3.11 version works well with the LEDs. I used your quick script for hcitool and modified it for hidd.

It's just getting the joystick config going that's driving me nuts.
with HCITool you need to use wminput, but with hidd I thought you didn't.

Thoughts? Ideas? Progress? At this point I'm trying to just get a wii remote working .. then I'll try to get a classic controller going too.

Can you explain more what you're using (hcitool / wminput ?) / how you're doing ?
I'll have some time to work on it again this week, I'm downloading image v2.3 to see what's inside (kernel, a recent one I hope, and tools) then I'll try to make my remote work with it :)
As I learnt a bit python, I hope I could switch from bash script to python (with better MAC filtering).

Also, last time I looked at wiimotes, it seemed that we could keep remote association using MAC address, but I'm not an expert of bluetooth stack, more informations here : http://wiibrew.org/wiki/Wiimote#Bluetooth_Pairing
Edit: also :
http://www.stavros.io/posts/your-weight-online/
https://github.com/pcacjr/bluez/commit/c70a4afe4328053f462d8e30a0a787245aa7b948
http://stackoverflow.com/questions/19214805/how-can-i-permanently-pair-a-wii-balance-board-with-an-ubuntu-pc

https://github.com/dvdhrm/xwiimote/issues/4
Great to see that in 2014 Debian is still running Bluez 4.99 from 08/03/2012, which cannot pair with unofficial remote (that I use) -_-

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xrobau picture xrobau  路  7Comments

thatso picture thatso  路  4Comments

iasdeoupxe picture iasdeoupxe  路  9Comments

joolswills picture joolswills  路  5Comments

nschloe picture nschloe  路  8Comments