Hello, I am using AT24HC02C https://store.ncd.io/product/at24hc02c-256-byte-eeprom-i2c-mini-module/ to extend EEPROM with ESP8266 but need some suggestions about how can I store the my wifi credential and average of values of my temperature sensor in EEPROM for life time ? Any leads on this will much helpful
Look for an ESP8266 module that brings the I2C interface to external pins and connect them directly to the external EEPROM. The ESP8266-01 module (the 8 pin one) is not suitable due to lack of IO pins.
Note that the ATHC02C only has 256 addresses so you won't be able to store much in it.
Also, I am looking for some example which will help me to store the sensor values in EEPROM and test the data mentioned in EEPROM whenevr I reset ESP8266?
From what you specified above, it will not be stored a bulk data, but just settings at large time intervals. It will not be necessary to use an external EEPROM memory, as the ESP8266 modules has plenty of r/w FLASH available. Note that these modules has a limited I/O available, and this way you would not waste 2 pins for that.
Hello, I am using AT24HC02C https://store.ncd.io/product/at24hc02c-256-byte-eeprom-i2c-mini-module/ to extend EEPROM with ESP8266 but need some suggestions about how can I store the my wifi credential and average of values of my temperature sensor in EEPROM for life time ? Any leads on this will much helpful
you can store any datatype to the eeprom
char - 1byte, int type -2bytes
so, its better to store the char datatype. in case you want to store the wifi credentials to eeprom like ssid and password, you need to specify the address where you want to store the char. begin your eeprom and specify the size. First specify the size of char array where you want to store your ssid and password. use the eeprom.write(addr,data);
You can do it like this
eeprom.begin(length of address);//to write to eepromchar ssid[30];//store ssid here
charpass[30];//store pass herefor(n=0;n<ssid.length()+1;n++){
eeprom.write(n,ssid[n]);}for(int n=31; n<pass.length()+1;++n){
eeprom.write(n,pass[n]);}//to read from the eepromchar datassid[];char datapass[];for(int r=0; r<30 r++){
datassid += eeprom.read(r-1);}//similarly for datapass