[mythtv-users] Scripts to monitor recording times

David Watkins watkinshome at gmail.com
Fri Oct 14 07:33:19 UTC 2022


On Fri, 14 Oct 2022 at 07:01, Jeff <jffry at posteo.net> wrote:

> On 14/10/2022 04:15, Hika van den Hoven wrote:
> > The most complex part is knowing when the backend should be awake for
> > recordings. In the past I have ones or twice seen people sharing
> > scripts just for that. I'm wondering if they can share them again.
> > It would speedup things, as I won't have to invent the wheel again.
>
> It is several years since I set all of this up, and the details are
> vague, but it was all fairly straightforward, and hung around Mythwelcome:
>
> https://www.mythtv.org/wiki/Mythwelcome
>
> My backend supports the ACPI wakeup with RTC:
>
> https://www.mythtv.org/wiki/ACPI_Wakeup
>
> i.e. this should all be possible independent from the RPi, if your
> backend supports the wakeup function.
>
> In my case, I use my RPi as a frontend, and I added a wakeonlan call to
> the frontend so that it would wake the backend.
>
> Regards
>
> Jeff
>
>
This is the script I have on my backend to wake itself up using an rtc
alarm.

It's in a script called by the backend as a shutdown command defined using
mythtv-setup.  I don't think mythwelcome is involved, but it's possible.

The wakeup time, passed into the script as $1 is automatically calculated
by the backend.

The last two lines are just there to create a log entry for debugging
purposes.

#!/bin/sh
#$1 is the first argument to the script. It is the time in seconds since
1970
#this is defined in mythtv-setup with the time_t argument

echo 0 > /sys/class/rtc/rtc0/wakealarm      #this clears your alarm.
echo $1 > /sys/class/rtc/rtc0/wakealarm     #this writes your alarm

echo "Set Alarm to Wakeup at $1 :  $(date -d "@$1")" | logger -t
"set-wakeup"
cat /proc/driver/rtc | logger -t "set-wakeup"

HTH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20221014/b6274520/attachment.htm>


More information about the mythtv-users mailing list