LinHES Forums
http://forums.linhes.org/

ACPI Wakeup - what is the next $time
http://forums.linhes.org/viewtopic.php?f=11&t=18114
Page 1 of 1

Author:  ilmonstro [ Mon Mar 31, 2008 6:29 pm ]
Post subject:  ACPI Wakeup - what is the next $time

First, thanks to all for the great writeups on ACPI Wakeup.
I have been attempting to get ACPI wakeup along with Mythshutdown/Mythwelcome working and I am almost there. My myth box will start itself based on the time set in /proc/acpi/alarm and will then shut itself down. BUT the time of the next scheduled recording is not getting set in /proc/acpi/alarm. In myth setup I have Shutdown/Wakeup options -> Set wakeuptime command to "sudo mythshutdown --setwakeup $time". Here, I believe, $time gets passed to the /usr/bin/setwakeup.sh shell script that is called by mythshutdown when it is used with the --setwakeup option. HOW DOES $time GET SET? I believe it should be based on the time of the next scheduled recording but how does this happen? Is there any way to test the value of $time is set?

Author:  nmcaullay [ Mon Mar 31, 2008 9:29 pm ]
Post subject: 

Gday ilmonstro,

From memory,
1) Mythwelcome asks for the status of the backend/frontend to determine if its time to shutdown
2) Once it determines that nothing is running, it uses the parameters you set in the backend to start the shutdown process

I believe that myth recognises the $TIME keyword and replaces it with funny seconds-since-1970..

The way i figured it out was to echo at each step of the setwakeup.sh to a file to see what was being passed...

I can post my setup if you like to see if theres any thing in there that can help... im at work, so cant do that for a few hours..

Let me know if theres anything i can assist with..

Cheers,

Nathan

Author:  alien [ Tue Apr 01, 2008 1:23 am ]
Post subject: 

One clarification. It is actually the backend that starts the whole process.

The backend calls mythshutdown --setwakeup $time when it is idle. Since the backend knows when it will need to record again, it knows the $time.

Mythshutdown converts this into seconds-since-1970 and calls its configured "nvram-wakeup command" (in your case, setwakeup.sh). Note that mythshutdown may modify the time if there is a daily wakeup period set.

As nmcaullay suggests, the easiest way to debug is to edit the "nvram-wakeup command" script with debug commands like "echo $time >> /tmp/debug.txt".

How are you shutting down the box? The only way this works is if the backend does the shutdown. Ex. If you exit the frontend to mythwelcome, see the "myth is shutting down in xxx seconds" countdown go to zero and then the box shuts down.

Author:  ilmonstro [ Tue Apr 01, 2008 9:06 pm ]
Post subject: 

Good idea! I have annotated my script as suggested, the output follows:

Inputs --settime 1207130400
Current time -> Tue Apr 1 22:29:45 EDT 2008
Requested machine up by 2008-04-02 06:00:00 -0400
Will wake up at 2008-04-02 05:58:00 -0400
Sleep for 0 days 7:28:15

What is happening is the $time value 1207130400 in the case above is the Period 1 start time (which I have set to 06:00) on the MythWelcome Settings. Yet when I look at Upcoming Recordings, the next scheduled recording is 4/1 11:00 PM, therefore the value passed into the script should have been 1207105200 (which is 7 hours [25300 seconds] earlier than the value actually sent). Any thoughts or hints appreciated!

Author:  alien [ Wed Apr 02, 2008 1:04 am ]
Post subject: 

Hmmmm.... I've never had that problem. The times were always magically right for me.

You might try clearing the daily wakeups to see what you get.

The only other thing I can think of is that the backend isn't passing the time correctly to mythshutdown -setwakeup. In particular, check the time format in myth setup:
Code:
Wakeup time format:         yyyy-MM-ddThh:mm
Set wakeup time command:    sudo mythshutdown --setwakeup $time

Author:  iscraigh [ Sat Apr 26, 2008 10:44 pm ]
Post subject: 

not trying to hijack the thread but I have a similar problem. My wake up time is getting set an hour later than it should. According to date my timezone is correct. I am assuming it has to do with daylight savings time but I do not know how to correct this, any suggestions?

Thanks

Craig

Author:  marc.aronson [ Sun Apr 27, 2008 8:17 am ]
Post subject: 

iscraigh wrote:
not trying to hijack the thread but I have a similar problem. My wake up time is getting set an hour later than it should. According to date my timezone is correct. I am assuming it has to do with daylight savings time but I do not know how to correct this, any suggestions?

Thanks

Craig


Craig, I've provide I response to this question on your original thread on this topic at http://mysettopbox.tv/phpBB2/viewtopic. ... 534#110534

Marc

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/