Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Great stuff' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Great stuff
Authored by: bluehz on Nov 22, '02 01:37:02PM

Wonder what the process thats going on here is. If you launch /EyeTV 1.0.4/EyeTV.app/Contents/Resources/Wakein in the terminal you get a display like this:

AutoWake property: 1/1/1904 0:00:00
AutoPower property: 1/1/1904 0:00:00

So wonder how we modify these properties - in other words - I don;thave an EyeTV - but sure would like to be able to auto-wake!!!



[ Reply to This | # ]
Great stuff
Authored by: weygold on Nov 22, '02 04:46:04PM

Check out: /Developer/Documentation/Carbon/utilities/PowerManager/Power_Manager/index.html

Power Manager allows your application or other software to

* install a procedure that is executed when
power to internal devices is about to be
shut off or when power has just been restored
* set a timer to wake up the computer at some
time in the future



[ Reply to This | # ]
How did they do this?
Authored by: keaka on Nov 23, '02 05:06:11PM

This is a great hint, and I've wanted to use this functionality when programming for a long time. However, the power management documentation at:
<http://developer.apple.com/techpubs/macosx/Carbon/utilities/PowerManager/Power_Manager/Power_Manager_Reference/>
has always said, and still says, that most desired functions 'do nothing' on Mac OS X. Specifically, the function SetWUTime to set the wake up timer says it will return an error on Mac OS X. Does anybody know what frameworks they actually used to implement this, and if so do you have any links to current documentation?

Thanks, Keaka



[ Reply to This | # ]
Great stuff
Authored by: mithras on Nov 22, '02 05:03:11PM
Looks like it's a very simple utility. Just type:

sudo ./WakeIn 20

to wake in 20 seconds, for example.

I just tried this and it works - put the computer to sleep, and it pops awake 20 seconds after the command was issued.

It seems to document which system calls it makes, too; when I run it without sudo, I get this:

openDevice() error e00002c1
IOConnectSetCFProperties fails
closeDevice() error 10000003
writePMUProperty AutoWake returned 10000003
openDevice() error e00002c1
IOConnectSetCFProperties fails
closeDevice() error 10000003
writePMUProperty AutoPower returned 10000003
AutoWake property: 1/1/1904 0:00:00
readAutoPowerProperty returned ffffffce



[ Reply to This | # ]
Great stuff
Authored by: bluehz on Nov 22, '02 05:17:25PM

FAR OUT!!!

Works here too G4/400!!! So what's so hard about building this into a pre-OS X type Energy Saver with wake and sleep commands like we have been screamin fro since day one of OS X.

Prob shouldn't say this - but you can copy the "Wakein" file into your /usr/local/bin and get rid of the rest of the EyeTV stuff and voila you have a scriptable Wake command.



[ Reply to This | # ]
Great stuff
Authored by: bhines on Nov 22, '02 06:58:48PM

Me and nriley are going to add this feature to Pester. Should be pretty simple.



[ Reply to This | # ]
Great stuff
Authored by: bluehz on Nov 22, '02 11:31:30PM

What is pester?

Noting some oddities though - as described above - issuing command Wakein 20 should wake the machine in 20 secs. Watch this:

root# date
Fri Nov 22 23:28:58 EST 2002
root# Wakein 20
AutoWake property: 11/23/2002 0:29:26
AutoPower property: 11/23/2002 0:29:26

Now if the current time is 23:28 - why do I get 0:29 as the wakeup time when I issue Wakein 20?



[ Reply to This | # ]
Great stuff
Authored by: lluistar on Nov 22, '02 11:45:26PM

I think Wakein references Standart Time.
In my case I'm 6 hours ahead

% date
Sat Nov 23 12:37:41 HKT 2002

% sudo Wakein 20
AutoWake property: 11/23/2002 6:38:05
AutoPower property: 11/23/2002 6:38:05

Also I tried % /EyeTV\ 1.0.4/EyeTV.app/Contents/Resources/Wakein and what I got is Command not found. Neither with % sudo ./Wakein
So I searched and found Wakein in /Library/Application\ Support/EyeTV/Wakein
from there worked fine.
I copied it to /usr/local/bin

Now works fine



[ Reply to This | # ]