khoih-prog / ESP_DoubleResetDetector

ESP_DoubleResetDetector is a library for the ESP32/ESP8266 Arduino platform to enable trigger configure mode by resetting twice.
MIT License
49 stars 18 forks source link

RTC address with OTA #5

Closed W4KRL closed 4 years ago

W4KRL commented 4 years ago

It may be worth noting in the Readme that the first 127 bytes (32 blocks) of RTC memory on the ESP8266 are overwritten by OTA. https://arduino-esp8266.readthedocs.io/en/latest/libraries.html?highlight=rtc#esp-specific-apis

khoih-prog commented 4 years ago

@W4KRL

Thanks for the info. Will put on README in next release.

The DRD RTC memory usage is still in the lib, but just for cosmetic reason, and is not advisable to use. It's better to use the EEPROM, SPIFFS and latest LittleFS for that DRD purpose.

W4KRL commented 4 years ago

Khoi Hoang,

Thank you for your quick response. I am curious as to why you prefer EEPROM or SPIFFS over RTC memory.

I have a project that uses RTC memory to store the WiFi channel and BSSID in order to speed up the connection after deep sleep. See https://www.bakke.online/index.php/2017/06/24/esp8266-wifi-power-reduction-avoiding-network-scan/ Since this is called every wake cycle, I will continue to use RTC memory for this data. But using SPIFFS for the DRD looks like a good idea.

I tried using TZAPU's WiFiManager with variable results. Not using the channel and BSSID adds about 3 seconds to the connection time. Your ESP_WiFiManager looks like it will be very easy to incorporate Bakke's connection speed-up technique. Thank you for making this library available.

If interested, you can take a look at my project at https://w4krl.com/iot-kits/ with live data at https://thingspeak.com/channels/286120 Note the processor time in Field 3.

73 Karl W4KRL

On Sun, May 24, 2020 at 10:21 PM Khoi Hoang notifications@github.com wrote:

@W4KRL https://github.com/W4KRL

Thanks for the info. Will put on README in next release.

The DRD RTC memory usage is still in the lib, but just for cosmetic reason, and is not advisable to use. It's better to use the EEPROM, SPIFFS and latest LittleFS for that DRD purpose.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/khoih-prog/ESP_DoubleResetDetector/issues/5#issuecomment-633344230, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHJF5M5TVY4HTIS46MNU2TRTHI3BANCNFSM4NJBWDHA .

khoih-prog commented 4 years ago

I have a project that uses RTC memory to store the WiFi channel and BSSID in order to speed up the connection after deep sleep

That's a niche ESP8266 DeepSleep application and the use of RTC is advisable as RTC can be accessed in DeepSleep to use for your WiFi purpose. But the catch is the software is working only for ESP8266, and not portable to ESP32, etc.

EEPROM is just OK, not the best choice to use for other applications because of reducing the short EEPROM life.

Using SPIFFS / LittleFS for DRD or ESP_WiFiManager is much better as it can be portable, has no location conflict, much larger storage, wear-leveling included features.