PC monitor sleep mode using iPhone

[Mike Silverman] rigged up a way to make his monitor sleep from an iPhone. Working with a Windows system, he installed QuickPHP and NirCmd to add PHP and command line controls. Some quick PHP code writing and this has the effect of creating a sleep button toggled via a network address. He loads up the IP and port information in the Safari browser of his iPhone, creating a Home Screen short cut seen in the image above. Now he clicks on the button and puts the screen to sleep.

It’s not that we find this functionality useful since most monitors sleep after a few minutes of inactivity. But we like the methodology and you can bet we’re already planning uses for this. Any PHP server (like the copy of Apache running on this machine) will do as long as it’s on the same LAN as the iPhone’s WiFi connection.


  1. Alex Rossie says:

    How is this a hack.

  2. Josh says:

    Have been doing this with EventGhost and X10 for a while now. It works well

  3. poot says:

    Why not just set the screen saver to put the monitor into stand-by…seems like a lot of work for nothing.

  4. VODKA says:

    Yea, it’s not really usefull in this way. But if you do some port forwarding on your router or modem, you could just start an FTP server from your phone to get some stuff of your computer while you are not home. Or something like that. This could be usefull in some ways.

  5. Aaron says:

    So…a web app? Little novice-level for Hack a Day, isn’t it?

    Better keep it behind a firewall, too, or every bored thirteen-year-old on 4chan’ll be pissing you off just for the hell of it.

  6. Erik Johnson says:

    I’d like to submit my iphone hack:
    Open mobile safari and type in http://www.hackaday.com/
    Create bookmark to home screen

    Hack A Day app on the springboard!

  7. poot says:

    @Erik Johnson


  8. DarkFader says:

    “I’d rather see a proper solution to that!” or something in the lines is all I can come up right now. Screensavers do it automagically too.
    My room lights go on automagically whenever I enter the room. Turning lights on is more useful than turning them off, don’t you think?

  9. dcroy says:

    that is quite a bit of work to just put the monitor into sleep mode

    before my remote control bay fried i could do the same thing using intelliremote


    it has an iphone app too

  10. Whoever says:

    @ the screensaver guys:

    Nope. Some of us need the monitor to be on and stay on indefinitely, even if there’s no activity anywhere near the computer.
    No automated solution will ever work in these situations, at least not until AI can tell what you’re doing and when you’re done, but that’d be a little overkill.

    I just put a “monitor toggle” button in my IR remote. I hate touch screens for control, real buttons FTW.

  11. Cole Faust says:

    I did something like this, but php launched iTunes on my Mac. I wanted this because the remote app for iTunes would only open my computer’s music if iTunes was open, and now I have a button on my homescreen to do that!

  12. homb says:

    when i read this i thought it was gonna be some bluetooth monitoring daemon on the pc that noticed when you left your desk.

  13. DroneZone says:

    I think VLC remote is better “hack” than this. You can use your phone as a fully functional remote control and setting it up takes couple of minutes.
    You can browse for movies on all your mounted drives as well.
    I thinking of developing an app tho for my N900 in QT to interface with my relay board which controls stuff in my house. Even tho that has web frontend as well but who the hell want to open the browser all the time. I just need some fast app with big icons to keep clicking on for the relays.

  14. BiOzZ says:

    this is one of those problems you never thought you had until a solution is made XD

  15. Uhm… This is fail?

    I already has a widget installed on my HTC Desire, which is transferring transparent TCP commands to a proxy server on my public domain (as security measure) and when it goes back to my house and when into my home control system…

    I have 4 buttons, Lights on, Lights off, Unlock door and Sleep/Wake up … Oh and not to hijack anyone, but if someone is interested it’s up on my blog in a few days when I’ve finished some “tracking device” :)

  16. Concino says:

    I guess he uses his computer monitor as TV and watches it in bed. I cannot think of any other reason why this would be helpful otherwise. Even then it might be faster to just walk to the monitor and hit the power button.

    WHY is this advertised as an iPhone solution? Any device with wifi and browser can do the same thing…

  17. Aeros says:

    I used to do this all the time 8 or 9 years ago to shutdown or reboot our application servers. It’s not that what he did isnt a big deal its that there are several other applications if you *THINK* about it.
    This might be lost on some of the people here though.

  18. Brett says:

    This is really cool, as it could be used for many more things. NirCmd has a lot of functions other than putting a monitor to sleep, and I think this is just laying a framework for other simple tasks to be performed remotely.

  19. icebrain says:

    Blueproximity: http://sourceforge.net/projects/blueproximity/

    Can run a script when it detects your bluetooth-enabled phone comes near, and another when it goes away.
    I use it to activate xscreensaver, which locks the screen and sleeps it after 2 minutes.
    When I get back, it auto-unlocks.

  20. M4CGYV3R says:

    @whoever What could you possibly be doing that precludes display sleep?

    My computers all have a power button, which I have told windows to treat as a sleep button. It’s actually faster to walk 5 feet and press a button than it is to unlock my phone, turn on wifi, and navigate to some address.

  21. Paradox says:

    In linux I made it so that when I walk away with my phone it locks the computer using xscreensaver and turns the monitor off. then when you walk within distance think it was rssi=-16 then the screen turns back on and the login prompts you.
    And that was just a simple bash script

  22. Paradox says:

    Just saw blueproximity’s post. didn’t realize they made a program out of it lol ^_^ there ya go

  23. therian says:

    Have some respect for disable, this guy have iphone after-all

  24. Anonymous says:

    Perhaps I’m missing something, but why did he compress a 158 byte PHP file into a 264 byte ZIP archive?

    I see the utility of being able to turn the monitor off remotely, but is it really that much of an advantage over just turning the thing off manually? While you’re at it, why not turn the whole computer off, and save some energy?

  25. PlastBox says:

    Why are you guys all ragging on this guy? By your mentality, why does this site even exist? Hell, why do anything at all, ever? It’s not like a passable solution can’t be bought.

    Number one reason for hacking, the motivation behind 95% of everything posted here and the reason why turning off your monitor from bed with your touchscreen phone is cool:

    Because we can.

  26. Someone says:

    I visit this site because people repurpose things and / or spend what seems to be a lot of time / thought / effort into assembling physical thing or coding reasonably large programs (or if they do it in a really obscure, thought provoking way)

    This hack requires almost no ingenuity, uses off the shelf programs, and 3 lines of code. I’m fairly certain I typed out the glue code faster than I would downloading the zip file. I never actually did, and I assume he did something like this:

    Then entered his phone browser, typed “http://ip/monitor/” and saved the shortcut to the desktop). I farted this out in about 60 seconds (that includes looking up nircmd’s arguments online).

    I guess it’s all relative. You have to factor in what phone he has. It’s so locked down that doing anything “nonstandard” is a hack.

    P.S. Careful, this thing uses PHP script, which is illegal in the store — it might get banned. ;)

  27. Someone says:

    hmm… the comment system edited out my php. No fear, I’ll even spend another 20 second retyping it:

  28. Someone says:

    > I visit this site because people repurpose things and / or spend
    > what seems to be a lot of time / thought / effort into assembling > physical thing or coding reasonably large programs (or if they do > it in a really obscure, thought provoking way)

    > This hack requires almost no ingenuity, uses off the shelf
    > programs, and 3 lines of code.


    > I guess it’s all relative. You have to factor in what phone
    > he has. It’s so locked down that doing anything “nonstandard”
    > is a hack.

    you could do all things on the iphone, first you could jailbreak it and you could also use adhoc distribution and sell your app through a website and so on.

  29. Someone (2:39am and 2:41am) =P says:

    @Someone (3:28pm)

    I’m trying to determine your intent: are you simply agreeing with me? Installing apps not from the store is “nonstandard” on those devices, so it require a hack to the phone — and therefore agree with my “nonstandard”=”hack” statement?

    I’m just waiting for them to use the E-Fuse like technology, making it retardedly difficult to do anything bordering a “hack”. The Android phones that do have this hack (last I heard) were only able to get root, but without any way to get code to do anything meaningful to the file system onto the device, you can’t do anything with root. Nobody else has that problem because the market is barely filtered, plus “[ ] Enable External Sources for Apps”

    With so much control over their own ecosystem, I’m surprised they haven’t done so before.

  30. Whatnot says:

    I thought everybody that reads hackaday and has an iphone would have it jailbroken, (and 50% of the rest of the iphone users).

  31. Whatnow? says:

    Hmm, this seems to me that this hack (ignoring the debate whether this is a “hack” or not) is actually platform agnostic and could actually be from any device as long as it can run wget or a browser. The proper title of this article should be:

    “PC monitor sleep mode using any browser”

    But I guess it’s not as cool sounding.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 97,790 other followers