Setup wii remote

Hi,

Are there any pointers on setting up Wii Remote in RA (ArchLinux on RPi2)? I am using cwiid app to control the remote (works great in kodi), but cannot get the remote to work in RA. Any help will be appreciated.

Thanks

You shouldn’t need cwiid, bluez should be able to pair with the wiimote and the kernel xwiimote module should generate evdev events for it. Only thing you might need to do is make some changes to the udev rules so its treated as a joypad so Retroarch uses the input events.

I have not tried xwiimote. Thanks for this tip.

I currently have this udev rule I found somewhere on the net:

/etc/udev/rules.d/10-local.rules

SUBSYSTEM==“input”, ATTRS{name}==“Nintendo RVL-CNT-01”, MODE=“0666”, ENV{ID_INPUT_JOYSTICK}=“1” Any comments on the rule will be appreciated.

I also tried to use lakka, but could not get the Wii remote (+ classic controller pro) to work…

Hmm, the rule looks correct to me. There was an issue on the retroarch bug tracker ages ago that dealt with wiimotes as they send some odd events that are actually keyboard events that retroarch filtered out at the time. I think the rules needed might have been mentioned in that bug, but I’m not sure. BTW, I was incorrect about the kernel module being called xwiimote, that is just an example userspace library for writing specific wiimote handling into an application. The kernel module is hid-wiimote and you might want to make sure that is loaded into the kernel.

  • Get wii remote connected via bluetoothctl
  • hid-wiimote module loaded

No button presses register in retroarch. I can only get the D-Pad buttons to register (e.g in kodi & tty). The man page for xorg-wiimote states that e.g. the default for A (Option “MapA”) is KEY_ENTER, but that does not register at all.

Connecting the classic controller + classic controller pro also results in D-Pad buttons registering (also only in tty & kodi) …

Any other pointers will be appreciated.

Can you get events for all the buttons using evtest?

Yes, evtest registers events for Wii remote + classic controllers.

Edit:

Finally got it to work on my RPi2 with arch linux:

  • Install xwiimote-git via yaourt.

  • Install xf86-input-xwiimote-git via yoaurt (dunno if this is needed??)

  • Install the bluetooth apps using pacman (I have bluez, bluez-firmware, bluez-libs, bluez-plugins (this is for the PS3 controller, so maybe not needed - never got that to work with my 3rd PS3 party controller), bluez-utils)

  • xwiimote-git supplies the hid_wiimote module - load module with modprobe. Get this to autoload each boot.

use bluetoothctl to connect wii remote:

power on
[FONT=arial black]agent on
<press red sync button -or- 1+2>
scan on
pair <MAC of the found wiimote, use TAB for autocompletion>
connect <MAC of the wiimote>
trust <MAC of the wiimote>
[/FONT]
  • Still struggling to make the above persistant, where I just press a button/s then Wii Remote will connect automatically. Tried running sudo bluetoothctl, but I cannot seem to “save” the Wii Remote.

  • I added this udev rule.

# /etc/udev/rules.d/10-local.rules
SUBSYSTEM=="input", ATTRS{name}=="Nintendo RVL-CNT-01", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
SUBSYSTEM=="input", ATTRS{name}=="Nintendo Wii Remote Classic Controller", MODE="666", ENV{ID_INPUT_JOYSTICK}="1"

I still cannot get retroarch to recognise the Wii remote, but I got the Classic Controller + Classic Controller Pro to work by following this thread: http://libretro.com/forums/archive/index.php?t-964.html

This bit seemed to have been the magic sauce:

Then put this classic.cfg into your joypad_autoconfig_dir:

input_device = "Nintendo Wii Remote Classic Controller"
input_driver = "udev"
input_b_btn = "1"
input_y_btn = "3"
input_select_btn = "10"
input_start_btn = "9"
input_up_btn = "11"
input_down_btn = "14"
input_left_btn = "12"
input_right_btn = "13"
input_a_btn = "0"
input_x_btn = "2"
input_l_btn = "4"
input_r_btn = "5"
input_l2_btn = "6"
input_r2_btn = "7"
input_l3_btn = null
input_r3_btn = null
input_l_x_plus_btn = "h1right"
input_l_x_minus_btn = "h1left"
input_l_y_plus_btn = "h1up"
input_l_y_minus_btn = "h1down"
input_r_x_plus_btn = "h2right"
input_r_x_minus_btn = "h2left"
input_r_y_plus_btn = "h2up"
input_r_y_minus_btn = "h2down"
input_menu_toggle_btn = "8"
  • Plugging in the Classic Controller/Pro caused Retroarch to recognise the controller.
  • Initially the button configs were way off, but currently busy using my keyboard to assign the buttons on the Classic controller via the RA Settings -> Input menu option.

I will still experiment and play around with the settings/udev rules/packages… but for now I am just happy to be able to use the Classic Controllers in RA.

Regarding the issue of it not being able to auto connect, if I remember correctly, you have to do the pairing and connect pretty quickly one after the other or the wiimote won’t remember the device to connect to (its probably not the PC failing to remember the remote but the other way around). There was an issue regarding it on the xwiimote github issue tracker IIRC. Not sure why it can’t see the wiimote device at all, it won’t auto-config without a config file for it, but you should be able to create one in retroarch.

Hey OmniBlade!

  • Forgot to thank you for the tips provided!!! ThankyouThankyou!!!
  • I will try out the auto-connect tips.

A couple of issues remain:

  • For the life of me I cannot use the analogue sticks. Tried mapping/manually editing the conf file, but to no avail.
  • RA(?) seems to have an issue with using the [Home] button when mapped to bring up the RGUI menu while playing a game. The Classic controller/pro seems to disconnect a short time after pressing [Home] in-game to activate the RGUI. Remapped RGUI to [L2] seems to hopefully sort this out.