An update regarding this problem: yesterday I've encountered the same non-waking up problem again, in a random manner: I was expecting two wake-up moments, one in the morning and the other one in the afternoon. Well: for the first one scheduling the MythTv BE/FA woke up and recorded correctly, for the secondo one it didn't wake up at all.<div>
<br></div><div>So, while doing a further check, connecting and disconnecting via shh, I saw this:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>~$ ssh multisala </div></div><div>
<div>datLinux multisala 2.6.35-32-generic #65-Ubuntu SMP Tue Jan 24 13:48:14 UTC 2012 i686 GNU/Linux</div></div><div><div>Ubuntu 10.10</div></div><div><div>...</div></div><div><div>No mail.</div></div><div><div><b>Last login: Tue Feb 14 01:58:57 2012 from lapsung</b></div>
</div><div><div>date</div></div><div><div>~$ date</div></div><div><div><b>Tue Feb 14 01:02:16 CET 2012</b></div></div></blockquote><div><div><br></div><div>In brief: the second time I logged into the BE/FE ssh reported that the last login was in the future!</div>
<div>So I realized that, probably, the problem isn't related to the MythTv/MythWelcome configuration but in something related to the time settings itself of the system, instead.</div><div>I've checked running processes and, yes, my backend was running 'ntpd'.</div>
<div>So I stopped and disabled at boot the NTP daemon . Let's see if I can blame it.</div><div><br></div><div><br></div><br><div class="gmail_quote">2012/2/12 ganassa <span dir="ltr"><<a href="mailto:ganassa@gmail.com">ganassa@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Date: Sun, 12 Feb 2012 15:51:45 +0100<br>
From: ganassa <<a href="mailto:ganassa@gmail.com" target="_blank">ganassa@gmail.com</a>><br>
Subject: [mythtv-users] MythTv BE/FE go to sleep but doesn't wake up<div class="im"><br><br>
Hi<br>
<br>
I have a problem in setting up ACPI WakeUp on my MythTv BE/FE on Ubuntu<br>
10.10<br></div></blockquote><div>[cut] </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>Date: Sun, 12 Feb 2012 10:10:15 -0500<br>
From: Marco Quezada <<a href="mailto:mellamanjefe@gmail.com" target="_blank">mellamanjefe@gmail.com</a>><br>
Subject: Re: [mythtv-users] MythTv BE/FE go to sleep but doesn't wake<br>
up<br>
To: Discussion about MythTV <<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a>><br>
Message-ID:<br>
<<a href="mailto:CA%2BqgVUYUB6804biLJmMma4f6bB-4SvFsLYj-XkduLwC7vix01w@mail.gmail.com" target="_blank">CA+qgVUYUB6804biLJmMma4f6bB-4SvFsLYj-XkduLwC7vix01w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<div><div class="h5"><br>
<br>
On Sun, Feb 12, 2012 at 9:51 AM, ganassa <<a href="mailto:ganassa@gmail.com" target="_blank">ganassa@gmail.com</a>> wrote:<br>
> Hi<br>
><br>
> I have a problem in setting up ACPI WakeUp on my MythTv BE/FE on Ubuntu<br>
> 10.10<br>
> It's a log time I'm trying to setting it up correctly but I gave up several<br>
> times.<br>
> Now I've discovered that I made a small but important error, by setting up<br>
> in mythtv-setup the time format in:<br>
><br>
> 'yyyy-MMddThh:mm:ss'<br>
><br>
> instead than<br>
><br>
> 'yyyy-MM-ddThh:mm:ss'<br>
><br>
> So, previously the Mythwelcome screen shows countdown but, when it reached<br>
> to 0, it restarted, because of the check of time format.<br>
><br>
> Now, after correcting the error, MythWelcome shuts down. But it doesn't wake<br>
> up.<br>
> Because of the several different informations found on the web, I think I<br>
> made a mess and now I really need an help to get the work done.<br>
><br>
> First of all: I've setted up my sistem following both:<br>
><br>
> <a href="http://www.mythtv.org/wiki/ACPI_Wakeup" target="_blank">http://www.mythtv.org/wiki/ACPI_Wakeup</a><br>
><br>
> and<br>
><br>
> <a href="http://www.mythtv.org/wiki/Mythwelcome" target="_blank">http://www.mythtv.org/wiki/Mythwelcome</a><br>
><br>
><br>
> ACPI WAKEUP SETTINGS<br>
> Follwing:<br>
><br>
> <a href="http://www.mythtv.org/wiki/ACPI_Wakeup" target="_blank">http://www.mythtv.org/wiki/ACPI_Wakeup</a>:<br>
><br>
><br>
> My system can wake up from S4:<br>
><br>
> $ grep -i rtc /var/log/kern.log<br></div></div>
> Feb 12 14:12:56 multisala kernel: [ ? ?0.787284] rtc_cmos 00:03: RTC can<div class="im"><br>
> wake from S4<br>
><br>
><br>
> HWclock updates are disabledm both for the Ubuntu 8.04 version ad earlier<br>
> (my Ubuntu came from 8.04 version) by setting up HWCLOCKACCES to "no" in the<br>
> proper file<br>
><br>
> $ cat /etc/default/rcS |grep HWCLOCKACCESS<br>
> HWCLOCKACCESS=no<br>
><br>
><br></div>
> and for the?Ubuntu 9.10 and later by commenting out "exec" line in the<div class="im"><br>
> proper file<br>
><br>
> $ cat /etc/init/hwclock-save.conf |grep exec<br></div>
> # ? ?exec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear<div class="im"><br>
><br>
><br>
> kernel is newer than 2.6.22<br>
><br>
> $ uname -a<br>
> Linux multisala 2.6.35-32-generic #65-Ubuntu SMP Tue Jan 24 13:48:14 UTC<br>
> 2012 i686 GNU/Linux<br>
><br>
><br></div>
> so it use?/sys/class/rtc/rtc0/wakealarm<div class="im"><br>
><br>
> $ ls /sys/class/rtc/rtc0/wakealarm<br>
> /sys/class/rtc/rtc0/wakealarm<br>
><br>
> consequentiely, wakealarm should accept time format in epoch time<br>
><br>
> TESTING<br>
> Now, it's time to test it by following<br>
><br>
> <a href="http://www.mythtv.org/wiki/ACPI_Wakeup#Manually_test_wakealarm" target="_blank">http://www.mythtv.org/wiki/ACPI_Wakeup#Manually_test_wakealarm</a><br>
><br>
><br>
> $ sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"<br>
> $ sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` ><br>
> /sys/class/rtc/rtc0/wakealarm"<br>
> $ cat /sys/class/rtc/rtc0/wakealarm<br>
> $ cat /proc/driver/rtc<br></div>
> rtc_time ? ? ? ?: 15:45:14<br>
> rtc_date ? ? ? ?: 2012-02-12<br>
> alrm_time ? ? ? : 15:50:06<br>
> alrm_date ? ? ? : ****-**-12<div class="im"><br>
><br>
> PROBLEM!<br>
> date is<br>
> ****-**-12<br>
><br>
> I've read somewhere that **** somewhere in date means: wakeup time was set<br>
> up in the past, and it won't wake up. In fact, it doesn't wake up at all.<br>
><br>
> SECOND TEST<br>
> still according to<br></div>
> <a href="http://www.mythtv.org/wiki/ACPI_Wakeup#Manually_test_wakealarm?(Example" target="_blank">http://www.mythtv.org/wiki/ACPI_Wakeup#Manually_test_wakealarm?(Example</a> to<div class="im"><br>
> convert to epoch time and set date/time)<br>
> I've tried to make a further test by:<br>
><br>
> $ echo 0 > /sys/class/rtc/rtc0/wakealarm<br>
> -bash: /sys/class/rtc/rtc0/wakealarm: Permission denied<br>
><br>
><br>
> It looks like I don't have permission to do that. Let's try with sudo:<br>
><br>
> $ sudo echo 0 > /sys/class/rtc/rtc0/wakealarm<br>
> -bash: /sys/class/rtc/rtc0/wakealarm: Permission denied<br>
><br>
><br>
> still no permission! let's root:<br>
><br>
> $ sudo su<br></div>
> $?echo 0 > /sys/class/rtc/rtc0/wakealarm<br>
> $?date -u --date "Feb 12, 2012 16:00:00" +%s > /sys/class/rtc/rtc0/wakealarm<br>
> $?cat /proc/driver/rtc<br>
> rtc_time ? ? ? ?: 15:50:12<br>
> rtc_date ? ? ? ?: 2012-02-12<br>
> alrm_time ? ? ? : 16:00:00<br>
> alrm_date ? ? ? : 2012-02-12<div class="im"><br>
><br>
><br>
> I've got it! Time is now setted up and, if I do a<br>
><br>
> sudo shutdown -P now<br>
><br>
><br>
> My BE/FE shuts down and wake up at 16:00:00 UTC time (15:00:00 local time)<br>
><br>
> Now: reading the next paragraph (Setting alarm when BIOS clock is in<br>
> localtime)<br>
> I've learned that "The BIOS clock is in localtime, however wakealarm must be<br>
> given a UTC time"<br>
> But my BIOS *SHOULD BE* in UTC time, because of the difference between date<br>
> result and BIOS query:<br>
><br>
> $ date<br>
> Sun Feb 12 14:58:17 CET 2012<br>
> $ cat /proc/driver/rtc<br></div>
> rtc_time ? ? ? ?: 15:58:20<div class="im"><br>
><br>
><br>
> By the way: let's go with next check as suggested in Wiki:<br>
><br>
> $ SECS=`date -u --date "2012-01-12 17:00:00" +%s`<br>
> $ echo 0 > /sys/class/rtc/rtc0/wakealarm<br>
> -bash: /sys/class/rtc/rtc0/wakealarm: Permission denied<br>
><br>
><br>
> Whoops, I'm not a sudoers? (but the setwakeup.sh script is, see later).<br>
> Anyway, let's sudo:<br>
><br>
> $ sudo su<br>
> $ SECS=`date -u --date "2012-02-12 17:00:00" +%s`<br>
> $ echo 0 > /sys/class/rtc/rtc0/wakealarm<br>
> $ echo $SECS > /sys/class/rtc/rtc0/wakealarm<br>
> $ cat /proc/driver/rtc<br></div>
> rtc_time ? ? ? ?: 16:08:32<br>
> rtc_date ? ? ? ?: 2012-02-12<br>
> alrm_time ? ? ? : 17:00:00<br>
> alrm_date ? ? ? : 2012-02-12<div class="im"><br>
><br>
><br>
> Double-check: let's face the "sudo" problem, by going directly to<br></div>
> the?setwakeup.sh, to clean any doubt on the permission thing:<div class="im"><br>
><br>
> $ time=`date -u --date "2012-02-12 18:00:00" +%s`<br>
> $ sudo sh -c "/usr/bin/setwakeup.sh $time"<br>
> $ cat /proc/driver/rtc<br></div>
> rtc_time ? ? ? ?: 16:12:36<br>
> rtc_date ? ? ? ?: 2012-02-12<br>
> alrm_time ? ? ? : 18:00:00<br>
> alrm_date ? ? ? : 2012-02-12<div class="im"><br>
><br>
> So: all checks are checked out.<br>
><br>
> INTEGRATE INTO MYTHTV<br>
><br></div>
> As seen in the latest check, I've already created the?setwakeup.sh script as<div class="im"><br>
> suggested in the Wiki, and my mythtv user is a sudoers of it, so let's<br>
> integrate it in MythTv:<br>
><br>
> I use MythWelcome, so - despite the fact I've read all the Wiki page - I'll<br>
> skip to "Mythwelcome users" paragraph.<br>
> I see two settings related to my problem:<br>
><br>
> mythbackend Shutdown/Wakeup Options (mythtv-setup)<br>
><br>
><br></div>
> Wakeup time format ? ? ? ? ? ? ? ? ? ? : yyyy-MM-ddThh:mm:ss (Must be this<div class="im"><br>
> format for mythshutdown)<br>
><br>
><br>
> that's it (I miss "T" meanings, but I'm just RTFMing)<br>
><br></div>
> Command to set Wakeup Time ? ? ? ? ? ? : mythshutdown --setwakeup $time<div class="im"><br>
><br>
><br>
> all checked.<br>
><br>
> BEGIN NOTE:<br>
> It would be kind to double-check it by query the "settings" table in the<br>
> database, but for un unknown reason it doesn't show up in the database:<br>
><br>
> for the Wakeup time format thing, it only contains a format related to<br>
> MythWelcome (and it doesn't have any relation to the MythWelcome settings,<br>
> see below in this post when I'll get to the MythWelcome settings)<br>
><br>
> mysql> SELECT value, data FROM settings where hostname ='multisala' and data<br></div>
> like ?'%yyyy%' order by value;<br>
><br>
> +-----------------------+------------------+<br>
><br>
> | value ? ? ? ? ? ? ? ? | data ? ? ? ? ? ? |<div class="im"><br>
><br>
> +-----------------------+------------------+<br>
><br>
> | MythWelcomeDateFormat | dddd<br>
><br>
> dd MMM yyyy |<br>
><br>
> +-----------------------+------------------+<br>
><br>
> 1 row in set (0.00 sec)<br>
><br>
><br>
> for the Command to set Wakeup time, no data corresponding to what I've just<br>
> set up:<br>
><br>
> mysql> SELECT value, data FROM settings where hostname ='multisala' and data<br></div>
> like ?'%mythshutdown%' order by value;<div class="im"><br>
><br>
> Empty set (0.00 sec)<br>
><br>
><br>
> END NOTE;<br>
><br>
><br>
> MythShutdown/MythWelcome Settings (mythwelcome --setup or F11 in<br>
> mythwelcome)<br>
><br></div>
> Command to set wakeup time ? ? ? ? ? ? : sudo /usr/bin/setwakeup.sh $time<br>
> Wakeup time format ? ? ? ? ? ? ? ? ? ? : time_t<br>
> nvram-wakeup Restart command ? ? ? ? ? : (Must be blank)<br>
> Command to shutdown ? ? ? ? ? ? ? ? ? ?: sudo shutdown -h now (some systems<div class="im"><br>
> may need "sudo shutdown -P now"<br></div>
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?instead (-h may cause system to<br>
> restart))<br>
> Command to start the frontend ? ? ? ? ?: /usr/bin/mythfrontend<div class="im"><br>
><br>
><br>
> Now i can check them via mysql:<br>
><br>
> mysql> SELECT value, data FROM settings where hostname ='multisala' and<br>
> value like '%shutdown%' order by value;<br>
> +-----------------------------+----------------------------------+<br></div>
> | value ? ? ? ? ? ? ? ? ? ? ? | data ? ? ? ? ? ? ? ? ? ? ? ? ? ? |<br>
> +-----------------------------+----------------------------------+<br>
> | AllowQuitShutdown ? ? ? ? ? | 4 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|<br>
> | MythShutdownNvramCmd ? ? ? ?| sudo /usr/bin/setwakeup.sh $time |<br>
> | MythShutdownNvramRestartCmd | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|<br>
> | MythShutdownPowerOff ? ? ? ?| sudo shutdown -h now ? ? ? ? ? ? |<br>
> | MythShutdownReboot ? ? ? ? ?| sudo shutdown -h -r now ? ? ? ? ?|<br>
> | MythShutdownWakeupTimeFmt ? | time_t ? ? ? ? ? ? ? ? ? ? ? ? ? |<br>
> | MythShutdownXTermCmd ? ? ? ?| xterm ? ? ? ? ? ? ? ? ? ? ? ? ? ?|<div class="im"><br>
> +-----------------------------+----------------------------------+<br>
><br>
> 7 rows in set (0.00 sec)<br>
><br>
><br>
> the setwakeup.sh script is allright:<br>
><br>
> $ cat /usr/bin/setwakeup.sh<br>
> #!/bin/sh<br>
> #$1 is the first argument to the script. It is the time in seconds since<br>
> 1970<br>
> #this is defined in mythtv-setup with the time_t argument<br>
><br>
><br>
> UTCBIOS=true<br>
><br>
> if $UTCBIOS<br>
> then<br></div>
> ? ? #utc bios - use supplied seconds<br>
> ? ? SECS=$1<br>
> else<br>
> ? ? #non utc bios - convert supplied seconds to seconds from<br>
> ? ? #epoch to local time<br>
> ? ? SECS=`date -u --date "\`date --date @$1 +%F" "%T\`" +%s`<div><div class="h5"><br>
> fi<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>
><br>
> and so /etc/sudoers is:<br>
><br>
> $ sudo cat /etc/sudoers |grep mythtv<br>
> %mythtv ALL = NOPASSWD: /sbin/shutdown, /usr/bin/setwakeup.sh,<br>
> /usr/bin/mythshutdown<br>
><br>
><br>
> ALL CHECK FINISHED, NOW WHAT?<br>
><br>
> After all those checks:<br>
> Working:<br>
> - MythWelcome shuts down my BE/FE according to time parameters<br>
> Not working:<br>
> - The MythTv BE/FE doesn't wake up<br>
><br>
> I was thinking that the problem could be related to<br>
><br>
> the UTC/local time thing<br>
><br>
> or<br>
><br>
> the time_t/yyyy-MM-dd hh:mm:ss thing<br>
><br>
> but, after trying to read all the forum posts, mailing list messages, blog<br>
> suggestions, Ubuntu documents, MythTv Wikis, now I am in a big mess: I can't<br>
> understand where I'm doing wrong things.<br>
><br>
> I've made several attempt to change parameters (UTC, time formats) but the<br>
> test are not so easy (I have to make let the BE shuts down and wait for a<br>
> program to check if it wake up, and in the meantime I am using my BE to<br>
> record things, so it's a long process with a "production" system ;) ) and<br>
> now I'm not sure I've tried all the possible combinations done.<br>
><br>
> If any of you can point me in the right direction, I'll be grateful :)<br>
><br></div></div>
> _______________________________________________<br>
> mythtv-users mailing list<br>
> <a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a><br>
> <a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
><br>
<br>
I've been battling the other side of this (getting the system to shut<br>
down) but just last night I followed the same wiki article you did and<br>
my system is now working.<br>
<br>
One thing I had to fix in mine (a long time ago) was that the user<br>
running the backend was not the same as the user running the frontend.<br>
I have a user called mythtv, it runs the backend wchich starts<br>
automatically when the machine boots up. Then there is a user called<br>
mitotv and it is the one the system uses to auto-login to X (Ubuntu<br>
desktop) and this is the user that runs mythwelcome and mythfrontend.<br>
So I had to add mitotv to the mythtv users group so that it could use<br>
the commands listed in the sudoers file under the mythtv group. I<br>
can't tell from your post if you have a similar situation (different<br>
users running different portions of mythtv) but if you do it could be<br>
that the user running mythwelcome/mythshutdown does not have<br>
permission to write to the RTC alarm. In this case the system can<br>
initiate a shutdown but when it tries to write to the RTC the step<br>
fails, however the shutdown continues and now the machine has no alarm<br>
set up to wake it up.<br>
<br>
If you manually bring up the machine, after mythwelcome/mythshutdown<br>
automatically shut it off, can you query the rtc (cat<br>
/proc/drivers/rtc) and confirm that the alarm was properly set top the<br>
time mythshutdown expected and there are no **** in it?<br>
<br>
-Marco<br>
<br><br></blockquote><div><br></div><div><br></div><div>Hi</div><div><br></div><div>When I told:</div><div><br></div><div>> Command to set Wakeup Time ? ? ? ? ? ? : mythshutdown --setwakeup $time<br>><br>><br>> all checked.<br>
</div><div><br></div><div>I was telling a lie: reading the wiki and writing this mail step-bt-step, in fact, I realized that something in my configuration was different.</div><div>In this case, the "Command to set Wakeup Time" was set to</div>
<div><br></div></div><div class="im"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="'courier new', monospace">sudo sh -c "/usr/bin/setwakeup.sh $time"</font></div>
</div></blockquote></div><div class="gmail_quote"><div><br></div><div>instead than</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="'courier new', monospace">mythshutdown --setwakeup $time</font></div>
</div></blockquote><div class="gmail_quote"><div><br></div><div>also </div><div><br></div></div><div class="im"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote"><div><font face="'courier new', monospace">sudo sh -c "/usr/bin/setwakeup.sh $time"</font></div>
</div></blockquote></div><div class="gmail_quote"><div><br></div><div>was used in MythWelcome setup instead than</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_quote">
<div>
<font face="'courier new', monospace">sudo /usr/bin/setwakeup.sh $time</font></div><div><br></div></div></blockquote>So I changed them while writing, thiking that they should'nt be significants.<div><br></div>
<div>On the contrary, they are. Or, at least, I think that the former one is: in fact, about one half an hour after I wrote here - and those parameters was fixed - the MythTv BE/FE started up to record a test program I scheduled.</div>
<div><br></div><div>So, thank you anyway: I could sove the problem just by having someone reading my blethers ;-)</div><div><br></div><div>About your experience: both my backend and frontend are running on a same user. It's not the "mythtv" user - I had to change some settings - permissions and their default - in the past to make it work correctly - but they are using my usual linux username, so this should not be a problem.</div>
<div><br></div><div>Now my next steps are:</div><div>- waking up while feeding xmltv - I don't know how to tell mythtv that crontab is set at a specific hour</div><div>- waking up from remote requests - it will be hard because the BE/FE is wireless-connected to the router, and no Wake Up on LAN feature on my WiFi USB dongle.</div>
<div><br></div><div>But for now I am satisfied.</div>
</blockquote></div><br></div>