0
votes

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?

1
I think maybe that limit is there just to keep it from reading random stuff if the saveConfig method somehow failed. This page shows the file system sizes for various ESP8266's.leetibbett
My vote is for the JSON buffer allocation with 200. Possibly he do not want to exceed JSON buffer. If it is, it is better to use JSON_OBJECT_SIZE for StaticJsonBuffer.cagdas

1 Answers

2
votes

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.