[mythtv-users] Waking up at a time different than specified
Douglas Peale
Douglas_Peale at Comcast.net
Sun May 10 03:32:44 UTC 2026
On 5/8/26 12:03, Douglas Peale via mythtv-users wrote:
> On 5/7/26 12:59, Douglas Peale via mythtv-users wrote:
>> On 5/7/26 11:55, Douglas Peale via mythtv-users wrote:
>>> On 5/7/26 11:48, Roland Ernst wrote:
>>>>
>>>>
>>>> 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
>>>> <http://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`.
>>>>
>>>> _______________________________________________
>>>> mythtv-users mailing list
>>>> mythtv-users at mythtv.org
>>>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>>>> http://wiki.mythtv.org/Mailing_List_etiquette
>>>> MythTV Forums:https://forum.mythtv.org
>>>
>>> $ timedatectl
>>> Local time: Thu 2026-05-07 11:54:48 PDT
>>> Universal time: Thu 2026-05-07 18:54:48 UTC
>>> RTC time: Thu 2026-05-07 18:54:41
>>> Time zone: America/Los_Angeles (PDT, -0700)
>>> System clock synchronized: yes
>>> NTP service: active
>>> RTC in local TZ: yes
>>>
>>> Warning: The system is configured to read the RTC time in the local time zone.
>>> This mode cannot be fully supported. It will create various problems
>>> with time zone changes and daylight saving time adjustments. The RTC
>>> time is never updated, it relies on external facilities to maintain it.
>>> If at all possible, use RTC in UTC by calling
>>> 'timedatectl set-local-rtc 0'.
>>>
>>> --
>>> 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.
>>>
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>>> http://wiki.mythtv.org/Mailing_List_etiquette
>>> MythTV Forums:https://forum.mythtv.org
>>
>> I just noticed the warning and ran the suggested command. We will see tonight if that changed anything.
>>
>> --
>> 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.
>>
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums:https://forum.mythtv.org
>
> I think I found the problem. Boot from RTC had somehow gotten disabled again. I'm not sure how this is happening. The only
> thing I have modified in the bios since the last time this happened is allowing the system to boot from USB because I needed
> to re-install Linux.
>
> --
> 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.
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums:https://forum.mythtv.org
This seems to have fixed it. It woke at the proper time this morning.
I'll keep an eye on it and see if the bios changes on me again. If so, I'll try changing the CMOS battery.
--
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20260509/49d99803/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x7B9B5178E6AE112A.asc
Type: application/pgp-keys
Size: 2452 bytes
Desc: OpenPGP public key
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20260509/49d99803/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20260509/49d99803/attachment.sig>
More information about the mythtv-users
mailing list