View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 9 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Dec 01, 2007 6:32 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
Hardware details:
Athlon 1900+
Asus A7N8X-VM motherboard (yeah it's 4-years-old)
As the title says, I'm running R5F27.

I was reading fra's post on this topic as well as the ACPI Wakeup mythtv wiki page trying to get my hardware to work with this useful feature. So far I have been unsuccessful to get the machine to startup on its own.

The board does indeed have a BIOS option for RTC wakeup under "Power>Power Up Control> RTC Resume:Image

As-per fra's post, I tried this:
Code:
# cat /proc/acpi/alarm
2007-00-00 00:00:00


I then his echo + command
Code:
# echo "+00-00-00 00:05:00" > /proc/acpi/alarm
# cat /proc/acpi/alarm
0007-12-01 12:27:04


After I issued a shutdown, the machine didn't come up.

I did the same thing, except this time I manually entered the date (notice the year above was 0007 using fra's code) to be like this:
Code:
# echo "2007-12-01 12:35:00" > /proc/acpi/alarm
# cat /proc/acpi/alarm
2007-12-01 12:35:00


I shutdown again, but the machine didn't come back up. I'm assuming my hardware just doesn't work with ACPI wakeup? I have tried the above with the RTC option both disabled and enabled in the BIOS with the same result.

One thing I noticed, my timezone is EST (GMT-5 h), but the /proc/acpi/alarm seems to be using GMT. I also tried the above command using my time zone's time (i.e. 12:35:00 became 07:35:00), but again, was met with the same result.

My question now is: whatelse within my R5F27 might I need to have enabled for this to work properly?

Thanks all!

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Last edited by graysky on Sun Dec 02, 2007 6:14 am, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 01, 2007 7:34 am 
Offline
Joined: Mon Aug 29, 2005 4:04 pm
Posts: 729
Location: Philadelphia, PA US
Have a look at the "Fussy BIOS" stuff on the MythTV WIKI.

I had to modify /etc/init.d hwclock.sh that would end up writing the wake up time.

check my post on page 4 of this topic.

http://mysettopbox.tv/phpBB2/viewtopic. ... 4&start=45


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 01, 2007 12:42 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
Thanks man, that did the trick. Only question that remains now is how does one shutdown the machine correctly? From the KNOPPMYTH menu? I read somewhere if I issue a
Code:
$ sudo shutdown -h now
that more or less breaks the auto startup.

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 01, 2007 2:32 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
I think you are just supposed to exit to MythWelcome and let the backend reach its idle timeout so it performs the shutdown.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 01, 2007 3:00 pm 
Offline
Joined: Mon Aug 29, 2005 4:04 pm
Posts: 729
Location: Philadelphia, PA US
Quote:
Only question that remains now is how does one shutdown the machine correctly? From the KNOPPMYTH menu? I read somewhere if I issue a
that more or less breaks the auto startup.


Right, If you shutdown though command line or KM menu won't wake. I personally removed the KM shutdown menu after implementing ACPI wakeup. From the MythWelcome menu you can shutdown though, this will write the correct wakeup time.

Here is my setupwake script. I put some extra logging in mine for initial troubleshooting obviously YMMV. I'm in EST timezone.

Code:
#!/bin/bash
stamp_file=/home/mythtv/timestamp
log1=/home/mythtv/log1
log2=/home/mythtv/log2
log3=/home/mythtv/log3

#echo $1\ $2 > $stamp_file
# If using mythwelcome you can try the next line instead on the one above.
echo $2 | sed "s/T/ /" >$stamp_file
echo $2 | sed "s/T/ /" >$log1
# Read the date in the locale time format and add the time-zone info to the stamp_file
datum=$(date -d "1970-01-01 UTC $2 sec" +%F\ %T\ %z)
echo $datum > $stamp_file
echo $datum > $log2

# reinterpret this in utc and write to alarm
utcdatum=$(/bin/date -u -f $stamp_file +%F\ %T)
echo $utcdatum > $stamp_file
echo $utcdatum > $log3
#rm -f $stamp_file
echo $utcdatum >/proc/acpi/alarm


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 2:00 am 
Offline
Joined: Fri Sep 07, 2007 11:57 pm
Posts: 166
as i understand, the thing you had a problem with was with testing if the machine can shutdown. what i wrote worked for me. i'll change that a bit to make it work universally. the idea is this: if you modify /etc/init.d/hwclock.sh as i suggested in my writeup (replying to your other post), upon shutdown the machine reads /tmp/alarm and uses the time there as the time to wake up next. the contents of /tmp/alarm come from the file /usr/bin/setwakeup.sh that i also provided in that writeup. this file only gets executed if you shutdown through mythwelcome.

so: now that you know your machine can wake up on its own, ignore the "testing part" in my writeup and just go ahead with the setup. you should then be good to go. have you tried that? did you have any problems??

one thing to keep in mind: if you created /tmp/alarm by hand or if you exited using mythwelcome at least once (after you've followed my writeup to set things up), then /tmp/alarm will exist. so when you shutdown by hand (shutdown -h now) or use shutdown from KnoppMyth's menu, i believe the machine will still wake up as /tmp/alarm indicates. only this may not correspond to the "correct" wake-up time! see, when you shutdown through mythwelcome, the machine runs mythshutdown --setwakeuptime first and figures out when it's supposed to wake up next time, then feeds that time to the script setwakeup.sh which turns it into the format the BIOS understand and writes that over /tmp/alarm. then the machine shuts down using shutdown -h now (!) and will wake up as /tmp/alarm indicates, which this time around it is the correct time.

so if you shutdown at some point not using mythwelcome, then this should still be OK as long as there hasn't been any changes in the schedules since the last time you shutdown using mythwelcome. but since you can never be sure of that (in practice), i would just shutdown through mythwelcome.

note that shutting down through mythwelcome is simple: keep hitting exit on the remote till it asks you if you really wanna exit. say yes, and it goes into mythwelcome. now either leave it and it will countdown to shutdown (in my case it counts 60 seconds), or hit menu on the remote to get the menu and choose "shutdown now".

i hope this helps understanding how this works.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 3:45 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
@spalVl and fra - great replies, guys. It makes sense to me now. I got it working on my R5F27 box, but those details were a little hazy to me.

1) Is there a way to automatically exit the frontend after x minutes of inactivity and thus activating mythwelcome and starting the automatic shutdown timer?

2) Can someone answer my post about mythtv-setup regarding shutdown/wakeup times in this thread?

Thanks again guys!

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 12:09 pm 
Offline
Joined: Fri Sep 07, 2007 11:57 pm
Posts: 166
graysky wrote:
@spalVl and fra - great replies, guys. It makes sense to me now. I got it working on my R5F27 box, but those details were a little hazy to me.

1) Is there a way to automatically exit the frontend after x minutes of inactivity and thus activating mythwelcome and starting the automatic shutdown timer?

2) Can someone answer my post about mythtv-setup regarding shutdown/wakeup times in this thread?

Thanks again guys!


i don't know of a way to exit frontend into mythwelcome after x minutes of inactivity. though, i personally wouldn't want that! what if i stopped watching a show and decided to go do something and come back to continue watching, only to find the machine shutdown and i now have to reboot it? like Cecile once said: it's a tv! when you're done watching, turn it off. if you want the machine to shutdown too, exit to mythwelcome.
but that's just me.

i'll take a look at the other thread.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 12:59 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
@fra - thanks for the reply. I answer it in the other thread.

As to the part about me wanting a way to drop out of the frontend after x min of idle... that's more or less since my wife will undoubtedly leave it in the frontend so mythwelcome will never have a chance to load up. What you said makes sense though. This is why I'd like to have a one-click method to exit the frontend (yeah, I know what you're thinking... exit on the remote, then up arrow, then enter is EASY, but you don't know my wife!)

Have a look at my menu item thread, and see if you can help :)

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu