[mythtv] detecting activity - not signal. > cablebox_on.sh

Mark Paulus mark.paulus at verizonbusiness.com
Wed Nov 7 16:13:44 UTC 2007

Peter Hartmann wrote:
> Thank for the responses guys ....I found the $! method just after the
> posting.  This script solves my rebooting cable box problem.  It's not
> like I could complain to the cable company about it.  They'd probably
> do it more often if they knew they were messing up my recordings
> considering they have thier own DVR service to offer.  Anyway it
> samples /dev/video0 or the end of the current mythtv recording, makes
> 2 stills and compares the difference in color.  If there is no
> difference it turns the box on and changes to the last channel in
> mythbackend.log.  Enjoy!
> Peter

One thing to note.

You have a comment in your script:
# channels in the mythbackend.log seem to have 1000 added to them.
CHAN=$(( $LAST_CHAN - 1000 ))

Actually I believe the logic is:
The first (first 2??) digits indicate the tuner #.  So, if you
only have 1 tuner, and you don't delete/add tuners, then it
will be 1.  In my system, I have 6 tuners (3 Haupp PVR 150/250,
Avermedia A180, Air2PC, Dvico RT5 Lite), so my channels are
all over the place, 1023, 4005, 6260, etc.  So, perhaps you 
would need to perhaps just take the last 3 digits of the first
subset, where the file name is parsed by '_'

Something like this:
$ CHAN=`echo $LAST_CHAN | cut -d '_' -f 1  | sed -e 's/^.*\([0-9][0-9][0-9]\)$/\1/'`
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mark.paulus.vcf
Type: text/x-vcard
Size: 296 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20071107/762b043c/attachment.vcf 

More information about the mythtv-dev mailing list