Managing Specific Configurations for Deployed ESP devices

Hello,

To break down my question here is my use case.

I have numerous ESP8226 devices deployed in the wild, all using a HX711 ADC to track weight, and send that weight to my server to store in a database.

Each ESP device pings my server to see if a new version of the sketch is available periodically. This OTA update is happening via the ESPHttpUpdate library.

The part I am having trouble with is that each HX711 ADC board is unique and requires a calibration factor specific to that individual HX711 board. To accommodate for this and still provide OTA updates would require me to track each Hx711 board's calibration factor and compile a new binary file for EACH ESP with that specific calibration factor baked into the sketch. Then make that specific sketch available to the board when it requests an OTA update.

As the number of ESP devices grows in number that would require a larger and larger number of compiled sketches to be stored for each device rather than one sketch that can be provided to all ESP boards OTA.

Was hoping someone would have some advice on a way to accommodate for this.

Would using RTC mem or storing that calibration factor in SPIFFS be a reasonable to handle this?

Any advice is greatly appreciated!

Thanks!

Data you write to SPIFFS remain after reflashing your ESP device so that seems like a logical choice for retaining the calibration constants Reference

Thanks for the quick reply. Would EEPROM be more efficient if I will not be updating the values ever?

On the initial upload sketch save the configurations in EEPROM then retrieve those values on each startup?

Thank you!

Jtoeniskoetter:
On the initial upload sketch save the configurations in EEPROM then retrieve those values on each startup?

Or save it to a file in SPIFFS.
The potential problem of having the data in the sketch to store in EEPROM/SPIFFS on first run is you need a separate sketch for each ESP but having the data in a file written to SPIFFS means you can set it on/after initial deployment and use/update the same sketch on all ESP's.
I'm currently testing an IR blaster using ESP8266 that can read/write settings in SPIFFS from my server using MQTT.
On first run it uses WiFiManager to select the wifi settings and then once it connects to MQTT I can upload specific settings and IR codes for that device over MQTT.