[mythtv-users] Joy and pain (Daryl McDonald)

Hika van den Hoven hikavdh at gmail.com
Tue Feb 18 19:11:02 UTC 2014


Hoi Hika,

Tuesday, February 18, 2014, 8:07:21 PM, you wrote:

> Hoi Daryl,


> I think we found it!!!!!!!!! Are there more scripts like this?
> In essence you have to change every line with irsend to contain
> '-d /var/run/lirc/lircdSerial
> I will add lines without '>'
> And mark lines with '#' to remove (just place that '#' in front to
> make them a remark
> A line with '##' is an added remark
>> #! /bin/bash

>> # Authored by Evuraan_AT_gmail_DOT_com

>> # ABSOLUTELY NO WARRANTY, to the extent permitted by
>> # applicable law.

>> # YMMV.
>> # Use at your own risk.

> ## Change this to match your Lirc socket file
> lirc_socket="/var/run/lirc/lircdSerial"
> ## Change this to match your video device file
>> pvr="/dev/video0"
>> t="$RANDOM-$RANDOM"
>> out="/tmp/$t.mpg"
>> mark="1727"
>> blank="0"
>> say="/usr/bin/logger -p info -t mythstb-check"
>> POWEROFF="0"
>> POWERON="0"
#>> wakeup="/usr/bin/irsend SEND_ONCE DCT700 POWER"
> wakeup="/usr/bin/irsend -d ${lirc_socket} SEND_ONCE DCT700 POWER"
#>> info="/usr/bin/irsend SEND_ONCE DCT700 info"
> info="/usr/bin/irsend -d ${lirc_socket} SEND_ONCE DCT700 info"



>> send_power_on() {
>> $say "`date` STB seems to be turned off, last count was $blank,
>> attempting to Power it on" & $wakeup 1>>/dev/null 2>/dev/null || :
>> sleep 2
>> }

>> scan_images(){
>> for i in `echo /tmp/$t*.jpeg`
>> do
>> if [ -s "$i" ]
>> then
>> #blank="`jp2a $i --invert --size=72x24 | sed -e 's/./& \n/g'|grep -c "M"`"
>> blank="`jp2a $i --invert --size=72x24 | sed 's/W/M/g' | sed -e 's/./&
>> \n/g'|grep -c "M"`"
>>  rm -f "$i" 1>/dev/null 2>/dev/null || :
>> else
>>  :
>> fi
>> [ "$blank" -gt "$mark" ] && export POWERON="100"
>> [ "$blank" -le "$mark" ] && export POWEROFF="100"
>> done
>> if [ "$POWERON" -eq "100" -a "$POWEROFF" -ne "100" ]
>> then
>> # its off
>> send_power_on
>> else
>> # power is on, non blank frames
>> $say "`date` STB seems to be turned on, last count was $blank"
>> :
>> fi

>> }

>> purge_stuff(){
>> [ -f "$out" ] && rm -f "$out" 1>/dev/null >/dev/null || :
>> }

>> #ivtv-tune -c 3 -d "$pvr" 1>/dev/null 2>/dev/null &

>> cd /tmp
>> $info &

>> dd if="$pvr" of="$out" bs=64K count=2  1>/dev/null 2>/dev/null

>> if [ -s "$out" ]
>> then
>> ffmpeg -i $out -f image2 -vcodec mjpeg /tmp/$t%d.jpeg 1>/dev/null 2>/dev/null
>> [ -s "/tmp/${t}1.jpeg" ] && scan_images
>> else
>> $say "`date` Unable to query $pvr, as it seems to be in use."
>> :
>> fi
>> purge_stuff &

> Tot mails,
>   Hika                            mailto:hikavdh at gmail.com

> "Zonder hoop kun je niet leven
> Zonder leven is er geen hoop
> Het eeuwige dilemma
> Zeker als je hoop moet vernietigen om te kunnen overleven!"

> De lerende Mens
> --


As you saw it also contained /dev/video0. Replace it with the udev
name you created earlier! I possibly also moved.

Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens
--



More information about the mythtv-users mailing list