Router Rebooter Without The Effort

It’s one of the rituals of our age, rebooting the family router when the bandwidth falters. Flip the power, and after half a minute or so your YouTube video starts up again. Consumer-grade router hardware is not the most reliable computing equipment you will own, as [Nick Sayer] found out when the router at his vacation home wasn’t reliable enough to support his remote monitoring equipment. His solution is an auto-reboot device, that power-cycles the offending device on command.

An obvious method might be to switch the mains supply, but instead he’s taken the simpler option of switching the DC from the router’s wall wart power supply with a cunning arrangement of three MOSFETs to keep the router defaulting to on under all conditions except when it is commanded to power down by the ATtiny microcontroller overseeing it. This chip provides extra fail-safe and debouncing functions to ensure no accidental rebooting.

Driving the circuit is a Raspberry Pi that handles the house monitoring, on which a Python script checks for Internet access and asks for a reboot if there is none. For extra safety it requires access to be down for a sustained period before doing so in case of a router firmware upgrade.

This isn’t the first router rebooter, for a mains-switching ESP8266 take a look at this one.

Router picture: Asim18 [CC BY-SA 3.0]

67 thoughts on “Router Rebooter Without The Effort

  1. A simple time-swtich, set to cycle the power in the middle of the night does the job.

    It’s just as likely, that restarting one’s home router, also kicks off a load of things at the exchange end, especially with a ADSL/VSDL service, as a lot of modem re-training takes place, at both ends!

    Which reminds me, I have router firmware to update, once domestic management has finished watching her soap series online and gone out.

    1. Ironically, modern routers often have a scheduled reboot that you can configure. But, of course, that assumes that cron (or whatever) on the router is reliable.

      Besides, there’s no need to reboot the router when it’s working. Better to just test it periodically and take action when it fails.

      As for the cable modem, it can be rebooted remotely from the cable company’s web site. If that fails, then it’s usually because of an outage that they’ll eventually fix on their own (of course meanwhile the router will wind up getting rebooted every few hours, but that’s harmless enough).

  2. X10 works reliably for me long long time now. Is UL approved with very low failure rate and even still being sold. Plus I did lay in a 2X lifetime supply of spares which, after this many years of excellent service looks like is really a 5X lifetime of spares. Easy to interface to computer as well as SBC.

    I suggest it to others so you can spend your hacking time elsewhere and have the benefit of UL approval.

    1. So much this – I’m a great advocate of using wireless remotes to interface with various microcontroller-operated mains projects. Bridging the contacts on a key fob controller, or generating a control signal, is much better/safer than trying to wrangle the angry electrons of house wiring.

      Still struggling with trying to get an Arduino to interface directly with a Firecracker X-10 serial module though…if there are any suggestions…..

    2. X-10 is running up to it’s 45th birthday. It is unreliable, slow, poorly supported by modern devices, and horribly insecure. There are a wide range of replacement wireless protocols that work better in every conceivable way. Many of those are cheaper, more reliable, more secure, more standard, and more widely supported. Sticking with X10 in this day seems foolish.

        1. “Have the central controller constantly send commands to “refresh” the state of all devices. With the packets going end to end, it would be a lot harder for anything else to change the state of devices.”

          Would this be security by spam?

  3. “It’s one of the rituals of our age, rebooting the family router when the bandwidth falters.” — In my experience, installing OpenWRT is by far the best solution to such issues.

    1. If you have to reboot a router that often, then you are not using the right firmware. There shouldn’t be any memory leaks. Let me ask you linux users, how often you reboot your PC? :P Most of the routers runs some linux kernels from the factory firmware. I had up times of years on my old router with Tomato firmware. There is an option to reboot from the web interface on a schedule.

      Sadly OpenWRT seems to be moving away from supporting routers with small resource.

        1. Not in my experience. All the routers and modems I’ve ever used and which have been crashing or otherwise stopping working properly have been fixed once I installed OpenWRT — nothing to do with power-supplies. Not once has the power-supply been the problem.

    2. Yeah, I used to be That Guy who jail-broke his phone and like that. I’ve discovered as I’ve gotten older that the one resource whose allocation is finite and not under my control is time.

      And, yes, this project has used *less* of my time than I believe managing third party firmware would.

  4. If you need to reboot your router, your router sucks.

    -Running an ASUS AC-RT3200, Number of reboots 0, uptime, 185 days+

    -Running an Linksys EA-6400 /w “Advanced Tomato” firmware, Number of reboots, 0, uptime, 203 days+

    Reboots are for Windows and other crap. If you need to reboot your router, either change it’s firmware, or the router.

    1. Asus ac-RT3200???? That has to be the WORST router I have ever used in my entire life. This is coming from a huge ASUS fan, but that router is absolute garbage. Great range and speed but wow so unreliable. It couldn’t handle all my devices and network traffic. If you don’t believe me go read other reviews and forums. The firmware is a nightmare and Asus is doing nothing to fix it. If you aren’t haven’t problems it’s because you haven’t had it long enough or because you are hardly pushing it. That is the router that finally drove me to leave the consumer market. I put in Unify last year and haven’t looked back. The only reboots have been from me updating firmware. Best investment I ever made.

      1. It runs the same firmware, doing the same darn thing over and over again. Unless you are upgrading your internet connection to speeds beyond the horsepower of the router or want the latest WiFi stndards, you are just making uneducated observations.

        1. Tekkieneet you’re absolutely wrong. Especially when it comes to consumer routers. The hardware inside degrades overtime. They use cheap CPUs and memory that eventually starts to cause errors. They all start to crap out after a couple years.

          1. Usually the ADSL circuits, due to static on the lines. But if you have clean power, and it doesn’t overheat constantly due to being sandwiched in between 2 other devices, will last as long as my old 286 which still runs like it did 20 years ago.

          2. I still have 3 older router dated back from WRT54 that still work. The only reason I upgrade them over the years was for more memory to run optware, USB, faster internet speeds and Wifi.

            May be I take care of my routers better than you?

          3. > They all start to crap out after a couple years.

            root@gate:~# uptime
            19:59:17 up 592 days, 9:53, load average: 0.16, 0.14, 0.14

            The only time I’ve ever rebooted an OpenWrt router is when it transpired that it was a problem at the ISP.

  5. My Belkin router has a feature where it can be set to reboot itself at a regular time. I don’t use it though.

    I have my router and cable modem plugged in to a digital timer so they go off when I am asleep. They are both “Energy Star” compliant but when off for 6 hours they save even more.

        1. So? I said I wasn’t sure what tge battery did. But this discussupion reminded me of it.

          The power was off last.week for maintenance. The tablets were charged, I have a portable battery to recharge them. I’d turned off the computer tye night before. If the battery kept the modem going a bit, I’d bave had internet.

    1. And if you have a smart home? Run a file server / webserver from your home? Have security cameras that run off POE from your router? Turning off your network for 6 plus hours is not really an option for most tech savvy folks. Smart devices especially will not like being disconnected but powered on for that long.

  6. Since 2012 we’ve had Bell Fibe here, I forget what make the modem/router js but it came from Bell.

    A handful of times the thing had to be reset. Just last week the power was off, the thing came back on and wifi to it worked but no internet until reset.

    That’s happened before, not sure if there were any actual random incidences that needed a reset.

    So reading this, it does seem the router needs an upgrade, not some workaround to compensate for a bad router. Maybe it’s a bad router, but maybe it just lacks circuitry to reset when needed.

    1. if the router needs a reboot, the software/hardware or both are defective.

      since the router is leased, you can make it fail.

      120V AC in the ethernet ports will generally do it.

      failing that, wrap it in some towels, and “bake” it for a few days/hours. Make sure to supervise it though.

      failing that, some good old h2o in the vents, make sure to do that carefully, generally, unplug, submerge, and plug back in. dry fully before the exchange.

      remember, you are paying a fee for replacement, make sure to get your money’s worth.

        1. doubt they are detectable. If the ISP is any good, they collect failure data, and would select a new model. Problem is, most/all ISPs suck.

          I’m with start,ca, which is awesome, because they allow you to use any modem on their list, and you can even purchase a modem from them.

          Robbers and Bellus make you lease a PoS modem, that I prermanently put in bridge mode,

  7. You’ll get replacement from provider and it will be same or similar crap. Better idea is to get your own router and use provider’s only as media converter. They actually work pretty ok when they’re not doing any heavy lifting.

  8. I built something similar with an arduino pinging 8.8.8.8, but it never occurred to me that firmware updates were a potential problem that I’d have to handle. That’s a much needed consideration and I’ll go change my little setup accordingly.

  9. Switched to a unifi setup about 6 months ago after I was tired of rebooting my Netgear router because it couldn’t handle my home server and 2 people on the internet without regular reboots. After setting up.the unifi network I haven’t had to touch it once, best network I have ever dealt with.

    1. Did the same a year ago coming from an Asus setup. Worth every penny. I have 50+ devices connected at any given time. Half hardwired and the other half wireless. No issues at all anymore and so much useful information on the health of the network. I will never buy a consumer router again.

  10. Or you could just buy one of the many devices that already exist for this.

    There’s one on Amazon for $20.99 that actually connects to your WiFi, and only reboots when it loses the ability to connect to the router or loses internet access.

  11. If the router runs linux, run a cron job to reboot it once a night or if you wanna get fancy write a script to ping a web site and if the ping fails, reboot it.

    For what it would cost in time and money hacking at junk hardware you might just consider buying better instead of investing good money to polish a turd.

    1. You can probably script it to reboot nightly through most routers interfaces… they usually have a reboot button in there when you’re logged in, take a bit of parsing their web page front end though.

  12. I file this more under the same usefulness as a “life hack”. Neat but not terribly useful. At the end of the day if you want reliability as others have pointed out, don’t buy crap. I have owned and used just about every consumer router, and used a far number of alternative firmware’s, now I just use Mikrotik.

    My router has never had an unexpected reboot except for power outages that deplete the UPS. It has a watchdog timer so if it should ever lockup it will automatically reboot without any other programming or external parts. It astounds me how few people know about this company.

    1st) It runs Linux (a striped down core that fits in a few megs)
    2nd) They regularly update (every few months, plus security patches as needed)
    3rd) They are inexpensive ($50-$150, most models)
    4th) They are feature rich. (several flavors of QoS, PoE, MiMo multiband wifi, IPv4&6, Layer 7 manipulation..etc. )
    5th) One of if not the most stable router I have ever seen(including pro gear) (one of my units is going on 4+ years)
    6th) Has a good CLI and scriptabality if thats your thing (Similar to Cisco, you can copy and paste settings etc as well)
    7th) Has a great standalone GUI if thats your thing. (dedicated app [winbox], or http/s page, or mobile app)

    At work the Cisco gear to do a L2 bridge across a wan was priced well north of $20k, with the more pro version of Mikrotik router (needed a specific set of copper and fiber ports and bandwith) I got the same features and more for south of $5k with more bandwidth, memory and cpu power. I tested it with my home router first as all the features are in both products, the only difference is the physical hardware performance and ports.

    I am sorry that this message is a pimp the company kind of thing but in all honesty the product is so feature dense and reliable and affordable I am surprised that people are still buying junk routers even to run some other firmware on it.

    Simply put there isn’t any reason to buy junk (routers), fiddle with junk or tinker with making junk do things it doesn’t normally do if your time is worth anything and you want reliability or if your not just playing to learn something new.

  13. I bought a ResetPlug for exactly this purpose!
    It worked well, until eventually I moved away and didn’t need it any more. It’s good to see that there’s an open-source solution.
    Has someone done the same with the hackable Kankun KK-SP3 power socket, or the EcoPlug/WiOn 50050 that has an Esp8266 inside?

  14. I noticed my internet speed reduce after about two weeks and then start connectivity issues as well. I have a zigbee smart plug connected to the node-red home automation hub does the restart job pretty reliable and clean way.

    1. I came here to say an S31… but that’s just because I like the form factor better.

      Added bonus that my brother discovered while dealing with his children, “Alexa, turn off internet”

      Sure Alexa can’t turn the internet back on again, but that’s kind of the point with a nuclear option…. (and the router/s31 need to be locked where the kids can’t get to them.)

Leave a 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.