waking up monitor from PPC?

Help each other out

waking up monitor from PPC?

Postby cowanrg on Sat Jan 13, 2007 1:47 am

so, i have my plasma set to go to sleep after a minute of inactivity. well, i guess the video card is actually set to sleep, but in any event, my monitor turns off after a minute of nothing going on.

i am using a dell PPC to control everything, but even though i have mimic mode set up, the tv doesnt turn back on when i use the PPC to control it. is there a way to get the screen to come back from sleep with the PPC? if the TV is on, i want to be able to wake it up from the PPC and not grab the keyboard or whatever.
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby tswhite70 on Mon Jan 15, 2007 5:34 pm

You should be able to use sendmessage.exe or girder to wake the monitor. I found this:

SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, -1);

at: http://www.codeproject.com/system/displ ... ct=1242584

Actually if you have Girder you can just use it to move the mouse and the screen should wake up. Mannyman has a discussion over here about doing as much: http://www.xlobby.com/forum/viewtopic.php?t=5019

Obviously you'll need a button on your PPC to run the wake up event which would then run the Xlobby Server event to wake the monitor (whichever way works for you).

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby cowanrg on Mon Jan 15, 2007 5:58 pm

ok great. its strange that in the mimic function, its changing the screen, but the monitor doesnt come on...

i would rather not have to use girder too. seems overly complex for what i need to do. thanks, ill give it a try and see if it works!
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby tswhite70 on Mon Jan 15, 2007 9:13 pm

You can probably just avoid Girder and Sendmessage.exe (or writing your own code altogther).

Xlobby has sendmessage built in under the OS Events - hopefully you can just send a message to Xlobby itself.

Event: OS\SendMessage
ClassName: WindowsForms10.Window.8.app.0.33c0d9d
WindowName: Xlobby
Message: 274
Wparam: 61808
Lparam: -1

EDIT: Here's a screenshot, works like a champ... (Note: I'm just running this on my server, I don't have PPC to test with..)
Image

Mimic won't do it, because the system with the sleeping monitor requires either keyboard or mouse movement to tell it to wake the monitor.

good luck,
tsw
Last edited by tswhite70 on Tue Nov 06, 2007 5:42 pm, edited 1 time in total.
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby cowanrg on Thu Jan 18, 2007 5:28 am

it's not working for me... i think i typed it all in right. i just added the event to the clock on all the pages.

yours looks like it had 4 commands, 2 send messages and 2 waits. do i need those?
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby tswhite70 on Thu Jan 18, 2007 5:29 pm

Do you mean you made the clock on your page a navigable (sp?) item and added the event to it so that when you click on the clock it runs the event?

I had the 4 events (2 waits, 2 OS\Sendmessage) just for testing. You can set the same thing up on your Xlobby server and test it there. That will verify we have the command correct.

Create a "TEST" event group:
event1: Timer\Wait 5000 (this is milliseconds and is here so that pressing the test button doesn't keep the monitor from going to sleep)
event2: OS\SendMessage -ClassName: WindowsForms10.Window.8.app.0.33c0d9d -WindowName: Xlobby -Message: 274 -Wparam: 61808 -Lparam: 1 (This will put the monitor to sleep)
event3: Timer\Wait 5000 (Let the monitor sleep for a few seconds)
event4: OS\SendMessage -ClassName: WindowsForms10.Window.8.app.0.33c0d9d -WindowName: Xlobby -Message: 274 -Wparam: 61808 -Lparam: -1 (wake the monitor up)

Now click on the "TEST" event group and press the TEST button next to the DELETE button. Five seconds later your monitor should go to sleep, and then 5 seconds later it should wake up.

Let me know how it goes - also make sure you are using the latest version of Xlobby (that's what I used to get the Classname).

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby cowanrg on Thu Jan 18, 2007 5:34 pm

oh ok, i get it. i might be using an older version of xlobby. the newer one gave me problems for some reason. all i can find is a build date, july 31, 2006. maybe a newer version would help?
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby cowanrg on Thu Jan 18, 2007 5:49 pm

hum. this is strange...

i tried your method, and it works. so, for grins, i copied the event over to the ppc, it works just fine. i press the button, and it turns off, then on. no problems. i removed the wait commands, and the turn off command, nothing....

i even tried adding two commands in a row... even keeping the same as what you had, but shortening the waits... nothing seems to work reliably.
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby tswhite70 on Thu Jan 18, 2007 11:31 pm

You can update Xlobby via F2\Download if you want - the most recent version is Nov. 2006.

Just to make sure I understand what's going on. If you run the full test on your server (all 4 commands) your plasma goes to sleep and then wakes up just like we would expect right?

Now what if you modify the commands - remove the first 2, set the remaining wait command to 90000 (ie 1.5 minutes). You said earlier your plasma is set to go to sleep after 1 minute using the Control Panel\Power Options correct? So fire the event on the server and then don't do anything else - the plasma should shut off after 1 minute and then wake back up 30 seconds later. Does that work?

I'm trying to keep the PPC out of it just so we can make sure the command works as advertised, then we can figure out why it doesn't work on the PPC correctly...

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby cowanrg on Fri Jan 19, 2007 12:09 am

this is getting confusing...

the 5 second pause, monitor off, 5 second pause, monitor on, works just fine.

i tried it with the 1.5 minute pause, then monitor on. it goes off after a minute, but never comes back on.

here is where it gets strange... when i have the first scenario (pause, off, pause, on), it only works from the setup menu, it wont work from the PPC.

the command seems to be ok when it comes from the computer, but doesnt work when coming from the PPC. sometimes the screen will flicker on for a second, but then goes away almost immediately.
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby cowanrg on Fri Jan 19, 2007 12:19 am

i think im figuring it out...

it ONLY works when the command is what sends the monitor to sleep. for instance, if you just do a wake command, it doesnt work... i made a sleep command (event) in xlobby. when i use that command to sleep the monitor, the ppc wakes it up just fine. it ONLY wakes up when its a command that puts it to sleep.

i tried making a command that would force sleep (1) and then a slight pause (1000 ms), and then awake (-1), didnt work :-(

im not sure the deal. but if do the event to make the monitor sleep, it comes back on no problem.

edit:

what's strange is that the reverse works just fine. if i make an even to turn off the screen, it works flawlessly.
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby tswhite70 on Fri Jan 19, 2007 4:43 pm

I did some more testing last night and your absolutely right. If I force the monitor to sleep then I can wake it up. If the system power options sleep the monitor I can't. I don't know why that is, I tried using some different windows (the desktop, a cmd prompt window) as the target and the result was the same. I'll do some more testing if I get a chance.

I did verify that Girder initiated mouse movement will wake the monitor regardless of what put it to sleep - so if you already have girder installed on your server you can use that.

Sorry for sending you on a wild goose chase!

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby tswhite70 on Fri Jan 19, 2007 8:43 pm

I think I kind of figured it out. The sendmessage idea works when the window itself puts the monitor to sleep because the Power Options haven't engaged. Once the Power Options engage (in your case after 1 minute) XP requires an actual mouse or keyboard event to wake it up. I don't think that's exactly right - it's more like we can still wake the monitor up with sendmessage but the Power Options immediately put the monitor to sleep again because there hasn't been any keyboard or mouse input. I did some testing with the sendmessage.exe and that appears to be what's happening. It happens fast enough that you typically won't see the monitor start to wake up before it goes back to sleep.

There are windows API's that cause "real" keyboard/mouse events and they will trigger the Power Options to wake the monitor. I wrote a little exe that moves the mouse 1 pixel right and then 1 pixel left that seems to work fine.

EDIT: http://home.comcast.net/~twhite644/spid ... seMove.exe
Just call the exe with OS\Execute, no parameters, select the "Server Event" checkbox so it executes on the server.

I don't think my exe will really solve your problem though, the monitor will go back to sleep 1 minute later regardless of what you do on you PPC. The problem goes back to Xlobby's mimic functionality. Steven, is performing the mimic entirely in Xlobby which makes perfect sense (ie you click a button on the PPC, it has a Xlobby based id, Steven passes this back to the Xlobby Server instance and executes the events associated with the button id on the server). But because of this the server OS never encounters the actual keyboard inputs (like Enter, or LeftClick) when you click on a button on the PPC.

So I think the only real answer would be for Steven to provide an option with Mimic that sends the appropriate OS calls for keyboard input.

tsw
Last edited by tswhite70 on Tue Nov 06, 2007 5:41 pm, edited 1 time in total.
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby cowanrg on Sat Jan 20, 2007 6:42 pm

nah, that works fine. i really just want to be able to turn on the screen with the PPC. i dont really care if it goes back to sleep in a minute. ill give this a try (trying it now) and see if it works out.

actually, i dont necessarily want mimic to turn on the screen. i like being able to control the system without the tv coming back on. its nice when i just play music, and when i play a movie, the screen automatically comes on anyways. if this works as advertised, it will be just fine.
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Postby cowanrg on Sat Jan 20, 2007 6:54 pm

works like a charm.

i tested it first just in the event manager, i added a 1.5 minute wait command, just like before. it worked! then, i added it to the PPC, and it didnt work. turns out, i forgot to remove the wait command and it just made it seem like the PPC was locked up. haha. i removed the wait command and it works perfectly. the only slight downside is you DO see the mouse cursor pop up for a second, and then go away, but that's fine. it would be nice if you could make a small program that would send a random keyboard stroke instead, like the shift key (which will do nothing on it's own, but still wakes the monitor).

thanks!

now i need to figure out spiders, and how to make them relatively automatic from the interface...
cowanrg
 
Posts: 35
Joined: Sat Jan 13, 2007 1:41 am

Next