sblantipodi / arduino_bootstrapper

Utility classes for bootstrapping Arduino projects with Wifi management, OTA upload management, memory management, MQTT and queue management. (ESP8266/ESP32 ready)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suspected bug with writing setup file with ESP32

Pronoe opened this issue · comments

Hellow,
in WiFiManager.cpp, when writing the setup file, in the case of ESP32, the current code is:
File configFile = SPIFFS.open("/setup.json", "w");
if (!configFile)
{
Serial.println("Failed to open [setup.json] file for writing");
}
serializeJsonPretty(doc, Serial);
serializeJson(doc, configFile);
configFile.close();
Serial.println("[setup.json] written correctly");
The else block that exists for the ESP8296 is missing.
The code should be:
File configFile = SPIFFS.open("/setup.json", "w");
if (!configFile)
{
Serial.println("Failed to open [setup.json] file for writing");
}
else
{
serializeJsonPretty(doc, Serial);
serializeJson(doc, configFile);
configFile.close();
Serial.println("[setup.json] written correctly");

Is this correct ?
The same apply for BootstrapManager::writeToSPIFFS

I'm sorry can you elaborate what is the suspected bug?
Thank you.

Thank you for reporting Pronoe, fixing it soon.