[mythtv-users] automatic power down fun and games

blind Pete 0123peter at gmail.com
Sat Dec 19 01:36:00 UTC 2015


Hi *, 

I've been running Mythbuntu 14.04 LTS Trusty Tahr reasonably
successfully for a long time now.  MythTV version is 0.28-pre from a
few weeks ago.  Now that the hot weather has set in (southern
hemisphere) it is time to sort out automatic power down and power up.  

After considerable phaffing about and experimental coding, power up
seems to be OK.  Power down still has me beaten.  Presumably there are
lots of people on this list who have it working.  If a couple of
responses say, "Yes, it does work on UEFI firmware" I will re-read
<https://www.mythtv.org/wiki/ACPI_Wakeup> and
<https://www.mythtv.org/wiki/Mythwelcome> before I come back with more
specific questions.  I have not actually played with Mythwelcome yet,
it does not appear to be strictly necessary.  

There seem to be some oddities - at least on this system - or possibly
I've just mis-understood things.  Comments and explanations for dummies
welcome.  

Something clears the wake alarm setting occasionally.  
This is good...
$ cat /sys/class/rtc/rtc0/wakealarm 
1450569060
$ date -d @$(cat /sys/class/rtc/rtc0/wakealarm)
Sun Dec 20 10:51:00 AEDT 2015

But sometimes this happens... 
$ cat /sys/class/rtc/rtc0/wakealarm 
$ date -d @
date: invalid date ‘@’

It might be easier if it "cleared" to MAX-INT or even 0, but if you are
alert to undefined variables here and there it is OK.  This could be a
firmware issue and completely beyond our control.  

The firmware (?) does not seem to allow setting the alarm to any time
in the past.  Is this a misguided safety feature?  

In Mythbuntu 14.04 and Ubuntu 15.10 /etc/init/hwclock.conf
and /etc/init/hwclock-save.conf contain a line like 
"exec hwclock [many parameters]".  After adding many echo to logfile
lines and many reboots (in Mythbuntu 14.04) it seems that hwclock.conf
is not executed, it is not leaving anything in my log file.  Is the OS
supposed to execute it independent of MythTV?  More strangely execution
of hwclock-save.conf stops at the "exec hwclock" line, but when the
"exec" was deleted then hwclock ran (seemingly successfully) as did the
rest of the commands in hwclock-save.conf!  I'm out of my depth here.  

I have also created /usr/local/bin/checklogin.sh that seems to be well
behaved, but not called and /usr/local/bin/setwakeup.sh that seems well
behaved except for some echoed comments about time to sleep.  It will
be wrong for sleep times greater than 31 days (the length of January)
and some time zone setups.  (Mine!)  

-- 
testing
bP


More information about the mythtv-users mailing list