Potty Page

January 17, 2009

Bluetooth... to wake up my PC

This is a kind of follow on from the last post (about wake-on-lan and DHCP and stuff...)

One of the joys of leaving your computer running is that it's always ready for you - if you hibernate it, it takes a bit of time to respond. If you turn it off it's gonna take some time to come back. (Now I can hear some of you screaming... suspend, suspend... don't hibernate! Well, my fingers are in my ears and I'm not listening - I've found that my PC comes out of suspend waaay too easily, although to be fair there's probably settings I can change to make the mouse not turn it on.)

Anyways, so seeing as there's a server that runs all the time in the lab, I thought "ah-ha", if I put a Bluetooth dongle in it... and probe occasionally, when it sees my mobile phone it can start to turn the PC on (by wake-on-lan) that means that I can turn it on passively, by just being present so it's ready for my by the time I get there. I've not messed with full distances and the like, but I think it can see me as I leave the lift.

This has lead to me finding a somewhat annoying feature of Windows XP. This being that if you WoL a hibernated machine... after 2 mins of idle time it'll hibernate itself again. So, the bluetooth turns the computer on, but you don't check your emails - you're making a cup of coffee... and the bloody thing turns itself back off!

Now... this feature is documented on Microsoft's support site in KB810719 -

After two minutes, if no other activity or ping requests from the network occur, the computer automatically returns to standby or hibernation. This behavior occurs because Wake-on-LAN is typically configured to return your computer to standby or hibernation after two minutes of inactivity.

Now, in there it says "typically configured...two minutes". OK. How do I configure it to be atypical, at a time of say 24 hours or 1 year? I can't find this documented anywhere!

I guess I could write a program that convinces Windows that executes the command SetThreadExecutionState saying that the computer is always busy, but that's a lot of a fudge.

Ideas, anyone?

Posted by Ed at January 17, 2009 4:53 PM | Geek |