0

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?

guagay_wk
  • 26,337
  • 54
  • 186
  • 295
  • 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](https://github.com/esp8266/Arduino/blob/master/doc/filesystem.md#flash-layout) for various ESP8266's. – leetibbett Oct 19 '16 at 10:50
  • 1
    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 Oct 19 '16 at 10:57

1 Answers1

2

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.

Dawn Minion
  • 905
  • 5
  • 12