Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By btidey
#88870 It is true it doesn't keep state, but for many applications that is not required. So a sensor that has to report an event or measurement does so without any need for previous state after being triggered.

Where some form of state is needed then that can normally be obtained by storing in EEPROM, filing system or on a remote server while shutting down and then retrieved when re-activated.
User avatar
By eriksl
#88872 Save state in RTC RAM, IIRC that is retained on CE down. Don't use EEPROM (FLASH actually), it will wear out.
User avatar
By schufti
#88881 if you have an external "wake up" signal, it is better to use deepsleep w/o timeout, retaining rtc memory for keeping info about state etc.
User avatar
By btidey
#88886 The RTC is off and registers cleared when EN is low so that is not an option for state if EN is used.

Using deep sleep only is OK when timed operation is used but can make hardware a bit messy if external wake up is needed.

I agree that EEPROM should only be used very carefully to avoid excessive wear. Filing system with wear leveling is much less problematic. I use remote web server in those instances where I need state and web server is part of the overall application.