I'm running an IDE sketch on 4 ESP8266 clients sending temperature data to an ESP8266 station. WDT is enabled on each to allow a reset if RF data is not received after a certain elapsed time & this works well, resetting clients & ultimately the station if neccessary, to re-establish RF comms between the devices.
I log data on the station during the coarse of the day using 3 - 100 int arrays but if I reset the ESP8266 station (say for an code upload) or WDT resets the station then these arrays are reset.
Is there a way to store these arrays in PROGMEM so they are not reset when the ESP8266 station resets. These arrays are for read only purposes.
At the end of each day I need to reset these 3 arrays for the following day's use.
I'm not a programmer so please keep any advice simple
dominator99:
I log data on the station during the coarse of the day using 3 - 100 int arrays but if I reset the ESP8266 station (say for an code upload) or WDT resets the station then these arrays are reset.
These arrays are for read only purposes.
At the end of each day I need to reset these 3 arrays for the following day's use.
I'm not a programmer so please keep any advice simple
The highlighted statements are mutually exclusive. If you're logging data it's not read only. PROGMEM is used for data which will never change and cannot be changed by the running program.
dougp:
The highlighted statements are mutually exclusive. If you're logging data it's not read only. PROGMEM is used for data which will never change and cannot be changed by the running program.
I log values sequentially in each 'cell' of the arrays only once. Having logged them in the sketch can I then save them in PROGMEM from where they can be read?
dominator99:
I log values sequentially in each 'cell' of the arrays only once. Having logged them in the sketch can I then save them in PROGMEM from where they can be read?
Yes, but only if they're placed into the array and *downloaded * as part of your sketch. PROGMEM reference
I've come across EEPROM.write, EEPROM.update, EEPROM.clear etc which look like a more suitable way to achieve what I want but being mindful that the EEPROM can only reliably be written to 100,000 times.
So if I fill my 2-100 cell arrays every day writing sequentially to a 4kB EEPROM that means I'll fill the EEPROM in approx 20 days. so I'll reach the EEPROM limit in approx 5,500 years if my maths is correct!