Wiimote not correctly working (RPi2)

Hi,

I have a Wiimote connected via the “MyOSMC” Bluetooth Settings. It works a little bit, it reconnects fine after reboot, i can use the arrow-buttons to move up, down, left and right.

But thats all, none of the other buttons work.

bluethooth status is active
rfkill shows no blocking
hciconfig shows “running pscan”

whats wrong? here are my logs

I’m not sure if we have ever had anyone report success or failure with a Wiimote before, it’s possible that the necessary udev rules to support it are not there.

If you run ‘irw’ from the command line using SSH, it should list what key codes are sent to Kodi when you press each button. What results do you see for each button, in particular buttons that currently don’t do anything ?

I can confirm the same behavior. Using only bluetooth no IR receiver.

Running “irw” returns nothing. Even on the arrow keys that do work.

If irw doesn’t report anything it must be detected as a keyboard.

Try enabling debug mode in Kodi then running the following command to tail the Kodi log:

tail -f /home/osmc/.kodi/temp/kodi.log

Then press buttons and see what key codes are reported in the log.

Ok so here is what I found.

21:59:02 1209.688477 T:1956413440   DEBUG: Keyboard: scancode: 0x67, sym: 0x0111, unicode: 0x0000, modifier: 0x0
21:59:02 1209.688965 T:1956413440   DEBUG: OnKey: up (0xf080) pressed, action is Up
21:59:03 1210.525635 T:1956413440   DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0
21:59:03 1210.526855 T:1956413440   DEBUG: OnKey: down (0xf081) pressed, action is Down
21:59:05 1212.851318 T:1956413440   DEBUG: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0
21:59:05 1212.852173 T:1956413440   DEBUG: OnKey: right (0xf083) pressed, action is Right
21:59:07 1213.958862 T:1956413440   DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:59:07 1213.959961 T:1956413440   DEBUG: OnKey: left (0xf082) pressed, action is Left
21:59:08 1215.722168 T:1956413440   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(304)
21:59:09 1216.767700 T:1956413440   DEBUG: Previous line repeats 1 times.
21:59:09 1216.768433 T:1956413440   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(305)
21:59:12 1219.644897 T:1956413440   DEBUG: Previous line repeats 1 times.
21:59:12 1219.645752 T:1956413440   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(412)
21:59:13 1220.401733 T:1956413440   DEBUG: Previous line repeats 1 times.
21:59:13 1220.402710 T:1956413440   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(407)
21:59:14 1221.435547 T:1956413440   DEBUG: Previous line repeats 1 times.
21:59:14 1221.435791 T:1956413440   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(316)
21:59:16 1223.158081 T:1956413440   DEBUG: Previous line repeats 1 times.
21:59:16 1223.158569 T:1956413440   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(257)
21:59:16 1223.714844 T:1956413440   DEBUG: Previous line repeats 1 times.
21:59:16 1223.714966 T:1956413440   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(258)

Up, Down, Left, Right work and are pretty self evident.

XBMCK_UNKNOWN from code(304) = (A) button

BMCK_UNKNOWN from code(305) = (B) button

XBMCK_UNKNOWN from code(407) = (+) button

XBMCK_UNKNOWN from code(412) = (-) button

XBMCK_UNKNOWN from code(316) = (Home) button

XBMCK_UNKNOWN from code(257) = (1) button

XBMCK_UNKNOWN from code(258) = (2) button

So… Hope that info leads to some answers. And thanks for help so far.

you might be able to construct a keyboard.xml to map these keys (goes in /home/osmc/.kodi/userdata/keymaps/)
from remotes
keyboard remote
and keynames
You need to take account of the comments about decimal values etc, and be prepared to experiment.
One of my keys is mapped to reloadkeymaps, so I can do quick remaps without having to restart the mediacenter or reboot.
Derek

Has there been any update to this? Anyone developed a keyboard mapping file?

In getting the same results:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
osmc@osmc:~$ hostname
osmc
osmc@osmc:~$ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:df:36:cd
inet addr:192.168.1.7 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:48298 errors:0 dropped:0 overruns:0 frame:0
TX packets:25850 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:55561724 (52.9 MiB) TX bytes:2737124 (2.6 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:400 (400.0 B) TX bytes:400 (400.0 B)

osmc@osmc:~$ irw
^C
osmc@osmc:~$ tail -f /home/osmc/.kodi/temp/kodi.log
21:34:59.842 T:1958555648 NOTICE: VideoPlayer: waiting for threads to exit21:34:59.842 T:1958555648 NOTICE: VideoPlayer: finished waiting 21:34:59.842 T:1958555648 NOTICE: CVideoPlayer::CloseFile() 21:34:59.842 T:1958555648 NOTICE: VideoPlayer: waiting for threads to exit21:34:59.842 T:1958555648 NOTICE: VideoPlayer: finished waiting 21:41:49.196 T:1958555648 ERROR: Control 50 in window 10025 has been asked to focus, but it can’t 21:41:59.298 T:1187910640 NOTICE: URLResolver: Initializing URLResolver version: 4.0.12
21:42:12.697 T:1958555648 ERROR: GetDirectory - Error getting plugin://plugin.video.covenant/?action=addItem&title=Coco
21:42:12.699 T:1958555648 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.covenant/?action=addItem&title=Coco) failed
21:42:14.660 T:1311638512 NOTICE: URLResolver: Initializing URLResolver version: 4.0.12
21:50:57.783 T:1958555648 WARNING: Cleanup: Having to cleanup texture button-nofocus.png
21:50:57.785 T:1958555648 WARNING: Cleanup: Having to cleanup texture button-focus.png
21:50:58.834 T:1751118832 WARNING: CSkinInfo: failed to load skin settings
21:52:51.793 T:1958555648 NOTICE: Log level changed to “LOG_LEVEL_DEBUG_FREEMEM”
21:52:51.794 T:1958555648 NOTICE: Enabled debug logging due to GUI setting. Level 2.
21:52:51.796 T:1958555648 DEBUG: ------ Window Init () ------
21:52:54.943 T:1958555648 DEBUG: ProcessMouse: trying mouse action rightclick
21:52:54.971 T:1958555648 DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
21:52:54.971 T:1958555648 DEBUG: ------ Window Deinit (SettingsCategory.xml) ------
21:52:54.973 T:1958555648 DEBUG: CGUIWindowManager::PreviousWindow: Activate new
21:52:54.973 T:1958555648 DEBUG: ------ Window Init (Settings.xml) ------21:53:00.928 T:1958555648 DEBUG: ------ Window Deinit (Pointer.xml) ------
21:53:02.028 T:1958555648 DEBUG: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0
21:53:02.028 T:1958555648 DEBUG: OnKey: right (0xf083) pressed, action is Right
21:53:02.202 T:1958555648 DEBUG: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0
21:53:03.720 T:1958555648 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:53:03.720 T:1958555648 DEBUG: OnKey: left (0xf082) pressed, action is Left
21:53:03.721 T:1918890992 INFO: CActiveAESink::OpenSink - initialize sink
21:53:03.722 T:1918890992 DEBUG: CActiveAESink::OpenSink - trying to open device PI:HDMI
21:53:03.722 T:1918890992 DEBUG: CAESinkPi:Initialize Format:15 Channels:2 Samplerate:44100 framesize:8 bufsize:17640 bytes/s=352800.00 dest=PI:HDMI21:53:03.723 T:1918890992 DEBUG: CAESinkPi:SetAudioProps hdmi_stream_channels 0 hdmi_channel_map 00000008
21:53:03.725 T:1918890992 DEBUG: COMXCoreComponent::Initialize OMX.broadcom.audio_render input port 100 output port 100 m_handle 0x65a0e320
21:53:03.728 T:1918890992 DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.audio_render) - port(100), nBufferCountMin(1), nBufferCountActual(2), nBufferSize(17648), nBufferAlignmen(16)
21:53:03.729 T:1918890992 DEBUG: CActiveAESink::OpenSink - SinkPi Initialized:
21:53:03.730 T:1918890992 DEBUG: Output Device : HDMI
21:53:03.730 T:1918890992 DEBUG: Sample Rate : 44100
21:53:03.730 T:1918890992 DEBUG: Sample Format : AE_FMT_FLOAT
21:53:03.731 T:1918890992 DEBUG: Channel Count : 2
21:53:03.731 T:1918890992 DEBUG: Channel Layout: FL,FR
21:53:03.731 T:1918890992 DEBUG: Frames : 2205
21:53:03.732 T:1918890992 DEBUG: Frame Size : 8
21:53:03.891 T:1958555648 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:53:05.119 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:05.119 T:1958555648 DEBUG: OnKey: left (0xf082) pressed, action is Left
21:53:05.372 T:1958555648 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:53:09.522 T:1958555648 DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0
21:53:09.522 T:1958555648 DEBUG: OnKey: down (0xf081) pressed, action is Down
21:53:09.693 T:1958555648 DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0
21:53:11.327 T:1958555648 DEBUG: Keyboard: scancode: 0x67, sym: 0x0111, unicode: 0x0000, modifier: 0x0
21:53:11.328 T:1958555648 DEBUG: OnKey: up (0xf080) pressed, action is Up21:53:11.587 T:1958555648 DEBUG: Keyboard: scancode: 0x67, sym: 0x0111, unicode: 0x0000, modifier: 0x0
21:53:12.360 T:1958555648 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:53:12.361 T:1958555648 DEBUG: OnKey: left (0xf082) pressed, action is Left
21:53:12.653 T:1958555648 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:53:14.095 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(412)
21:53:16.801 T:1759507440 DEBUG: Previous line repeats 1 times.
21:53:16.801 T:1759507440 DEBUG: script.module.osmcsetting.updates : - blurp 937 - Settings.xml
21:53:19.152 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(407)
21:53:24.277 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:24.277 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(257)
21:53:25.068 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:25.069 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(258)
21:53:26.276 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:26.277 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(316)
21:53:27.112 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:27.112 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(305)
21:53:28.228 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:28.228 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(304)
21:53:36.295 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:36.295 T:1958555648 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:53:36.295 T:1958555648 DEBUG: OnKey: left (0xf082) pressed, action is Left
21:53:36.464 T:1958555648 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
21:53:36.995 T:1958555648 DEBUG: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0
21:53:36.996 T:1958555648 DEBUG: OnKey: right (0xf083) pressed, action is Right
21:53:37.126 T:1958555648 DEBUG: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0
21:53:37.787 T:1958555648 DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0
21:53:37.787 T:1958555648 DEBUG: OnKey: down (0xf081) pressed, action is Down
21:53:37.911 T:1958555648 DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0
21:53:38.878 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(304)
21:53:39.387 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:39.388 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(412)
21:53:39.962 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:39.963 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(316)
21:53:40.504 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:40.505 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(407)
21:53:41.202 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:41.203 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(257)
21:53:41.624 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:41.625 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(258)
21:53:42.252 T:1958555648 DEBUG: Previous line repeats 1 times.
21:53:42.253 T:1958555648 DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey returned XBMCK_UNKNOWN from code(305)