[RTC memory] Rethink what needs to be stored in RTC to survive reboot and sleep #1597
Labels
Category: Settings
Related to settings/configuration
Category: Stabiliy
Things that work, but not as long as desired
Type: Enhancement
Improve something already present
Currently the functions
saveUserVarToRTC()
andreadFromRTC()
handle storing last known variables of the plugins to RTCsaveToRTC()
andreadFromRTC()
handle the storage of theRTCStruct
:This struct has no proper constructor, so it could contain any information at boot.
Also, since the RTC storage is very sparse, the layout of this data should be done different.
Start with the biggest items (unsigned long) and add smaller ones.
Current implementation is a waste of space.
Also not all active tasks/plugins must have their values stored.
Often the previous value is only useful when using a formula and not all plugins have 4 values.
Also consider storing last WiFi connection information, like BSSID and channel. That information could help improving WiFi connection speed.
Maybe also store last used IP config? (DHCP may take a few seconds to complete)
Other data could contain information on last changed setting, or whether to boot in safe mode at some crash. (first set next boot mode to safe mode when loading settings and after successful load, set it to normal mode)
See NodeMCU - RTC User Memory Module for some information about size.
The text was updated successfully, but these errors were encountered: