The use of the ESP8266 in the world of IoT

User avatar
By jmseight
#69120 Hi,

I would like to put my ESP-12E module into either modem sleep mode or light sleep mode while running as a web server. The ESP-12E is connected to an WiFi AP, and is set up as an ESP8266WebServer. Do I put the statement
wifi_set_sleep_type(MODEM_SLEEP_T);
at the end of setup()? What do I have to put into loop() to make sure it goes to sleep. I tried delay(10000) but it hangs in light_sleep, and does not reduce power consumption in modem_sleep. Also, when I click on a button on my web page served from the ESP-12E, it does not respond immeidately but waits until the 10sec is over, so it seems that the web server is not asynchronously handled.

Thanks,
James