- Thu Mar 24, 2022 6:00 pm
#94070
Thank you both.
This is what I am doing:
I use ESP-01s because of their small size, and they are "imbedded" in such a way that they cannot be accessed easily.
I first tried to use the OTA facility, but with, say, 80% of success (i.e. it works most of the time, but not always).
Anyway the program is now completed, but it is necessary to be able change at least one parameter (one byte) remotely.
This is done via an UDP packet sent from the PC with packet sender. Its faster and safer than re-compiling and sending a new program by OTA. And I dont fear to wear the memory because it will only happen from time to time.
=> Everything runs perfectly on a NodeMCU/ESP12, but not on my ESP-01 (512Mo).
This is what happens:
I can write the parameter value in the "EEPROM". I can also re-read the value from the "EEPROM".
But after a reset or power-off/power-on, it reads as 0.
(On the NodeMCU, a parameter not set is read as FF).
I have tried to suppress the OTA function (just in case) but the problem remains.
I wrote this:
...
#define EEPROM_SIZE 12 // as in the tuto, but also 1, 4096, and other values
byte Parameter;
...
EEPROM.begin(EEPROM_SIZE);
Parameter = EEPROM.read(0);
...
// to write in the EEPROM
EEPROM.write(EEPROMaddress, Parameter);
//EEPROM.put(EEPROMaddress, Parameter); // also tried. Same result.
EEPROM.commit();
...
// to read the EEPROM
Parameter = EEPROM.read(0);
...
Once compiled the program occupies 318257 bytes (33%) and the variables 29732 bytes (36%).
May be should I use an ESP-01 with 1Mb memory, but I wonder why.
I can send you the whole program if you wish but I dont want to bother you.
If I could have this function working, it would be a great help for my other projects.
This one, for example:
http://amfn.nice.free.fr/microcontroleurs/EggerBahn1010.htmThank you. Best regards!