View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 21 posts ] 
Go to page 1, 2  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun Feb 10, 2008 4:22 pm 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
I spent a good deal of the weekend trying to get ACPI wakeup working on my machine. I followed graysky’s excellent how-to along with fra’s note but with no success. The MB supports it and I am able to force a wakeup by inserting the time into /proc/acpi/alarm. Shutting down puts the correct wakeup time into /tmp/alarm but I do not get the correct time in /proc/acpi/alarm. The time has the date listed 00 but with other possible (but incorrect) numbers in the other fields. I also tried entering a startup and shutdown time in mythwelcome which the machine ignores.

Some questions:
1. I still have R5F1 installed. Has anyone had success with this version?
2. In my modifications rather than copy the /etc/init.d/hwclock.sh to a backup file I moved it (mv) to a backup name then opened with nano and resaved it as /etc/init.d/hwclock.sh. I then found I had to “chmod +x ….” to get it executable. Do I need to “chmod 755 …” as well?
3. Are there any logs which may give me an indication of where the process fails?

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Last edited by nicom on Sat Mar 08, 2008 8:52 pm, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 2:55 am 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
I ran "chmod 755 /etc/init.d/hwclock.sh".

No difference. Machine still refuses to wake up.

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 6:35 pm 
Offline
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location: Perth, Australia
Just to clarify, you could
1) manually inject the time into /proc/acpi/alarm, and
2) shutdown -h now

and it would wakeup?

If it has not ever woken up once you have shutdown, it sounds like you could be subject to the "fussy BIOS" problem.. described here
http://www.mythtv.org/wiki/index.php/ACPI_Wakeup

the hwclock.sh script (and subsequent shutdown) seem to nuke some of the detail that was inserted into the /proc/acpi/alarm...

Once you find out the intricacies, it works like a dream... much better than leaving the box on 100% and exposing yourself... :)

Maybe a bit more description, other might be able to give some insight on how they got it to work...

does it insert UTC into /proc/acpi/alarm?
Is your BIOS set to UTC?
did you find an RTC setting in the BIOS settings?
does the manual method actually do a wakeup once you shutdown?

I remember i had problems with sudoers trying to give the scripts a chance to run as root through mythwelcome... had to add my setwakeup.sh to sudoers, make sure halt and the others are in there also... only counts once youve managed to make it go manually though...

Hope that helps, or alteast gives you some more motivation after a weekend of frustration..

Cheers,

Nathan

_________________
LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 7:39 pm 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
Thanks for your input, Nathan.

Are you using R5F1 version?

Yes, inserting the time (UTC) into /proc/acpi/alarm then shutting down will cause the machine to restart at the correct time.

I looked at the fussy bios technique and although I did not think it was necessary I added it in my later attempts, again with no success.

Quote:
does it insert UTC into /proc/acpi/alarm?
Is your BIOS set to UTC?
did you find an RTC setting in the BIOS settings?
does the manual method actually do a wakeup once you shutdown?


Yes both the time that gets stored in /tmp/alarm and the bios are both UTC and the bios needs no special setting to make it work when the time is entered manually.

I have added setwakeup to the sudoers file (using visudo) and this part seems to works because the correct time makes it into /tmp/alarm on shutdown. My problem seems to be that /etc/init.d/hwclock.sh is not doing its thing properly. If I could locate a log file that tells me whats happening I might be able to find what's wrong.

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 11, 2008 7:49 pm 
Offline
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location: Perth, Australia
Hi again,

I'm using R5F27, but have been using mythwelcome/ACPIwakeup since before R5F1.

From memory, i followed the suggestions in the link i added previous... which simply was storing the reset time in a variable, then writing it back to the /proc/acpi/alarm once the hwclock was synched...

Could you post your hwclock.sh?

Although, if you are having success manually waking up, then it should be using the hwclock.sh already... so maybe thats not the problem...

Re-reading your post, suggests that the process can write to /tmp/alarm, but fails to write to /proc/acpi/alarm... can you run setwakeup.sh as mythtv from a console?

setwakeup.sh blah 1334980324

does that set the value into /proc/acpi/alarm?

if so, then there is a problem with mythwelcome calling your wakeup script as mythtv

if i was at home, i could get the sudoers list from my box.. to show you, but alas...

Cheers,

Nathan

_________________
LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 2:35 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
Yeah, your BIOS might be using UTC rather than your timezone time. Try setting it to wakeup in UTC time (time without your timezone offset) and see if it happens.

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 3:58 pm 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
Nathan,

I only had a short time to try your suggestion last night but kept having problems with the time format. What I was trying was

hwclock.sh --set --date xxxxxxx

My problem was the format of the date and the man pages I read did not make it any clearer. Should the format be the same as /proc/acpi/alarm or should it be as per the Date command [MMDDhhmm[[CC]YY][.ss]] in which case what does the [[CC]YY[.ss]] mean?

Grasky,

Yes the bios does use UTC and the machine will wake at the correct time (UTC) if I manually force the time into /proc/acpi/alarm.

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 6:15 pm 
Offline
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location: Perth, Australia
Hi again,

I assume you are talking about using setwakeup.sh and not hwclock.sh?
What i was suggesting was to manually kickoff the setwakeup.sh script like mythwelcome/mythshutdown would by issuing the following from the console.

setwakeup.sh option1 option2 23232323

i cant remember off hand, but i think that option2 or option3 was the seconds since 1970 style time (i just put some crazy number in there to make sure it was working).
This is what the script takes, translates into UTC (and timezones etc) and puts into /proc/acpi/alarm.

As far as i can tell the modifications to the hwclock.sh are to store the value that was inserted into /proc/acpi/alarm by the setwakeup.sh script, and reinsert it once the hwclock.sh sets the system time to the bios.... or something like that..

Does that make any sense, or am i talking gibberish?

Cheers,

Nathan

_________________
LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 7:53 pm 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
Yes I did mean setwakeup.sh not hwclock.sh.

Thanks for the tip about the options and the time format, I will try tonight. I never quite understood the comment in the file so I might embellish it a bit for next time for my own understanding.

My understanding of the process is as follows:
1.setwakeup.sh picks up the wake time from mythwelcome, converts it to UTC then stores it in /temp/alarm.
2. hwclock.sh picks up the time in /tmp/alarm and puts it into /proc/acpi/alarm.

I have seen other approaches where the set...sh file stores to /proc/acpi/alarm and then hwclock.sh picks up the time there and puts it back there.

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 12, 2008 7:58 pm 
Offline
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location: Perth, Australia
Hi there,

Apologies for not reading the linked posts you referred to in your first post, as i probably would have made more sense before now! :)

I use the "other" approach you talk of... i dont use/tmp/alarm

My setwakeup.sh puts the correct formatted values into /proc/acpi/alarm, then i alter the hwclock.sh to save that value, and put it back in after the hwclock.sh script syncs the time (or whatever it does)....

Same result, i would imagine...slightly different method...

Hope you get somewhere on this...

Cheers,

Nathan

_________________
LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 15, 2008 10:17 pm 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
I have narrowed down the problem.

When mythwelcome shuts down, /usr/bin/setwakeup.sh inserts the correct time into /tmp/alarm corrected adjusted for UTC, eg. 2008-02-17 08:25:00.
The time entered into /proc/acpi/alarm, however, is correct for all but the day. For the above example the time in /proc/acpi/alarm would be 2008-02-00 08:25:00.

I have grasky's additional lines for fussy bios included although I had to include an additional fi on the second last line to make it work. I get the same result as described above with or without the fussy bios mod.

Can anybody help as to why /etc/init.d/hwclock.sh is not inserting the correct date? Or could something be happening to the file after hwclock has written to it?

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 17, 2008 6:20 pm 
Offline
Joined: Sun Sep 04, 2005 7:48 pm
Posts: 264
Location: Perth, Australia
I dont know if it helps, but i think when i cat /proc/acpi/alarm (possibly after restart) that some part is missing (i think the day is missing like you say).
So that could be a big red kipper!

What value is being inserted into /proc/acpi/alarm (is it UTC or seconds since whenever)?
What value is being shown on cat /proc/acpi/alarm?
Have you tried switching the RTC setting in the BIOS to the other way round? I head some people had luck with the opposite/wrong setting. Although you've successfully wokeup before manually... so maybe not...
Have you tried commenting out the whole of hwclock.sh?

Just some ideas, but i guess youve had a go at all of these things?

Cheers,

Nathan

_________________
LinHES: R6 | MB: Asus M3N-H/HDMI | CPU: AMD ??Mhz
Capture: 2xHDHR DVB-T
Graphics: Onboard 8300|PSU: Corsair vx450w
Cooling: Zalman cu?,
Display: Benq xx projector


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 18, 2008 6:37 am 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
Thanks for your ideas Nathen.

Unfortunately I am out of the country for the next 2 weeks so I will not be able to investigate. In answer to your questions though,

1&2. UTC time is enteres into /proc/acpi/alarm and it cat /proc/acpi/alarm shows it that way, except day is 00, eg. 2008-02-00 08:25:00.
3. I did try switching the bios settings around when I first started but once I got it working I left it. I found it works when I do not enable wake on S5.
4. I haven't tried commenting out all of hwclock.sh. I did try inserting a couple of trouble-shooting lines to dump the value of ACPITIME to files at various points.
Code:
echo $ACPITIME>/tmp/test1

I think from memory ACPITIME had the correct time in the earlier locations but nothing was saved in the latter parts of the script. Unfortunately my lack of understanding of what the script was doing prevented me from following this line of investigation much further.

Richard

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 04, 2008 3:32 am 
Offline
Joined: Mon Aug 14, 2006 8:24 pm
Posts: 320
Location: Melbourne, Australia
I am back in the country and have done some more investigations. It appears the /usr/bin/setwakeup.sh works correctly on shutdown putting the correct time into /tmp/alarm. I tried modifying /usr/bin/setwakeup.sh to write to /proc/acpi/alarm directly. After shutdown and restart the correct year, month and time was there but the date was reset to 00.

So what appears to be happening is:
1./etc/init.d/hwclock.sh does not execute, and
2. something is reset the date to 00

What I would like to know is what initiates the hwclock.sh command and what could be resetting the date back to 00.

I attach the second part of my /etc/init.d/hwclock.sh. You will notice the many "echo "$ACPITIME">/tmp/test.."
These I put in for troubleshooting purposes.
Code:
       # WARNING: If you disable this, any changes to the system
       #          clock will not be carried across reboots.
       #
#      ACPITIME=`cat /proc/acpi/alarm`
      ACPITIME=`cat /tmp/alarm`
   echo "run this time">/tmp/message
   echo "$ACPITIME">/tmp/test1
       if [ "$HWCLOCKACCESS" != no ]; then
      log_action_msg "Saving the system clock."
      if [ "$GMT" = "-u" ]; then
          GMT="--utc"
      fi
      /sbin/hwclock --systohc $GMT $HWCLOCKPARS $BADYEAR
      verbose_log_action_msg "Hardware Clock updated to `date`"
      echo "$ACPITIME">/proc/acpi/alarm   # && sleep 1 && echo "$ACPITIME"> /proc/acpi/alarm
   echo "$ACPITIME">/tmp/test2
       else
      verbose_log_action_msg "Not saving System Clock"
       fi
       ;;
   show)
       if [ "$HWCLOCKACCESS" != no ]; then
      /sbin/hwclock --show $GMT $HWCLOCKPARS $BADYEAR
       fi
       ;;
   echo "$ACPITIME">/tmp/test3
   *)
       log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}"
       log_success_msg "       start sets kernel (system) clock from hardware (RTC) clock"
       log_success_msg "       stop and reload set hardware (RTC) clock from kernel (system) clock"
       return 1
       ;;
    esac
   echo "$ACPITIME">/tmp/test4
}
#   Extra code for fussy bios
ACPITIME=`cat /proc/acpi/alarm`
   if [ "$HWCLOCKACCESS" != no ]
   then
      if [ "$VERBOSE" != no ]
      then
      echo "Saving the System /etc/init.d/hwclock.shClock time to the Hardware Clock..."
      fi
      [ "$GMT"="-u"] && GMT="--utc"
      /sbin/hwclock --systohc $GMT $BADYEAR
      if [ "$VERBOSE" != no ]
      then
      echo "Hardware Clock updated to `date`."
      fi
echo "$ACPITIME" >/proc/acpi/alarm
   echo "$ACPITIME">/tmp/test5
   fi
hwclocksh "$@"


Any help greatly appreciated.

_________________
Intel DG965WH, Dvico DVB-T Lite x2, HDHR, Gigabyte GT220, KingstonSSD, WD20EARS version=latest


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 04, 2008 10:28 pm 
Offline
Joined: Sat Sep 02, 2006 1:46 pm
Posts: 44
nmcaullay wrote:
I dont know if it helps, but i think when i cat /proc/acpi/alarm (possibly after restart) that some part is missing (i think the day is missing like you say).
So that could be a big red kipper!


I had the same experience when I was getting ACPI wakeup to work. I think the date gets reset to "00" after restarting whether or not the wakeup was successful. Now that you are writing to /proc/acpi/alarm directly have you tested whether your machine is waking up properly?


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ] 
Go to page 1, 2  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 66 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:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu