Turn On Your Computer From Anywhere With An Arduino Server

arduino server

Unless you live off-the-grid and have abundant free electricity, leaving your rig on while you go away on trips is hardly economic. So if you’re like [Josh Forwood] and you happen to use a remote desktop client all the time while on the road,  you might be interested in this little hack he threw together. It’s a remote Power-On-PC from anywhere device.

It’s actually incredibly simple. Just one Arduino. He’s piggybacking off of the excellent Teleduino software by [Nathan] who actually gave him a hand manipulating it for his purpose. The Arduino runs as a low-power server which allows [Josh] to access it via a secure website login. From there, he can send a WOL packet to his various computers to wake them up.

The system is working so well, he’s set it up with all his roommates’ computers as well, giving each their own login information on the Arduino’s page to allow them to access their own computer. Not a patient fellow, he also wanted a way to tell when his desktop would be ready to access…

To do that, he setup a MySQL database to compare time stamps on the computer and  local time — once it’s within 60 seconds it knows the computer is ready to go. Kind of overkill if you ask us, considering you could just have a 60 second timer on the website instead… Anyway, it’s a sweet hack and super handy for those of us with multiple computers at home.

[vimeo 115137097 w=800]

All the info to do it yourself is available over at Hackaday.io!

36 thoughts on “Turn On Your Computer From Anywhere With An Arduino Server

    1. the router only works, if your computer supports WOL. in this case even a WOL-app on your mobile would work.

      a pi might be a little overkill (as far as a pi can be called that way) to send a WOL package or switching a single gpio pin.

      i think this is quite the nice solution to start computers without WOL support. i have three of them in my rack (hacked together from old dead computers to live on as test-servers and so on). this will work fine for me.

      1. WOL is a bitch. On my machine it only works if there was no power outage (ie. you can shut it down and then wake up by an Android app, but when I disconnect mains and reconnect it, it won’t.)

        1. This implementation, yes. There are implementations that hook the Arduino IO to a computer power switch – ATX makes it trivial to actually properly switch a machine on that way without WOL.

          1. I switch my ‘big iron’ machine on/off remotely with the ATX power line, but momentarily switching this line to ground just changes the power state: if it was off it turns it on, if on, it turns off. Is there a way to “actually properly switch a machine” to a known state with the ATX power line (or is my machine’s BIOS just dumb)?

          2. A simple circuit. Switched 5v from the PC to detect IF the PC is on to a GPU of tha arduino. Note line level conversion my be needed. Use a relay with a 5v coil, a couple resistors to create a voltage drop, or line level conversion chip. Tie another gpo to the power switch of the computer. Again line level conversion may be needed. Now that does not tell when the desktop is running. Simply have the computer access a web address on the arduino. Say something like http://192.168.1.5/deskon or http://192.168.1.5/deskoff when the desktop shuts down. That part is easy autostart a browser to a specific address. Killing a browser afterward is easy too. If you use a specific browser only for triggering the arduino on autostart, send a kill all signal to kill all browsers of that name, ie firefox, chrome chromium, or a lesser known browser. If you boot a server with no desktop, use curl or wget or other terminal/command line app to access a web page

  1. It should be possible to just NAT UDP traffic on a given port from the wan side to the lan, that way you can just use standard WoL cliens. However, i remember that i had an issue when i tried to do that some years ago. I think the problem was that you need to set a broadcast IP address (otherwise the router will try to resolve the MAC address for that IP instead of using the broadcast MAC address) and some routers don’t allow to do that.
    Any correction is welcome.

  2. Surely anybody who have various IOT stuff in their network will have some sort of small *nix based server stuffed away in the corner? If you don’t then this is a viable solution, but you do have some strange priorities.

  3. “Unless you live off-the-grid and have abundant free electricity” <<< I have no idea what the author is trying to say here – I don't know of anyone off-grid who has 'abundant' electricity, nor is any off-grid electricity 'free' – the capital costs are vast, with payback periods of years compared to a utility supply. I suppose off-gridders with surplus must exist, but for most life is about as being as frugal as possible in terms of power consumption.

    1. With a half-decent server, you’re probably only looking at pence/yr electric costs. And that probably pays for itself in reduced hdd startup wear (my servers have powercycled twice in the last year)

      1. … it’s “pence/yr” as long as you can count in kilopence. Do the arithmetic:
        A very frugal server might take 10 watts, or 80 kWh/yr. At 15p/kWh that’s 1200 pence/year. And if your server is older or non-trivial (i.e. “half decent”), you may be looking a ten times this cost. A desktop’s burn rate could make this effort economically worthwhile.

        In the US, rule of thumb is a dollar per watt per year. If it’s a warm wallwart it’s a buck a year. If it needs a fan, it’s a hundred bucks a year per fan.

        (and if you’re trying to run a server off-grid, your 10-watt burn rate will cost you $100/year in capital cost and maintenance…)

  4. The thing I hate about WOL is that it doesn’t always work when computers haven’t been “soft” shutdown or in some cases, in sleep mode. The unreliability in my experience has made be consider hard-wiring something to the power switch which is hardly an elegant solution.

    1. Set firmware/BIOS to always power-on after power restoration.

      After that, connect http://www.powerswitchtail.com/Pages/default.aspx (or similar device), trigger said device to momentarily interrupt current.
      Or the enterprise route: switched/metered PDU triggering power cycling via SNMP.
      Second one combined with a watchdog script running on my router is how I deal with crappy modem from my ISP conking out during heavy usage periods…

    1. “Set router for WOL passing”

      Make this make sense to me. WOL packets are non-routable layer 2 stuff. How do you get your router to “pass” them? I can log into my router over the internet and ask it to send a WOL packet for me, but that is in no way what you seem to be describing.

    2. Well I can see two problems with that. First if your provider gives you a static IP you might not be able to access your equipment because you don’t know what your IP is going to be from any given point. Second does your provider tell you what your IP and port address is for your particular Hardware you might be sharing the same IP with others and just have a different port address.

  5. Oh wow, since when did arduinos have built in Ethernet? Oh wait, it doesn’t. This isn’t “one arduino” It’s a arduino with extra hardware. Kind of an important point.

  6. ..Or you could just hook up your old nokia2600 or any other phone via vibrator to power connector on the mainboard and power up your machine by calling the number and closing the circuit.

    1. This is also overkill but I guarantee it use less power than the router so you win today.

      People seem to have forgotten that the router is particularly power hungry, especially those ADSL modems that get nice and warm.

      I say use a cell device with an io to power on the router then send WOL.

  7. I had been using a Pogo-V4 mobile I picked up on Amazon for 5 bucks. It had ArchArm Linux on it, and worked great until the USB stick went bad. Might want to see if this can be adapted to my setup (I like the web page idea) if it can be used as a SSH jumpbox as well.

  8. I use GPIO ports of a pi to switch on and off my computer at home by connecting switch pins on the computer’s mother board. And it also monitors computer power state via power LED input to GPIO. The reason to use switch pins on the mother board is to make it able to force restart even when the computer crashes, in which case, WOL cannot restart the computer afaik.

Leave a Reply to JaiCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.