Using the virtual (! the ESP8266 has no real EEPROM but uses a piece of FLASH memory instead) EEPROM on the ESP8266 is a bit different from how the Arduino does it:
- at the beginning of your sketch you need to invoke begin(...) on the EEPROM:
The 4096 value can be 1 upto and including 4096.
- after writing values using EEPROM.write(...) you need to do a:
to make sure it gets really written to EEPROM/FLASH. No need to do the "delay(5); /* and read back written data */"-trick that seems to be required on real Arduino boards.