Auto modem reset when internet down

The physical build & isolation is not the best as it was a last minute job before I went on holiday, and had the intention to rebuild it when I got back home - but as per usual I never got around to it... :wink:

The Wemos D1 Mini has the following connections;

  1. A removable link between pins RST & D0. It must be removed when uploading a sketch, but replaced afterwards to ensure that the Wemos can wake up from deep sleep.
  2. Pins 5V & Ground connected to the relay module +Vcc & Grd.
  3. Pin D7 connected to relay module trigger.
  4. The Wemos sketch is configured for the above, and only needs the wifi ssid & password adding, before uploading.

The relay module is a typical Ebay/AliExpress opto-isolated 5V single channel module with 3 low voltage connections (as above), and note that on the module shown, 0V on the module trigger energises the relay whilst +3V de-energises!
The high voltage side has 3 connections; normally closed, common & normally open. I've used normally closed & common, so in it's normal state the relay is de-energised but the contacts are closed.

Please Note - Working with high voltages can be dangerous, and shouldn't be attempted unless you are fully aware of the associated risks.

1 Like

Why do you put the Wemos to sleep? Can it not just stay running? Just curious

Energy saving is the main reason. When it's sleeping, the power consumption is negligible.

Are you running it from a battery?
I measure my D1 at about 0.070ma which is negligible? Seems like unless you are on battery power I can't see why you would want the added complication of Deep Sleep?

User choice.
If you don't want to put it to sleep, then just use timers to trigger the actions.
No I'm not using batteries.

1 Like

Hello,
could I ask you the schema of the project with the pin connection to the esp8266?
please let know
thanks
Ivano

It is a Wemos D1 mini that I used, and I listed the pin connections above.
I didn't feel it necessary to draw a schematic, but the Wemos pinout's are well documented online.

Thanks Paul, do you think the code will work on a esp8266MOD ?

I've never used a esp8266MOD so can't really say.

You might be interested in just doing this with a Tasmotta'd switch

Watchdog for Wi-Fi router

So you can purchase any approved Socket device that has and ESP chip and flash it with Tasmota, then implement the rules - they even have exponential backoffs between reboots !

Craig

1 Like