-
Notifications
You must be signed in to change notification settings - Fork 14
Wall ink Memory
There are four types of memory on the ESP8266, and the wall-ink device project uses all of them.
The esp8266 has several MB of flash. This is where the Arduino sketch is stored. Is is overwritten by using the serial port and overwriting the sketch.
There is nearly 80kB of RAM on an esp8266, but there is only about 40-50 kB available for a sketch to use. A simple reset of the chip will cause all contents of the RAM to be cleared. In this project, that means every time the sketch is run all contents of the RAM start empty. You cannot use any variables from one boot to another. This is what Flash, EEPROM and RTC memory are for.
The EEPROM is actually a small portion of the Flash memory that the esp8266 makes available during execution of the sketch to read and write from. It can be written to and cleared from within the sketch, or firmware code. This is where all of the settings in Admin mode are stored, such as WiFi passwords, the URL of the wall-ink-server to attach to, the image key, etc. The EEPROM should be used sparingly since this type of memory does wear out after many uses. This is not a place to store data that will change several times a day or it will burn out the memory.
Reference the EEPROM discussion on the firmware page to see exactly which variables are stored in EEPROM.
All of the Admin mode settings are stored in the EEPROM memory. This memory persists across flashes. To reset the EEPROM memory, you can run the ESP8266 eeprom_clear
sketch. This sketch can be found in the Arduino IDE under file -> Examples -> Examples for Generic ESP8266 Module -> EEPROM -> eeprom_clear
. After flashing this sketch and running it once, flash the ESP8266 with the wall-ink firmware.
The Real Time Clock has 512 bytes of memory. This is very small, but incredibly useful. This memory keeps it state over reboots, and does not wear out like flash or EEPROM memory. This is where the wall-ink device stores settings such as the drift "fudge factor", the hash of the last image, (wink header chunk 4), and what access point that was used last. The RTC memory is updated with all of the latest information each time the screen checks in with the server.
Reference the RTC memory discussion on the firmware page to see exactly which variables are stored in RTC memory.