ESP8266, To Sleep or Not to sleep that is a question

Don Warr
Posts: 11
Joined: Fri Oct 19, 2018 10:01 am

ESP8266, To Sleep or Not to sleep that is a question

Postby Don Warr » Sat Mar 09, 2024 6:54 am

I'm using a esp8266 in a project,, I Need to conserve power, ,, I have the chip send one piece of data to a client then turn on a certain led according to a result.. Then I want the chip to "basically" shut down UNTILL a power reset but keep display led on... This project all works fine using Light Sleep Mode... Now, I am only using 3 lines of code to accomplish the sleep (indefinitely)..
//wifi_station_disconnect(); not using
//wifi_set_opmode(NULL_MODE); not using
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T); //1
wifi_fpm_open(); //2
wifi_fpm_do_sleep(0xFFFFFFF); //3
This Works the way I want and goes to sleep, BUT AM I looking for trouble down the road.. I mean, by using some kind of do sleep timing line of code (line3)..????

Any Response Will be appreciated Thanks...

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: ESP8266, To Sleep or Not to sleep that is a question

Postby liaifat85 » Sat Mar 09, 2024 9:28 am

Using the wifi_fpm_do_sleep() function with a sleep duration of 0xFFFFFFF will effectively put the ESP8266 into deep sleep mode indefinitely until it receives a reset signal. You can use the timer wake-up from deep sleep: https://randomnerdtutorials.com/esp32-t ... eep-sleep/

Don Warr
Posts: 11
Joined: Fri Oct 19, 2018 10:01 am

Re: ESP8266, To Sleep or Not to sleep that is a question

Postby Don Warr » Sun Mar 10, 2024 7:02 am

Well thank you liaifat85,,, Thats the answer I was hopping for... I just want to show and keep led on, but stop major current flow... I just needed a second opinion....

rin67630
Posts: 138
Joined: Sun Mar 11, 2018 5:13 pm

Re: ESP8266, To Sleep or Not to sleep that is a question

Postby rin67630 » Wed May 01, 2024 5:26 am

Don Warr wrote:
Sun Mar 10, 2024 7:02 am
I just want to show and keep led on, but stop major current flow...
Normally, you chose deep sleep to save power, not to waste it, lighting a LED.

Who is online

Users browsing this forum: No registered users and 75 guests