[mythtv-users] mceusb power button repeats

Robin Gilks g8ecj at gilks.org
Tue Aug 5 02:52:09 UTC 2008


> One "normal" press of the power button on my mceusb remote yields the
> following:
> [mythtv at MythBox etc]$ irw
> 000000037ff07bf3 00 Power mceusb
> 000000037ff07bf3 01 Power mceusb
> 000000037ff07bf3 02 Power mceusb
> 000000037ff07bf3 03 Power mceusb
> 000000037ff07bf3 04 Power mceusb
> 000000037ff07bf3 05 Power mceusb
>
> My .lircrc file shows that the button should never repeat:
> begin
>         prog = irexec
>         button = Power
>         repeat = 0
>         config = /home/mythtv/bin/restart.sh
> end
>
> I'm running mythtv 0.21, lirc 0.8.3. I only find one lircd.conf and one
> lircrc. Any ideas on why my restart script is being called 2-3 times each
> time the power button is pressed?

Which is why I put a timestamp into a file and check for a repeat within
10 seconds in my script. Never did get to the bottom of it but just worked
round it!


#!/bin/sh

AMP=rm-aap013
FILE=/home/mythtv/.power
DEV=/dev/lircd1
export DISPLAY=:0
SU="su mythtv -c "
DATE=`date +%s`

# Use the presense of a flag file to see if we are powering up or down
if [ -e $FILE  ]
then
LAST=`cat $FILE`
# ignore unless at least 10 seconds has passed  this stops a keybounce
# from turning us off straight after a turn on
if [ $(($LAST + 10)) -lt $DATE ]
then
# power down TV - just blindly do it
$SU "/usr/bin/xset dpms force off"
# the amp needs the code repeated to get it to work - handled by repeat
value in the conf file
/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_power
/bin/rm -f $FILE
fi

else
# power up and select the correct input on the amp
$SU "/usr/bin/xset dpms force on"
/usr/bin/irsend -d $DEV SEND_ONCE $AMP A_dvd
echo $DATE > $FILE

fi


-- 
Robin Gilks zl3rob/g8ecj
Internet: g8ecj at gilks.org    http://www.gilks.org





More information about the mythtv-users mailing list