I’m just wondering - is there any easy solution, how to save respective device credentials not directly into the code as constant, but read them from device’s EEPROM? I mean I have a pool of devices, which I want to load with the same firmware and their respective specific parameters (device id, credential, OTA update address, wifi ssid, wifi password…) load from each device’s EEPROM.
Hi @Tomas, this is possible, and it fact it is actually done inside the ThingerWebConfig when the user configures the device id and credential from a web page. Take a look on this code from the library. But the code is basically the following. It is using the filesystem from ESP8266 and writing a pson file, so you can store any data you want easily. Hope this helps!
Thank you for your swift reply @alvarolb ! This part I basically have done, just don’t know what to do next - how to call the thinger init with my parameters in variables before I can use
I think that this can be an interesting use case, so I can add this feature to the library in further updates with support for empty constructors.
Notice that you should keep now the credentials read from eeprom in some global variables. You can just define them in your sketch like the following, as it is done in the ThingerWebConfig.