I'm about to deploy several solar powered IoT sensors, based on ESP32 with Arduino, which will go online depending on their battery level. During daylight that's about once every five minutes for a few seconds. The rest of the time the sensors are in deep sleep.
Upon wakeup they check for a new firmware version online and download/install it if the battery level allows.
As the sensors are deployed in various wifi networks each of them has to be configured with SSID and password and I currently provide individual builds depending on the deployment location/ssid. However that's stupid and I'd like to separate the firmware code from the configuration, so that the OTA update will alter the code, but not the configuration.
What's the best way to achieve this ? With a full blown device and a disk I'd place the configuration in a file and read it upon startup, but how would you handle persistence with an ESP32 and Arduino ?
However, there's still the issue of how to initialize the persistent configuration, as this must be done by software again, so I'd need two firmware versions: one with the initializing code (which must not be shared as it contains confidential information) and one for the OTA updates which is stripped of any secrets.
Uploading config by simple file transfer using USB would make this more convenient. Thus my question.
C, S, _ssid, _pass and host are separte commands. some can be precessed sequential, others need to be the last on a line of input. Those starting with '' have an argument and these are the only 3 cmds that do
the 'C' cmd clears the eeprom, 'S" dumps the eeprom contents which should be none after the 'C' cmd
I don't have a clue what "mount the ESP's file system using USB" means in this context. I'm guessing you want a simple means of creating/updating the configuration data when you build the system? If so, since you're running on an ESP, a simple browser interface for doing the configuration is the obvious solution. It could easily allow you to send the configuration data to the ESP using a browser running on a phone, table, pc or other device, and the ESP simply receives the data and writes it to the configuration file in the FLASH filesystem. I do it that way all the time.