Reset Your Router The Modern Way

Many Hackaday readers will be settling back into their lives after a holiday period crammed into some family matriarch’s house along with too many assorted relatives, having given up their speedy internet connection for whatever passes for broadband wherever Granny lives. The bargain-basement router supplied by the telephone company will have spent the period wilting under the pressure of a hoard of teenagers watching other teenagers inanities on YouTube, and the Christmas ritual of Resetting The Router will have been performed multiple times.

A very simple schematic for the resetter.
A very simple schematic for the resetter.

Wouldn’t it be nice if your router simply reset itself every time it crashed or the Internet connection went down? [Cyb3rn0id] has a solution (Italian original here), in the form of an ESP8266 that pings an online service every few seconds, and turns the router off and on again via a power relay in the event that the ping attempt is repeatedly unsuccessful. It’s brilliantly simple, requiring only a single GPIO and a MOSFET to fire the relay with an LED indicator for good measure, and it’s built upon a piece of prototyping board. The router power is switched on the low-voltage side for safety.

The software is pretty basic and has the WiFi credentials hard-coded into it, so we’re guessing a version with a web interface could be built. But as a personal device for easing the pain of router crashes it gets our vote despite that shortcoming.

This isn’t the first router resetter we have seen here, but a previous model still required human intervention.

34 thoughts on “Reset Your Router The Modern Way

    1. I suspect that many router issues originate from the exchange, maybe a telecom expert could enlighten,
      “teenagers watching other teenagers inanities on YouTube” don’t forget all the cat stuff.

    1. Consider your self lucky,

      I had a linksys wag200 provided my isp that required a reboot daily.
      The problem wasn’t the reboot effort, but rather the random time it would occur and inconvenience.

      1. Ah, I didn’t think about ISP-provided routers.

        I’m definitely lucky, we have the option to just use a simple cable modem. I have an Ubiquiti EdgeRouter and I don’t think I’ve ever had to reboot it apart from applying firmware updates and power outages.

    2. why not just press the button on the back like a normal human being?
      also srry m8, accidentally hit report on your comment, so mods for this site please just ignore it, I fucked up.

  1. I built a Pi -based device to do the same thing; I wrote code to ping three different IP’s, looking for a fail across each. While testing the system (by pulling the broadband connection from the modem), I was perplexed as to why the system continued to loop the test without throwing a fault. It turns out that my AT&T Gigabit modem was merrily spoofing a ping from google.com!!

    1. You could modify the sketch to have an array of host names (both raw IP addresses and URLs requiring DNS lookup), and only conclude that internet connectivity is lost if the majority of connection attempts fail multiple times in a row.

  2. I’m not going to name devices but I’ve seen this in lots of consumer devices where the limited resources get overrun with new devices (MAC tables usually). Also firmware bugs that get triggered by specific events. These kind of devices keep the Family IT support from having to travel. :-)

  3. I had a e-tech router a long time ago that would helpfully light up a red led with the label ‘error’ whenever it crashed. I hooked up a small mcu (pic10f200) that would turn it off for a few seconds and back on, triggered by the voltage over the led. Could’ve used a 555 and a transistor but I thought an mcu was more fun :)

    I like to use draytek, fritzbox, engenius or ubiquity. These seem to be more stable with the latest firmwares. Never had to reset them so far. I’ve had trouble with e-tech, linksys, netgear, trust and TP-link, though I use TP link ethernet hubs without problems.

      1. Hubs still get some use for network monitoring when you wanna do some packet sniffing. You can do this with more advanced switches, but it’s otherwise kind of a pain in the ass on consumer hardware. Otherwise there is pretty much no reason to prefer a hub over a switch.

  4. You can do this via a script on the router itself or via a client that SSH into the router when it’s time to reset. A lot of routers have this ability built into them, but honestly, it is rare these days that a router needs to be reset to fix the connection.

    1. Assuming the device has not crashed and is only experiencing a partial failure. Putting the device outside the failure domain avoids that. Technically, you could have the devices check on each other for an even more robust solution. The router makes sure the pi is active, and reboots it if it isn’t. The pi checks the network, and reboots the router if it loses network. This is why watchdog controllers are typically a standalone unit.

  5. You know, if you go the esp route, you could simply use one of the ecoplugs to do the job. Better yet, use a power strip connected to an ecoplug and you can restart multiple devices at one. Much more likely to get wife approval and being more pet/ child resistant as well.

  6. I’d like a device that applies shocks to my tech support every time I call them to tell them their internet is out and they have me reboot the modem even after I told them I tried it already.

  7. “in the form of an ESP8266 that pings an online service every few seconds”

    Is there a practical limit to how often embedded devices ping a particular address? Multiplied by every other instance/device doing the same. Every few seconds seems excessive? Can it amount to a DoS attack if quantities get exponential?

    Same for NTP…. some devices sync every few minutes by default…but once every day (or upon reboot) seems sufficient… but perhaps not all doing so at exactly midnight. Should we all be more cognizant of these parameters in our devices?

    1. I’ve had issues with the phonelines going down for days on end living in a very rural area. Its not the main reason but its one of the reasons why my adsl router only has one thing plugged into it, an 8 port gigabit switch and a separate wifi AP. Sure its a lot of plugs, but when it powercycles the home network is intact. I can also keep going with the crappy one provided by the ISP instead of shelling out for an ADSL router with GB ethernet and really good quality dual band wifi.

    2. Add a variable that is stored in EEPROM and a soft or hard button that resets the process. Code it to max out after X tries within X time. Optional retry every X hours without reset.

  8. If your router needs to be rebooted frequently because it got stuck it would probably be a good idea to get better router.
    However, as general watchdog for lower quality routers this is cool project.

Leave a Reply

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