[mythtv-users] Ensure STB is on

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Aug 14 09:12:15 UTC 2013


On Tue, 13 Aug 2013 21:00:14 -0700, you wrote:

>>
>>
>>
>> Thanks Mark, I now seem to be "chmod" ed properly, but as you pointed out
>> Stephen, there is no display command:
>>
>>  daryl at daryl-A780L3C:~$ /usr/local/bin/check_stb
>> irsend: command failed: SEND_ONCE DCT700 DISPLAY
>> irsend: unknown command: "DISPLAY"
>> daryl at daryl-A780L3C:~$
>>
>>
>Daryl,
>
>if your lircd.conf is verbatim from
>https://help.ubuntu.com/community/Motorola_DCT700_Channel_Change_Script, it
>should be "info" in place of "DISPLAY"
>
> $ irsend SEND_ONCE DCT700 info
>
>if so,  try changing inside check_stb:
>
>info="irsend SEND_ONCE DCT700 DISPLAY"
>
>to:
>
>info="irsend SEND_ONCE DCT700 info"
>
>Good luck!

OK, I have now worked out how the blank= line does its job.  The jp2a
command converts a jpeg file into ASCII art.  The chosen options make
black areas be represented by M characters.  The first sed command
converts W characters to M characters as well - presumably W
represents near-black areas, but I am not getting any Ws in my output
to verify that.  The second sed command converts each character in the
output into a line with a line terminator character at the end, and
the final grep then counts how many of these lines are just an M
character.  Since the jp2a command has the --size=72x24 option, it
always outputs 72x24=1728 characters representing the jpeg file.  If
all 1728 characters are M or W, then the script says that is a blank
screen and the set top box must be off.

So, all of that should just work without any modification with any set
top box that produces blank video on its output when it is off.  It
works with my box.

The "info=" line needs to send any command that will ensure that the
box is sending non-blank output.  If it is always sending non-blank
output when it is on, the you could just comment out the "info=" line
and the "$info &" line further down.  Comment out = put a # character
as the first non-blank character on the line.

Unfortunately, I am running into a problem where the ffmpeg command is
failing on some captured video.  If that happens, the script just
cleans up and exits without doing anything.  The program guide being
on screen causes this to happen.  However, if the box is off, ffmpeg
always seems to work, so the script will then turn it on  So the
script is still doing what it is designed to do, despite this problem.


More information about the mythtv-users mailing list