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!
nice and all, but I just use my router, or a Pi.
+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.
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.)
“the router only works, if your computer supports WOL”
??
The Arduino also only works if your computer supports WOL.
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.
You can access GPIO pins on a router with openWRT
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)?
You can find out the current state of you PC easily enough – monitor the 5V line or ping the PC and you can decide to toggle or not.
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
Could that have anything to do with which BIOS settings you use, How to act on outage ?
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.
Dd-wrt based routers can also do this for you
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.
dd-wrt runs on almost any router. it’s free (for most routers) and it is also more secure.
DDWRT hasn’t been updated in years thus runs stale SSL packages, so itsn’t it vulnerable to the recent issues w/ MITM attacks?
“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.
I think you got the point
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)
… 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…)
Facepalm.
Obviously this website is above your level of comprehension.
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.
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…
This is what I was expecting with the hack
Don’t be picking on him. Give the man a break. And BTW there are a LOT of people off grid with a Genny. If you ever read a Northern Tool catalog you’d get a hint.
Thank you for another project James.
Set BIOS to restore state after outage.
Set BIOS and os for WOL
Set router for WOL passing
Set PC OS to sleep.
enjoy.
Hack not needed but wheres the fun.
“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.
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.
Alternatively you can use one of these: http://www.digital-loggers.com/lpc.html
My company uses these to switch hardware all over the world through OpenVPN connections hosted through Amazon virtual machines — gets through every firewall we’ve encountered, even the Great Firewall Of China.
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.
Without any hardware literally all you can do with an arduino is blink the built in led. I think it’s implied there will be something extra connected to it.
..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.
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.
http://techprocity.com/how-to-hack-a-computer/
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.
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.