[mythtv-users] wakeup

Mike Bibbings mike.bibbings at gmail.com
Fri Sep 14 17:33:57 UTC 2018


On 14/09/18 17:00, Daryl McDonald wrote:
>
>
> On Fri, Sep 14, 2018 at 9:58 AM Mike Bibbings <mike.bibbings at gmail.com 
> <mailto:mike.bibbings at gmail.com>> wrote:
>
>     On 12/09/18 23:54, Daryl McDonald wrote:
>>
>>
>>     On Wed, Sep 12, 2018 at 2:03 PM Daryl McDonald
>>     <darylangela at gmail.com <mailto:darylangela at gmail.com>> wrote:
>>
>>
>>
>>         On Wed, Sep 12, 2018 at 10:53 AM Nicolas Krzywinski
>>         <myth2 at site7even.de <mailto:myth2 at site7even.de>> wrote:
>>
>>             Am 12.09.2018 um 13:52 schrieb Daryl McDonald:
>>>
>>>
>>>             On Wed, Sep 12, 2018 at 3:32 AM jksj
>>>             <jksjdevelop at gmail.com <mailto:jksjdevelop at gmail.com>>
>>>             wrote:
>>>
>>>                 On 12/09/18 00:53, Daryl McDonald wrote:
>>>>                 I have the same set up in 18.04 as I did in 16.04
>>>>                 but my box doesn't wake up in time, once it came on
>>>>                 two hours late, since then I've pushed the button
>>>>                 myself. Is there a time setting I'm missing
>>>>                 somewhere? TIA  Daryl
>>>>
>>>>
>>>>                 _______________________________________________
>>>>                 mythtv-users mailing list
>>>>                 mythtv-users at mythtv.org
>>>>                 <mailto: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
>>>
>>>                 Mine wakes on time to record programs, the same as
>>>                 in 16.04 but I think it does not do this for the
>>>                 daily wake up time set in Mythwelcome. Could that be
>>>                 your issue?
>>>
>>>                 No, I don't use Mythwelcome, but thanks for the
>>>                 reply, I'll go over my setup again, I must have
>>>                 missed something. Curious that the wakeup_test.sh,
>>>                 thanks Bill, restarts 16.04 and not 18.04 when the
>>>                 report from (bad syntax from memory) proc driver rtc
>>>                 is identical from both distros.
>>>                 _______________________________________________
>>>                 mythtv-users mailing list
>>>                 mythtv-users at mythtv.org <mailto: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
>>>
>>             Hey Daryl,
>>
>>             recently I set up a new MythTV system (see signature) and
>>             there I switched to the new method of using only:
>>             /usr/sbin/rtcwake --date "<datestring>" --mode no
>>             to set the wakeup time.
>>
>>             This works fine for my system.
>>
>>             The MythTV wiki was quite confusing as there is a lot of
>>             outdated and ambigous information, but you can find the
>>             above mentioned call as well, if you search for it.
>>
>>             Btw., I made a small script to also update the LCD
>>             display with the next scheduled automatic wakeup time:
>>
>>                 me at mysystem:~$ cat /usr/sbin/wakewrapper.sh
>>                 #!/bin/bash
>>                 # Sets RTC wake time and inserts the time into
>>                 LCDd.conf for letting the display inform about the
>>                 next wakeup time when the system is off
>>
>>                 if [ -z "$1" ]
>>                     then
>>                         echo "Usage $0 <time>"
>>                         exit 1
>>                 fi
>>
>>                 # set wake time
>>                 wakestring=`/usr/sbin/rtcwake --date "$1" --mode no`
>>
>>                 # grab the confirmed wake time
>>                 wakestring=`rtcwake --mode show | grep Alarm`
>>
>>                 # extract only time of confirmation output
>>                 waketime=${wakestring:15:16}
>>
>>                 # convert utc time string to local time
>>                 waketime=`date --date="$waketime +0000" +"%d. %b %T"`
>>
>>                 # update LCDd.conf with wake time
>>                 sed -i -e "s/GoodBye = \"[^H].*/GoodBye =
>>                 \"$waketime\"/g" /etc/LCDd.conf
>>
>>                 # reload LCDd to let it use the new config
>>                 systemctl reload-or-restart LCDd.service
>>
>>             The sed command to update the LCDd.conf has to be adapted
>>             to the target environment. It needs to filter out the
>>             second GoodBye line, that should not be overwritten. Mine
>>             begins with "H", therefore the regex skips every GoodBye
>>             lines that have a value beginning with "H".
>>
>>             Have fun!
>>             Nicolas
>>
>>             -- 
>>             Nicolas
>>
>>             MythTV Version : v29.1-22-g675676b
>>             Ubuntu 18.04 LTS (4.15.0-23-generic)
>>             Digital Devices GmbH Octopus DVB Adapter via ddbridge kernel module
>>             15c2:0036 SoundGraph Inc. LC16M VFD Display/IR Receiver (imon) via ir-keytable
>>             VGA compatible controller: Intel Corporation Device 3e91 (Intel(R) Core(TM) i3-8100T)
>>
>>             _______________________________________________
>>             mythtv-users mailing list
>>             mythtv-users at mythtv.org <mailto: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
>>
>>
>>         Thanks Nicolas, I've just changed the BE setting from "$time"
>>         to "-mode no" That part of the wiki was confusing for me too
>>         until now. I'll report the results here later this evening.
>>
>>
>>     The box didn't wake on its own, and it looks like the change to
>>     "-mode no" is a step backward, from
>>     /var/log/mythtv/hwclock-rebootTime I see no new writes:
>>     Current Time      ->Tue Sep 11 23:21:32 EDT 2018
>>     Shutting down for ->13hrs:27Mins
>>     Wake up at approx.->Wed Sep 12 17:49:00 EDT 2018
>>     ------------------------------------------------------
>>     Current Time      ->Wed Sep 12 09:51:20 EDT 2018
>>     Shutting down for ->02hrs:57Mins
>>     Wake up at approx.->Wed Sep 12 17:49:00 EDT 2018
>>     and if the math can be taken literally, this looks faulty with
>>     the "$time" setting.  Ideas and suggestions welcome.
>
>     Your original post indicates failure to powerup at the appropriate
>     time.
>
>     Attached is the script autowakeuptest.sh I use to test wakeup on
>     xubuntu systems (16.04 and up), it saves copy and paste from the
>     Mythtv ACPI wiki page.
>     Just make it executable (chmod +x) and run it. If it does not
>     powerup in 5 minutes that problem needs to be fixed.
>
>     I have also attached an alternative script (autowakeuptest2.sh)
>     which uses rtcwake instead.
>
>     If you want to use rtcwake with mythtv you need to modify script
>     in /usr/bin/setwakeup.sh as follows:
>     replace lines
>     echo 0 > /sys/class/rtc/rtc0/wakealarm      #this clears your alarm.
>     echo $1 > /sys/class/rtc/rtc0/wakealarm     #this writes your alarm
>
>     with one line
>     sudo /usr/sbin/rtcwake --mode no -t $1
>
>
>     Note: "--mode no" not "-mode no" (the Mythtv ACPI wiki has a
>     missing - character in the example /usr/sbin/rtcwake -mode no)
>
>
>     Mike
>
>     _______________________________________________
>     mythtv-users mailing list
>     mythtv-users at mythtv.org <mailto: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.or <https://forum.mythtv.org>g
>
> Thanks Mike, I'm still struggling with this, I downloaded both 
> scripts, chmod'd them. I tested each and both shutdown but neither 
> restarted after five minutes. This was all done without any 
> modifications to the BE setup, where do we go from here?
Looks like there is something in your Bios settings preventing wakeup 
from working.
Assuming that you have not made any changes to the Bios settings between 
using ubuntu 16.04 and 18.04, it is possible that the default grub entry 
needs adjusting.

But first just make sure mythtv-backend does not run (I don't know what 
mythtv-backend does, if anything, when the system is shutdown via "sudo 
shutdown -h now" ) you need to temporarily disable mythtv-backend  :
sudo systemctl stop mythtv-backend
sudo systemctl disable mythtv-backend

now reboot the system and try the scripts again. If it wakes up after 5 
minutes, there is likely a problem with mythtv backend settings, if it 
does not wakeup try changing GRUB_CMDLINE_LINUX_DEFAULT command line in 
file /etc/default/ grub, it is unfortunately a bit of trial and error to 
get this working.

In the past, depending on the motherboard I have had add either 
iommu=soft and/or hpet=disable to the default 
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" command line before rtc wakeup 
would work.

Before changing file /etc/default/grub make a copy and put it some where 
safe just in case it all goes wrong.
try changing to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash iommu=soft hpet=disable"

after editing file /etc/default/grub you need to run
sudo update-grub
sudo reboot

now try the scripts again, if wakeup works great, you can then narrow 
down which of the two options you really need. Then enable mythtv-backend:
sudo systemctl enable mythtv-backend
sudo systemctl start mythtv-backend   # or simply reboot


  If wakeup does not work, it means going into the Bios to try some 
different settings e.g. disable RTC Wakeup, disable C states - if you 
can post details of your motherboard and the CPU it might help.

Mike



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20180914/235aacd0/attachment.html>


More information about the mythtv-users mailing list