On 9/5/07, <b class="gmail_sendername">Robin Gilks</b> <<a href="mailto:g8ecj@gilks.org">g8ecj@gilks.org</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> Hello,<br>><br>> I have a MythTV box with a MS MCE Remote. What I have understand it can<br>> also<br>> control other devices, I mean the "IR Receiver" can also act "IR Sender"<br>
> with the two plugs.<br>> Would it be possible to press "PC power" button and that put both the TV<br>> and<br>> Myth box in standby mode. If so how can it be done?? Any hints ??<br><br>I use mine to control both the TV and theatre amp power. No point in using
<br>it to power off the myth box as otherwise it won't wake up again.<br><br>My lirc.conf file has the codes for the MCE remote, the TV remote and the<br>amp remote in it. This is required to generate the correct codes for the
<br>IR senders. I run irexec with an entry in the .lircrc file that uses<br>irexec to call a script when the power button is pressed. Note that lirc<br>uses ALL entries in lircrc for a button definition so the same button can
<br>be used by several applications SIMULTANEOUSLY. This allows me to use the<br>MENU jumppoint mapped to the power button in mythtv so I always 'park'<br>myth in a known place as well as calling the script.<br><br>
These are my script and lircrc entries, the latter also maps the volume<br>controls (so I can use spdif output since mythtv can't then use the<br>internal alsa mixer controls):<br><br> $ cat power_toggle.sh<br>#!/bin/sh
<br><br>TV=panasonic_tv_01<br>AMP=rm-aap013<br>FILE=/home/mythtv/.power<br>DEV=/dev/lircd1<br><br>DATE=`date +%s`<br><br># Use the presense of a flag file to see if we are powering up or down<br>if [ -e $FILE ]<br>then<br>
LAST=`cat $FILE`<br># ignore unless at least 10 seconds has passed this stops a keybounce<br># from turning us off straight after a turn on<br>if [ $(($LAST + 10)) -lt $DATE ]<br>then<br># power down - just blindly do it
<br>/usr/bin/irsend -d $DEV SEND_ONCE $TV T_power<br>/usr/bin/sleep 1<br># the amp needs the code repeated to get it to work<br>/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_power<br>/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_power
<br>/bin/rm -f $FILE<br>fi<br><br>else<br># power up - select tuner channel One on TV, that turns it on, then AV to<br>get to AV1<br># meanwhile, power up and select the correct input on the amp<br>/usr/bin/irsend -d $DEV SEND_ONCE $TV T_one
<br>/usr/bin/sleep 1<br>/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_dvd<br>/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_dvd<br>/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_dvd<br>/usr/bin/sleep 4<br>/usr/bin/irsend -d $DEV SEND_ONCE $TV T_av
<br>echo $DATE > $FILE<br><br>fi<br><br> $<br><br>=========================<br> $ tail lircrc<br><br>begin<br> prog = irexec<br> button = Power<br> config = /usr/local/bin/power_toggle.sh<br>end<br><br>#begin
<br># prog = irexec<br># button = *<br># config = /usr/local/bin/mythclick /usr/local/share/mythtv/beep.wav &<br>#end<br><br>begin<br> prog = irexec<br> button = VolUp<br> config = /usr/local/bin/setvol.sh A_volup
<br>end<br><br>begin<br> prog = irexec<br> button = VolDown<br> config = /usr/local/bin/setvol.sh A_voldown<br>end<br><br>begin<br> prog = irexec<br> button = Mute<br> config = /usr/bin/irsend -d /dev/lircd1 SEND_ONCE rm-aap013 A_mute
<br>end<br><br><br><br><br>--<br>Robin Gilks</blockquote><div><br><br>Thanks for the very good example (live one :) )<br><br>One other questions regarding MCE Remote....I have Lirc 0.8.1 that are provided in the (K)ubuntu repository. I have problems with repeating key strokes (
e.g. navigating in EPG results almost often with 2 steps up/down instead of 1.<br><br>I saw that there is a patch on <a href="http://www.mythtv.org/wiki/index.php/MCE_Remote">http://www.mythtv.org/wiki/index.php/MCE_Remote
</a> but it also says that it should not be needed since it was fixed in 0.8.1.<br><br>Any idea??<br clear="all"></div></div><br>-- <br>Regards<br>Joacim