[mythtv-users] Waking up at a time different than specified

Roland Ernst rcrernst at gmail.com
Thu May 7 18:48:11 UTC 2026


On Thu, May 7, 2026 at 7:49 PM Douglas Peale via mythtv-users <
mythtv-users at mythtv.org> wrote:

> I have my myth TV set up to shut off when it is idle, and nobody is using
> the computer.
>
> It is setting the correct time to wake up, and shutting down, but it is
> waking up at a different time than specified.
>
>  From the backend log:
>
> 2026-05-06T23:32:16.416290-07:00 BlackBox mythbackend: mythbackend[17054]:
> N Scheduler scheduler.cpp:3429 (ShutdownServer)
> Running the command to set the next scheduled wakeup time
> :-#012#011#011#011#011sudo sh -c "/usr/bin/setwakeup.sh 1778201587"
> 2026-05-06T23:32:16.416372-07:00 BlackBox mythbackend: mythbackend[17054]:
> N Scheduler scheduler.cpp:3460 (ShutdownServer)
> Running the command to shutdown this computer :-#012#011#011#011#011setsid
> /usr/bin/shutdown.sh
>
>
> the setwakeup.sh command is as follows:
>
> #!/bin/bash
> #$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
>
> LOG_FILE='/var/log/mythtv/hwclk.log'
>
> #I don't know how to ask MythTV for this value, so it is duplicated here.
> This is ugly.
> #number of seconds before scheduled recording that computer should start
> booting.
> startbeforerecord=600
>
> #Calculate time_t format time for next non MythTV event. Note that the
> user event time is hard coded!
> # This hard coded time must match the time of the event you schedule in
> cron.
>
> currenttime=$(date "+%Y-%m-%d %H:%M:%S %s")
>
> userevent=$(( $(date -d 3:00AM +%s) - startbeforerecord ))
>
> (( userevent += ( userevent < $(date +%s) ) ? 24*60*60 : 0 )) # If event
> time has already passed, add 1 day
>
> # Set wake time to the earliest of MythTVs wake time and userevent
> (( waketime = ( userevent < $1 ) ? userevent : $1 ))
>
> echo $currenttime MythTV requested $1 UserEvent is $userevent Chosen time
> to wake is $waketime >> $LOG_FILE
>
> #Does not seem to work anymore on Mint
> #echo 0 > /sys/class/rtc/rtc0/wakealarm      #this clears your alarm.
> #echo $waketime > /sys/class/rtc/rtc0/wakealarm     #this writes your alarm
>
> #try this instead:
> rtcwake -m no -t $waketime >>$LOG_FILE
>
>
> The log file it writes is:
>
> 2026-05-06 23:32:16 1778135536 MythTV requested 1778201587 UserEvent is
> 1778147400 Chosen time to wake is 1778147400
> rtcwake: wakeup using /dev/rtc0 at Thu May  7 09:49:53 2026
>
> 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).
>
>
> But the next entry in the backend log is:
>
> 2026-05-07T17:08:22.484022-07:00 BlackBox mythbackend: mythbackend[2214]:
> C thread_unknown mythcommandlineparser.cpp:2904
> (ConfigureLogging) mythbackend version: fixes/34
> [v34.0+fixes.20240210.e3e165a1-0ubuntu6] www.mythtv.org
>
> 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.
>
>
> My scripts appear to be working correctly, but the computter is waking up
> at the wrong time.
>
> What am I missing?
>
> --
> 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.
>
>

Please post the output of `timedatectl`.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20260507/632c742b/attachment.htm>


More information about the mythtv-users mailing list