ESP32: How to create a config file with SPIFFS or LittleFS

MoThunderz
MoThunderz
12.3 هزار بار بازدید - پارسال - When you power cycle or
When you power cycle or switch of the ESP32 all variables are lost. So how do you save your settings? In this video I show how to create a config file so you can store any number of variables. There are two versions of the code on Github, namely one using the SPIFFS library and one using the LittleFS library. If you are using the ESP32 board library v2.0.4 or newer, please use LittleFS, otherwise use SPIFFS. The video explains the SPIFFS version, but the LittleFS code works just the same.

Github:
https://github.com/mo-thunderz/Esp32C...

Chapters:
0:00 Introduction
0:28 How to store multiple variables in a string with JSON
1:02 Download from Github - NOTE: link has been updated in Video Description
1:34 Explanation of code: libraries and general stuff
2:50 Explanation of code: setup
4:52 Explanation of code: saving variables to config file
7:02 Explanation of code: saving variables from config file
9:41 Explanation of code: main loop
11:11 Testing code

Corrections:
01:08 I have renamed the Github Repository to "Esp32ConfigFile" as both SPIFFS and LittleFS versions are available now. The .ino file is renamed as well.
01:23 If you are using the ESP32 board library v2.0.4 or newer, please use Esp32ConfigFileLittleFS, otherwise use Esp32ConfigFileSPIFFS. The video explains the SPIFFS version, but the LittleFS code works just the same.
پارسال در تاریخ 1402/02/23 منتشر شده است.
12,380 بـار بازدید شده
... بیشتر