Router Rebooter Eliminates Hassles

Some low-end or older routers might get you a decent WiFi network in your house or apartment, but often these cheaply made devices are plagued with subtle software problems that cause the router itself to become unresponsive after a few days of operating. One solution is to just power cycle the router by hand whenever the Internet disappears, but a better solution is to build something that does that for you.

[Charlie] had this problem as the de facto IT person in his family, and didn’t want to keep getting bothered for such a simple problem. His solution involves a relay, an ESP8266, and a Wemos D1 mini. The device connects to the Internet through the router and occasionally sends out pings to another address. If it can’t ping the address successfully after a certain time period, the device power cycles the router by activating the relay.

Since this isn’t the newest idea out there, there are many ways to solve this problem if you are constantly annoyed by router issues, whether from your own router or from friends and family who treat you as their personal IT department. One solution doesn’t involve any extra hardware at all as long as you have a computer near your router/modem already, and others solve this problem when it happens to the modem rather than the router.

85 thoughts on “Router Rebooter Eliminates Hassles

  1. I find it weird how many people just accept having to reboot their routers all the time as a fact of life. Not buying the cheapest, lowest-end piece of junk available often goes a long way towards not having to reboot anything, and making sure that the device you’re buying can be flashed with OpenWRT instead of the default firmware is even better, if you want a stable device.

      1. A good router will never require a reboot unless it’s being an updated. Been rocking pfsense for years now on a custom-built, very low power / noise system I built… rock solid stable.

        1. Lots of assumptions. Never say never.

          The problem in my setup is the vendor provided “router”, VDSL to PPoE convertor, which doesn’t handle talking back to the vendor kit correctly. Insists on using DHCP for a static WAN IP, and freezes if there is a problem. – DHCP server timeout and wont re-issue.
          So ideas on fixing vendor locked equipment on a postcard.

          But where is the ellegance here?
          It’s yet another turn off the power job.
          Why not have your ESP log into the router, perform a ping test from it’s internal diagnostics and then issue the reboot command ?
          HTTP(S) scripting and getting a better understanding of what’s actually going wrong and how to converse with HTTP servers.
          +1 more complicated.

          1. In some cases taking the power off is the only solution. My isp provided router at home for instance needs a reboot about once a week. going into the webinterface and clicking reboot somehow doesn’t reboot it completely, but taking the power off for a few seconds obviously does

      2. I nearly only have to reboot my computer at Microsoft’s will, if their updates require it. I also noticed once that my Linksys router required more or less frequent rebooting rebooting only after several years of age. I think some deterioration of the hardware caused it to become unstable and throttling my internet connection from 35Mbit/s down to 20Mbit/s. After the reboot it worked normal again for around a week.
        In the meantime it got replaced by a 8quite cheap) TPLink product flashed with OpenWRT.

      3. That’s also pretty weird. I couldn’t tell you the last time my desktop was rebooted, certainly not within the last 6 months.

        If a computer is getting “flaky” and needs to be restarted often, then something is wrong with it.

    1. Think of this for parents or grandparents who use the internet, but don’t understand it. They’re not going to want to buy new hardware. And if you install one of these you an save yourself tons of tech support calls.

    2. That crap annoys the hell out of me in every computer related device. It gets carried into server hosting as well (not by the host but by the customers). For the longest time my CS:S community had an auto-reset script on our CS:S and Minecraft servers. Annoyed the hell out of me because it always triggered really late at night when we would have 5 or so highly skilled players on each team but after reset they were gone for the rest of the night. I begged and pleaded to let me log into the admin account and determine why they needed a regular reset to fix it. Pointed out that I had experience working on game servers that stayed running for long periods of time (3 years straight for CS:S, 1 year for Minecraft). No go on that despite being one of the founding members of that community and one of the goto guys for tech help.

    3. I dunno. Mine has an option where you can schedule a reboot in the interface. It is a Dlink so not super uncommon I would think. I still do mine manually when it starts to get a bit chuggy but it could be the modem. I haven’t checked as just cycling things every year or so it is not enough of a hassle.
      I would add that this person could always just plug it into one of those travel timers for the outlet and set it to power off and on late at night but that wouldn’t allow an automated emergency reboot.

    4. That doesn’t happen only to low end routers… I have an Archer AC3200 that has been lately freezing (and not exactly a cheap one, 200$)… I can transfer at 30-40 MB/S (I think it’s the max speed that my laptop’s wireless card can handle) and >90 MB/s with cable… But then suddenly gets non responsive and all connections die…

      1. Could you compose a whole ethernet packet (or frame) with a series of one-shots? A hard coded “GET” or “POST” would be doable, I think, with enough 555s. A simple UDP datagram could even send something useful with a reasonable number of chips. Add an additional 555 for a heartbeat timer firing once every few minutes, and you might even be able to replicate the above behaviour.

    1. However it can’t hurt to develop the good engineering practice of keeping the line voltage well isolated from low voltage circuitry. Not that I saying this is going to start a fire, but is a construction practice to avoid. Particularly if your building something that will go into another’s property.

      1. It is isolated at least by the relay. And this relay board is one of the kind which incorporates additionally an Optoisolator. Which is of course completely useless, as the grounds are tied together.
        But the relay isolates the mains voltage reliably from the low voltage side.

      2. Not to disparage the project, but I also thought it would be much easier and safer to switch the power using the 9-12v DC from the wall wart rather than deal with the line voltage.

      1. Ever get a toenail in the eye? I have had eye injuries where I was VERY lucky…a toenail would seriously suuuuck. Seriously though, just because something is unlikely does not mean it can be ignored. You have to weight the outcome of a hazard against the chances. In this case, you and your family could burn to death. Being lazy and not resetting the router manually is not worth that.

    2. I’m just wondering why not power cycle the DC supply instead. The only downside is finding a pair of barrel connectors of the specific size (there aren’t that many), and you can use a smaller DIP relay instead.

    3. It’s a legitimate concern when you post something like this on the internet and people with widely varying knowledge and skill try to copy it. IF it ever causes a fire people can die worst case. Best case, your insurance denies coverage and you are out the cost of a house. Explain to me how that is better than getting off your chair and resetting a cheapo router that saved you all of $30 instead of buying a proper one. It is not worth the risk to go screwing around with anything behind an outlet plate. Now replacing an outlet, switch, etc… is not a big deal if you are not a complete idiot unlike the previous owners of both houses I have owned…so forgive me if I have a VERY low opinion about the average home owner even owning a screwdriver. But installing additional crap that does not belong in an outlet box is another story. And it’s Chinese crap on top of all the other issues…

      The biggest thing that smokes my 555 about these kinds of hacks is that they are typically to solve laziness. If you want to switch an outlet then buy a remote operated power strip. Done, solved.

  2. Years ago, I had my router and cable modem on a mechanical “Christmas light timer” that would turn them off for 15 minutes at 3AM each night to reboot them. They always seemed to survive a day without issues. Several equipment upgrades later, and this is no longer necessary. Checking my router, it’s been up for 4 months – and I think we lost power around then.

  3. Name toast
    Model Asus RT-N16
    Chipset Broadcom BCM4716 chip rev 1 pkg 10
    CPU Freq 133MHz
    Flash RAM Size 32MB
    Time Wed, 31 Jan 2018 19:46:41 -0800
    Uptime 92 days, 07:08:11

    This was a $90 router when it was new. You get what you pay for :)

  4. My fibre modem and LEDE (better than OpenWRT in my experinece) have great uptimes, but they have the incredible ability to sense when I go on travel and fail on day 1 of my trip.

    Did something similar using a Sonoff S20 and a spare Airport Express to create a parallel control network and to isolate my IoT (yes I did flash Tasmota). Seems a little safer than this build. I’d love similar software for Sonoff systems, maybe I’ll see how easily it will port.

    1. When I am on travel I would not notice my home internet going off. Sometimes I even switch it off, if I don’t forget. My cat’s (and the neighbor feeding them) will not use it anyway. I also don’t see the necessity to switch any lights, when I am not at home.

    2. Not to seem like a loser, replying to my own post, but it looks like this code should be cake to port to the S20 (just need to remap the GPIO’s). Will try in the very near future. I’m a N00B, and this is a great simple “do something useful” software project and building a mains-power hardware project is (somewhat) intimidating to me.

  5. youtube? really?

    sigh.

    can we just stop posting links to videos (other sites love posting ‘news’ articles as twit feeds).

    I would have thought HAD editors had some respect for written words. I have zero interest in sitting thru videos; such a time sink.

    if its worth telling people about (your project) its worth some written words. please refrain from posting video links if that’s all there is about that topic. we need to encourage makers to WRITE UP their projects, not just point some camera at it.

    I know, its the short attention span generation, but still, we should TRY to have some standards.

    1. Short attention span? My principal beef with videos in place of text is that they take far too long to get any information out of. Usually, by the time the jackass with the camera has even gotten it to focus clearly on the project for once, I could have skimmed an entire writeup, decided if this is actually an interesting project or not, and got halfway through reading about the part that’s actually relevant to me.

      But instead, we now get to wait through several minutes of useless blather for each five-second blip of real information. That’s what I don’t have the attention span to tolerate.

      1. Your words in everyones ears…eerrmmm Eyes!
        I agree. I like Videos if they do what 10 pages of text can’t: show the stuff in a graphical way.
        What I really hate is when someone tries to make a tutorial into a video. 5 minutes of looking at the Arduino IDE? really?
        News sites tend to do that too with everyday affairs. Not only do I NOT have the time for a 3 minute Video. I do not want to waste my precious mobile data for that shit or I do not want to take out my earphones to get the information because I don’t want to bother the people around me…

        Seriously… READING… altough we are in 2018 and youtube seems to be the only thing that young people understand.

        1. I feel your rant. Different media allow for different modes. As a writer, coder, and devout command-liner, I like things in words whenever possible.

          But describing GUI navigation is awkward with just text. “Now go over to the File menu, pull down, select “Board Manager” and click here and there until you get something right.” Not saying it’s better in a video, necessarily, but just that if you want to do a detailed walkthrough of something GUI intensive, you lose both ways.

    2. That’s the whole point of sites like HaD: to summarize the project/video/whatever so you know if it’s something you want to look into deeper.

      HaD is presenting you with the written overview of the Youtube video you wanted, so I’m having trouble understanding your complaint.

  6. As an aside: part of the problem with consumer wireless routers is the OS they use. Back in the day of the WRT54G embedded Linux was pretty common, and given how built-in network features are in Unix systems it was a great fit that worked fine. The problem was that people figured this out, and since Linux is GPL started making demands for source code with valid legal standing. This did get us OpenWRT, but it also paved the way for VXWorks to sell their real-time OS into the market. I think issue being that VXworks is an RTOS not a general purpose operating system and therefore takes a lot of expert work to build a stable set of tasks and priorities. It’s not really necessary in a network environment where a little latency added from round-robin scheduling is just fine, and the possible 100% CPU utilization is desirable. Whatever the case, most VXworks routers hang one or more components after some time and need power cycling.

    1. I think you got that a bit backwards, Up before the WRT54 series, nearly all home routers were VXWorks or some other propitiatory solution. Router manufacturers switched to linux to stop having to pay licensing fees for for VXWorks and other solutions.

      The original linksys BEFSR41 was VXWorks based

      And there is nothing wrong with VXWorks, other than being poorly implemented on SOHO routers. VXWorks run on several NASA probes and rovers which obviously no one can reach out to them to power cycle them if VXWorks was a POS that crashed a lot.

      https://www.windriver.com/news/press/pr.html?ID=10901

    1. That doesn’t always clear issues that might be cleared by a full power cycle. Poorly designed routers can have circuitry that is susceptible to latch-up, or supply voltages that fail over time. A full power cycle can also reveal issues such as caps going bad. had a bunch of dlink routers that all had the same failure mode.

  7. Why not just, you know, invest in a router or setup that doesn’t need to be rebooted constantly to maintain normal operation? My EdgeRouter has been up for four months without a single burp, and it can be had for $80-ish USD or less. Why a fairly elaborate hack to do something that doesn’t address the actual issue?

  8. Fun! I once did something similar with an e-tech wireless router. It would even light up a led when it crashed, so I hooked up a PIC microcontroller with a solenoid. Whenever the red light comes on, it resets the device.
    Now I have an engenius AP, a Fritzbox for vdsl internet and pfsense firewall made from an old pc from 2004 I think, needed recapping and I recently upgraded to a pentium 4 cpu with x64 support so I could still get updates. I also had to 3D print a mini pci backplate for the second NIC. The Engenius is a semi to professional level device with power over ethernet, aimed at hotels and companies. It’s rock solid for 4 years now. It has a transmitter that can be boosted to 300mW iirc.

      1. Because these days, the kids can’t even flash an LED without using a micro controller.

        If you showed them how to flash an LED with a 555 timer or a multivibrator they would probably think it was some kind of hack

  9. I am one of those guys that has a shit load of luck.
    And most of it bad.
    I have gotten expensive and cheap and expensive again and again.
    Every 2 years at the most My modem goes. Just after the warranty expires.
    Like I said I have a lot of luck.
    I have a backup Modem on hand that I’ve tested. It is so much of a problem to have to keep doing this.
    I got test equipment running on my phone line for that has been running for years.
    It doesn’t matter how I go threw it is all the same equipment.
    I have back ups of every peace of equipment that is needed for your house, so that It is down the least amount of time.
    Example 1 1/2 years ago I got a new 16 port switch I spent $250 on it its dead and I am running off the backup now.

  10. If you are going through the effort of building this circuit, wouldn’t it be easier to put the relay on the 12V (or whatever comes out of the wall wart) going into the router. Still has the effect of a full power cycle, but no need to work with the higher voltages and you can also potentially use the existing power on the line to power the circuit directly. With a female / male barrel connector / jack you can easily make it a reversible mod.

  11. I made one of these years ago. A cheep remote controlled socket. Stripped out the rf bit and reused the relay with it’s ttl bit and the power supply in the socket.
    I connected it up to a pin on one of the parallel ports, upgraded to a usb to parallel port adaptor later on [ was using the other pins for other things. ]
    Added a little asm snippet to put the pin high when connected to the internet then low for a second or so if the internet for stuck.

  12. I have a Dlink router that started acting up some time ago. My solution was to demote it to being just an AP and using a Raspberry Pi as my edge router (getting it to route IPv4 was a breeze but configuring IPv6 things to come up reliably was pain and took a bit of trial and error.) As my Internet is only 3.5Mbps down/1Mbps up, using a USB Ethernet adapter for the WAN facing side isn’t a performance bottleneck for me. Ever since I demoted the Dlink to being just an AP, it’s been considerably more stable.

  13. I came here looking for the “could’a done it with a ‘555” posts….

    But seriously, why does router firmware _not_ already have a scheduled reset feature? Seems like a daily/weekly/monthly reset in the wee hours of the night would make many things smoother.

  14. Long ago I discovered Mikrotik.
    My router cost me sub $150, has multiple 2.4 and 5ghz wifi radios, gigabit speeds to match my gigabit isp. Has a hardware watchdog (basically what this HaD article is about). Has been up 200+ days and only rebooted when I upgraded the OS.
    The OS is based on linux, and can be installed on your own x86 hardware if you desire.
    Overall its the best product and every time I meet someone that says something about their issues with crap company like linksys and netgear and d-link (they have some good lines but most are crap) For less money you get a more feature rich product. I tired pfsense and other software packages long ago and still had issues with performance or reliability.

    I apologize about making my comment seem like an ad thats not my intent put simply the devices and software are far above what you get normally. Most people haven’t heard of them. It my understanding they are a predominantly european company that targets ISP’s in that market. However they make an incredibly reliable and inexpensive line of products that simply work as you expect.

    At work I had to convince my boss they could do a better job for less. This was an uphill battle, he is a certified cisco guy. The problem, Link 2 remote sites together (MPLS metro ethernet linked). We have several networks that are routed between facilities. That’s pretty standard fare. However I needed to be able to failover our disaster recovery needs to a remote facility. Also standard. The issue is that a number of our VM’s have licence and configuration based on MAC/IP/Site stuff that we need to keep exactly the same for it to work(long story). So I wanted to move my vms and keep the exact same network from the VM perspective(routers, DNS, IP everything). That necessitated a L2 bridged network, but I had to do this over an MPLS routed system with some other crap in the way and at speed. So my boss went to the vendor and got a quote: $70,000 in equipment and services to what amounts to a bridged VPN.

    I proposed we at least try Mikrotik routers. Do to the almost throwaway price of $5k total for the project compared to $70k he felt it was worth a shot. It took some convincing that it was a superior tool for this particular class of needs. And it has worked great. Plenty of ports, fiber sfp’s, 10gig, dual power supplies, etc. typical business class stuff and we put the savings to better use on other infrastructure needs.

    The fact is most home products don’t have the same feature set as enterprise offerings. In this case Mikrotik doesn’t make any distinction, the features of the “home” and “cloud” (enterprise) routers are entirely defined by the hardware bits, not software. They support all of the bits on the cheapest to the most expensive platforms or even if you custom build your own router.

    L7 filters,QOS, VPN server and client in 5+ flavors, WiFi with Mesh, even TDMA full duplex over wifi is an option. Heck they even support “virtual” routers where you can allow your roommate their own router that is just a VM so they don’t mess up your primary setup etc. Along with enterprise features such as MPLS, BGP, OSPF, an entire script engine, several tunnel types, ipsec etc…

    Like I said, sorry to sound like an advertisement.

  15. I found a WiFi sensing outlet with a receptacle for the modem and one for the router. It pings certain sites and if no response numerous times it reboots both devices, with a configurable time lag in between to let the modem power up first. It’s remotely accessible and will even email me when it has to reboot. Worth it more managing remote locations.
    https://smile.amazon.com/gp/product/B00LLVQ9OI/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

    1. I work for 3Gstore, and you beat me to the comment :) You’d be surprised how many of these we sell to companies for use in PoS terminals, digital signs, etc, basically anywhere that would cost you a truck roll to do a simple reboot. Inside its effectively the same concept. A small internet connected device pinging local or remote IPs and listening for replies, and a couple of relays to power on/off the modem. Even so, hard to beat a good quality router. I always call this type of thing a bandaid vs a solution.

      1. I bought my 3G when I had an older router that was prone to frequent lockups in a remote location. I replaced the router almost a year ago with a much better router. I think the only times the 3G has rebooted the new router has been when the internet itself has gone out. And once when I was upgrading the router firmware – that power cycle at the wrong time bricked the router until I could re-install the original firmware. Thanks, Murphy.

  16. If your router runs on OpenWRT, DDWRT, ASUS/WRT etc you can write an expect script in Python or Bash to telnet on router with given username and password and rest it, You can also change settings by tweeking “nvram” variables.

    1. What it the router is frozen too deep to accept the telnet session, or doesn’t respond to the shutdown command? What it it doesn’t even have an accessible shell? But anyway, many failure modes won’t be solved by a soft reboot because it’s an IC that’s acting up and only power cycling knocks sense into it.

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

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