[mythtv-users] Ensure STB is on

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Aug 13 16:52:26 UTC 2013


On Tue, 13 Aug 2013 11:08:18 -0400, you wrote:

>On Tue, Aug 13, 2013 at 10:51 AM, Stephen Worthington <
>stephen_agent at jsw.gen.nz> wrote:
>
>> On Tue, 13 Aug 2013 07:35:23 -0400, you wrote:
>>
>> >Greetings Mythizens, I have followed this wiki;
>> >"https://help.ubuntu.com/community/Motorola_DCT700_Channel_Change_Script"
>> >to set up my remote definition and change channel script, it's functional,
>> >but sometimes I loose the first channel digit. I'm hoping the
>> >implementation of the Curious Onlooker from this post:
>> >"http://evuraan.blogspot.ca/2008/01/how-to-ensure-set-top-box-stb-is.html
>> "
>> >will not only ensure my STB is powered on, but also revive it enough to
>> >accept all channel digits.(subsequent irsend's seem to be fully accepted)
>> >My problem is that I don't know where to put the script he suggests. I've
>> >installed the ffmpeg and jp2a from software center. Does the new script go
>> >in the same directory as the change-channel.sh with a reference in the
>> file
>> >to it? I get even more confused when I look at the "example" link on
>> >Curious Onlooker's post.
>> >
>> >I'm running MythTV 0.25 inside a Ubuntu 12.04 lts desktop with a serial IR
>> >Blaster connected to a DCT700 STB, the front & back end in one box uses my
>> >Plasma TV for a monitor. Will Curious Onlooker's script work with my
>> >set-up, if so How? Or is there a better solution?
>> >
>> >Daryl
>>
>> That script should work with your box, but you would need to customise
>> it appropriately by changing the config variables at the top.
>>
>> The script needs to be called as the first thing in the channel change
>> script.  The obvious place to put it is also in /usr/local/bin, and
>> give it the same ownership and permissions as required by the channel
>> change script.
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>
>
>Can you walk me through this customization process? Is additional info
>needed to do that? I can get t into /usr/local/bin, but I'm guessing it
>should be modified first.

You are going to have to experiment with what commands work for your
box.  The "wakeup=" and "info=" lines need to be changed respectively
to commands that will turn on your box and display an information page
with text that the jp2a command can recognise.  First change
"blaster1" to "DCT700".  Next, your box does not seem to have a
DISPLAY command, so the current "info=" line will not work for that -
you will need to find some other command that works.  And you need to
check if your box's POWER command is a toggle or whether it will
always turn the box on if it is off and do nothing if it is already
on.  If it is a toggle, then you probably want to find another command
(if there is one) that will only turn the box on.  Many set top boxes
will turn on when they see a channel number command, for example.

You will also need to change the location of irsend in those lines to
where it is on your box.  Find that out using this command:

  which irsend

On Mythtbuntu 12.04 irsend is at /usr/bin, not /usr/local/bin.

The tricky bit is likely to be the "blank=" line in the scan_images()
function.  That needs to be tweaked to be able to produce usable ASCII
text output from the video read from your box and to recognise what is
produced when there is a blank screen when the box is off.  I tried
the script as it is with my SkyTV box and it does not seem to work, so
if I have time tomorrow I will try to work out exactly how that line
works and how to tweak it.  You may need to post some captured video
from your box so I can test with that, but first just try it as is and
see if that will be necessary.

To test the script, you can simply run it manually from a terminal
prompt:

  /usr/local/bin/check_stb

and see what log messages turn up in /var/log/syslog from the script.
This command:

  grep mythstb-check /var/log/syslog

should show you all the messages logged by the script.

If the script does not work then try the following for how to debug
it.  For the following commands, you may need to prefix them with
"sudo".  And you should run them from a safe directory, so for example
you could do this first:

  cd ~
  mkdir stbtest
  cd stbtest

To capture some video from your box, do this:

  dd if=/dev/video0 of=settopbox.mpg bs=64K count=2

Do it with the box on, and a screen with text displayed using the
command you are using in the "info=" line.

You can then play the settopbox.mpg file with MythTV to see what was
captured:

  mythavtest settopbox.mpg

or use your favourite video player software.

This command:

  ffmpeg -i settopbox.mpg -f image2 -vcodec mjpeg %d.jpg

will create individual 1.jpg, 1.jpg, 3.jpg,... files from the frames
in the captured video, and you can look at them using a picture viewer
program.  Pick one of them that has the ASCII text showing, then you
can do this:

  jp2a 1.jpg --invert --size=72x24

to try out the jp2a command used by the script to see if it works with
your captured video.

And then try this:

  jp2a 1.jpeg --invert --size=72x24 | sed 's/W/M/g' | sed -e 's/./&
\n/g'|grep -c "M"

to see how the whole "blank=" line works and see if the value in the
script's "mark=" line is correct.  This is where I got to in my
testing of the script so far - I do not know just what the "blank="
line is looking for yet.


More information about the mythtv-users mailing list