[LINUX] HOW-TO get Hama MCE Remote Control to fully work in Ubuntu 9.04 - lx_cool_j - 2009-12-02 23:10
i finally got the hama mce remote control to work properly under ubuntu 9.04 with xbmc after about a week doing a lot of research and testing.
i use this remote control and got almost every key to work in xbmc.
in this tutorial, [xbmc-user] is a placeholder for your xbmc user.
please note that some keys have the same mapping (for example: "OK", "Start" and "Enter" or "i" and the right mouse button). some keys send three commands to the ir receiver, but in the lircd.conf, i only entered one, otherwise it didn't work, because xbmc only catches the first key sent.
log in as your standard xbmc user and install the latest lirc:
Code:
sudo apt-get install lirc
In the lirc configuration tool, that opens up after installation, select "None" in every screen.
after the installation has been completed, edit the following files:
/etc/lirc/lircd.conf
Code:
begin remote
name hama_52451
bits 32
begin codes
HOMEPAGE 0x100ac
POWER 0x1008e
YELLOW 0x10014
BLUE 0x10032
GREEN 0x10017
RED 0x10012
TV 0x10018
PICTURES 0x10022
REWIND 0x10030
FASTFORWARD 0x10021
PREV 0x100a5
NEXT 0x100a3
PLAYPAUSE 0x100a4
STOP 0x100a6
REC 0x10013
BACK 0x1000e
INFO 0x10111
UP 0x10067
LEFT 0x10069
RIGHT 0x1006a
DOWN 0x1006c
ENTER 0x1001c
BTN_LEFT 0x10110
VOLUMEUP 0x10073
VOLUMEDOWN 0x10072
MUTE 0x10071
CHANNELUP 0x10068
CHANNELDOWN 0x1006d
1 0x1004f
2 0x10050
3 0x10051
4 0x1004b
5 0x1004c
6 0x1004d
7 0x10047
8 0x10048
9 0x10049
0 0x10052
STERN 0x10037
CLOSE 0x1003e
CLEAR 0x10001
end codes
end remote
/etc/lirc/hardware.conf
Code:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="None"
REMOTE_MODULES="lirc_atiusb lirc_dev"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS="-r"
#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""
#Enable lircd
START_LIRCD="true"
#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"
#Try to load appropriate kernel modules
LOAD_MODULES="true"
# Default configuration files for your hardware if any
LIRCMD_CONF="lircd.conf"
#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="true"
START_LIRCMD=""
add the following code to
/etc/modprobe.d/blacklist.conf
Code:
blacklist ati_remote
add the following code (IMPORTANT: the entry has to be written before "exit 0") to
/etc/rc.local
Code:
./home/[xbmc-user]/lircstart.sh
read out the event numbers for your hid:
Code:
cat /proc/bus/input/devices
you get something like this (i only copied the important entries containing Name="HID...):
Code:
I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
N: Name="HID 05a4:9881"
P: Phys=usb-0000:00:04.0-3/input0
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb2/2-3/2-3:1.0/input/input3
U: Uniq=
H: Handlers=kbd [b]event3[/b]
B: EV=120013
B: KEY=e080ffdf 1cfffff ffffffff fffffffe
B: MSC=10
B: LED=7
I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
N: Name="HID 05a4:9881"
P: Phys=usb-0000:00:04.0-3/input1
S: Sysfs=/devices/pci0000:00/0000:00:04.0/usb2/2-3/2-3:1.1/input/input4
U: Uniq=
H: Handlers=kbd mouse1 [b]event4[/b]
B: EV=17
B: KEY=1f0000 0 2020000 3878 d801d001 1e0000 0 0 0
B: REL=103
B: MSC=10
event3 and event4 are the two important entries from the cat we made before that we need in the next step. they could be different on your system.
create a file
/home/[xbmc-user]/lircstart.sh
please note that the code change from dec 17, 2009. the old code contained a copy/paste error...
Code:
#!/bin/sh
/etc/init.d/lirc stop
lircd --driver=devinput --device=/dev/input/event3 --pidfile=/var/run/lirc1.pid --listen=9988;
lircd --driver=devinput --device=/dev/input/event4 --pidfile=/var/run/lirc2.pid --connect=localhost:9988;
be careful to change event3 and event4 to the event numbers you got for your system.
chmod the lircstart.sh to 0755
Code:
chmod 0755 lircstart.sh
to be continued in the next post...
[LINUX] Full Hama MCE Remote Control support in ubuntu 9.04, continued... - lx_cool_j - 2009-12-03 14:54
continued from previous post
edit the file
/home/[xbmc-user]/.xbmc/userdata/Lircmap.xml
Code:
<lircmap>
<remote device="hama_52451">
<livetv>HOMEPAGE</livetv>
<power>POWER</power>
<myvideo>YELLOW</myvideo>
<mymusic>BLUE</mymusic>
<mypictures>GREEN</mypictures>
<display>TV</display>
<title>PICTURES</title>
<reverse>REWIND</reverse>
<play>PLAYPAUSE</play>
<forward>FASTFORWARD</forward>
<skipminus>PREV</skipminus>
<skipplus>NEXT</skipplus>
<stop>STOP</stop>
<pause>PLAYPAUSE</pause>
<record>REC</record>
<back>BACK</back>
<info>INFO</info>
<up>UP</up>
<left>LEFT</left>
<right>RIGHT</right>
<down>DOWN</down>
<select>ENTER</select>
<menu>BTN_LEFT</menu>
<volumeplus>VOLUMEUP</volumeplus>
<volumeminus>VOLUMEDOWN</volumeminus>
<mute>MUTE</mute>
<channelplus>CHANNELUP</channelplus>
<channelminus>CHANNELDOWN</channelminus>
<pageplus>CHANNELUP</pageplus>
<pageminus>CHANNELDOWN</pageminus>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
<six>6</six>
<seven>7</seven>
<eight>8</eight>
<nine>9</nine>
<zero>0</zero>
<star>STERN</star>
<hash>CLOSE</hash>
<clear>CLEAR</clear>
<start>CLOSE</start>
</remote>
</lircmap>
/home/[xbmc-user]/.xbmc/userdata/keymaps/remote.xml
Code:
<keymap>
<global>
<remote>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<select>Select</select>
<back>ParentDir</back>
<menu>PreviousMenu</menu>
<info>Info</info>
<display>FullScreen</display>
<title></title>
<play>Play</play>
<pause>Pause</pause>
<reverse>Rewind</reverse>
<forward>FastForward</forward>
<skipplus>SkipNext</skipplus>
<skipminus>SkipPrevious</skipminus>
<stop>Stop</stop>
<power>XBMC.ShutDown()</power>
<livetv>XBMC.ActivateWindow(Home)</livetv>
<mymusic>XBMC.ActivateWindow(MyMusic)</mymusic>
<mypictures>XBMC.ActivateWindow(MyPictures)</mypictures>
<myvideo>XBMC.ActivateWindow(MyVideos)</myvideo>
<star>AudioNextLanguage</star>
<record>ContextMenu</record>
<volumeplus>VolumeUp</volumeplus>
<volumeminus>VolumeDown</volumeminus>
<channelplus>PageUp</channelplus>
<channelminus>PageDown</channelminus>
<pageplus>PageUp</pageplus>
<pageminus>PageDown</pageminus>
<mute>Mute</mute>
<hash>ShowSubtitles</hash>
<clear>PreviousMenu</clear>
<start>XBMC.EjectTray()</start>
</remote>
</global>
<SlideShow>
<remote>
<pageplus>ZoomIn</pageplus>
<pageminus>ZoomOut</pageminus>
<one>ZoomLevel1</one>
<two>ZoomLevel2</two>
<three>ZoomLevel3</three>
<four>ZoomLevel4</four>
<five>ZoomLevel5</five>
<six>ZoomLevel6</six>
<seven>ZoomLevel7</seven>
<eight>ZoomLevel8</eight>
<nine>ZoomLevel9</nine>
<zero>ZoomNormal</zero>
</remote>
</SlideShow>
</keymap>
ok, everything should work now after a reboot.
to check if remote.xml and Lircmap.xml are integrated to xbmc without any problem you may check it with:
Code:
cat /home/[xbmc-user]/.xbmc/temp/xbmc.log | grep remote.xml
and
Code:
cat /home/[xbmc-user]/.xbmc/temp/xbmc.log | grep Lircmap.xml
something like this should come to your screen:
Code:
21:11:00 T:3041413008 M:1477832704 INFO: Loading special://xbmc/system/keymaps/remote.xml
21:11:00 T:3041413008 M:1477832704 INFO: Loading special://profile/keymaps/remote.xml
and
Code:
21:11:00 T:3041413008 M:1477832704 INFO: Loading special://xbmc/system/Lircmap.xml
21:11:00 T:3041413008 M:1477832704 INFO: Loading special://profile/Lircmap.xml
you also can check the incoming remote control commands with
press any keys on your remote and you should see the name for that key. To close irw, use strg-c.
with
Code:
tail -f /home/[xbmc-user]/.xbmc/temp/xbmc.log
you can see the keys pressed and the executed commands in xbmc with your remote control.
have fun using your working remote in xbmc!
- anton610 - 2009-12-03 20:14
Hey Thank you very much!!!
you made my day!  
regards
Ubuntu 9.10 - anton610 - 2009-12-07 16:21
Hello,
I've tried it in 9.10, but it didn't worked...
does anybody tried it also in ubuntu 9.10??
Regards Anton
- lx_cool_j - 2009-12-07 18:02
hi anton610,
are there any errors? do you get any response when you use irw? any errors in the xbmc.log?
regards alex
- anton610 - 2009-12-08 18:33
Hello, there are no errors.
of the remote are only a few buttons who work.
Ive found a sec. howto
I'll try and report.
regards Anton
- TheHeadGear - 2009-12-16 21:19
Thanks very much for posting this howto. I had trouble getting all the keys working. In the end, I did everything as posted with the exception of using the following to start lircd. I put these directly into /etc/rc.local rather than creating a separate sh script in my home folder.
sudo vim /etc/rc.local
Code:
/etc/init.d/lirc stop
lircd --driver=devinput --device=/dev/input/event3 --output=/dev/lircd --listen --pidfile=/var/run/lirc1.pid$
lircd --driver=devinput --device=/dev/input/event4 --output=/dev/lircd --connect=localhost:8765 --pidfile=/var/run/lirc2.pid$
- lx_cool_j - 2009-12-17 18:34
thank you @TheHeadGear,
there was a copy/paste error in my tutorial... i changed the lines regarding lircstart.sh in my post to the code i use. hope, it works now.
this could also be the solution for @anton610
- DocEvil - 2009-12-22 00:19
first, thanksfor the tutorial, but it is not working for me.
let me explain, what i did.
I Installed Ubuntu minimal with openssh server, then followed the Instruktions in the XBMC Wiki found here: http://wiki.xbmc.org/?title=XBMCbuntu.
Everthing works fine, only the damn remote from HAMA. I have until now no sound issues, no graphic issues, and the SMB Network with my Windows PC works fine.
So i install then straight following your tutorial lirc, everything was fine, editing the files, change chmod until even the thing with the event3 and event4. My ION has a bit more Harware at the USB connetors, so i have to changed that to event6 and event7.
But when i write this command in the terminal via ssh:
cat /home/[xbmc-user]/.xbmc/temp/xbmc.log | grep remote.xml
nothing happen. Of course i rebbot my Asrock ION 330 before i tested it.
Take a look at your tutorial the next command ist the same command like before.
Sounds strange, or?
So then I tried the other commans, like
irw
but no input was shown and the last command
tail -f /home/[xbmc-user]/.xbmc/temp/xbmc.log
displays also nothing on the screen.
So i'm a littlebit crazy, trying to install all the things with xbmc the last three days and then that.
S, eventually you can told me, how i unstall lirc, to try it again, or you know my problem and have a solution for me
- DocEvil - 2009-12-22 18:30
excuse my double post, but i want you to know, that i have a little success, with
i could ffind out the keymapping from my hama remote, so please tell me, what in which section i must adjust, to get my remote with this keybinding to work.
here are my commands recorded by me
Code:
00000000000100ac 00 HOMEPAGE hama_52451 -- this is the Button with an "e"
000000000001008e 00 POWER hama_52451
0000000000010014 00 YELLOW hama_52451
0000000000010032 00 BLUE hama_52451
0000000000010017 00 GREEN hama_52451
0000000000010012 00 RED hama_52451
0000000000010018 00 TV hama_52451
0000000000010022 00 PICTURES hama_52451
0000000000010014 00 YELLOW hama_52451 -- this is the Button next to TV
0000000000010032 00 BLUE hama_52451 -- that's the Button next to the Button before
0000000000010030 00 REWIND hama_52451
00000000000100a4 00 PLAYPAUSE hama_52451 -- big Playbutton
0000000000010021 00 FASTFORWARD hama_52451
00000000000100a5 00 PREV hama_52451
00000000000100a3 00 NEXT hama_52451
00000000000100a6 00 STOP hama_52451
00000000000100a4 00 PLAYPAUSE hama_52451 --small Pause button
0000000000010013 00 REC hama_52451
000000000001000e 00 BACK hama_52451
0000000000010111 00 INFO hama_52451
0000000000010067 00 UP hama_52451
0000000000010069 00 LEFT hama_52451
000000000001006a 00 RIGHT hama_52451
000000000001006c 00 DOWN hama_52451
000000000001001c 00 ENTER hama_52451 -- OK Button
0000000000010110 00 BTN_LEFT hama_52451
0000000000010111 00 INFO hama_52451 -- this is the Button marked with right Mouseclick
0000000000010073 00 VOLUMEUP hama_52451
0000000000010072 00 VOLUMEDOWN hama_52451
0000000000010071 00 MUTE hama_52451
0000000000010068 00 CHANNELUP hama_52451
000000000001006d 00 CHANNELDOWN hama_52451
000000000001001c 00 ENTER hama_52451 -- green START Button
000000000001004f 00 1 hama_52451
0000000000010050 00 2 hama_52451
0000000000010051 00 3 hama_52451
000000000001004b 00 4 hama_52451
000000000001004c 00 5 hama_52451
000000000001004d 00 6 hama_52451
0000000000010047 00 7 hama_52451
0000000000010048 00 8 hama_52451
0000000000010049 00 9 hama_52451
0000000000010037 00 STERN hama_52451
0000000000010052 00 0 hama_52451
0000000000010051 00 3 hama_52451 -- this and the next one are displayed when i pushing the # Button
000000000001004c 00 5 hama_52451
000000000001003e 00 CLOSE hama_52451
0000000000010001 00 CLEAR hama_52451
000000000001001c 00 ENTER hama_52451 -- the Button marked with Enter
i forget to say, that in XBMC only the Volume Buttons and a few other Buttons will work, about ninty Percent dont make anything while pushing it
oh god, the important thing i forget to say, i'm using minimal Ubunto 9.10 karmic. so this is eventually important for you.
|