-->
Page 1 of 1

Best way to store and update config via rest api

PostPosted: Sat May 22, 2021 3:43 pm
by Ice Cold
Hello everyone!
I am trying to store config for my robot . Config should be updatable via REST API. Now I store it as json file like this:
Code: Select all{
  "ap_name":"myDEvice",
  "ap_password":"mypassword",
  "ap_maxconn": 2,
  "ap_channel": 6,
  "sensors":[
    {
      "id":"sensor1",
      "pin": 0,
      "threshold": 0,
      ...   

    },
    {
      "id":"sensor2",
      "pin": 1,
      "threshold": 0,
      ...
    }
  ]
}

and everytime I need to update it, I read it from file, change desired json params and overwrite the file back with updated content. Recently, I've found this library https://github.com/siara-cc/esp_arduino_sqlite3_lib and I am thinking, that possibly storing params in the db is cleaner and possibly better and faster way to do things.... May be somebody is also able to adivse me something useful for that purpose?