Storing data in the ESP8266 filesystem
In this recipe, we will be looking at how to store data in the ESP8266 filesystem. To do that, we will store data measured by a sensor in the flash filesystem. This will get you started on using SPIFFS to store files on your ESP8266, and give you an idea of how you can use the filesystem in your projects.
Getting ready
Make sure you have the following components before proceeding:
- ESP8266 board
- USB cable
- DHT11 temperature/humidity sensor (https://www.sparkfun.com/products/10167)
- 10 kΩ resistor (https://www.sparkfun.com/products/8374)
- Breadboard
- Jumper wires
Start by mounting the ESP8266 board and the DHT11 sensor onto the breadboard. Connect a 10 kΩ pull up resistor to the DHT11 data pin and connect the VCC pin and GND pin to the 3V pin and GND pin of the ESP8266 board, respectively. Finally, connect the data pin of the DHT11 to GPIO 2 of the ESP8266 board. Use jumper wires to do the connections. The complete setup will look as shown in the following...