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.
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”
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.
It’s not so difficult.
What routers do people have that crash often enough that you need to auto-reset them? I’m not being flippant, it’s just not a problem I’ve ever had and I’m curious.
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.
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.
Anything provided by ComCast.
Netgear, they use their customers as free beta testers.
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.
This. Oh, this. Wait a minute… the description of everything in the description so closely matches my experience at the in-laws that I’m wondering if you’re one of the cousins, Jenny?
I wonder how long it took him to understand why the LED wasn’t turning on.
You’re wrong, the LED light-up as the relay release, because there’s no reverse diode on the relay coil… ;-)
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!!
Good old DNS “assist”
Good idea, unless the server you’re pinging is online ????
Sorry: as long
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.
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. :-)
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.
I didn’t think people still used hubs. Or that they even made them with switch prices so low.
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.
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.
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.
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.
I don’t see this as news, I implemented an router auto reset like this nearly 2 years ago. All that had to be done is look
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.
“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?
I want a setup that will stop giving out conflicting IP addresses to clients.
So what happens when the phone line goes down for a few days and the modem / router keeps getting power cycled every few minutes?
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.
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.
Sometimes, only 1 device in our house can’t get online. So this detection wouldn’t work. I’m not a network guy. Any ideas?
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.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)