# HOWTO: iMon MCE kernel IR with lirc & lcdproc (15c2:0038)

## danomac

HOWTO: Using an MCE iMon device with kernel IR, lirc, and lcdproc

I have a Silverstone case with the iMon LCD/IR package. After the lirc changes (migration to in-kernel) I did make an early attempt at getting it working. However, I spent a couple of days trying to get it to work, and absolutely nothing would work. Eventually I got the LCD working on that attempt, but I never did get the IR working.

Now that it's been a while, I decided to try this again and attempt to document what I've done in order to get it to work.

Known Issues / Notes

Lirc and lcdproc need to be started AFTER modifying the keymaps, in that order. If you modify before, there's a (high) chance ir-keytable will hang the boot process! See Making it all work together in the Table of Contents.

Prerequisites

-You need an iMon device! The one I have is:

```

# lsusb

Bus 005 Device 002: ID 15c2:0038 SoundGraph Inc. GD01 MX VFD Display/IR Receiver

```

-The specific examples are amd64 (such as unmasking packages) - if you're using a 32-bit install, adjust accordingly.

-It's highly recommended that you install the latest versions of the packages needed.

-In order for the LCD to work properly, you need lcdproc-0.5.5 or higher.

Summary

In order to get it working, there are a few major steps:

Configure the kernel

Install userspace helper tools

Testing the kernel IR

Installing & configuring lirc

Setting custom keycodes

Installing lcdproc

Making it all work together (initscript modification)

Troubleshooting

Conclusion

Configuring the kernel

Configure the kernel as follows:

```

Device Drivers  --->

   <*> Multimedia support  --->

      <*>   Remote Controller adapters  --->

         <*>   Compile Remote Controller keymap modules

         <*>   Enable IR raw decoder for the RC6 protocol

         <*>   Enable IR to LIRC bridge

         <M>   SoundGraph iMON Receiver and Display

```

I wound up building the keymap modules into the kernel - I was having stability problems before I did. Technically speaking, these are optional, especially if you are going to override them (like later in this Howto.)

Reboot into the new kernel.

Install userspace helper tools

The kernel is now using keytables in order to generate IR events. In other words, the kernel is supposed to generate actual keypresses when you press a button on your remote (making lirc redundant/obsolete.) What we need to do is install some userspace tools that will provide and allow us to modify these keytables and test the actual kernel IR itself. In gentoo, the package we need to install the newest version of media-tv/v4l-utils:

```

# echo "media-tv/v4l-utils ~amd64" >> /etc/portage/package.keywords

# emerge -av v4l-utils

```

Testing the kernel IR

Before doing anything with any other packages, we need to make sure the kernel IR is working.

The program we'll be using is ir-keytable. This program is like the swiss-army knife for kernel IR. It allows you to view recognized devices, load custom keymaps, switch IR protocols on recognized IR receivers, and even test them (similar to `irw` used with lirc.)

First, let's list devices:

```

# ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event15) with:

        Driver imon, table rc-imon-pad

        Supported protocols: RC-6 other 

        Enabled protocols:  

        Repeat delay = 500 ms, repeat period = 125 ms

```

That's good news, it sees the IR receiver! It is the imon receiver. So what does "table rc-imon-pad" mean? This is the remote keys that are currently loaded by the kernel. In this case, it assumes you want to use the original iMon remote. This device also supports MCE-like remotes (protocol RC-6.)

When the driver was loaded, it didn't enable either protocol (which means it won't respond to any IR) - that's why the 'Enabled protocols' is blank.

I like to use the MCE remote, so we're going to change it. When the v4l-utils package was installed, it also installed a bunch of new keymaps under /etc/rc_keymaps. The two that pertain to the iMon are imon_pad and imon_mce. So, to load the new remote and switch IR protocols:

```

# ir-keytable -c -p rc-6 -w /etc/rc_keymaps/imon_mce

Read imon_mce table

Old keytable cleared

Wrote 77 keycode(s) to driver

Protocols changed to RC-6 

# ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event15) with:

        Driver imon, table rc-imon-pad

        Supported protocols: RC-6 other 

        Enabled protocols: RC-6 

        Repeat delay = 500 ms, repeat period = 125 ms

```

Well, it looks like it updated the kernel driver. Don't worry about the table listed, it seems that when you do a custom keymap it doesn't get updated. How useful. Now it should respond to keypresses:

```

# ir-keytable -t

Testing events. Please, press CTRL-C to abort.

1347818338.172322: event MSC: scancode = 800ff416

1347818338.172326: event key down: KEY_PLAY (0x00cf)

1347818338.172326: event sync

1347818338.276315: event MSC: scancode = 800ff416

1347818338.276316: event sync

1347818338.526047: event key up: KEY_PLAY (0x00cf)

1347818338.526047: event sync

1347818338.612318: event MSC: scancode = 2000028

1347818338.612319: event key down: KEY_OK (0x0160)

1347818338.612320: event sync

1347818338.724319: event MSC: scancode = 2000028

1347818338.724320: event sync

1347818338.828320: event MSC: scancode = 2000028

1347818338.828321: event sync

1347818338.932319: event key up: KEY_OK (0x0160)

1347818338.932320: event sync

1347818339.700325: event MSC: scancode = 800ff419

1347818339.700328: event key down: KEY_STOP (0x0080)

1347818339.700329: event sync

1347818339.812324: event MSC: scancode = 800ff419

1347818339.812325: event sync

1347818339.916324: event MSC: scancode = 800ff419

1347818339.916325: event sync

1347818340.166047: event key up: KEY_STOP (0x0080)

1347818340.166047: event sync

^C

#

```

Great! Now that we know this is working, we can move on.

Installing & configuring lirc

The problem with this "new" method is that it does map direct keypresses. This can be a problem, especially if you're used to having different lircrc tables for each program - you'd have to modify the keyboard keybindings for each program to be the same, which is, uh, not intuitive.  What we can do is wedge lirc between the kernel IR and the applications to maintain compatibility. Time to install lirc. 

lirc interfaces with the new kernel IR with devinput, so set this in make.conf:

```

# Remote (LIRC) configuration

LIRC_DEVICES="devinput"

```

Now emerge lirc:

```

# emerge -av lirc

```

Once, lirc is installed, it should install a new /etc/lirc/lirc.conf (I'll post the first few lines of it here):

```

# generated by devinput.sh

begin remote

        name            devinput

        bits            16

        eps             30

        aeps            100

        pre_data_bits   16

        pre_data        0x0001

        post_data_bits  32

        post_data       0x00000001

        gap             132799

        toggle_bit      0

        begin codes

                KEY_0                   11

                KEY_102ND               86

                KEY_1                   2

                KEY_2                   3

                KEY_3                   4

                KEY_4                   5

                KEY_5                   6

                KEY_6                   7

                KEY_7                   8

                KEY_8                   9

                KEY_9                   10

                KEY_A                   30

                ...

```

If this was not installed, it's possible that you've selected more than one remote (and you have to do it manually.)

Now we need to configure the lircd daemon. We need to tell it to listen to devinput IR events. ir-keytable can help us here:

```

# ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event15) with:

        Driver imon, table rc-imon-pad

        Supported protocols: RC-6 other 

        Enabled protocols: RC-6 

        Repeat delay = 500 ms, repeat period = 125 ms

```

As we can see, the IR is coming through /dev/input/event15. However, we shouldn't tell lirc to listen to this directly (what happens if the IR gets plugged into a different USB port? It stops working.) To get around this, we'll tell it to listen to the device by it's device id:

```

# # ls -l /dev/input/by-id/

total 0

lrwxrwxrwx 1 root root 10 Sep 16 09:43 usb-15c2_0038-event-if00 -> ../event15

lrwxrwxrwx 1 root root 10 Sep 16 09:43 usb-15c2_0038-event-mouse -> ../event14

lrwxrwxrwx 1 root root  9 Sep 16 09:43 usb-15c2_0038-mouse -> ../mouse0

lrwxrwxrwx 1 root root 10 Sep 16 09:43 usb-Lite-On_Technology_USB_Productivity_Option_Keyboard__has_the_hub_in_#_1__-event-if01 -> ../event17

lrwxrwxrwx 1 root root 10 Sep 16 09:43 usb-Lite-On_Technology_USB_Productivity_Option_Keyboard__has_the_hub_in_#_1__-event-kbd -> ../event16

lrwxrwxrwx 1 root root 10 Sep 16 09:53 usb-Microsoft_Microsoft_Optical_Mouse_with_Tilt_Wheel-event-mouse -> ../event18

lrwxrwxrwx 1 root root  9 Sep 16 09:53 usb-Microsoft_Microsoft_Optical_Mouse_with_Tilt_Wheel-mouse -> ../mouse1

```

As we can see, /dev/input/event15 is /dev/input/by-id/usb-15c2_0038-event-if00 - this is what we'll use to configure lircd:

Edit /etc/conf.d/lircd, uncomment and edit the appropriate line:

```

# Options to pass to the lircd process

# for devices with lirc-kernel-module

#LIRCD_OPTS="-d /dev/lirc0"

#LIRCD_OPTS="-d /dev/lirc"

# for devices using the input-layer

LIRCD_OPTS="-H devinput -d /dev/input/by-id/usb-15c2_0038-event-if00"

# This should work, Bug #235107

#LIRCD_OPTS="-H devinput -d name=*DVB*"

# set default protocol to 'lirc' for in-kernel IR decoding

# for the following entries in /sys/class/rc/

# (space-separated list if there is more than one)

LIRCD_SET_SYSCLASSRCS="rc0"

# If running mulitple instances of lircd, the following

# can be used to override the default socket path and

# socket symlink

#LIRCD_SOCKET="/var/run/lirc/lircd"

#LIRCD_SYMLINKFILE="/dev/lircd"

```

Now we can start lircd:

```

# /etc/init.d/lircd start

* Starting lircd ...            [ ok ]

```

Then use irw to see if lirc is receiving anything (press some keys on the remote after starting irw, the Ctrl+C to stop):

```

# irw

00000000800100cf 00 KEY_PLAY devinput

0000000080010160 00 KEY_OK devinput

0000000080010080 00 KEY_STOP devinput

```

Lirc is now set up.

Setting custom keycodes

My MCE remote has an extra key, which I was using with irexec. I wanted to be able to use this key still, so I edited the keymap.

First, we need to figure out if the key responds (we can use ir-keytable for this):

```

# ir-keytable -t

1347818638.173362: event MSC: scancode = 800ff465

```

OK, we have a scancode. Now we need to map it to an existing key. To see what keys are available, look in /etc/lirc/lircd.conf. I decided to map it to the FN+F1 key.

To actually make the change, I edited /etc/rc_keymaps/imon_mce and added:

```

0x800ff465 KEY_FN_F1

```

After you make changes you need to update the driver:

```

# ir-keytable -c -p rc-6 -w /etc/rc_keymaps/imon_mce

Read imon_mce table

Old keytable cleared

Wrote 78 keycode(s) to driver

Protocols changed to RC-6 

```

Test the code with `ir-keytable -t` or `irw` to make sure it works.

Installing lcdproc

In order to get the LCD to work, we need to install lcdproc. This specific device needs the imon_lcd driver, so add this to your /etc/portage/make.conf:

```

# LCD Device driver support

LCD_DEVICES="imonlcd"

```

You will need to install lcdproc-0.5.5 or newer to get support for this new driver (at the time of writing this, it's masked):

```

# echo "app-misc/lcdproc ~amd64" >> /etc/portage/package.keywords

# emerge -av lcdproc

```

The ebuild should set the imonlcd driver for you, but you need to set a couple of options for it to work, so edit the config file /etc/LCDd.conf:

```

[imonlcd]

# Specify which iMon protocol should be used

# [legal: 0, 1; default: 0]

# Choose 0 for 15c2:ffdc device,

# Choose 1 for 15c2:0038 device

Protocol=1

# Set the exit behavior [legal: 0-2; default: 1]

# 0 means leave shutdown message,

# 1 means show the big clock,

# 2 means blank device

OnExit=2

# Select the output device to use [default: /dev/lcd0]

Device=/dev/lcd0

# Select the displays contrast [default: 200; legal: 0-1000]

Contrast=200

# Specify the size of the display in pixels [default: 96x16]

#Size=96x16

# Set the backlight state [default: on; legal: on, off]

#Backlight=on

# Set the disc mode [legal: 0,1; default: 0]

# 0 => spin the "slim" disc - two disc segments,

# 1 => their complement spinning;

#DiscMode=0

```

I always set the LCD to blank/turn off on shutdown. (OnExit=2)

Make sure you use the correct protocol.

Making it all work together (initscript modification)

I discovered an unusual problem when setting up the rc-scripts to start all the services involved. If you modify the keycode tables and/or protocols after LCDd and lircd have started, you run the risk of hanging the boot process (it seems ir-keytable sometimes hangs.) So using a start script in /etc/local.d/ is out of the question - I had to use a live CD to remove it so I could boot again. The failure rate I experienced was high after testing it - 80% of the time ir-keytable would hang.

Unfortunately the only way for me to get this working reliably was to modify /etc/init.d/lircd and /etc/init.d/LCDd in order to modify the keytable and control the order of the scripts.

/etc/init.d/LCDd (only thing added is the 'after lircd' line):

```

#!/sbin/runscript

# Copyright 1999-2012 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/app-misc/lcdproc/files/0.5.1-LCDd.initd,v 1.3 2012/05/10 09:33:55 pacho Exp $

depend() {

        use net

        use g15daemon

        after lircd

}

start() {

        ebegin "Starting LCDd"

        start-stop-daemon --start --quiet -m --pidfile /var/run/LCDd.pid \

                --background --exec /usr/sbin/LCDd -- -s 1 -f

        eend $? "Failed to start LCDd. Did you remember to set a driver in /etc/LCDd.conf? See syslog for details."

}

stop() {

        ebegin "Stopping LCDd"

        start-stop-daemon --stop --quiet --pidfile /var/run/LCDd.pid

        eend $?

}

```

There were a few modifications to /etc/init.d/lircd - one to change the dependency order, one to change the notification at startup, and one to modify the keytable and change the IR protocol. This is the full initscript:

```

#!/sbin/runscript

# Copyright 1999-2012 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/lircd-0.8.6-r2,v 1.1 2012/07/19 19:52:17 axs Exp $

PIDFILE=/var/run/lirc/${SVCNAME}.pid

: ${LIRCD_SYMLINKFILE:=/dev/lircd}

: ${LIRCD_SOCKET:=/var/run/lirc/lircd}

depend() {

        need localmount

        use modules

        provide lirc

        before LCDd

}

start() {

        local retval

        ebegin "Starting lircd (updating keytable first)"

        /usr/bin/ir-keytable -c -p rc-6 -w /etc/rc_keymaps/imon_mce &> /dev/null

        for retval in ${LIRCD_SET_SYSCLASSRCS} ; do

                if [ -e /sys/class/rc/${retval}/protocols ] && \

                grep 'lirc' /sys/class/rc/${retval}/protocols &>/dev/null ; then

                        einfo "Setting lirc protocol active for ${retval}"

                        echo lirc >/sys/class/rc/${retval}/protocols

                fi

        done

        checkpath -q -d -m 0755 -o root:root /var/run/lirc

        rm -Rf ${LIRCD_SOCKET} && ln -s ${LIRCD_SOCKET} ${LIRCD_SYMLINKFILE}

        if [ $? -ne 0 ]; then

                eend $? "Unable to create symbolic link ${LIRCD_SYMLINKFILE}"

                return 1

        fi

        start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd -- \

                -P "${PIDFILE}" ${LIRCD_OPTS}

        retval=$?

        if [ ${retval} -ne 0 ]; then

                rm -Rf ${LIRCD_SOCKET}

        fi

        eend ${retval}

}

stop() {

        ebegin "Stopping lircd"

        rm -f ${LIRCD_SYMLINKFILE}

        start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd

        eend $?

}

```

Once the scripts are done, add them to the default runlevel:

```

# rc-update add LCDd default

# rc-update add lircd default

```

Reboot the PC. Once it's back up, use `irw` and press some buttons to make sure the remote is working.

Troubleshooting

No output from `ir-keytable -t`? Stop lircd first.

Remote not working? It's almost always because ir-keytable silently failed.

In order to use ir-keytable to test this, you have to stop lircd first. Then type `ir-keytable` with no options and make sure the right protocol is enabled. If it isn't, set it manually and try running `ir-keytable -t`. Once you get ir-keytable working, restart lircd and test with irw.

Conclusion

Now with everything set up, you may want to add 'lirc' and 'lcd' to your USE-flags to build appropriate support. Once that's done, you'll need to build your own .lircrc files to pass codes on to programs (this is outside the scope of this HowTo.)

I just realized none of my existing lircrc files will work, so now I have to redo them all! What fun!

----------

## jonsag

Excellent

Finally I seem to have made a successful transition to lirc-0.9.0 thanks to your guide!

----------

## danomac

Great, glad it helped.  :Wink:  Did you also have an iMon device? 

Now that I think about it, the framework is there to set up other remote receivers too. I kept putting the upgrade off, mostly because I tried once while it was in the staging area of the kernel and I just couldn't get the damn thing to work. My mythtv frontend was on 2.6.32 until yesterday.  :Embarassed: 

----------

## steveybaby2

Thanks for the guide danomac. Did you manage to get your 15c2:0038 device working with the original iMON remote using the imon_pad keymap too?

I'm having real trouble getting it working - I get nothing when cat'ing the eventX attached to it, and ir-keytable gives me a segfault when I try to set the table:

saruman steve # ir-keytable -c -w /etc/rc_keymaps/imon_pad -d /dev/input/event5

Read imon_pad table

Old keytable cleared

Wrote 90 keycode(s) to driver

Segmentation fault

No-one on the lirc mailling list have responded so I don't know if its an isolated case.

----------

## danomac

I didn't bother, I don't like the iMon remote. So I can't say if it will work or not...

What's the output of `ir-keytable` with no parameters? Do you have more than one IR device in your computer?

----------

## steveybaby2

I do have more than one IR device, do you think this could be affecting it? I did wonder myself, but thought using the -d would get around it.

saruman steve # ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event5) with:

	Driver imon, table rc-empty

	Supported protocols: RC-6 other 

	Enabled protocols: 

	Repeat delay = 500 ms, repeat period = 125 ms

Found /sys/class/rc/rc1/ (/dev/input/event7) with:

	Driver budget_ci, table rc-empty

	Supported protocols: 

	Enabled protocols: 

	Repeat delay = 500 ms, repeat period = 125 ms

Found /sys/class/rc/rc2/ (/dev/input/event8) with:

	Driver cx88xx, table rc-empty

	Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ other 

	Enabled protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC RC-5-SZ other 

	Repeat delay = 500 ms, repeat period = 125 ms

----------

## danomac

On mine I only had the one remote control, and I only built the imon driver.

Another thing that it could possibly be unhappy about is you're not setting a protocol. I'd try using the system class identifiers, in your case:

```

$  ir-keytable -s rc0 -c -w /etc/rc_keymaps/imon_pad -p other

```

Edit: You're not running LCDd or lircd when doing this, are you? You need to make changes before starting either.

Edit2: What's the contents of /etc/rc_keymaps/imon_pad? Post it in here (or use pastebin), maybe there's something wrong with it? Have you tried using imon_mce? Does it segfault too? If it doesn't maybe compare the two files, maybe it's crashing on file formatting. I doubt it, but I guess it could happen...

----------

## steveybaby2

I've just done some testing and blacklisted the other IR device modules, so the iMON is the only device listed in ir-keytable. That didn't seem to make a difference. However, by using the system class IDs instead of the event device I did get ir-keytable to complete (although specifying the protocol didn't go down well):

```
saruman steve # ir-keytable -s rc0 -c -w /etc/rc_keymaps/imon_pad       

Read imon_pad table

Old keytable cleared

Wrote 90 keycode(s) to driver

Protocols changed to other 

saruman steve # ir-keytable -s rc0 -c -w /etc/rc_keymaps/imon_pad -p other

Read imon_pad table

Invalid parameter(s)

ir-keytable: -p: (PROGRAM ERROR) Option should have been recognized!?

Try `ir-keytable --help' or `ir-keytable --usage' for more information.
```

Even after this, I'm still not getting output from it when testing with ir-keytable. When I cat /dev/input/event5 and hit some keys, there's no output like I had with an old build of lirc. Do you get any output when cat'ing your ir device?

Since reading you guide, I've left LCDd and lirc off to try and get this working.

```
saruman steve # cat /etc/rc_keymaps/imon_pad 

# table imon_pad, type: OTHER

0x2a8195b7 KEY_REWIND

0x298315b7 KEY_REWIND

0x2b8115b7 KEY_FASTFORWARD

0x2b8315b7 KEY_FASTFORWARD

0x2b9115b7 KEY_PREVIOUS

0x298195b7 KEY_NEXT

0x2a8115b7 KEY_PLAY

0x2a8315b7 KEY_PLAY

0x2a9115b7 KEY_PAUSE

0x2b9715b7 KEY_STOP

0x298115b7 KEY_RECORD

0x01008000 KEY_UP

0x01007f00 KEY_DOWN

0x01000080 KEY_LEFT

0x0100007f KEY_RIGHT

0x2aa515b7 KEY_UP

0x289515b7 KEY_DOWN

0x29a515b7 KEY_LEFT

0x2ba515b7 KEY_RIGHT

0x0200002c KEY_SPACE

0x2a9315b7 KEY_SPACE

0x02000028 KEY_ENTER

0x28a195b7 KEY_ENTER

0x288195b7 KEY_EXIT

0x02000029 KEY_ESC

0x2bb715b7 KEY_ESC

0x0200002a KEY_BACKSPACE

0x28a115b7 KEY_BACKSPACE

0x2b9595b7 KEY_MUTE

0x28a395b7 KEY_VOLUMEUP

0x28a595b7 KEY_VOLUMEDOWN

0x289395b7 KEY_CHANNELUP

0x288795b7 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

0x28b595b7 KEY_NUMERIC_1

0x2bb195b7 KEY_NUMERIC_2

0x28b195b7 KEY_NUMERIC_3

0x2a8595b7 KEY_NUMERIC_4

0x299595b7 KEY_NUMERIC_5

0x2aa595b7 KEY_NUMERIC_6

0x2b9395b7 KEY_NUMERIC_7

0x2a8515b7 KEY_NUMERIC_8

0x2aa115b7 KEY_NUMERIC_9

0x2ba595b7 KEY_NUMERIC_0

0x02200025 KEY_NUMERIC_STAR

0x28b515b7 KEY_NUMERIC_STAR

0x02200020 KEY_NUMERIC_POUND

0x29a115b7 KEY_NUMERIC_POUND

0x2b8515b7 KEY_VIDEO

0x299195b7 KEY_AUDIO

0x2ba115b7 KEY_IMAGES

0x28a515b7 KEY_TV

0x29a395b7 KEY_DVD

0x29a295b7 KEY_DVD

0x2ba385b7 KEY_MENU

0x2ba395b7 KEY_MENU

0x288515b7 KEY_BOOKMARKS

0x2ab715b7 KEY_CAMERA

0x298595b7 KEY_SUBTITLE

0x2b8595b7 KEY_LANGUAGE

0x29a595b7 KEY_ZOOM

0x2aa395b7 KEY_SCREEN

0x299115b7 KEY_KEYBOARD

0x299135b7 KEY_KEYBOARD

0x01010000 BTN_LEFT

0x01020000 BTN_RIGHT

0x01010080 BTN_LEFT

0x01020080 BTN_RIGHT

0x688301b7 BTN_LEFT

0x688481b7 BTN_RIGHT

0x2a9395b7 KEY_CYCLEWINDOWS

0x2b8395b7 KEY_TIME

0x289115b7 KEY_POWER

0x29b195b7 KEY_EJECTCD

0x299395b7 KEY_EJECTCLOSECD

0x02800000 KEY_CONTEXT_MENU

0x2b8195b7 KEY_CONTEXT_MENU

0x02000065 KEY_COMPOSE

0x28b715b7 KEY_COMPOSE

0x2ab195b7 KEY_MEDIA

0x29b715b7 KEY_DASHBOARD
```

Thanks

Steve

----------

## danomac

Use:

```

$ ir-keytable -t

```

To test for events.

Did you try changing the protocol to rc-6 to see if that works? I'm not sure what else to pass to the imon driver to get its proprietary protocol working.

Edit: Wait a second, the first command switched the protocol to other when you applied the keymap.

Try `ir-keytable` with no parameters after running that first command again, and see if it lists the enabled protocol.

If it does, use `ir-keytable -t` and press a few buttons on the remote to test it. Heck, use `ir-keytable -t` to listen for events even if it doesn't appear to be enabled.

----------

## steveybaby2

Checked to see if ir-keytable listed the set protocol, but it just shows blank and ignores my keypresses:

```
saruman ~ # ir-keytable -s rc0 -c -w /etc/rc_keymaps/imon_pad         

Read imon_pad table

Old keytable cleared

Wrote 90 keycode(s) to driver

Protocols changed to other 

saruman ~ # ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event5) with:

   Driver imon, table rc-empty

   Supported protocols: RC-6 other 

   Enabled protocols: 

   Repeat delay = 500 ms, repeat period = 125 ms

saruman ~ # ir-keytable -t

Testing events. Please, press CTRL-C to abort.

^C

saruman ~ # 

```

If I try to set the protocol to rc-6, it seems to take, but again I get no output:

```
saruman ~ # ir-keytable -s rc0 -c -w /etc/rc_keymaps/imon_pad -p rc-6

Read imon_pad table

Old keytable cleared

Wrote 90 keycode(s) to driver

Protocols changed to RC-6 other 

saruman ~ # ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event5) with:

   Driver imon, table rc-empty

   Supported protocols: RC-6 other 

   Enabled protocols: RC-6 

   Repeat delay = 500 ms, repeat period = 125 ms

saruman ~ # ir-keytable -t

Testing events. Please, press CTRL-C to abort.

^C

saruman ~ # 
```

Still nothing from 

```
cat /dev/input/event5
```

 .

----------

## danomac

As I said in my earlier post, I've not tried the original remote. I did a quick google and people seem to struggle to get the imon remote working, and when they do the pad part doesn't seem to work? If I remember right I used it originally with the old lirc setup and it was treated like a mouse. That's why I started using the MCE remote.

If you set the protocol to RC-6 you need to use a Microsoft remote (or philips remote?) with it, the imon remote will not work. Do you have a universal remote that you can program lying around? Actually, I'd bet an xbox remote would work if you have one lying around. At least you could test it.

I don't want to start messing with my install, I only have one imon controller and that's in my living room, I don't want to break the config for obvious reasons.

I find it weird that it says it changes the protocol to other when you put in the imon_pad keymap, but it doesn't show in enabled protocols... what kernel are you using?

If you do have a Microsoft remote lying around try it with the mce keymap and rc6 protocol. When you run ir-keytable -t are you pressing a bunch of buttons in the test mode? I remember when I was setting up mine I had to press a few buttons before it responded.

----------

## steveybaby2

Yeah, I can appreciate you wouldn't want to go messing with your setup after getting it all working, I'd be the same   :Smile: 

I am considering just buying an MCE remote rather than fixing this (I'm sick of my wireless keyboard for one), but first I'm going to try booting into a new genkernel I've just created to see if it helps (my current kernel is manually build). I'll post how I get on...

----------

## steveybaby2

After trying both a hand-rolled kernel with all driver options selected, and also the genkernel based kernel, neither helped to get the iMON remote working. Oh well, time to buy some different hardware I guess.

----------

## danomac

 *steveybaby2 wrote:*   

> After trying both a hand-rolled kernel with all driver options selected, and also the genkernel based kernel, neither helped to get the iMON remote working. Oh well, time to buy some different hardware I guess.

 

A tip: a cheap harmony universal remote will get you the ability to use the Microsoft remote, and it might be cheaper... I've seen some of the cheaper Harmonies sell for $25.

Edit: Here's one for £14.

----------

