From 41683887e1c67b9f6073ade732a736ae42afc2ca Mon Sep 17 00:00:00 2001 From: Christopher Liebman Date: Fri, 19 Jul 2019 09:45:31 -0700 Subject: [PATCH] change the Config.json path to include leading "/" so that a default config can optionally be supplied in an initial SPIFFS image --- src/Config.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Config.cpp b/src/Config.cpp index f74f606..dac4e40 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -11,7 +11,7 @@ #include "ArduinoJson.h" 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) @@ -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; }