I live in Washington state, which, due to the amount of trees and their proximity to power lines, often means that I might lose power in my apartment, while just blocks away, everyone else is powered up. I also often visit my parents, and this has led to multiple instances where I am torn between spending the night at their house, where they still have power, or starting the drive back without knowing whether or not I will have hot water and my favorite electronics ready for use.
At these times, I have often wished for an easy way to check remotely, over the internet, whether or not my home has power. Building and setting up a home server is something on my to-do list (and has been on it for a while) and it would easily solve this issue, but with a potential snowstorm on the way, and a visit to my parents planned, I wanted to set something up in a jiffy. I was also thinking – given the plethora of internet-connected devices the average consumer, and I myself own, surely there must be some way to accomplish this already?
To be clear – the easiest solution is to simply check with the power utility company. However, since during the last outage their reporting system went down with the power (LOL) I was annoyed enough to look into my own method for checking.
Here are some of the ideas I explored. My quick solution for today is at the bottom (or click here to jump to it).
- Idea: Leave a spare Laptop / PC on and running TeamViewer (remote control software for screen sharing). This would allow me to log in remotely and even check out the webcam remotely. If it fails to connect, I know my power has gone out.
- Failure: Most computers, including the ones I own, do not automatically start up after power has been lost and then restored. Some BIOS configurations will allow for enabling a setting which turns this feature on, but it is not often found on laptops or tablets, which are the only spare devices I own and would be comfortable leaving TeamViewer installed as a server on.
- Idea: Use an old Android phone as a remote security camera. If I can’t connect, I know the power has gone off. Or I could install some simple server software on it.
- There are a bunch of free applications that cover these needs
- Remote security camera:
- Alfred Home Security Camera: Play Store Link
- Simple home server
- LAMP like stack: “HTTP Server Powered by Apache” – Play Store Link
- Remote security camera:
- ISSUE: Same as the Laptop / PC issue. Many Android phones do not automatically boot themselves back up after losing and regaining power. HOWEVER, this is still one of the best solutions, for multiple reasons:
- If the screen is off, even old phones should hold a charge for a decent amount of time before depleting the battery. Hopefully your power comes back on before then.
- There is a way to force your phone to auto boot back up after power has been restored. However, it requires root – instructions here
- There are a bunch of free applications that cover these needs
At this point, I started thinking “what devices do most people own, that are always plugged in, and already feature auto-restart / auto-boot on power failure and subsequent restoration?”…
- Idea: Roku / Amazon Fire Stick / Smart TV
- This led me down a very fascinating rabbit hole of technology, which I could read about for days
- Both Roku and Amazon FireTV/Fire Stick have network endpoints which you can make requests to and get data back. Both support something called DIAL, which is sort a protocol for 1st-screen (TV) discovery and control by 2nd-screen (smartphone, tablet) devices.
-
- Roku is much more developer friendly, and has published docs on using DIAL. In addition, they have their own API they have developed, which is surprisingly in-depth and powerful. A little scary actually, in terms of what can be controlled without authentication…
- For example, as long as I’m on the same network, I can actually “press” keys on the Roku remote just by issuing network requests. For example, making a POST request to this URL presses the “Home” key on my Roku!
http://[Roku_Local_IP]:8060/keypress/Home
- Amazon is much more secretive and harder to find information on. They also support DIAL, but it is less clear on what functionality is supported. However, by poking around, it looks like they support the general DIAL syntax. For example, if Netflix is installed, a GET request to this URL will return XML information about the application.
- Roku is much more developer friendly, and has published docs on using DIAL. In addition, they have their own API they have developed, which is surprisingly in-depth and powerful. A little scary actually, in terms of what can be controlled without authentication…
http://[FireStick_Local_IP:8009/apps/Netflix
-
- Both Roku and Amazon FireTV/Fire Stick have network endpoints which you can make requests to and get data back. Both support something called DIAL, which is sort a protocol for 1st-screen (TV) discovery and control by 2nd-screen (smartphone, tablet) devices.
- This led me down a very fascinating rabbit hole of technology, which I could read about for days
- Idea (and SOLUTION, at least for today): ROUTERS!!!
- If you are already using DD-WRT (open source firmware for routers, great stuff), you have tons of options at your fingertips, especially since it supports scripting.
- In general, this is a risky option, since the last thing you want to do with a router is purposefully allow outside access pointing in.
- This is basically the whole point of firewalls, which are built into most routers.
- If you try to make a GET/POST/etc HTTP request to your Public IP address, that is very unlikely to get routed anywhere.
- This is basically the whole point of firewalls, which are built into most routers.
- Works for me – Pinging the router! – For my quick, no fuss setup, I saw that my ISP’s router had “Drop Incoming ICMP Echo Requested to Device WAN address” actually turned to off by default – 2 seconds later, I had fired up my terminal and a simple “ping [MY_PUBLIC_IP]” later… low and behold, the router responded and no packets dropped!
- I should have checked this first, but had assumed that this would be locked down. To be fair, many routers might have this locked down, so you might have to explore the other options above if this is not working for you.
- Since I have an Android phone, I can use Android’s terminal to ping from my parents house and see if my router is up and running.
- There are also dedicated apps for checking on ping status – such as this one.
- Please note that an ICMP ECHO packet is different from HTTP – see wiki here – but the reason I mention this is because you can’t use typical website uptime monitoring tools to check if your router is up or down. If you want to use an automated alert site, look for one that specifically supports “ping”, such as UptimeRobot.
Why not buy an old cassette style answering machine and simply call your own number from remote.
That’s not a bad idea on the surface, but assumes that I have A) have a landline (I do not), and B) assumes that the telephone service only ever has outages at the same time as power outages (also not true).