Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspected bug with writing setup file with ESP32 #8

Closed
Pronoe opened this issue Dec 25, 2021 · 3 comments
Closed

Suspected bug with writing setup file with ESP32 #8

Pronoe opened this issue Dec 25, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Pronoe
Copy link
Contributor

Pronoe commented Dec 25, 2021

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

@sblantipodi
Copy link
Owner

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

@Pronoe
Copy link
Contributor Author

Pronoe commented Dec 31, 2021 via email

@sblantipodi
Copy link
Owner

Thank you for reporting Pronoe, fixing it soon.

@sblantipodi sblantipodi self-assigned this Jan 6, 2022
@sblantipodi sblantipodi added the bug Something isn't working label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants