Linux HOW-TO setup an MCE remote via iMON IR in Ubuntu 11.10 and above
#1
This is a short HOW-TO based on the trial&error of many people including mostly those of sparkie2640 (thanks again!) and my own experience.

The iMON IR is used by some common htpc case manufactors like antec, it has become difficult to setup correctly in ubuntu and derivates since 11.10. Personally I'm currently using the official XBMCbuntu image install of Frodo beta1 and the iMON IR type 0038 receiver together with a standard MCE remote. You might be lucky and this guide also works for the ffdc type (or others if existing) or other remotes, please confirm in here if it does. You can check which iMON IR type you have with
Code:
cat /proc/bus/input/devices

The relevant output section on my system looks like this:
Code:
I: Bus=0003 Vendor=15c2 Product=0038 Version=0002
N: Name="iMON Remote (15c2:0038)"
P: Phys=usb-0000:00:04.0-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb3/3-1/3-1:1.0/rc/rc0/input5
U: Uniq=
H: Handlers=kbd event5
B: PROP=0
B: EV=100013
B: KEY=fff 0 0 4000000 108fc322 2d76041 0 0 0 4 118000 4180 10000801 9e9680 0 2000000 10004002
B: MSC=10
You'll notice your specific model in line N.

Now to get everything except the "Power On from remote" functionality to work I have to do the following:

1. Install ir-keytable
You have to use an additonal program to get the IR input recognized again called ir-keytable. To install enter:
Code:
sudo apt-get install ir-keytable


2. Reconfigure LIRC
Now we want LIRC to recognize inputs from the Linux Input Layer. You have to reconfigure LIRC by typing:
Code:
sudo dpkg-reconfigure lirc
* The blue screen should contain a listing of possible input services. Scroll to "Linux Input Layer" and select it with 'Enter'.
* The selection in the second screen depends on your system setup, I always select NONE.
* The third and last screen contains the list of devices which the Linux Input Layer should grab, for the 0038 I have to select

/dev/input/by-id/usb-15c2 0038-event-if00

This may vary depending on your specific type, see above.


3. Get ir-keytable to load the keymap on every boot
After installing ir-keytable in the first step you'll have a nice selection of keymaps lying around in /lib/udev/rc_keymaps/. Their purpose is to map your raw remote input codes to specific button labels. You could use ir-keytable right away to get the remote recognized in xbmc again, but this is lost with every shutdown. You have to write the command in
/etc/rc.local
to get it executed with every boot. So open this file with your favorite unix editor, I prefer nano:
Code:
sudo nano /etc/rc.local
Paste the following line after the comments section:
Code:
/usr/bin/ir-keytable -w /lib/udev/rc_keymaps/imon_mce
Close with 'CTRL+X' and type 'y' to save the changes.

The command points ir-keytable to the specific rc keymap to load. I have to use imon_mce, you might try out different ones if you have a different remote.

4. Create a Lircmap.xml to get unrecognized keys working in XBMC
This step is very remote specific. Depending on the used keymap some key labels might not be "understood"
by xbmc right away. I have to create a new Lircmap.xml in my homedir's xbmc/userdata, so I have to do
Code:
nano ~/.xbmc/userdata/Lircmap.xml
and put in the following content:
Code:
<lircmap>
  <remote device="linux-input-layer">
  <altname>cx23885_remote</altname>
  <altname>devinput</altname>
     <start>KEY_MEDIA</start>
     <title>KEY_EPG</title>
     <one>KEY_NUMERIC_1</one>
     <two>KEY_NUMERIC_2</two>
     <three>KEY_NUMERIC_3</three>
     <four>KEY_NUMERIC_4</four>
     <five>KEY_NUMERIC_5</five>
     <six>KEY_NUMERIC_6</six>
     <seven>KEY_NUMERIC_7</seven>
     <eight>KEY_NUMERIC_8</eight>
     <nine>KEY_NUMERIC_9</nine>
     <zero>KEY_NUMERIC_0</zero>
     <star>KEY_NUMERIC_STAR</star>
     <hash>KEY_NUMERIC_POUND</hash>
  </remote>
</lircmap>

Presto, reboot and see your MCE remote working again.

Suggestions welcome, also I don't really know if this is working with other iMON types other than 0038 right now. Please bare with typos and jerky grammar, I'm not a native english speaker.
Reply
#2
Hi gokudo

Thanks for posting this!

I followed your instructions and had an issue running the command
Code:
sudo apt-get install ir-keymap
it returned E: Unable to locate package ir-keymap

I then ran this command instead
Code:
sudo apt-get install ir-keytable

Anyways my standard MCE remote appears to be working now with my Antec Fusion Remote Micro-ATX case.
I need to test all the buttons but will report back.

EDIT: The Green Button doesn't seen to do anything.

Cheers
Reply
#3
A bit more information on the behaviour of the power button on the MCE remote.

If I am at the XBMC main menu and press the power button the PC is shutdown. If possible might need to change this to S3 Sleep instead.

Once the PC has shutdown (S5) pressing the power button on the remote does not turn the PC back on. Have to press the button on front of PC.

However if I select from the XBMC Power menu to suspend, then once in S3 Sleep, pressing the power button on the remote does wake up the PC OK.

Also just installed the XBMC WOL add-in which seems to work well and have configured it to wake up my sleeping WHS server when this XBMC client is launched.

Would be nice if Green Button took you back to the main XBMC menu ?

Thanks
Reply
#4
(2013-01-11, 13:38)cw-kid Wrote: Hi gokudo

Thanks for posting this!

I followed your instructions and had an issue running the command
Code:
sudo apt-get install ir-keymap
it returned E: Unable to locate package ir-keymap

I then ran this command instead
Code:
sudo apt-get install ir-keytable


Cheers

Oh, my bad. This was a typ0, thanks!
Reply
#5
(2013-01-11, 13:38)cw-kid Wrote: EDIT: The volume up / down doesnt do anything and neither does the green button. Is there no way to get the power button working?

Cheers

Now for the questions: Depending on your remote, even if standard mce it might send different hex-values for those buttons. So you might have to alter the keymap you're using to use YOUR specific values for these unrecognized keys. Test those with irw and write down their hex codes. Taking my example you'd habe to "sudo nano /lib/udev/rc_keymaps/imon_mce" and enter the right values for your "volume up" and "volume down" keys before KEY_VOLUMEUP and KEY_VOLUMEDOWN respectively.

As I said in the how-to, it is not possible to get the "Power On from remote" functionality to work via imon because that works on a more hardware based level which isn't supported by newer linux versions somehow for imon...at least as it seems. Mine stopped working with (XBMC)Ubuntu 11.10. I have forgotten the 'why' in detail, you can read that in other threads just search for power button and imon. I have a Asrock remote now with a built-in power on functionality on the mainboard.

It is possible to assign the green button, too.
1. Make sure your green button is recognized by keymap label in irw, if not, edit your current keymap and add the right hex-code as said above.
2. Assing the keymap label to the prefered xbmc keytag in ~/.xbmc/userdata/Lircmap.xml. Actually by creating this user defined Lircmap.xml you are overriding the one which comes with xbmc which lies in /usr/share/xbmc/system/, look it up and browse to the section under <remote device="linux-input-layer">. For every assignment you make in your homedir's Lircmap.xml you are overriding this default assignment. The default assignment contains some button labels which don't fit the ones specified in imon_mce keymap, that's why we have to create a user Lircmap.xml in the first place. The turorials example satisfied for me, but of course you're free to assign other labels and experiment a bit. See also here to see which tags are possible: http://wiki.xbmc.org/index.php?title=Keyboard.xml
Reply
#6
Thanks for the tips!

I think the reason the Volume Up/Down buttons were not doing anything on my test Ubuntu / XBMC PC is because the standard MCE remote I was using, I grabbed from my daughters room from her Linksys DMA extender. I previously setup that MCE remote to control the TV set volume in her room. Will try and dig out another standard MCE remote and test those buttons again with XBMC PC.

I will try and setup the Green Button as you suggested.

Was just reading this post here - http://fw.hardijzer.nl/?p=108

He changed the power button to put the PC in to S3 sleep rather than S5 shutdown:

"Finally because I wanted the box to sleep when pressing power instead of shutting down completely, I opened /usr/share/xbmc/system/keymaps/remote.xml and changed the line:

<power>XBMC.ShutDown()</power>

to

<power>XBMC.Sleep()</power>"

I usually have my HTPC just sleep so I think I need to try this.

Thanks
Reply
#7
Hi

I tried to fix the green button but still not working, please switch to my thread here to see what I tried.

Many thanks
Reply
#8
I can confirm this guide works with my new HTPC which is an OrigenAE M10 case and has a SoundGraph VF-310 board. I am using Ubuntu 12.10 Minimal and XBMC Frodo V12 Final.

I can also confirm I can now use my Logitech Harmony 895 with the RF to IR extender on this HTPC.

Now if only I could get the LCD working ?

I: Bus=0003 Vendor=15c2 Product=0036 Version=0003
N: Name="iMON Panel, Knob and Mouse(15c2:0036)"
P: Phys=usb-0000:00:1d.0-1.5/input1
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/input/input4
U: Uniq=
H: Handlers=kbd mouse0 event4
B: PROP=0
B: EV=100007
B: KEY=10800320 200000200000000 30000 400110000 411000000801 e168000000000 10000002
B: REL=103

I: Bus=0003 Vendor=15c2 Product=0036 Version=0003
N: Name="iMON Remote (15c2:0036)"
P: Phys=usb-0000:00:1d.0-1.5/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/rc/rc0/input5
U: Uniq=
H: Handlers=kbd event5
B: PROP=0
B: EV=100013
B: KEY=fff 0 4000000108fc322 2d7604100000000 0 400118000 418010000801 9e968000000000 200000010004002
B: MSC=10

Reply
#9
How do I exit full screen ? If I play some music and the visualization kicks in I cannot exit unless I press stop. Back / Clear / Green button etc don't seem to get me out of it and back to the main XBMC Menu.

Pressing the Back button when in the full screen visualization brings up the Audio Codec information, same as pressing O on keyboard.

EDIT: Just connected an MCE IR USB receiver to my Windows 7 laptop which has XBMC Frodo installed. When the music visualization is in full screen, I simple press the Back button on the MCE remote and it returns me to the main XBMC menu and the music continues to play etc.

This does not work on the Linux / XBMC PC, back button displays the Audio Codec Information. Yet in other areas of XBMC Back button works fine and exits dialogues


irw

00000000800100ae 00 KEY_EXIT devinput = BACK Button
000000008001006f 00 KEY_DELETE devinput = Clear Button

Testing with a Microsoft MCE remote like this one:

http://gbpvr.com/pmwiki/uploads/Hardware...e_2005.jpg

If I press the Info button once it shows two lines for it in irw


0000000080010166 00 KEY_INFO devinput = Info Button
0000000080010166 00 KEY_INFO devinput

Does the same with the Green button I get two lines, I take it this not normal.

00000000800100e2 00 KEY_MEDIA devinput = Green Button
00000000800100e2 00 KEY_MEDIA devinput

Thanks

OK so I tested each button and made a note of the irw output. Why do some buttons only produce one line whilst others produce 2 or 3 lines of output.

Microsoft Media Center Remote Control

Model: 1039

Output results from irw:

00000000800100ae 00 KEY_EXIT devinput = BACK Button
000000008001006f 00 KEY_DELETE devinput = Clear Button


0000000080010166 00 KEY_INFO devinput = Info Button
0000000080010166 00 KEY_INFO devinput


00000000800100e2 00 KEY_MEDIA devinput = Green Button
00000000800100e2 00 KEY_MEDIA devinput


0000000080010160 00 KEY_OK devinput = OK Button & Enter Button


000000008001020a 00 KEY_NUMERIC_STAR devinput = * Button
000000008001020b 00 KEY_NUMERIC_POUND devinput = # Button


0000000080010067 00 KEY_UP devinput = Up Button
000000008001006c 00 KEY_DOWN devinput = Down Button
0000000080010069 00 KEY_LEFT devinput = Left Button
000000008001006a 00 KEY_RIGHT devinput = Right Button


0000000080010080 00 KEY_STOP devinput = Stop Button
0000000080010080 00 KEY_STOP devinput
0000000080010080 00 KEY_STOP devinput
00000000800100cf 00 KEY_PLAY devinput = Play Button
00000000800100cf 00 KEY_PLAY devinput
00000000800100cf 00 KEY_PLAY devinput
0000000080010077 00 KEY_PAUSE devinput = Pause Button
0000000080010077 00 KEY_PAUSE devinput
0000000080010077 00 KEY_PAUSE devinput


00000000800100d0 00 KEY_FASTFORWARD devinput = FWD Button
00000000800100d0 00 KEY_FASTFORWARD devinput
00000000800100d0 00 KEY_FASTFORWARD devinput
00000000800100d0 00 KEY_FASTFORWARD devinput

00000000800100a8 00 KEY_REWIND devinput = REW Button
00000000800100a8 00 KEY_REWIND devinput


000000008001019c 00 KEY_PREVIOUS devinput = Replay Button
000000008001019c 00 KEY_PREVIOUS devinput
000000008001019c 00 KEY_PREVIOUS devinput

0000000080010197 00 KEY_NEXT devinput = Skip Button
0000000080010197 00 KEY_NEXT devinput
0000000080010197 00 KEY_NEXT devinput


00000000800100a7 00 KEY_RECORD devinput = Record Button
00000000800100a7 00 KEY_RECORD devinput
00000000800100a7 00 KEY_RECORD devinput
00000000800100a7 00 KEY_RECORD devinput
00000000800100a7 00 KEY_RECORD devinput



0000000080010192 00 KEY_CHANNELUP devinput = Channel Up Button
0000000080010192 00 KEY_CHANNELUP devinput
0000000080010192 00 KEY_CHANNELUP devinput

0000000080010193 00 KEY_CHANNELDOWN devinput = Channel Down Button
0000000080010193 00 KEY_CHANNELDOWN devinput
0000000080010193 00 KEY_CHANNELDOWN devinput

0000000080010073 00 KEY_VOLUMEUP devinput = Volume Up Button
0000000080010073 00 KEY_VOLUMEUP devinput

0000000080010072 00 KEY_VOLUMEDOWN devinput = Volume Down Button
0000000080010072 00 KEY_VOLUMEDOWN devinput


0000000080010071 00 KEY_MUTE devinput = Mute Button
0000000080010071 00 KEY_MUTE devinput
0000000080010071 00 KEY_MUTE devinput

000000008001016e 00 KEY_PVR devinput = Recorded TV Button
000000008001016e 00 KEY_PVR devinput
000000008001016e 00 KEY_PVR devinput

000000008001016d 00 KEY_EPG devinput = Guide Button
000000008001016d 00 KEY_EPG devinput
000000008001016d 00 KEY_EPG devinput
000000008001016d 00 KEY_EPG devinput

000000008001018f 00 KEY_GREEN devinput = Live TV Button
000000008001018f 00 KEY_GREEN devinput
000000008001018f 00 KEY_GREEN devinput

0000000080010185 00 KEY_DVD devinput = DVD Menu Button
0000000080010185 00 KEY_DVD devinput
0000000080010185 00 KEY_DVD devinput
0000000080010185 00 KEY_DVD devinput


0000000080010201 00 KEY_NUMERIC_1 devinput = Numerical Number Buttons 1-9
0000000080010202 00 KEY_NUMERIC_2 devinput
0000000080010203 00 KEY_NUMERIC_3 devinput
0000000080010204 00 KEY_NUMERIC_4 devinput
0000000080010205 00 KEY_NUMERIC_5 devinput
0000000080010206 00 KEY_NUMERIC_6 devinput
0000000080010207 00 KEY_NUMERIC_7 devinput
0000000080010208 00 KEY_NUMERIC_8 devinput
0000000080010209 00 KEY_NUMERIC_9 devinput

0000000080010200 00 KEY_NUMERIC_0 devinput = 0 (Zero) Button


0000000080010074 00 KEY_POWER devinput = PC Power Button
0000000080010074 00 KEY_POWER devinput
0000000080010074 00 KEY_POWER devinput
0000000080010074 00 KEY_POWER devinput

No response in irw from TV Power Button
Reply
#10
This is confusing

Below is the contents of the imon_mce keymap file. First question, why are some buttons listed twice ? For example Key_Right is listed twice:

0x0200004f KEY_RIGHT & 0x800ff421 KEY_RIGHT

When running IRW if I press key right the output is: 000000008001006a 00 KEY_RIGHT devinput

The hex code does not match either of the ones in the imon_mce keymap file, yet the right key is working OK.

I seem to have issues with double key presses happening, for example if I press the guide button the right click context menu flashes up and then disappears. If I hold down the guide button longer the context menu flashes up and off the screen and when I let go sometimes it stays on the screen, kinda hard to explain.

# table imon_mce, type: RC6
0x800ff415 KEY_REWIND
0x800ff414 KEY_FASTFORWARD
0x800ff41b KEY_PREVIOUS
0x800ff41a KEY_NEXT
0x800ff416 KEY_PLAY
0x800ff418 KEY_PAUSE
0x800ff419 KEY_STOP
0x800ff417 KEY_RECORD
0x02000052 KEY_UP
0x02000051 KEY_DOWN
0x02000050 KEY_LEFT
0x0200004f KEY_RIGHT
0x800ff41e KEY_UP
0x800ff41f KEY_DOWN
0x800ff420 KEY_LEFT
0x800ff421 KEY_RIGHT
0x800ff40b KEY_ENTER
0x02000028 KEY_ENTER
0x02000028 KEY_OK
0x800ff422 KEY_OK
0x0200002a KEY_EXIT
0x800ff423 KEY_EXIT
0x02000029 KEY_DELETE
0x800ff40a KEY_DELETE
0x800ff40e KEY_MUTE
0x800ff410 KEY_VOLUMEUP
0x800ff411 KEY_VOLUMEDOWN
0x800ff412 KEY_CHANNELUP
0x800ff413 KEY_CHANNELDOWN
0x0200001e KEY_NUMERIC_1
0x0200001f KEY_NUMERIC_2
0x02000020 KEY_NUMERIC_3
0x02000021 KEY_NUMERIC_4
0x02000022 KEY_NUMERIC_5
0x02000023 KEY_NUMERIC_6
0x02000024 KEY_NUMERIC_7
0x02000025 KEY_NUMERIC_8
0x02000026 KEY_NUMERIC_9
0x02000027 KEY_NUMERIC_0
0x800ff401 KEY_NUMERIC_1
0x800ff402 KEY_NUMERIC_2
0x800ff403 KEY_NUMERIC_3
0x800ff404 KEY_NUMERIC_4
0x800ff405 KEY_NUMERIC_5
0x800ff406 KEY_NUMERIC_6
0x800ff407 KEY_NUMERIC_7
0x800ff408 KEY_NUMERIC_8
0x800ff409 KEY_NUMERIC_9
0x800ff400 KEY_NUMERIC_0
0x02200025 KEY_NUMERIC_STAR
0x02200020 KEY_NUMERIC_POUND
0x800ff41d KEY_NUMERIC_STAR
0x800ff41c KEY_NUMERIC_POUND
0x800ff446 KEY_TV
0x800ff447 KEY_AUDIO
0x800ff448 KEY_PVR
0x800ff449 KEY_CAMERA
0x800ff44a KEY_VIDEO
0x800ff424 KEY_DVD
0x800ff425 KEY_TUNER
0x800ff450 KEY_RADIO
0x800ff44c KEY_LANGUAGE
0x800ff427 KEY_ZOOM
0x800ff45b KEY_RED
0x800ff45c KEY_GREEN
0x800ff45d KEY_YELLOW
0x800ff45e KEY_BLUE
0x800ff466 KEY_RED
0x800ff425 KEY_GREEN
0x800ff468 KEY_YELLOW
0x800ff41d KEY_BLUE
0x800ff40f KEY_INFO
0x800ff426 KEY_EPG
0x800ff45a KEY_SUBTITLE
0x800ff44d KEY_TITLE
0x800ff40c KEY_POWER
0x800ff40d KEY_MEDIA
Reply
#11
Thanks! Your instructions worked great for me, using an Antec Fusion Remote case and a Logitech Harmony 650 remote configured to control a Windows MCE machine.
Reply

Logout Mark Read Team Forum Stats Members Help
HOW-TO setup an MCE remote via iMON IR in Ubuntu 11.10 and above1
This forum uses Lukasz Tkacz MyBB addons.