Where ESP Easy stores its config data?
Moderators: grovkillen, Stuntteam, TD-er
Where ESP Easy stores its config data?
Hi all,
Do you know where ESP saves its config data like wifi credentials
Does it use eeprom, spiffs?
Thanks for your comments
Do you know where ESP saves its config data like wifi credentials
Does it use eeprom, spiffs?
Thanks for your comments
Re: Where ESP Easy stores its config data?
ESPEasy uses a local file system, mostly using SPIFFS, or LittleFS when that is part of the .bin filename (often for file systems > 1 MB). There the configuration is stored in some binary stored .dat files.
/Ton (PayPal.me)
Re: Where ESP Easy stores its config data?
The 'secrets', like credentials are stored in security.dat
The settings in config.dat
The settings in config.dat
Re: Where ESP Easy stores its config data?
So, as you're talking about file names, it means it's SPIFFS
My question wasn't about the files themselves but what kind of storage is used because I'm about to write my own code and I was wondering about the best practice.
So I wanted to know what is the ESP Easy dev team choice
Thanks for all
My question wasn't about the files themselves but what kind of storage is used because I'm about to write my own code and I was wondering about the best practice.
So I wanted to know what is the ESP Easy dev team choice
Thanks for all
Re: Where ESP Easy stores its config data?
SPIFFS has been deprecated for quite some time for Arduino development, in favor of LittleFS (also included in the Arduino libraries).
As usual: It depends.
If you intend to store only a few configuration items, and don't need to store other types of information, then using direct flash storage or eeprom would be just fine, but if other files, or logging, is going to be needed, then a file system is more than nice-to-have.
Depending on the intended hardware, and user-audience, you can also use an SD-card for storage, that's also quite easy to support in plain Arduino code (and also supported in ESPEasy, but as secondary storage).
An ESP Flash-based file system requires the flash to be partitioned correctly. Information about how to do that is plenty available from google searches (too many solutions to list here )
/Ton (PayPal.me)
Re: Where ESP Easy stores its config data?
SPIFFS is more light-weight, but as Ton mentioned, is deprecated.
LittleFS is much faster when dealing with "large" file systems (> 1 MB), however it is quite a bit slower when you need to change something in a file.
Depending on where the change is in the file and filesize, it can be several factors slower. Even > 10x slower.
Opening files is also slower on LittleFS, so you may want to keep a file handle to speed up access.
Just make sure this (read)handle is closed when trying to write to the same file.
LittleFS is said to be more robust compared to SPIFFS, but for write-once-read-many situations this doesn't really matter.
TL;DR
If you need small binaries, small file system and dare to risk changing it later when SPIFFS might eventually be removed from the Arduino code base, then I think SPIFFS is still the better choice.
LittleFS is much faster when dealing with "large" file systems (> 1 MB), however it is quite a bit slower when you need to change something in a file.
Depending on where the change is in the file and filesize, it can be several factors slower. Even > 10x slower.
Opening files is also slower on LittleFS, so you may want to keep a file handle to speed up access.
Just make sure this (read)handle is closed when trying to write to the same file.
LittleFS is said to be more robust compared to SPIFFS, but for write-once-read-many situations this doesn't really matter.
TL;DR
If you need small binaries, small file system and dare to risk changing it later when SPIFFS might eventually be removed from the Arduino code base, then I think SPIFFS is still the better choice.
Re: Where ESP Easy stores its config data?
I'm working on wemos D1 mini
I just need to connect a siren in order to fire it via jeedom and mqtt
So I'll run a small web server to be able to change wifi settings
My storage needs are wifi setting and one or 2 html pages
I just need to connect a siren in order to fire it via jeedom and mqtt
So I'll run a small web server to be able to change wifi settings
My storage needs are wifi setting and one or 2 html pages
Re: Where ESP Easy stores its config data?
Or install ESPEasy on the unit, and let it handle the MQTT messages for you
/Ton (PayPal.me)
Re: Where ESP Easy stores its config data?
ESP Easy is already installed
But it's like an educative project I'll make with my son. He's learning to code and I'm developer so....
And as additional, I wanted to manage different alarm types directly into wemos and to be able to fire specific type with mqtt message
But it's like an educative project I'll make with my son. He's learning to code and I'm developer so....
And as additional, I wanted to manage different alarm types directly into wemos and to be able to fire specific type with mqtt message
Re: Where ESP Easy stores its config data?
That's also possible with ESPEasy
You can do string formatting in the rules, which is already close to programming.
You can do string formatting in the rules, which is already close to programming.
Re: Where ESP Easy stores its config data?
Do you really think I can do the following (this is only an example) :
Message À => 1sec bip
Message B => 1sec bip 1sec off 1sec bip
Message C => continuous bip for 30sec
And so.....
Message À => 1sec bip
Message B => 1sec bip 1sec off 1sec bip
Message C => continuous bip for 30sec
And so.....
Re: Where ESP Easy stores its config data?
Sure, just use a Normal build (or any build when using an ESP32) and configure the MQTT Import plugin as a device (name: MQTTImport), using the Mapping feature you can translate a character to a number, and generate an event for that, that can be handled in Rules (must be enabled in Tools/Advanced page):
The matching Values entry for the receiving topic is named 'Siren', and 'Single event with all values:' is unchecked/off
Assuming A -> 1, B ->2, C -> 3 is mapped: Having this in Rules:
NB: I'm using the longpulse_ms command as that uses the scheduler to turn the GPIO pin on/off
You will need an MQTT Controller configured and Enabled, best to use is the (very generic) Home Assistant (openHAB) MQTT controller.
The matching Values entry for the receiving topic is named 'Siren', and 'Single event with all values:' is unchecked/off
Assuming A -> 1, B ->2, C -> 3 is mapped: Having this in Rules:
Code: Select all
// Siren on GPIO 4
// 1 = Siren on, 0 = Siren off
On MQTTImport#Siren Do
if %eventvalue1%=1
longpulse_ms,4,1,1000 // 1sec on
endif
if %eventvalue1%=2
longpulse_ms,4,1,1000,1000,2 // 1sec on, 1sec off, 2x
endif
if %eventvalue1%=3
longpulse_ms,4,1,30000 // 30sec on
endif
Endon
You will need an MQTT Controller configured and Enabled, best to use is the (very generic) Home Assistant (openHAB) MQTT controller.
/Ton (PayPal.me)
Re: Where ESP Easy stores its config data?
Thank you a lot for all those informations
Who is online
Users browsing this forum: No registered users and 38 guests