<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Sep 1, 2013 at 4:46 PM, Stefan Pappalardo <span dir="ltr">&lt;<a href="mailto:sjuk@gmx.de" target="_blank">sjuk@gmx.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  

    
  
  <div bgcolor="#FFFFFF" text="#000000">
    I try to answer your questions...<br>
    <div>
      <div>
        <div> <br>
          Q: The wiki didn&#39;t cover it and your settings don&#39;t either, so
          I&#39;m forced to assume that the &quot;Startup Command&quot; should be left
          blank?(Backend&gt;General&gt;Shutdown/Wakeup options page) My
          system will shut the backend down but will not wakeup for
          recordings, at this point. I can find no reference of what to
          put in the &quot;Startup Command&quot; box.<br>
          A: You can safely leave it blank. For Details follow this link
          to the wiki <a href="http://www.mythtv.org/wiki/User_Manual:Detailed_configuration_Backend" target="_blank">http://www.mythtv.org/wiki/User_Manual:Detailed_configuration_Backend</a>.<br>
          <br>
          Q: I did insert a disable hwclock script as directed by the
          wiki, how did you discern that it wasn&#39;t needed in your case?<br>
          A: Try and error. Are you sure the disabling of the hwclock
          update does work correctly? When you Post your method, I can
          have a look at it. (Four eyes see more than two.)<br>
          <br>
          Q: Below is my setwakeup.sh, quite different than yours, is
          this due to the local verses UTC difference?<br>
          A: I would recommend you to try my setwakeup.sh. But in your
          case you have to set &quot;UTCBIOS&quot; to false.<br>
          I have found it in the &quot;mythwelcome users&quot; section of the
          ACPI_Wakeup Wiki entry <a href="http://www.mythtv.org/wiki/ACPI_Wakeup" target="_blank">http://www.mythtv.org/wiki/ACPI_Wakeup</a><br>
          <br>
          Q: I have what has been referred to as the &quot;fussy BIOS&quot; too.<br>
          A: It&#39;s the same for me. It only woks if I disable &quot;Power-On
          by Alarm&quot; in the BIOS.<br>
          <br>
          Q: Block shutdown before client connected: unchecked &gt;
           checked, maybe I misinterpreted?<br>
          A: Depends on your Setup. For Details follow this link to the
          wiki <a href="http://www.mythtv.org/wiki/User_Manual:Detailed_configuration_Backend" target="_blank">http://www.mythtv.org/wiki/User_Manual:Detailed_configuration_Backend</a>.<br>
          <br>
          Q: Idle shutdown timeout (secs): 180 &gt; currently at 0 to
          disable shutting down<br>
          A: Depends on what you desire. I want my machine to shutdown
          after 180 seconds if it is idle. Very comfortable in addition
          with mythwelcome.<br>
          You only have to close the frontend. Shutdown will do
          automatically. Also good for testing. Give it a try.<br>
          <br>
          Q: Max. wait for recording (min): 15 &gt; can&#39;t remember why I
          set to 120<br>
          A: With this value the machine will not shutdown if your
          recording rules are busy everey two hours.<br>
          <br>
          Q: Command to set Wakeup Time:  sudo sh -c
          &quot;/usr/bin/setwakeup.sh $time&quot; &gt; sudo /usr/bin/setwakeup.sh
          $time (wiki didn&#39;t cover sh -c or quotation marks)<br>
          A: I had to do it because of mythwelcome (<a href="http://www.gossamer-threads.com/lists/mythtv/users/507639?search_string=Mythwelcome%20doesnt%20trigger%20setwakeup;#507639" target="_blank">http://www.gossamer-threads.com/lists/mythtv/users/507639?search_string=Mythwelcome%20doesnt%20trigger%20setwakeup;#507639</a>)<br>

          <br>
          Q: Then there is the next page &quot;Backend Wakeup Settings&quot;...<br>
          A: These is for WakeOnLan and has nothing to do with &quot;wake on
          alam&quot;.<br>
          <br>
          Hint: As a good starting point for configuration descriptions
          I would recommend you to have a look at the wiki (<a href="http://www.mythtv.org/wiki/User_Manual:Detailed_configuration_Backend" target="_blank">http://www.mythtv.org/wiki/User_Manual:Detailed_configuration_Backend</a>)<br>

          <br>
          Good Luck ;-)<br>
          <br>
          <pre cols="72">Stefan Pappalardo</pre>
          Am 01.09.2013 20:28, schrieb Daryl McDonald:<br></div></div></div></div></blockquote><div><br></div><div>Well I mirrored your settings and scripts and scheduled a recording for 7p.m. gave the system two minutes to shutdown the backend and set the alarm then powered off, and waited until 7:05p.m. and it did not come on. Does the last line of the following output indicate UTC time?:</div>
<div> daryl@daryl-A780L3C:~$  sudo grep -i rtc /var/log/dmesg</div><div>[sudo] password for daryl: </div><div>[    0.199663] RTC time: 19:04:25, date: 09/01/13</div><div>[    1.222545] rtc_cmos 00:03: RTC can wake from S4</div>
<div>[    1.222673] rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0</div><div>[    1.222692] rtc0: alarms up to one month, y3k, 114 bytes nvram</div><div>[    1.229942] rtc_cmos 00:03: setting system clock to 2013-09-01 19:04:26 UTC (1378062266)</div>
<div><br></div><div>This is what my disable hwclock script looks like:</div><div><div>daryl@daryl-A780L3C:~$ cat /etc/init/hwclock-save.conf</div><div># hwclock-save - save system clock to hardware clock</div><div># hwclock-save - save system clock to hardware clock</div>
<div>#</div><div># This task saves the time from the system clock back to the hardware</div><div># clock on shutdown.</div><div><br></div><div>description<span class="" style="white-space:pre">        </span>&quot;save system clock to hardware clock&quot;</div>
<div><br></div><div>start on runlevel [06]</div><div><br></div><div>task</div><div><br></div><div>script</div><div>    . /etc/default/rcS</div><div>    [ &quot;$UTC&quot; = &quot;yes&quot; ] &amp;&amp; tz=&quot;--utc&quot; || tz=&quot;--localtime&quot;</div>
<div>    [ &quot;$BADYEAR&quot; = &quot;yes&quot; ] &amp;&amp; badyear=&quot;--badyear&quot;</div><div>    ACPITIME=`cat /proc/acpi/alarm`</div><div>    exec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear</div>
<div>    echo &quot;$ACPITIME&quot; &gt; /proc/acpi/alarm</div><div>end script</div><div>daryl@daryl-A780L3C:~$ </div></div><div><br></div><div>and here is my setwakeup.sh:</div><div><div>daryl@daryl-A780L3C:~$ cat /usr/bin/setwakeup.sh</div>
<div>#!/bin/sh</div><div>#</div><div># set ACPI Wakeup time</div><div># usage: setwakeup.sh seconds</div><div>#    seconds - number of seconds from epoch to UTC time (time_t time format)</div><div>#</div><div># set UTCBIOS to true if bios is using UTC time</div>
<div># set UTCBIOS to false if bios is using local time</div><div><br></div><div>UTCBIOS=false</div><div><br></div><div>if $UTCBIOS</div><div>then</div><div>    #utc bios - use supplied seconds</div><div>    SECS=$1</div>
<div>else</div><div>    #non utc bios - convert supplied seconds to seconds from</div><div>    #epoch to local time</div><div>    SECS=`date -u --date &quot;\`date --date @$1 +%F&quot; &quot;%T\`&quot; +%s`</div><div>fi</div>
<div><br></div><div>echo 0 &gt; /sys/class/rtc/rtc0/wakealarm       # clear alarm</div><div>echo $SECS &gt; /sys/class/rtc/rtc0/wakealarm   # write the waketime</div></div><div><br></div><div>My two eyes are tired and confused, what do you see?</div>
<div><br></div><div>Thanks Daryl</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<div><div><div>
        </div>
        <blockquote type="cite">
          <div dir="ltr"><br>
            <div class="gmail_extra"><br>
              <br>
              <div class="gmail_quote"><div><div class="h5">On Sun, Sep 1, 2013 at 11:51 AM,
                Stefan Pappalardo <span dir="ltr">&lt;<a href="mailto:sjuk@gmx.de" target="_blank">sjuk@gmx.de</a>&gt;</span> wrote:<br>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                  <div bgcolor="#FFFFFF" text="#000000">
                    <div>Hi Daryl, here you are.<br>
                      <br>
                      Operating System: Ubuntu 12.04.3 LTS<br>
                      Motherboard: Gigabyte GA-MA785GM-US2H<br>
                      BIOS RTC (real time clock) is set to UTC (not set
                      to localtime)<br>
                      <br>
                      The machine is backend and frontend.<br>
                      Mythshutdown is controlled by mythwelcome.<br>
                      <br>
                      Power Management Setup<br>
                      ---------------------------------------<br>
                      ACPI Suspend Type: S3 (STR)<br>
                      HPET-Support: Disabled<br>
                      Power-On by Alarm: Disabled<br>
                      ErP Support: Disabled<br>
                      <br>
                      Hints<br>
                      -------<br>
                      1: With HPET-Support and ErP Support enabled all
                      seemed to work fine, but the system never waked
                      up.<br>
                      2: Setting a fixed Power-On by Alarm time can get
                      into conflict with the time mythtv sets. In my
                      case it only works when I disable it in BIOS.<br>
                      3: I can only choose between S1 (Power on Suspend)
                      and S3 (Suspend to RAM) in BIOS. But I always use
                      S5 (Soft Off).<br>
                      <br>
                      Kernel<br>
                      ---------<br>
                      sjuk@obelix:~$ uname -r<br>
                      3.2.0-52-generic<br>
                      <br>
                      sjuk@obelix:~$ sudo grep -i rtc /var/log/dmesg<br>
                      [    0.157612] RTC time: 14:28:52, date: 09/01/13<br>
                      [    1.592355] rtc_cmos 00:04: RTC can wake from
                      S4<br>
                      [    1.592440] rtc_cmos 00:04: rtc core:
                      registered rtc_cmos as rtc0<br>
                      [    1.592466] rtc0: alarms up to one month, 242
                      bytes nvram<br>
                      [    1.598070] rtc_cmos 00:04: setting system
                      clock to 2013-09-01 14:28:54 UTC (1378045734)<br>
                      <br>
                      sjuk@obelix:~$ cat /proc/driver/rtc<br>
                      rtc_time    : 14:50:45<br>
                      rtc_date    : 2013-09-01<br>
                      alrm_time    : 06:10:00<br>
                      alrm_date    : 2013-09-02
                      <div><br>
                        alarm_IRQ    : no<br>
                        alrm_pending    : no<br>
                        update IRQ enabled    : no<br>
                        periodic IRQ enabled    : no<br>
                        periodic IRQ frequency    : 1024<br>
                        max user IRQ frequency    : 64<br>
                        24hr        : yes<br>
                        periodic_IRQ    : no<br>
                        update_IRQ    : no<br>
                      </div>
                      HPET_emulated    : no
                      <div><br>
                        BCD        : yes<br>
                        DST_enable    : no<br>
                        periodic_freq    : 1024<br>
                        batt_status    : okay<br>
                        <br>
                      </div>
                      Disable hwclock updates<br>
                      ---------------------------------<br>
                      On my system there is no need to disable the
                      hwclock updates<br>
                      <br>
                      Setwakeuptime (don&#39;t forget to make it executable)<br>
-----------------------------------------------------------------<br>
                      sjuk@obelix:~$ cat /usr/bin/setwakeup.sh <br>
                      #!/bin/sh<br>
                      #<br>
                      # set ACPI Wakeup time<br>
                      # usage: setwakeup.sh seconds<br>
                      #    seconds - number of seconds from epoch to UTC
                      time (time_t time format)<br>
                      #<br>
                      # set UTCBIOS to true if bios is using UTC time<br>
                      # set UTCBIOS to false if bios is using local time<br>
                      <br>
                      UTCBIOS=true<br>
                      <br>
                      if $UTCBIOS<br>
                      then<br>
                          #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 &quot;\`date --date @$1 +%F&quot;
                      &quot;%T\`&quot; +%s`<br>
                      fi<br>
                      <br>
                      echo 0 &gt; /sys/class/rtc/rtc0/wakealarm       #
                      clear alarm<br>
                      echo $SECS &gt; /sys/class/rtc/rtc0/wakealarm   #
                      write the waketime<br>
                      <br>
                      Sudo<br>
                      -------<br>
                      sjuk@obelix:~$ sudo cat /etc/sudoers.d/mythwelcome
                      <br>
                      Defaults:mythtv !requiretty<br>
                      %mythtv ALL = NOPASSWD: /bin/sh,
                      /usr/bin/setwakeup.sh, /sbin/shutdown,
                      /usr/bin/mythshutdown<br>
                      <br>
                      Backend (General &gt; Shutdown/Wakeup Options)<br>
--------------------------------------------------------------<br>
                      Block shutdown before client connected: unchecked<br>
                      Idle shutdown timeout (secs): 180<br>
                      Max. wait for recording (min): 15<br>
                      Startup before rec. (secs): 600<br>
                      Wakeup time format: time_t<br>
                      Command to set Wakeup Time:  sudo sh -c
                      &quot;/usr/bin/setwakeup.sh $time&quot;<br>
                      Server halt command: sudo shutdown -h now<br>
                      <br>
                      <br>
                      When you have a question please post your settings
                      corresponding to the question.<br>
                      <br>
                      Good Luck ;-)<br>
                      <br>
                      Stefan<br>
                    </div>
                    <br>
                  </div>
                </blockquote>
                </div></div><div><div class="h5"><div>The wiki didn&#39;t cover it and your settings don&#39;t
                  either, so I&#39;m forced to assume that the &quot;Startup
                  Command&quot; should be left
                  blank?(Backend&gt;General&gt;Shutdown/Wakeup options
                  page) My system will shut the backend down but will
                  not wakeup for recordings, at this point. I can find
                  no reference of what to put in the &quot;Startup Command&quot;
                  box. Secondly I am using, to the best of my knowledge,
                  Local time in the RTC, because I employ a dual boot,
                  and as I compair terminal out put it seems to be off
                  by a day:</div>
                <div>
                  <div>daryl@daryl-A780L3C:~$ sudo grep -i rtc
                    /var/log/dmesg</div>
                  <div>[sudo] password for daryl: </div>
                  <div>[    0.200520] RTC time: 14:43:57, date: 08/31/13</div>
                  <div>[    1.242563] rtc_cmos 00:03: RTC can wake from
                    S4</div>
                  <div>[    1.242708] rtc_cmos 00:03: rtc core:
                    registered rtc_cmos as rtc0</div>
                  <div>[    1.242731] rtc0: alarms up to one month, y3k,
                    114 bytes nvram</div>
                  <div>[    1.250110] rtc_cmos 00:03: setting system
                    clock to 2013-08-31 14:43:58 UTC (1377960238)</div>
                </div>
                <div><br>
                </div>
                <div>I got this reading Sunday Sept 1st just before
                  2p.m.</div>
                <div><br>
                </div>
                <div>Although the time is correct from this probe:</div>
                <div><br>
                </div>
                <div>
                  <div>daryl@daryl-A780L3C:~$ cat /proc/driver/rtc</div>
                  <div>rtc_time<span style="white-space:pre-wrap"> </span>:
                    13:32:16</div>
                  <div>rtc_date<span style="white-space:pre-wrap"> </span>:
                    2013-09-01</div>
                  <div>alrm_time<span style="white-space:pre-wrap">
                    </span>: 18:45:00</div>
                  <div>alrm_date<span style="white-space:pre-wrap">
                    </span>: 2013-08-31</div>
                  <div>alarm_IRQ<span style="white-space:pre-wrap">
                    </span>: no</div>
                  <div>alrm_pending<span style="white-space:pre-wrap"> </span>: no</div>
                  <div>update IRQ enabled<span style="white-space:pre-wrap"> </span>: no</div>
                </div>
                <div><br>
                </div>
                <div>Apparently one of my attempt to wakeup is still
                  showing because it failed to execute.</div>
                <div>I did insert a disable hwclock script as directed
                  by the wiki, how did you discern that it wasn&#39;t needed
                  in your case?</div>
                <div><br>
                </div>
                <div>Below is my setwakeup.sh, quite different than
                  yours, is this due to the local verses UTC
                  difference?:</div>
                <div>
                  <div>daryl@daryl-A780L3C:~$ cat /usr/bin/setwakeup.sh</div>
                  <div>#!/bin/sh</div>
                  <div>#$1 is the first argument to the script. It is
                    the time in seconds since 1970</div>
                  <div>#this is defined in mythtv-setup with the time_t
                    argument</div>
                  <div><br>
                  </div>
                  <div>echo 0 &gt; /sys/class/rtc/rtc0/wakealarm    
                     #this clears your alarm.</div>
                  <div>echo $1 &gt; /sys/class/rtc/rtc0/wakealarm    
                    #this writes your alarm</div>
                  <div>daryl@daryl-A780L3C:~$ </div>
                </div>
                <div><br>
                </div>
                <div>I have what has been referred to as the &quot;fussy
                  BIOS&quot; too, and thought I was getting somewhere,
                  because after shutting down the system, before
                  midnight, I would find it on the next morning. I had
                  enabled wake from RTC and left the default setting
                  &quot;every day&quot; and &quot;00:00:00&quot;. Below is my kernel:</div>
                <div>
                  <div>daryl@daryl-A780L3C:~$ uname -r</div>
                  <div>3.5.0-39-generic</div>
                </div>
                <div>My values appear after the &gt; symbol</div>
                <div>
                  <div>Block shutdown before client connected: unchecked
                    &gt;  checked, maybe I misinterpreted?</div>
                  <div>Idle shutdown timeout (secs): 180 &gt; currently
                    at 0 to disable shutting down</div>
                  <div>Max. wait for recording (min): 15 &gt; can&#39;t
                    remember why I set to 120</div>
                  <div>Startup before rec. (secs): 600 &gt; 600</div>
                  <div>Wakeup time format: time_t  &gt; time_t</div>
                  <div>Command to set Wakeup Time:  sudo sh -c
                    &quot;/usr/bin/setwakeup.sh $time&quot; &gt; sudo
                    /usr/bin/setwakeup.sh $time (wiki didn&#39;t cover sh -c
                    or quotation marks)</div>
                  <div>Server halt command: sudo shutdown -h now &gt;
                    sudo shutdown -p </div>
                </div>
                <div><br>
                </div>
                <div>Then there is the next page &quot;Backend Wakeup
                  Settings&quot;:</div>
                <div>Delay between wake attempts (secs)  default 0</div>
                <div>Wake attempts  default 5</div>
                <div>Wake Command   blank</div>
                <div>It continues with slave backend settings, which I
                  don&#39;t have, but I need direction for the first three
                  boxes.</div>
                <div><br>
                </div>
                <div>Daryl</div>
                <div><br>
                </div>
              </div></div></div>
              <br>
            </div>
          </div>
          <br>
          <fieldset></fieldset>
          <br><div class="im">
          <pre>_______________________________________________
mythtv-users mailing list
<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a>
<a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a></pre>
        </div></blockquote>
      </div>
    </div>
  </div>

<br>_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org">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></blockquote></div><br></div></div>