Controlling my Ubuntu based mediacenter with a Logitech Harmony 555
This post i a follow up to my previous post:
My new best friend: the Logitech Harmony 555 . After having played for several days with my new toy, and convincing others to buy the same, I figured it was about time to make the next step : hook up the remote to the mediacenter! While searching the net, I found some different stories. The official LIRC site stated:
… it’s technically not possible to use USB IrDA dongles …
… which was enough for me to not-buy a USB IR receiver. On the other hand, it should be possible to use an MCE receiver. Especially the 2005 edition is said to be easy to set up. Philips, producer of the official MCE 2005 receiver, have created a new receiver: the Vista version. The ‘problem’ with this one is, that it
… only works with Vista …
Maybe on Windows, but also on Ubuntu? Guess again…
Adding mythtv as a device to the Harmony
After having tried serveral configurations, this step appeared to be the most essential one. I first tried adding it as a MythTV PVR but I couldn’t get that to work. The key was adding MythTv as a Windows Media Center, by choosing Computer > Mediacenter > Windows > Windows Media Center. Now, add an activity to do a basic setup of the keys. I chose “Watch Videos”.
Install LIRC
This one is easy:
apt-get install lirc
Configure your conf’s
I’ve added a download, containing the conf’s as the reside in my current setup. Ofcourse, you can also copy-paste them directly.
lirc.tar.gz (2.4 KiB, 147 hits)
You need to be a registered user to download this file.
/etc/lirc/hardware.conf
# /etc/lirc/hardware.conf # # Arguments which will be used when launching lircd LIRCD_ARGS="" #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 # Run "lircd --driver=help" for a list of supported drivers. DRIVER="" # If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be # automatically used instead DEVICE="" MODULES="lirc_mceusb2" # Default configuration files for your hardware if any LIRCD_CONF="" LIRCMD_CONF=""
/etc/lirc/lircd.conf
begin remote
name mceusb
bits 16
flags RC6|CONST_LENGTH
eps 30
aeps 100
header 2667 889
one 444 444
zero 444 444
pre_data_bits 21
pre_data 0x37FF0
gap 105000
toggle_bit 22
rc6_mask 0x100000000
begin codes
Power 0x00007bf3 # no e2,e3
MyTV 0x00007bb9 # starts at af
MyMusic 0x00007bb8 # starts at af
MyPictures 0x00007bb6 # starts at af
MyVideos 0x00007bb5 # starts at af
Record 0x00007be8 # no e2,e3
Stop 0x00007be6 # no e2,e3
Pause 0x00007be7 # no e2,e3
Play 0x00007be9 # no e2,e3
Rewind 0x00007bea # no e2,e3
Forward 0x00007beb # no e2,e3
Replay 0x00007be4 # no e2,e3
Skip 0x00007be5 # no e2,e3
More 0x00007bf0 # no e2,e3
Back 0x00007bdc # no ba - d8
Left 0x00007bdf # no ba - d8
Right 0x00007bde # no ba - d8
Up 0x00007be1 # no ba - d8
Down 0x00007be0 # no ba - d8
OK 0x00007bdd # no ba - d8
VolUp 0x00007bef # no e2,e3
VolDown 0x00007bee # no e2,e3
ChanUp 0x00007bed # no e2,e3
ChanDown 0x00007bec # no e2,e3
Home 0x00007bf2 # no e2,e3
Mute 0x00007bf1 # no e2,e3
RecordedTV 0x00007bb7 # starts at af
Guide 0x00007bd9 # no ba - d8
LiveTV 0x00007bda # no ba - d8
DVDMenu 0x00007bdb # no ba - d8
One 0x00007bfe # no e2,e3
Two 0x00007bfd # no e2,e3
Three 0x00007bfc # no e2,e3
Four 0x00007bfb # no e2,e3
Five 0x00007bfa # no e2,e3
Six 0x00007bf9 # no e2,e3
Seven 0x00007bf8 # no e2,e3
Eight 0x00007bf7 # no e2,e3
Nine 0x00007bf6 # no e2,e3
Zero 0x00007bff # no e2,e3
Star 0x00007be2 # no e2,e3
Hash 0x00007be3 # no e2,e3
Clear 0x00007bf5 # no e2,e3
Enter 0x00007bf4 # no e2,e3
Red 0x00007ba4 # no e2,e3
Green 0x00007ba3 # no e2,e3
Yellow 0x00007ba2 # no e2,e3
Blue 0x00007ba1 # no e2,e3
Teletext 0x00007ba5 # no e2,e3
#Following are unused with Hauppauge MCE remote.
#redefine these to something else
Radio 0x00007baf # starts at af
Print 0x00007bb1 # starts at af
end codes
end remote
Once this is working, test the connection using irw:
000000037ff07bfe 00 One mceusb 000000037ff07bfe 01 One mceusb 000000037ff07bfe 02 One mceusb 000000037ff07bfe 03 One mceusb 000000037ff07bb5 00 MyVideos mceusb 000000037ff07bb5 01 MyVideos mceusb 000000037ff07be0 00 Down mceusb 000000037ff07be0 01 Down mceusb 000000037ff07be0 02 Down mceusb
I was a little concerned about timings, since all buttons I hit appeared mutltipe times. But, impatient as I am, I first tried to get on and I was happy to see this is a perfect setup . One step left:
~/.mythtv/lircrc
(notice it’s not .lircrc ):
#
# lircrc config file for the Microsoft Media Center Edition Remote, model 1039
#
# Modified By Dale Jefferson at efficientpc.co.uk
# Email: dale@efficientpc.co.uk
#
# This file is intended to complement the lircd.conf.mceusb file included with
# lirc 0.8 and above.
#
# Save this file in ~/.mythtv/lircrc
#
# You will also need to make a few changes to the MythTV key bindings and jump
# points as follows.
#
# Jump Points:
#
# TV Recording Playback: Alt+R
# Program Guide: Alt+G
# Live TV: Alt+P
# MythVideo -> The MythVideo default view: Alt+V
# Main Menu: Alt+Home
#
# Key Bindings:
#
# TV Playback -> CHANNELDOWN: Down,PgDown
# TV Playback -> CHANNELUP: Up,PgUp
# TV Playback -> JUMPRWND: Shift+PgUp
# TV Playback -> JUMPFFWD: Shift+PgDown
#
###################################################################
# Begin of mythtv key bindings.
##
#
# Program Navigation
#
begin
prog = mythtv
button = Home
config = Alt+Home
end
begin
prog = mythtv
button = LiveTV
config = Alt+R
end
begin
prog = mythtv
button = RecTV
config = Alt+G
end
begin
prog = mythtv
button = Guide
config = Alt+P
end
begin
prog = mythtv
button = DVD
config = Alt+V
end
#
# Menu Navigation
#
begin
prog = mythtv
button = Back
config = Esc
end
begin
prog = mythtv
button = OK
config = Space
end
begin
prog = mythtv
button = More
config = I
end
begin
prog = mythtv
button = Left
config = Left
end
begin
prog = mythtv
button = Right
config = Right
end
begin
prog = mythtv
button = Up
config = Up
end
begin
prog = mythtv
button = Down
config = Down
end
#
# TV Control
#
begin
prog = mythtv
button = VolDown
config = F10
end
begin
prog = mythtv
button = VolUp
config = F11
end
begin
prog = mythtv
button = Mute
config = |
end
begin
prog = mythtv
button = ChanDown
config = PgDown
end
begin
prog = mythtv
button = ChanUp
config = PgUp
end
#begin
# prog = irexec
# button = red
# config = amixer -c 0 sset 'IEC958' unmute
#end
#begin
# prog = irexex
# button = green
# config = amixer -c 0 sset 'IEC958' mute
#end
#begin
# prog = irexec
# button = yellow
# config = amixer -c 0 sset 'IEC958' mute
#end
#
# Video Navigation
#
begin
prog = mythtv
button = Play
config = P
end
begin
prog = mythtv
button = Pause
config = P
end
begin
prog = mythtv
button = Stop
config = Esc
end
begin
prog = mythtv
button = Forward
config = >
end
begin
prog = mythtv
button = Rewind
config = <
end
begin
prog = mythtv
button = Replay
config = Q
end
begin
prog = mythtv
button = Skip
config = Z
end
begin
prog = mythtv
button = Record
config = R
end
#
# Miscellaneous
#
# M for Menu
begin
prog = mythtv
button = Star
config = M
end
begin
prog = mythtv
button = Hash
config = M
end
begin
prog = mythtv
button = Clear
config = Esc
end
begin
prog = mythtv
button = Enter
config = Space
end
#
# Numbers
#
begin
prog = mythtv
button = Zero
config = 0
end
begin
prog = mythtv
button = One
config = 1
end
begin
prog = mythtv
button = Two
config = 2
end
begin
prog = mythtv
button = Three
config = 3
end
begin
prog = mythtv
button = Four
config = 4
end
begin
prog = mythtv
button = Five
config = 5
end
begin
prog = mythtv
button = Six
config = 6
end
begin
prog = mythtv
button = Seven
config = 7
end
begin
prog = mythtv
button = Eight
config = 8
end
begin
prog = mythtv
button = Nine
config = 9
end
##
# End of mythtv key bindings.
##
Resources:
- http://mythtv.org/wiki/index.php/MCE_Remote says I can use the Vista controller
- http://www.mythtv.org/wiki/index.php/Logitech_Harmony_880_remote gave me the lircd.conf
- http://www.mythtv.org/wiki/index.php/Ubuntu_lirc_configuration_files#lirc_mceusb2 gave me the hardware.conf. I didn’t use the lirc-modules-source.conf.
- I tried http://www.mythtv.org/wiki/index.php/Logitech_Harmony_Generic_Setup but that did not help me. The real magic was in adding the MediaCenter PC as a device to the remote, setting it as a Windows device.
- http://www.remotecontrol.philips.com/index.cfm?id=1336 gave me the image.
- http://www.mythtv.org/wiki/index.php/LIRC told me
- The log file showing “accepted new client” immediately followed by “removed client” can indicate a a ~/.lircrc or ~/.mythtv/lircrc parsing error. Check the formatting.
- Set up
/etc/lircd.confto fit your remote.- Set up
~/.mythtv/lircrcwith the keys that are needed for MythTV and MPlayer- Ensure MPlayer knows about LIRC (assuming you use it as the default player). If LIRC was installed AFTER MPlayer, you need to tell mplayer where to find the lircrc file in either the global config file
/etc/mplayer/mplayer.conf, the local user override file~/.mplayer/config, or on the command line inmythfrontend -> Utilities/Setup -> Setup -> Media Settings -> Video Settings -> Player Settings -> Default Playerby adding-lircconf /path/to/lircrc. Note that when using all the default video players etc in myth, native control of MPlayer is only required when playing video files (like AVI’s etc..) under “Watch Videos”.
Downloads
lirc.tar.gz (2.4 KiB, 147 hits)
You need to be a registered user to download this file.
This entry was posted on Thursday, December 18th, 2008 at 20:14 and is filed under Blog, Commandline, Emacs, Gadgets, HTPC, Hardware, IR, Logitech, Mediacenter, Panasonic, Tech, Ubuntu, apt-get. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


