<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 5/7/26 11:48, Roland Ernst wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAO+qqbPycK-J-X8NmLCQ0BYvPow5yDkd6DM0NV3X6fOfoew4JA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote gmail_quote_container">
<div dir="ltr" class="gmail_attr">On Thu, May 7, 2026 at
7:49 PM Douglas Peale via mythtv-users <<a
href="mailto:mythtv-users@mythtv.org"
moz-do-not-send="true" class="moz-txt-link-freetext">mythtv-users@mythtv.org</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">I
have my myth TV set up to shut off when it is idle, and
nobody is using the computer.<br>
<br>
It is setting the correct time to wake up, and shutting
down, but it is waking up at a different time than
specified.<br>
<br>
From the backend log:<br>
<br>
2026-05-06T23:32:16.416290-07:00 BlackBox mythbackend:
mythbackend[17054]: N Scheduler scheduler.cpp:3429
(ShutdownServer) <br>
Running the command to set the next scheduled wakeup time
:-#012#011#011#011#011sudo sh -c "/usr/bin/setwakeup.sh
1778201587"<br>
2026-05-06T23:32:16.416372-07:00 BlackBox mythbackend:
mythbackend[17054]: N Scheduler scheduler.cpp:3460
(ShutdownServer) <br>
Running the command to shutdown this computer
:-#012#011#011#011#011setsid /usr/bin/shutdown.sh<br>
<br>
<br>
the setwakeup.sh command is as follows:<br>
<br>
#!/bin/bash<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>
LOG_FILE='/var/log/mythtv/hwclk.log'<br>
<br>
#I don't know how to ask MythTV for this value, so it is
duplicated here. This is ugly.<br>
#number of seconds before scheduled recording that computer
should start booting.<br>
startbeforerecord=600<br>
<br>
#Calculate time_t format time for next non MythTV event.
Note that the user event time is hard coded!<br>
# This hard coded time must match the time of the event you
schedule in cron.<br>
<br>
currenttime=$(date "+%Y-%m-%d %H:%M:%S %s")<br>
<br>
userevent=$(( $(date -d 3:00AM +%s) - startbeforerecord ))<br>
<br>
(( userevent += ( userevent < $(date +%s) ) ? 24*60*60 :
0 )) # If event time has already passed, add 1 day<br>
<br>
# Set wake time to the earliest of MythTVs wake time and
userevent<br>
(( waketime = ( userevent < $1 ) ? userevent : $1 ))<br>
<br>
echo $currenttime MythTV requested $1 UserEvent is
$userevent Chosen time to wake is $waketime >>
$LOG_FILE<br>
<br>
#Does not seem to work anymore on Mint<br>
#echo 0 > /sys/class/rtc/rtc0/wakealarm #this clears
your alarm.<br>
#echo $waketime > /sys/class/rtc/rtc0/wakealarm #this
writes your alarm<br>
<br>
#try this instead:<br>
rtcwake -m no -t $waketime >>$LOG_FILE<br>
<br>
<br>
The log file it writes is:<br>
<br>
2026-05-06 23:32:16 1778135536 MythTV requested 1778201587
UserEvent is 1778147400 Chosen time to wake is 1778147400<br>
rtcwake: wakeup using /dev/rtc0 at Thu May 7 09:49:53 2026<br>
<br>
Note that the time specified in the log is in GMT which
would be 2:50AM local time (not sure why there is a a 7
second discrepancy).<br>
<br>
<br>
But the next entry in the backend log is:<br>
<br>
2026-05-07T17:08:22.484022-07:00 BlackBox mythbackend:
mythbackend[2214]: C thread_unknown
mythcommandlineparser.cpp:2904 <br>
(ConfigureLogging) mythbackend version: fixes/34
[v34.0+fixes.20240210.e3e165a1-0ubuntu6] <a
href="http://www.mythtv.org" rel="noreferrer"
target="_blank" moz-do-not-send="true">www.mythtv.org</a><br>
<br>
So the computer shut down, then woke up at 8 minutes after
midnight even though it was told to wake up at 2:50 AM.<br>
<br>
<br>
My scripts appear to be working correctly, but the computter
is waking up at the wrong time.<br>
<br>
What am I missing?<br>
<br>
-- <br>
Note: the attached .asc file is a cryptographic signature
that would allow you to verify that this message has not
been modified from what was sent.<br>
<br>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<div>Please post the output of `timedatectl`.</div>
<div> </div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre wrap="" class="moz-quote-pre">_______________________________________________
mythtv-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a>
<a class="moz-txt-link-freetext" href="http://lists.mythtv.org/mailman/listinfo/mythtv-users">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a>
<a class="moz-txt-link-freetext" href="http://wiki.mythtv.org/Mailing_List_etiquette">http://wiki.mythtv.org/Mailing_List_etiquette</a>
MythTV Forums: <a class="moz-txt-link-freetext" href="https://forum.mythtv.org">https://forum.mythtv.org</a>
</pre>
</blockquote>
<p>$ timedatectl<br>
Local time: Thu 2026-05-07 11:54:48 PDT<br>
Universal time: Thu 2026-05-07 18:54:48 UTC<br>
RTC time: Thu 2026-05-07 18:54:41<br>
Time zone: America/Los_Angeles (PDT, -0700)<br>
System clock synchronized: yes<br>
NTP service: active<br>
RTC in local TZ: yes<br>
<br>
Warning: The system is configured to read the RTC time in the
local time zone.<br>
This mode cannot be fully supported. It will create
various problems<br>
with time zone changes and daylight saving time
adjustments. The RTC<br>
time is never updated, it relies on external facilities
to maintain it.<br>
If at all possible, use RTC in UTC by calling<br>
'timedatectl set-local-rtc 0'.<br>
<br>
</p>
<pre class="moz-signature" cols="128">--
Note: the attached .asc file is a cryptographic signature that would allow you to verify that this message has not been modified from what was sent.</pre>
</body>
</html>