-
Notifications
You must be signed in to change notification settings - Fork 833
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
move SPIFFS to LittleFS for ESP8266 #1226
Conversation
Why change directory upload to directory data. Please see link below.They can upload by esptool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No errors found
I didn't write the code for Web-AC-control.ino, some other author did. i.e. it was use submitted. |
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: These blank lines can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already edited. 👍
// | ||
// Returns: | ||
// A boolean indicating success or failure. | ||
bool mountSpiffs(void) { | ||
debug("Mounting SPIFFS..."); | ||
if (SPIFFS.begin()) return true; // We mounted it okay. | ||
debug("Mounting FILESYSTEM..."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug("Mounting " FILESYSTEM "...");
Use that instead, and it should report if it is SPIFFS or LittleFS etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already change to:
#if (FILESYSTEM == LittleFS)
debug("... LittleFS ...");
#else
debug("... SPIFSS ..."0;
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use my suggestion, then you don't need the #if
clause and it works for any other type of FS.
debug("Failed to mount FILESYSTEM!\n" | ||
"Formatting FILESYSTEM and trying again..."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug("Failed to mount " FILESYSTEM "!\n"
"Formatting " FILESYSTEM " and trying again...");
Use that instead, and it should report if it is SPIFFS or LittleFS etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
"Formatting FILESYSTEM and trying again..."); | ||
FILESYSTEM.format(); | ||
if (!FILESYSTEM.begin()) { // Did we fail? | ||
debug("DANGER: Failed to mount FILESYSTEM even after formatting!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug("DANGER: Failed to mount " FILESYSTEM " even after formatting!");
Use that instead, and it should report if it is SPIFFS or LittleFS etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
// Open the file | ||
server.streamFile(file, contentType); | ||
// Send it to the client | ||
file.close(); | ||
// Close the file again | ||
// Serial.println(String("\tSent file: ") + path); | ||
Serial.println(String("\tSent file: ") + path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. You're changing the behaviour by adding in the debug messages. Is that something you mean to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-comment.
return true; | ||
} | ||
// Serial.println(String("\tFile Not Found: ") + path); | ||
Serial.println(String("\tFile Not Found: ") + path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-comment.
// Serial.print("handleFileUpload Size: "); | ||
// Serial.println(upload.totalSize); | ||
Serial.print("handleFileUpload Size: "); | ||
Serial.println(upload.totalSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-comment.
// Serial.begin(115200); | ||
// Serial.println(); | ||
Serial.begin(115200); | ||
Serial.println(); | ||
ac.begin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-comment.
// Serial.println("mounting FS..."); | ||
Serial.println("mounting FS..."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't appear to have been updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you git push
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
_v2.7.10 (20200831)_ **[BREAKING CHANGES]** - move SPIFFS to LittleFS for ESP8266 (#1182 #1226) - Daikin176: Change & increase operating mode values. (#1233 #1235) **[Bug Fixes]** - TOSHIBA_AC: not turning off when using `IRac` class. (#1250 #1251) - Haier: change position of Fan speed bits. (#1246 #1247) **[Features]** - Voltas: Add detailed support for Voltas A/Cs (#1238 #1248) - Add support for Metz protocol. (#1241 #1242) - Basic support for Voltas A/C protocol (#1238 #1243) - Add low level bit formatting sanity checks. (#1232) **[Misc]** - Rewrite Airwell by using bit fields (#1254) - Rewrite Haier YRW02 using bit fields (#1253) - rewrite Haier HSU07-HEA03 (#1246 #1247) - rewrite ir_Gree & ir_Midea by using bit field (#1240) - Incorrect usage of `assert()` (#1244 #1245 #1232) - rewrite Gree (#1210)
## v2.7.10 release _v2.7.10 (20200831)_ **[BREAKING CHANGES]** - move SPIFFS to LittleFS for ESP8266 (#1182 #1226) - Daikin176: Change & increase operating mode values. (#1233 #1235) **[Bug Fixes]** - TOSHIBA_AC: not turning off when using `IRac` class. (#1250 #1251) - Haier: change position of Fan speed bits. (#1246 #1247) **[Features]** - Voltas: Add detailed support for Voltas A/Cs (#1238 #1248) - Add support for Metz protocol. (#1241 #1242) - Basic support for Voltas A/C protocol (#1238 #1243) - Add low level bit formatting sanity checks. (#1232) **[Misc]** - Rewrite Airwell by using bit fields (#1254) - Rewrite Haier YRW02 using bit fields (#1253) - rewrite Haier HSU07-HEA03 (#1246 #1247) - rewrite ir_Gree & ir_Midea by using bit field (#1240) - Incorrect usage of `assert()` (#1244 #1245 #1232) - rewrite Gree (#1210)
The code changes mention have now been included in the newly released v2.7.10 of the library. |
thanks for your work here @crankyoldgit what should I do before upgrading to 2.7.10? |
It's only a breaking change for two of the code examples. For those two examples, IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.h Lines 35 to 48 in 87d448f
If you choose to use LittleFS instead of SPIFFS it will wipe any locally stored information in the local filesystem of the ESP chip.e.g. Config file for IRMQTTServer and uploaded (web) files for Web-AC-Control
SPIFFS is now deprecated in the ESP8266 Core library due to it no longer being maintained AFAIK, LittleFS is a drop-in replacement, but completely different format, so it will format the data partition on first use. So, what do you need to do? Backup/record any config/settings and be prepared to have to do the initial setup of any ESP running |
I've made this (I hope) clearer (scope-wise) in the |
ok thanks for the answer 👍 |
I only replace
SPIFFS.open()
andSPIFFS.begin()
by LittleFS for ESP8266.