PDA

View Full Version : Wake-on-LAN" again



Andyoz
2006-04-19, 02:48
I have spent some time looking thru the threads relating to power management but still don't have an answer to this question:

I have Wake-on-Lan working properly on my server, i.e. I don't any issues with it going into standby. That's all fine, but I want to relocate the server to the loft so I have to also be able to shut down the server remotely after each listening session. Without that function the "wake-up" part is a bit redundant as I may as well leave the server on all the time if I can't shut it down remotely.

Is that something that is even possible in Windows and is anyone working on it at the moment?

Andy

p.s. the SB is the best thing to happen to music in a long time - most of my family and work colleages are in the process of buying them after seeing mine in action!

smc2911
2006-04-19, 03:19
If you have XP pro and a laptop downstairs you could always connect in via remote desktop and shutdown (note: you will have to use task manager rather than the start menu).

Alternatively you could use psShutdown from http://www.sysinternals.com/Utilities/PsTools.html

Sean.

Andyoz
2006-04-19, 03:33
Thanks,

I have a laptop in the study that is connected to the network. This controls the server using VNC. I guess I will just have to tell the server to shutdown from the laptop. Shame, as I don't always have the laptop on when I am using the server.

I can't believe this issue isn't mentioned more often as it must cause problems for any users with servers hidden away.

Andy

smc2911
2006-04-19, 03:34
Maybe some enterprising soul could come up with a plug-in that powers down the machine.

Andyoz
2006-04-19, 03:36
If they do, I'll pay for it!!!

Hey, just noticed you're from Sydney. No prizes for guessing where I am originally from (but live in Ireland now)

slimpy
2006-04-19, 03:54
What about the Execute Script Plugin?
http://www.deane-freeman.com/slimserver/
Scripts or programs can be run on the server by using the squeezebox remote.

-s.

oreillymj
2006-04-19, 04:11
I'm surprised your PC stay's on once the SB brings it out of standby.

In fact for me, WOL feature was more or less useless until the recent PreventStandby Plugin was released. The Microsoft docs indicate that the PC will resume standby after about 2 mins, so the plugin was required to make an API call every minute to say that the system was in use.
Perhaps you already run some software that is making this API call.

The Execute script plugin can be configured to run the following command which will put XP/2000 into standby

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

You can configure a script to run on a power off event.

Andyoz
2006-04-19, 04:29
That Execute Script Plugin looks interesting.

Am I reading it correctly that when it says it supports "Power" events - it can do a Shutdown function if required.

I am not computer savvy in any way. Can you give me a rough guide to get it going?

Andy

p.s. why am I the only person with this query - surely it affects most people?

oreillymj
2006-04-19, 04:49
The plugin can execute scripts based on certain Squeezebox "events".

i.e. You can configure a script to run when you power off the Squeezebox. If that script powers down your PC, then you should be able to indirectly get your PC to got into standby by switching "off" your Squeezebox.

On Windows create a directory called scripts here - C:\Program Files\slimserver\server

In C:\Program Files\slimserver\server
\scripts create a file called Standby.bat. Edit this file in Notepad and put this line into it.

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

Now save the file and exit Notepad.

Put the Execute plugin into C:\Program Files\slimserver\server\Plugins and restart you Slimserver service. From the Web Ui, navigate to the Server settings->Plugins page. You should see some new options for the execute plugin. On the power off event, tell it to execute Standby.bat

Andyoz
2006-04-19, 04:53
That's a great help. I will have a play with it tonight (The SB I mean!) when I have more time and see if I can get it going.

Once again, thanks.

Andy

oreillymj
2006-04-19, 05:06
Just tried the instructions in my previous post myself with 6.5 on my laptop. The script directory only gets scanned for scripts at Slimserver startup, so you must have the plugin,scripts dir and .bat file in place before doing a restart.

You'll find the Execute plugin script on Deanes site here .. http://www.deane-freeman.com/slimserver/

I don't have the hardware to test with, but it should work.

peter
2006-04-19, 06:15
On Wed, 19 Apr 2006 04:29:19 -0700, "Andyoz"
<Andyoz.26iebz1145446201 (AT) no-mx (DOT) forums.slimdevices.com> said:
>
> p.s. why am I the only person with this query - surely it affects most
> people?

In my book a server's supposed to be always on. Mine's in its own
seperate room with a stack of external disks, 3 TV Tuners, pumping out
music thru the Squeezeboxes and feeding MythTV Video to the cable system
thru the TV modulator. No need for a quiet system either.

15:12:04 up 33 days, 19:41, 1 user, load average: 0.00, 0.01, 0.00

Regards,
Peter

Andyoz
2006-04-19, 06:30
True,

Maybe I just need to get used to the idea of the server whirring away all the time. But my music listening sessions are fairly sporatic so I might only need it say 10% of the time. I can see if it was serving audio AND video then always on is essential.

Must be the "greenie" in me that makes the idea so foreign.

Andy

peter
2006-04-19, 06:52
On Wed, 19 Apr 2006 06:30:51 -0700, "Andyoz"
<Andyoz.26ik4b1145453701 (AT) no-mx (DOT) forums.slimdevices.com> said:
>
> True,
>
> Maybe I just need to get used to the idea of the server whirring away
> all the time. But my music listening sessions are fairly sporatic so I
> might only need it say 10% of the time. I can see if it was serving
> audio AND video then always on is essential.

It is if you've got scheduled recordings ;)

> Must be the "greenie" in me that make the idea so foreign.

I'm used to having servers work for me 24/7 as I'm in the IT business.
My desktops are always on as well in case I need to reach them when I'm
away. It's just a different way of thinking, I guess.

Unlike most users, I don't much see the point of using squeezenetwork so
far. ;)

Regards,
Peter

mattybain
2006-04-19, 07:38
I have a windows server on which I use the WOL feature. My server is set to go into standby after half an hour of inactivity or at 12pm every night (which is usually okay if not just press power on the SB and everything is sweet again).

To enable a set shutdown time and for those times when I just need to switch off immediately remotely I use PowerOff.

http://www.tucows.com/preview/195837

I have never had a problem with my computer staying either on or off standby it just seems to work as intended. It has been even better with the recent releases of SlimServer and the latest firmware.

Windows MediaCenter also seems to take the computer out of standby for recordings and place it neatly back in standby when it is done. Sweet.

kefa
2006-04-19, 07:54
I have created a plugin that does exactly that. Please have a look at my site to see how it works and download. I use this feature all the time.I run it on a Linux machine, although I haven't tested in on Windows/Mac

http://www.avdv70.dsl.pipex.com/shutdown

Apologies if the brief on the website seems rather complex - it really is rather simple. You just need to go to the normal Plugin configuration screen in Slimserver to configure the appropriate shutdown script to use. This could be as simple as create a batch file with the "c:\windows\system32\shutdown.exe -s" command in it, and configuring this command within the plugin.

peter
2006-04-19, 10:04
Remote shutdown and Wake-On-LAN has been in VideoBox since 2004 ;)

Regards,
Peter

On Wed, 19 Apr 2006 07:54:32 -0700, "kefa"
<kefa.26into1145458502 (AT) no-mx (DOT) forums.slimdevices.com> said:
>
> I have created a plugin that does exactly that. Please have a look at my
> site to see how it works and download. I use this feature all the time.I
> run it on a Linux machine, but I'm sure someone can advise on the
> correct cmd for Windows.
>
> http://www.avdv70.dsl.pipex.com/shutdown
>
> Apologies if the brief on the website seems rather complex - it really
> is rather simple. You just need to go to the normal Plugin
> configuration screen in Slimserver to configure the appropriate
> shutdown script to use. This could be as simple as create a batch file
> with the "c:\windows\system32\shutdown.exe -s" command in it, and
> configuring this command within the plugin.
>
>
> --
> kefa
>
> Fedora Core 5, Slimserver 6.2.2, Netgear DG834GT
> Squeezebox 3, Primare SPA20, Monitor Audio GR20
> Squeezebox 2, Denon UD-M30, Monitor Audio PMC703
> ------------------------------------------------------------------------
> kefa's Profile: http://forums.slimdevices.com/member.php?userid=421
> View this thread: http://forums.slimdevices.com/showthread.php?t=23109
>
>

dSw
2006-04-19, 12:56
I have created a plugin that does exactly that. Please have a look at my site to see how it works and download. I use this feature all the time.I run it on a Linux machine, although I haven't tested in on Windows/Mac

http://www.avdv70.dsl.pipex.com/shutdown

Apologies if the brief on the website seems rather complex - it really is rather simple. You just need to go to the normal Plugin configuration screen in Slimserver to configure the appropriate shutdown script to use. This could be as simple as create a batch file with the "c:\windows\system32\shutdown.exe -s" command in it, and configuring this command within the plugin.

Sounds great, and I'd like to try it out - but the link to your script (ShutdownServer.pm) is dead.

TheSaint
2006-04-19, 14:10
just right click and save as... :)

Thank you so much for the plug-in by thw way! Will try it outonce I have some time!!

dSw
2006-04-19, 14:14
just right click and save as... :)

Er.. that doesn't fix a broken link, although it does download the "page not found" page contents!

TheSaint
2006-04-19, 14:15
hmm strange...it worked for me....

dSw
2006-04-19, 14:21
hmm strange...it worked for me....

Have you looked at the contents of the file?

TheSaint
2006-04-19, 14:59
...the file has the extension .pm, so I guess it is the right one? no?

kefa
2006-04-19, 15:34
hmmm... sorry folks. there seems to be something strange going on with my isp. when I ftp to my site I can change directories but I can't list the contents of any directories. I get a 'ftp: connect: No route to host' error. I'll have a rant at PIPEX in the morning. I think the recent change to 'Remote system type is Windows_NT' might have something to do with it...

In the meantime, please find the plugin attached here...

bigjules
2006-04-19, 21:17
If you're happy with your server going into standby rather than shutting down, then you shouldn't need any plugins to do what you want.

just download the latest 6.2.2.

Set your power management to put your computer into standby (after 10 or 15 minutes).

Open the network interface controller properties for your network card (or wireless network controller).
Check the "Allow this device to bring the computer out of standby."
Check the "Only allow management stations to bring the computer out of standby."

And it should send itself into standby about 15 mins after you stop listening to music on your SB.

Jules

Andyoz
2006-04-20, 00:20
Ah, interesting.

I think I mananged to figure out the plugins but am not using 6.5 so it didn't work fully. I may try you option as I am happy with the standby option.

Thanks all again for the input.

Andy

p.s. have just tried it and it is working a treat.

gharris999
2006-04-20, 13:04
Anyone actually gotten kefa's plugin to work on a windows machine? I can't get it to load with the latest svn of 6.5. I'm getting the following output from --d_plugins:


2006-04-20 13:55:49.8508 Requiring Plugins::ShutdownServer plugin.
2006-04-20 13:55:49.8519 Removing ShutdownServer from menu: PLUGINS


The plugin never shows up on the Server Settings->Plugins page.

cvj
2006-04-20, 21:19
I have so far been unable to get this to work.

The startup.bat works fine when I execute it on my PC... but it fails to work when I press the "Power Off" button on the SB3 (wireless).

When I select the startup.bat as the option from and press the "Play" button, ther SB3 screen says "running script" and points to the "Script" directory - so that seems to be OK.

What am I missing? (Could it be a Windows security setting blocking .bat files from running over the wireless connection?)

I am running SlimServer Version: 6.5b1 - 6997 - Windows XP - EN - cp1252 and Player Firmware Version: 43 on a Windows XP (SP2) box.

danco
2006-04-21, 00:24
Are you using the Execute Script plugin?

I had some difficulty understanding the instructions, but finally worked it out. One can run a script manually by selecting it in one of the options and pressing Play.

If one want the srcipt to work automatically, after selecting the script in the relevant option (and no script in the other options) one goes back to the initial screen and then one has to press Play (there is a message "press Play to activate").

Michaelwagner
2006-04-21, 02:12
I'd just like to point out that, once you've shut down the hard disks and the monitor, you've already saved 3/4 of the possible electrical savings.

Powering down the hard disk and monitor have worked correctly since windows 98.

The Pareto Principal (http://en.wikipedia.org/wiki/Pareto_principle) says you've already done most of what you need to do (or can do simply).

bigjules
2006-04-21, 04:45
I'd just like to point out that, once you've shut down the hard disks and the monitor, you've already saved 3/4 of the possible electrical savings.


If you're sending your machine into suspend, the power is only maintained to the devices that can wake from standby, and to the ram. (and what little of the cpu needs to still work).. even shuts down all the fans.

-- insert picture of me hugging a tree here

Michaelwagner
2006-04-21, 06:23
I understand what power-down or standbye does, I have one machine that does it (right - out of 10 or so).

My point was, you can get 75% of the tree hugging for essentially no work, and the last 20% you have to sweat bullets for, so why bother?

cvj
2006-04-21, 11:08
Are you using the Execute Script plugin?

I had some difficulty understanding the instructions, but finally worked it out. One can run a script manually by selecting it in one of the options and pressing Play.

If one want the srcipt to work automatically, after selecting the script in the relevant option (and no script in the other options) one goes back to the initial screen and then one has to press Play (there is a message "press Play to activate").

Yes, I am trying to use the Execute Script plugin. BUT, I can't get it to work manually or automatically, per your suggestions. And I don't see the message "press Play to activate" on the initial screen...

Another issue - perhaps related to the above - is that I can send my PC into hibernation by pushing the "sleep" button on my keyboard...but I am unable to get it to go into hibernation or standby mode automatically (using the Windows XP "Power Options Properties" settings)...

Any other suggestions???

danco
2006-04-21, 12:31
Oh right, you're using SlimServer 6.5, while I use 6.1. You have got the correct version of the plugin, I hope.

On my setup, when you choose the Execute Script plugin a right-pointing arrow is shown. So you press the Right arrow on the remote, and immediately get a set of options, of which the first is "Press Play to activate", the second is "Execute on Open File", and so on.

If you are getting something different, it is either a change in the script (which it may well be) or some rrror in your installation. If the script has changed significantly, it will need someone else to respond.

cvj
2006-04-21, 13:24
Oh right, you're using SlimServer 6.5, while I use 6.1. You have got the correct version of the plugin, I hope.

On my setup, when you choose the Execute Script plugin a right-pointing arrow is shown. So you press the Right arrow on the remote, and immediately get a set of options, of which the first is "Press Play to activate", the second is "Execute on Open File", and so on.

If you are getting something different, it is either a change in the script (which it may well be) or some rrror in your installation. If the script has changed significantly, it will need someone else to respond.

I have the 6.5 version of the plugin. The options do not include "Press Play to activate" so that explains that. (Options are
1)Execute on Play File, 2) execute on Stop, 3) execute on power on,4) execute on power off and 5) execute on open file).

Perhaps someone else has successfully used the 6.5 version of the plugin on a window XP (SP2) box and can steer me further???

danco
2006-04-21, 14:18
So I don't know enough about the 6.5 plugin to make reliable suggestions.

I assume you have the script for "Power Off" selected. I assume that, like the 6.1 version, it must have an option for "No Script" and an option for each script you have, and that you have selected the option for your script.

It certainly could do no harm to see if the script worked when set for one of the other events, for instance on Stop, or even on Play File.

You said in an earlier post "When I select the startup.bat as the option from and press the "Play" button, ther SB3 screen says "running script" and points to the "Script" directory - so that seems to be OK." It's not clear to me if the script did definitely run and act on your PC - the message from the Squeezebox really just means that it has told the computer to run the script, not that it did run successfully.

Again, Windows is not an OS I know, but I wonder if there are issues about which user is running SlimServer and which user is entitled to run the script.

cvj
2006-04-21, 16:26
So I don't know enough about the 6.5 plugin to make reliable suggestions.

I assume you have the script for "Power Off" selected. I assume that, like the 6.1 version, it must have an option for "No Script" and an option for each script you have, and that you have selected the option for your script.

It certainly could do no harm to see if the script worked when set for one of the other events, for instance on Stop, or even on Play File.

You said in an earlier post "When I select the startup.bat as the option from and press the "Play" button, ther SB3 screen says "running script" and points to the "Script" directory - so that seems to be OK." It's not clear to me if the script did definitely run and act on your PC - the message from the Squeezebox really just means that it has told the computer to run the script, not that it did run successfully.

Again, Windows is not an OS I know, but I wonder if there are issues about which user is running SlimServer and which user is entitled to run the script.

Yes, I have the script for "Power Off" selected...and I have tried other events per your suggestion.... and still no luck getting the PC to hibernate.

I am beginning to think that this perhaps is related to some "obscure" security or firewall setting in the Windows OS... but that is unfortunately beyond what I can figure out :-)

I contacted Kevin Deane-Freeman - the author of the Executive plugin - and he gave the following advice:

"Quoting Claus <vogelius@hotmail.com>:

> Dear Kevin,
>
> I am having some problems getting your Executive Script Plugin to work
> at all on my PC.
>
if you press PLAY while selelcting the script for an event, it shoudl
run manually.

run slimserver command-line only:
c:\program files\slimserver\server\slim.exe --d_plugins

you'll see the event detection and script running. If you are trying
to run a shutdown, automatically from the service then it is possible
that the shutdown command isn't allowed when issued from a service.
services have very low level permissions. See the info in the FAQ on
shared volumes to set up the server to run as a user.

That's about all I can suggest for now.
-k "

This advise is unfortunately above my level of 'puter knowledge, so could someone tell how to try this - step by step ?

oreillymj
2006-04-22, 15:41
Near the beginning of this thread I suggested adding the command

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

to a batch file and having the Execute plugin run this batch file on SB power off to put the box into standby. If you have done this, have you tested that just manually running the batch file from a normal DOS prompt does sucessfully put the box into standby. This should be your next step.

You may have some software blocking the machine from shutting down. Some TV recording sofware does this.

Also the Prevent standby plugin, if you have it enabled, will be telling Windows to keep the system active. Make sure this is disabled.

Your situation seems to be the complete opposite of mine in that my machine always went back to standby after 2 mins after WOL prior to the Prevent Standby plugin.

bigjules
2006-04-22, 18:27
Also the Prevent standby plugin, if you have it enabled, will be telling Windows to keep the system active. Make sure this is disabled.

Just to clarify: The prevent standby plugin only prevents standby if there is a client playing music. so if all of your SBs are stopped or paused, it will let your machine go into standby.

kefa
2006-04-23, 02:22
Anyone actually gotten kefa's plugin to work on a windows machine? I can't get it to load with the latest svn of 6.5. I'm getting the following output from --d_plugins:

Yeah, sorry to anyone who may have tried this on a 6.5 SlimServer machine - it runs on SS 6.2.1/6.2.2. It might also run on earlier versions but I haven't tested it.

I do have a Windows machine running SS v6.5 but I'm not sure how the plugins framework changes between these versions. I've had a quick look at some other people's plugins but I can't see at a glance what needs to change. If anyone can point me in the right direction, I'll try to fix this next week.

-kefa

gharris999
2006-04-24, 09:43
I thought maybe that Andy's SVN 7086 check-in which restored the pendingTimers method would help with the ShutdownServer.pm plug-in, but it doesn't seem to with Windows. I'm still seeing slimserver automatically remove the plugin from the menu. Any other debug flags I ought to try, other than --d_plugin?

Andyoz
2006-04-24, 14:13
If you're happy with your server going into standby rather than shutting down, then you shouldn't need any plugins to do what you want.

just download the latest 6.2.2.

Set your power management to put your computer into standby (after 10 or 15 minutes).

Open the network interface controller properties for your network card (or wireless network controller).
Check the "Allow this device to bring the computer out of standby."
Check the "Only allow management stations to bring the computer out of standby."

And it should send itself into standby about 15 mins after you stop listening to music on your SB.

Jules


After loading 6.2.2 onto the music server a few days ago, I managed to get it to go into Standby with SB on/off switch. Since then, I have moved my Broadband connection so that it runs directly thru the music server (it was previously going into the server via my laptop over ethernet connection).

The Standby mode now doesn't appear to work on the server. I assume it is related to the broadband connection generating activity on the network and the server won't go into standby. Any thoughts?

bigjules
2006-04-24, 17:05
After loading 6.2.2 onto the music server a few days ago, I managed to get it to go into Standby with SB on/off switch.

I assume you mean that it goes into standby after the Windows power management configured standby timeout.


Since then, I have moved my Broadband connection so that it runs directly thru the music server (it was previously going into the server via my laptop over ethernet connection).

The Standby mode now doesn't appear to work on the server. I assume it is related to the broadband connection generating activity on the network and the server won't go into standby. Any thoughts?

As for the standby mode not working after changing your broadband connection.. Check the power management settings on the newtork card you use to connect the server to the internet. Uncheck both (or check both):

"Allow this device to bring the computer out of standby."
"Only allow management stations to bring the computer out of standby."

Also make sure that the "Prevent Standby While Playing" is checked on your slimserver (under Server Settings/Plugins).

bms13
2006-05-07, 16:11
The plugin can execute scripts based on certain Squeezebox "events".

i.e. You can configure a script to run when you power off the Squeezebox. If that script powers down your PC, then you should be able to indirectly get your PC to got into standby by switching "off" your Squeezebox.

On Windows create a directory called scripts here - C:\Program Files\slimserver\server

In C:\Program Files\slimserver\server
\scripts create a file called Standby.bat. Edit this file in Notepad and put this line into it.

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

Now save the file and exit Notepad.

Put the Execute plugin into C:\Program Files\slimserver\server\Plugins and restart you Slimserver service. From the Web Ui, navigate to the Server settings->Plugins page. You should see some new options for the execute plugin. On the power off event, tell it to execute Standby.bat

I am using a laptop with Windows XP home edition with Slim Server 6.5b1 - 7321 - Windows XP - EN - cp1252.

I rewrote standby.bat to first echo "foo" > c:\temp\foo then powerdown. I hit the poweroff on the remote control and the laptop does not powerdown and it does not write c:\temp\foo BUT when I click on standby.bat it works perfectly.

So then I also put standby.bat to execute on the play action, when I hit play it says "standby.bat" on the slim device (SB3 wired) but yet still does not work.

So this looks like a permissions problem but I can not figure it out. Ideas? Thanks.