[mythtv-users] Scripts to monitor recording times

Hika van den Hoven hikavdh at gmail.com
Fri Oct 14 14:19:13 UTC 2022


Hoi David,

Friday, October 14, 2022, 9:33:19 AM, you wrote:




> 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

Thanks, I'm aware of this option and I'm sure is will work on my
backend server. However on this basic level times are in GMT, which
adds an unneeded reason for errors and I can use the Pi to perform
other essential functions that do not need the power of the backend
server. Like ldap, which contains my user database, fetching programme
data in the middle of the night and maybe dns/dhcp, so I can also
power-off my firewall/router machine, when not needed.

For my main frontend I have my eyes on an Odroid. They are not
dissimilar to the Pi, but a little bit more powerful and with some
default extras, like IR, an eMMc slot and usb3. They even have a model
they say is 4K capable.


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