One of the requirements for a project I am working on is to be able to work with configuration file - the user should be able to upload a JSON or YAML file to the ESP32, which would then parse it and configure its application with details such as:
- IP address
- MQTT broker
- MQTT topics to publish/subscribe to
- Sensor polling interval
- Modbus registers to read and so on
Browsing through the examples, it looks like the simple ESP32 file server is a good starting point. The config files will be relatively large - a few KB. I'd like some advise on how to store them - NVS, SPIFSS, or external storage? Also, my initial idea is to read the complete file on boot, parse it and keep it in RAM for the duration of the application run. If any of the parameters change (MQTT will allow pushing parameters into the device), the RAM buffer will be written back to non-volatile storage.
Further, the device is supposed to support OTA, therefore what would be advisable - to keep the config file as a part of the compiled application, or keep it on separate storage, like SD card?
Thanks and hope my questions make sense.
Application configuration file
Re: Application configuration file
Cool that no one from espressif responded you.
I also have the same doubt.
I also have the same doubt.
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Application configuration file
Probably because there's no real advice to give - nvs is an option if you want to break apart the json after uploading, spiffs is also an option to store it integrally, external storage is an option if your board has external storage. In this case, the specifics of the program flow as well as the experience of the programmer (and the hardware in use, as far as external storage goes) is more relevant to pick the tech than a simple 'this is best' can convey.
Who is online
Users browsing this forum: No registered users and 54 guests