<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 14, 2013 at 5:12 AM, Stephen Worthington <span dir="ltr"><<a href="mailto:stephen_agent@jsw.gen.nz" target="_blank">stephen_agent@jsw.gen.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Tue, 13 Aug 2013 21:00:14 -0700, you wrote:<br>
<br>
>><br>
>><br>
>><br>
>> Thanks Mark, I now seem to be "chmod" ed properly, but as you pointed out<br>
>> Stephen, there is no display command:<br>
>><br>
>> daryl@daryl-A780L3C:~$ /usr/local/bin/check_stb<br>
>> irsend: command failed: SEND_ONCE DCT700 DISPLAY<br>
>> irsend: unknown command: "DISPLAY"<br>
>> daryl@daryl-A780L3C:~$<br>
>><br>
>><br>
>Daryl,<br>
><br>
>if your lircd.conf is verbatim from<br>
><a href="https://help.ubuntu.com/community/Motorola_DCT700_Channel_Change_Script" target="_blank">https://help.ubuntu.com/community/Motorola_DCT700_Channel_Change_Script</a>, it<br>
>should be "info" in place of "DISPLAY"<br>
><br>
> $ irsend SEND_ONCE DCT700 info<br>
><br>
>if so, try changing inside check_stb:<br>
><br>
>info="irsend SEND_ONCE DCT700 DISPLAY"<br>
><br>
>to:<br>
><br>
>info="irsend SEND_ONCE DCT700 info"<br>
><br>
>Good luck!<br>
<br>
</div></div>OK, I have now worked out how the blank= line does its job. The jp2a<br>
command converts a jpeg file into ASCII art. The chosen options make<br>
black areas be represented by M characters. The first sed command<br>
converts W characters to M characters as well - presumably W<br>
represents near-black areas, but I am not getting any Ws in my output<br>
to verify that. The second sed command converts each character in the<br>
output into a line with a line terminator character at the end, and<br>
the final grep then counts how many of these lines are just an M<br>
character. Since the jp2a command has the --size=72x24 option, it<br>
always outputs 72x24=1728 characters representing the jpeg file. If<br>
all 1728 characters are M or W, then the script says that is a blank<br>
screen and the set top box must be off.<br>
<br>
So, all of that should just work without any modification with any set<br>
top box that produces blank video on its output when it is off. It<br>
works with my box.<br>
<br>
The "info=" line needs to send any command that will ensure that the<br>
box is sending non-blank output. If it is always sending non-blank<br>
output when it is on, the you could just comment out the "info=" line<br>
and the "$info &" line further down. Comment out = put a # character<br>
as the first non-blank character on the line.<br>
<br>
Unfortunately, I am running into a problem where the ffmpeg command is<br>
failing on some captured video. If that happens, the script just<br>
cleans up and exits without doing anything. The program guide being<br>
on screen causes this to happen. However, if the box is off, ffmpeg<br>
always seems to work, so the script will then turn it on So the<br>
script is still doing what it is designed to do, despite this problem.<br>
<div class=""><div class="h5">_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
<a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a></div></div></blockquote><div><br></div><div>You have proved yourself a genius once again Mr. Worthington, with your direction even a newbie like me can see that the script is working: (not to mention the STB turned on)</div>
<div><br></div><div>daryl@daryl-A780L3C:~$ /usr/local/bin/check_stb</div><div>daryl@daryl-A780L3C:~$ grep mythstb-check /var/log/syslog</div><div>Aug 14 08:08:08 daryl-A780L3C mythstb-check: Wed Aug 14 08:08:08 EDT 2013 STB seems to be turned off, last count was 1728, attempting to Power it on</div>
<div>Aug 14 08:09:27 daryl-A780L3C mythstb-check: Wed Aug 14 08:09:27 EDT 2013 STB seems to be turned off, last count was 1728, attempting to Power it on</div><div>Aug 14 08:13:22 daryl-A780L3C mythstb-check: Wed Aug 14 08:13:22 EDT 2013 STB seems to be turned on, last count was 465</div>
<div>Aug 14 12:16:31 daryl-A780L3C mythstb-check: Wed Aug 14 12:16:31 EDT 2013 STB seems to be turned off, last count was 1728, attempting to Power it on</div><div>daryl@daryl-A780L3C:~$</div><div><br></div><div>Will Mythtv use this script every time I direct it to record from the STB, just because it's in the directory beside the change_channel.sh ? Or do I need to insert it into the change_channel.sh?</div>
<div><br></div><div>Many thanks and much tribute, Daryl</div></div><br></div></div>