<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 14 Oct 2022 at 07:01, Jeff <<a href="mailto:jffry@posteo.net">jffry@posteo.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 14/10/2022 04:15, Hika van den Hoven wrote:<br>
> The most complex part is knowing when the backend should be awake for<br>
> recordings. In the past I have ones or twice seen people sharing<br>
> scripts just for that. I'm wondering if they can share them again.<br>
> It would speedup things, as I won't have to invent the wheel again.<br>
<br>
It is several years since I set all of this up, and the details are <br>
vague, but it was all fairly straightforward, and hung around Mythwelcome:<br>
<br>
<a href="https://www.mythtv.org/wiki/Mythwelcome" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/Mythwelcome</a><br>
<br>
My backend supports the ACPI wakeup with RTC:<br>
<br>
<a href="https://www.mythtv.org/wiki/ACPI_Wakeup" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/ACPI_Wakeup</a><br>
<br>
i.e. this should all be possible independent from the RPi, if your <br>
backend supports the wakeup function.<br>
<br>
In my case, I use my RPi as a frontend, and I added a wakeonlan call to <br>
the frontend so that it would wake the backend.<br>
<br>
Regards<br>
<br>
Jeff<br>
<br></blockquote><div><br></div><div>This is the script I have on my backend to wake itself up using an rtc alarm.</div><div><br></div><div>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.</div><div><br></div><div>The wakeup time, passed into the script as $1 is automatically calculated by the backend.</div><div><br></div><div>The last two lines are just there to create a log entry for debugging purposes.</div><div><br></div>#!/bin/sh<br>#$1 is the first argument to the script. It is the time in seconds since 1970<br>#this is defined in mythtv-setup with the time_t argument<br><br>echo 0 > /sys/class/rtc/rtc0/wakealarm      #this clears your alarm.<br>echo $1 > /sys/class/rtc/rtc0/wakealarm     #this writes your alarm<br><br>echo "Set Alarm to Wakeup at $1 :  $(date -d "@$1")" | logger -t "set-wakeup"<br>cat /proc/driver/rtc | logger -t "set-wakeup"<br><div> </div><div>HTH</div></div></div>