[mythtv-users] harmony remote and start/stop scripts

Mike Perkins mikep at randomtraveller.org.uk
Fri May 11 10:09:00 UTC 2012


On 11/05/12 01:52, Aaron wrote:
> I am trying to get my Harmony remote to start/stop the mythfrontend to make
> it simpler for my family to do different things. I am on Mythbuntu 12.04
> 32bit. I have setup a irexec file, and made sure its running in daemon
> mode. It all seems to kinda work, but not really sure what I'm missing to
> make it run 100%. Here are my files, I think I just need another pair of
> eyes to help me see what I am missing.
>
> The parts I can't easily show are I have my Harmony remote set to run two
> different activities. First one is "Watch TV" , second is "Watch Movies".
> The watch TV activity is set to use the TV for audio (HDMI); then the
> movies activity is set to use SPDIF to my receiver. I have it set to send
> KEY_BLUE and KEY_YELLOW as the power on/off sequence from the remote. I
> have verified it is sending them with irw.
>
> The reason behind all this is my wife seems to get easily confused, so I am
> trying to eliminate all "hassles" with switching applications. I should
> mention when I run these scripts by hand they run flawlessly. So I'm not
> really sure where or why its not running correctly. The results are
> baffling. If I press "Watch TV" MythTV will pop up then close, then XBMC
> will open. If I press "Watch Movies" it does the opposite. At first I
> thought I had the Blue and Yellow wrong in the remote, but I've verified it
> many times. I have also switched KEY_BLUE and KEY_YELLOW in the irexec
> file, but it didn't seem to make a difference. Any incite would be much
> appreciated.
>
> ~/.lirc/irexec
> # MythTV
> begin
>       remote = mceusb
>       prog = irexec
>       button = KEY_BLUE
>       config = ~/scripts/mythtv_start.sh&
> end
>
> # XBMC
> begin
>       remote = mceusb
>       prog = irexec
>       button = KEY_YELLOW
>       config = ~/scripts/xbmc_start.sh&
> end
>
> ~/scripts/mythtv_start.sh
> #!/bin/bash
> # Test to see if XMBC is running first
> if ps -ef | grep xbmc.bin | grep -v grep
> then
> killall -v -s9 xbmc.bin
> fi
> # Now to see if MythTV is running
> if ps -ef | grep mythfrontend | grep -v grep
> then
> # Do nothing
> echo “MythTV already Running!”
> else
> # Startup MythTV
> mythfrontend
> fi
> exit
>
> ~/scripts/xbmc_start.sh
> #!/bin/bash
> # Test to see if MythTV is running
> if ps -ef | grep mythfrontend | grep -v grep
> then
>          killall -v -s9 mythfrontend.re
> fi
> # Now to see if XBMC is running
> if ps -ef | grep -v grep | grep -i xbmc.bin
> then
> # Do nothing
> echo “XBMC already Running!”
> else
> # Startup XBMC
> xbmc
> fi
> exit
>
You don't say which model of Harmony remote. That might be significant.

I would add this comment, based on my own experiences: Make sure that both the 
Harmony and *all* your devices are in the same, known, consistent state before 
you do any testing. Harmony remotes have an internal idea of what state each 
device is supposed to be in; if for example something is powered up when the 
remote thinks it should be off (or vice versa) then it is very easy to get into 
a confused state.

My system is a Harmony 600, TV, cable box, mythtv front end and DVD player. 
Currently I don't allow the remote to control the power on the cable box or the 
front end. The cable box is always on (standby saves nothing) and the TV gets 
confused switching inputs when the frontend powers up so we do that manually.

Try eliminating issues like power commands and just test a basic system. Switch 
everything on and get the TV to change inputs properly first. You can always add 
extras later.

-- 

Mike Perkins



More information about the mythtv-users mailing list