[mythtv-users] Wrote Script to Power on Cable Box

James MacKenzie mst3000 at newsguy.com
Mon Jun 25 16:43:31 UTC 2012


At Mon, 25 Jun 2012 11:35:06 -0400 (EDT), you wrote
>Don't know if checking for zero size is going to work, since a
>continual black screen encoded into whatever video format is probably
>going to be nonzero size.

I've got a similar script, that does exactly this.  Zero size files work in my
instance.

Also, to the other poster, I use firewire to power on my cable box, and there
is NO way to know whether the power is on or not.  It does not report the
result properly.  The only way for me to know that it isn't working is to
attempt to grab video and see if it's 0 bytes.

Mine is a Verizon FIOS HD Motorola box.

Here's my script:  (Note the use of the "power_off" command to turn it ON)

#!/usr/bin/perl

$node=`(plugreport | grep 0x3c754afffeb53c7a) 2> /dev/null`;

$node=~/^Node (\d+)/;

$node=$1;

# Attempt to record the current channel on the STB through the firewire port
system("(/usr/bin/test-mpeg2 -r $node > /tmp/$$ & VAR=\$!;sleep 1;kill \$VAR)
>/
dev/null 2>/dev/null");

# If the output file is of 0 length, the box is off.  Turn the box on.
if (-z "/tmp/$$")
{
  system("/usr/local/bin/stb-command -n $node power_off");
}

unlink "/tmp/$$";

----



More information about the mythtv-users mailing list