Search code examples
esp8266arduino-esp8266spiffs

Can config file size >1024 bytes on ESP8266 Arduino?


I am using ESP8266 Arduino ConfigFile.ino as an example to store configuration settings on SPIFFS.

https://github.com/esp8266/Arduino/blob/master/libraries/esp8266/examples/ConfigFile/ConfigFile.ino

From this code segment, configFile cannot be >1024 bytes.

size_t size = configFile.size();
  if (size > 1024) {
    Serial.println("Config file size is too large");
    return false;
  }

Why is 1024 bytes the limitation for config file size? If this is indeed a limitation, are there ways to overcome this limitation?


Solution

  • It's a limitation only in this particular example - It's meant to serve as a basis for you to start developing your own configuration file code. Nothing is stopping you from creating a larger buffer for both the raw character data and JsonBuffer. I have several configuration files on production devices around 10-20K with no issues to report.