Sign in to follow this  
Followers 0
Zohar

[Solved] How to Wake the Computer from Sleep, Without the Keyboard or Mouse

9 posts in this topic

#1 ·  Posted (edited)

Hi

 

I created a small application for Android, that Sends Commands to my computer,

and on my computer, an AutoIt script that receives the commands(via TCP), and then runs the appropriate code for it.

 

There are several nice commands, and now I want to add 2 more:

- Sleep

- Wake from sleep

 

There's no problem to implement Sleep, it's done via

Shutdown(32)    ;32=Standby

Now the problem is how to Wake the computer..

Usually the normal way to wake the computer is either pressing a key on the keyboard,

or moving the mouse.

 

But what if you want to wake the computer, without using the Keyboard or Mouse, but when being able to send TCP/UDP?

Is there a way for that?

 

Or am I stuck only with being able to implement Sleep, without Unsleep....

 

Thank you

Zohar

Edited by Zohar

Share this post


Link to post
Share on other sites

Hi,

Did you test if the script receives your tcp commands ? (e.g : write in a file or in the console)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi

I did not test, because naturally I expect my script not to run during sleep - the whole computer is asleep..

So the WakeUp code should not be something that I do in my code,

but more like a standard way(if exists) to wake a computer via the Local network..

(an which should be handled by the BIOS for example)

 

I remember there's a WOL signal, tthat is used to Turn On a computer...

Maybe there's something similar for Waking from sleep?

Edited by Zohar

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You can still document yourself on this and replicate the signal, but like you said it won't be your script which will handle the signal.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

what do you mean by "document yourself"?

 

>but like you said it won't be your script which will handle the signal.

I on't really care who will be the direct waking up agent, as long as it is does after a button press on my Anroid Phone...

That's what I'm trying to achieve

 

Since m phone is not connected to the computer like a Keyboard or a Mouse,

but only via Wi-Fi, via my LAN router,

then anything that can come from my Router, and can wake a sleeping computer, will be great.
 

 

Edit:

I went to Wikipedia to read about WOL, for turning on the computer, to see if it mentions anything about waking from sleep..

and it says:

"Wake-on-LAN (WOL) is an Ethernet computer networking standard that allows a computer to be turned on or awakened by a network message."

Awakening is included... so this is a good thing for my needs :)

I will test it now to see if it works.....

Edited by Zohar

Share this post


Link to post
Share on other sites

I meant search on the internet to find out how to replicate the signal, or if someone passes to help you.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Hi

I use >this simple script and it works

(don't know if it awake a pc from sleep)

you can have a look to it to study how it works


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

OK I have some updates.

 

I downloaded a WOL app for Android, there are quite many, here's one for example,

called SimpleWOL:

https://play.google.com/store/apps/details?id=com.sbrsoft.simplewol

 

I then tested it on my computer, while it was in Sleep mode.

It did not work.

 

I then decided to test it on my computer when it was Turned Off.

It then worked very well.

 

So it means that my computer can WOL when it's turned off,

but not WOL when it's in Sleep mode.

 

I wonder if there's any change I can do t my computer, that can make it WOL also when in Sleep mode..

If anyone has an idea, it will be great.

 

Maybe I should change some setting in my OS? (Windows XP SP3)

I know Windows XP is not running when I am in sleep mode,

but maybe before it send the computer to sleep mode, it tells the BIOS something, regarding how to wake?

 

 

Hi

I use >this simple script and it works

(don't know if it awake a pc from sleep)

you can have a look to it to study how it works

 

Hi PincoPanco

Thank you, this is a very nice implementation for the Client - the computer that Wakes the other computer.

That thread also contains a shorter and cleaner implementation..

here:

It is also explained in Wikipedia, how to do it:

http://en.wikipedia.org/wiki/Wake-on-LAN#Magic_packet

It's quite simple:

Send a UDP Packet to the IP of the computer, on Port 9,

where the UDP content should be this:

6 bytes of all 255 (FF FF FF FF FF FF in hexadecimal),

followed by sixteen repetitions of the target computer's 48-bit MAC address,

for a total of 102 bytes.

Edited by Zohar

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Update:

Apparently there is something that should be done in the OS:

We need to go to:

Control PanelNetwork Connections,

then Rightclick the Local Area Network connection, and choose Properties,

then press the "Configure..." button on the top of the window,

then in the new window that opens, goto the "Power Management" tab:

15g2d6v.png

 

and there, we need to select

"Allow this device to bring the computer out of standby".

 

Tho I must say the warning they write in the end is quite scary..

Does it do this behavior(waking up periodically) with all computers, or only older ones?  :)

Edited by Zohar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0