change the Config.json path to include leading "/" so that a default config can optionally be supplied in an initial SPIFFS image

This commit is contained in:
Christopher Liebman 2019-07-19 09:45:31 -07:00
parent 09dbd8ff8e
commit 41683887e1

View File

@ -11,7 +11,7 @@
#include "ArduinoJson.h" #include "ArduinoJson.h"
static const char* TAG = "Config"; static const char* TAG = "Config";
static const char* CONFIG_FILE = "Config.json"; static const char* CONFIG_FILE = "/Config.json";
Config::Config() : _syslog_host(), _syslog_port(0) Config::Config() : _syslog_host(), _syslog_port(0)
@ -42,6 +42,13 @@ bool Config::begin()
} }
} }
dlog.info(TAG, "begin scanning SPIFFS files");
Dir dir = SPIFFS.openDir("");
while (dir.next())
{
File f = dir.openFile("r");
dlog.info(TAG, "begin: file: '%s' size %d", dir.fileName().c_str(), f.size());
}
return true; return true;
} }