Routers/Modems

An ESP8266 with a relay is a perfect device for managing your router or internet modems.

As you are probably aware, wemos and most other IoT devices require internet access to function, and almost all required wifi. So if your router/wifi is down there is no way to reach your IoT device.

The wemo has a further problem in that it always powers up "off", meaning it must be accessed in some way to power on the device that's attached to it.

These features make IoT devices unsuitable for managing routers and modems by using them to provide power. In the event of a wifi loss there is no way to toggle the IoT device. In pure IoT devices loss of the internet will prevent any such action. WeMos are unsuitable in the case of a power outage as they will not restore power to your router or modem.

A further complication is that after a period of time many routers or modems being to operate inconsistently or fail completely (especially if they are used to run wemos). This is typically an out of resource condition and the resolution is to restart the network device. This can be done on a schedule and an appropriate time to prevent problems from developing, but if you use an IoT device and something does happen before the restart you may not be able to recover. A simple mechanical timer is usually a better choice in this case. Some modems have scheduled reboots or other fail safe which work well if the modem remains operational.

An interesting option is using an ESP8266 with a relay (the Sonoff is a good choice) powering the router, running the MppRelay code and managed by AutomationManager / AM Server. Use the MppServer properties to set the device to power up in the "ON" state, and the IpCheck properties to have it periodically confirm internet (or local access, e.g. wifi connectivity to your router). If connectivity is unavailable it can reboot your router/modem, or you can request a restart remotely.

Use the AM Server to install the firmware and setup the properties for the periodic checks. You'll gain remote access to this MppRelay to reboot manually when necessary, to set up a scheduled reboot, or to add additional external internet checks.

For only a few dollars you can add tremendously raise reliability and recovery to your Home Automation system that will function even when your wifi is down.