diff --git a/Reset_Sketch/Reset_Sketch.ino b/Reset_Sketch/Reset_Sketch.ino index 157eee1..a12ce2c 100644 --- a/Reset_Sketch/Reset_Sketch.ino +++ b/Reset_Sketch/Reset_Sketch.ino @@ -1,5 +1,5 @@ #include -#include +#include /* Upload this sketch to your ESP8266 to erase @@ -25,10 +25,10 @@ void setup() { Serial.println("EEPROM cleaned"); - SPIFFS.begin(); + LittleFS.begin(); Serial.println("SPIFFS initialized"); - SPIFFS.format(); + LittleFS.format(); Serial.println("SPIFFS cleaned"); ESP.eraseConfig(); @@ -44,4 +44,4 @@ void setup() { void loop() { -} +} diff --git a/esp8266_deauther/CLI.cpp b/esp8266_deauther/CLI.cpp index fb0fc66..54c4897 100644 --- a/esp8266_deauther/CLI.cpp +++ b/esp8266_deauther/CLI.cpp @@ -1,5 +1,6 @@ #include "CLI.h" +#include #include "settings.h" /* @@ -852,7 +853,7 @@ void CLI::runCommand(String input) { prntln(macToStr(mac)); FSInfo fs_info; - SPIFFS.info(fs_info); + LittleFS.info(fs_info); sprintf(s, str( CLI_SYSTEM_RAM_OUT).c_str(), fs_info.usedBytes, fs_info.usedBytes / (fs_info.totalBytes / 100), fs_info.totalBytes - fs_info.usedBytes, (fs_info.totalBytes - fs_info.usedBytes) / (fs_info.totalBytes / 100), fs_info.totalBytes); @@ -860,7 +861,7 @@ void CLI::runCommand(String input) { sprintf(s, str(CLI_SYSTEM_SPIFFS_OUT).c_str(), fs_info.blockSize, fs_info.pageSize); prnt(String(s)); prntln(CLI_FILES); - Dir dir = SPIFFS.openDir(String(SLASH)); + Dir dir = LittleFS.openDir(String(SLASH)); while (dir.next()) { prnt(String(SPACE) + String(SPACE) + dir.fileName() + String(SPACE)); @@ -896,7 +897,7 @@ void CLI::runCommand(String input) { // format else if (eqlsCMD(0, CLI_FORMAT)) { prnt(CLI_FORMATTING_SPIFFS); - SPIFFS.format(); + LittleFS.format(); prntln(SETUP_OK); } diff --git a/esp8266_deauther/CLI.h b/esp8266_deauther/CLI.h index 9dc7100..a9b6f18 100644 --- a/esp8266_deauther/CLI.h +++ b/esp8266_deauther/CLI.h @@ -3,7 +3,6 @@ #include "Arduino.h" #include -#include extern "C" { #include "user_interface.h" } diff --git a/esp8266_deauther/Names.cpp b/esp8266_deauther/Names.cpp index af6272f..72acacc 100644 --- a/esp8266_deauther/Names.cpp +++ b/esp8266_deauther/Names.cpp @@ -1,5 +1,7 @@ #include "Names.h" +#include + Names::Names() { list = new SimpleList; } diff --git a/esp8266_deauther/Names.h b/esp8266_deauther/Names.h index 85792f9..85a8f8c 100644 --- a/esp8266_deauther/Names.h +++ b/esp8266_deauther/Names.h @@ -1,8 +1,6 @@ #ifndef Names_h #define Names_h -#include "Arduino.h" -#include #include extern "C" { #include "user_interface.h" diff --git a/esp8266_deauther/SSIDs.cpp b/esp8266_deauther/SSIDs.cpp index 5a4c60f..bdcf494 100644 --- a/esp8266_deauther/SSIDs.cpp +++ b/esp8266_deauther/SSIDs.cpp @@ -1,5 +1,6 @@ #include "SSIDs.h" +#include #include "settings.h" SSIDs::SSIDs() { diff --git a/esp8266_deauther/SSIDs.h b/esp8266_deauther/SSIDs.h index 4131982..9f5164a 100644 --- a/esp8266_deauther/SSIDs.h +++ b/esp8266_deauther/SSIDs.h @@ -3,7 +3,6 @@ #include "Arduino.h" #include -#include extern "C" { #include "user_interface.h" } diff --git a/esp8266_deauther/esp8266_deauther.ino b/esp8266_deauther/esp8266_deauther.ino index c87f4f6..605097a 100644 --- a/esp8266_deauther/esp8266_deauther.ino +++ b/esp8266_deauther/esp8266_deauther.ino @@ -65,7 +65,7 @@ void setup() { // start SPIFFS prnt(SETUP_MOUNT_SPIFFS); - bool spiffsError = !SPIFFS.begin(); + bool spiffsError = !LittleFS.begin(); prntln(spiffsError ? SETUP_ERROR : SETUP_OK); // Start EEPROM @@ -73,7 +73,7 @@ void setup() { #ifdef FORMAT_SPIFFS prnt(SETUP_FORMAT_SPIFFS); - SPIFFS.format(); + LittleFS.format(); prntln(SETUP_OK); #endif // ifdef FORMAT_SPIFFS @@ -86,7 +86,7 @@ void setup() { // Format SPIFFS when in boot-loop if (spiffsError || !EEPROMHelper::checkBootNum(BOOT_COUNTER_ADDR)) { prnt(SETUP_FORMAT_SPIFFS); - SPIFFS.format(); + LittleFS.format(); prntln(SETUP_OK); prnt(SETUP_FORMAT_EEPROM); diff --git a/esp8266_deauther/functions.h b/esp8266_deauther/functions.h index d418c63..5da597f 100644 --- a/esp8266_deauther/functions.h +++ b/esp8266_deauther/functions.h @@ -2,7 +2,7 @@ #define functions_h #include "Arduino.h" -#include +#include extern "C" { #include "user_interface.h" } @@ -546,7 +546,7 @@ String leftRight(String a, String b, int len) { /* ===== SPIFFS ===== */ bool progmemToSpiffs(const char* adr, int len, String path) { prnt(str(SETUP_COPYING) + path + str(SETUP_PROGMEM_TO_SPIFFS)); - File f = SPIFFS.open(path, "w+"); + File f = LittleFS.open(path, "w+"); if (!f) { prntln(SETUP_ERROR); @@ -565,7 +565,7 @@ bool progmemToSpiffs(const char* adr, int len, String path) { bool readFile(String path, String& buf) { if (path.charAt(0) != SLASH) path = String(SLASH) + path; - File f = SPIFFS.open(path, "r"); + File f = LittleFS.open(path, "r"); if (!f) return false; @@ -580,7 +580,7 @@ bool readFile(String path, String& buf) { void readFileToSerial(String path, bool showLineNum) { if (path.charAt(0) != SLASH) path = String(SLASH) + path; - File f = SPIFFS.open(path, "r"); + File f = LittleFS.open(path, "r"); if (!f) { prnt(F_ERROR_READING_FILE); @@ -613,14 +613,14 @@ bool copyFile(String pathFrom, String pathTo) { if (pathTo.charAt(0) != SLASH) pathTo = String(SLASH) + pathTo; - if (!SPIFFS.exists(pathFrom)) { + if (!LittleFS.exists(pathFrom)) { prnt(F_ERROR_FILE); prntln(pathFrom); return false; } - File f1 = SPIFFS.open(pathFrom, "r"); - File f2 = SPIFFS.open(pathTo, "w+"); + File f1 = LittleFS.open(pathFrom, "r"); + File f2 = LittleFS.open(pathTo, "w+"); if (!f1 || !f2) return false; @@ -636,19 +636,19 @@ bool renameFile(String pathFrom, String pathTo) { if (pathTo.charAt(0) != SLASH) pathTo = String(SLASH) + pathTo; - if (!SPIFFS.exists(pathFrom)) { + if (!LittleFS.exists(pathFrom)) { prnt(F_ERROR_FILE); prntln(pathFrom); return false; } - SPIFFS.rename(pathFrom, pathTo); + LittleFS.rename(pathFrom, pathTo); return true; } bool writeFile(String path, String& buf) { if (path.charAt(0) != SLASH) path = String(SLASH) + path; - File f = SPIFFS.open(path, "w+"); + File f = LittleFS.open(path, "w+"); if (!f) return false; @@ -662,7 +662,7 @@ bool writeFile(String path, String& buf) { bool appendFile(String path, String& buf) { if (path.charAt(0) != SLASH) path = String(SLASH) + path; - File f = SPIFFS.open(path, "a+"); + File f = LittleFS.open(path, "a+"); if (!f) return false; @@ -677,7 +677,7 @@ bool appendFile(String path, String& buf) { void checkFile(String path, String data) { if (path.charAt(0) != SLASH) path = String(SLASH) + path; - if (!SPIFFS.exists(path)) writeFile(path, data); + if (!LittleFS.exists(path)) writeFile(path, data); } bool removeLines(String path, int lineFrom, int lineTo) { @@ -688,8 +688,8 @@ bool removeLines(String path, int lineFrom, int lineTo) { String tmpPath = str(F_TMP) + path + str(F_COPY); - File f = SPIFFS.open(path, "r"); - File f2 = SPIFFS.open(tmpPath, "w"); + File f = LittleFS.open(path, "r"); + File f2 = LittleFS.open(tmpPath, "w"); if (!f || !f2) return false; @@ -703,8 +703,8 @@ bool removeLines(String path, int lineFrom, int lineTo) { f.close(); f2.close(); - SPIFFS.remove(path); - SPIFFS.rename(tmpPath, path); + LittleFS.remove(path); + LittleFS.rename(tmpPath, path); return true; } @@ -717,8 +717,8 @@ bool replaceLine(String path, int line, String& buf) { String tmpPath = "/tmp" + path + "_copy"; - File f = SPIFFS.open(path, "r"); - File f2 = SPIFFS.open(tmpPath, "w"); + File f = LittleFS.open(path, "r"); + File f2 = LittleFS.open(tmpPath, "w"); if (!f || !f2) return false; @@ -738,8 +738,8 @@ bool replaceLine(String path, int line, String& buf) { f.close(); f2.close(); - SPIFFS.remove(path); - SPIFFS.rename(tmpPath, path); + LittleFS.remove(path); + LittleFS.rename(tmpPath, path); return true; } @@ -775,7 +775,7 @@ JsonVariant parseJSONFile(String path, DynamicJsonBuffer& jsonBuffer) { bool removeFile(String path) { if (path.charAt(0) != SLASH) path = String(SLASH) + path; - return SPIFFS.remove(path); + return LittleFS.remove(path); } void saveJSONFile(String path, JsonObject& root) { diff --git a/esp8266_deauther/webfiles.h b/esp8266_deauther/webfiles.h index 01ec9a9..5656aac 100644 --- a/esp8266_deauther/webfiles.h +++ b/esp8266_deauther/webfiles.h @@ -33,31 +33,31 @@ const char LICENSE[] PROGMEM = {0x1f, 0x8b, 0x08, 0x08, 0x7d, 0x98, 0xab, 0x5d, void copyWebFiles(bool force){ #ifdef USE_PROGMEM_WEB_FILES -if(settings.getWebSettings().use_spiffs){ - if(!SPIFFS.exists(String(F("/web/attack.html.gz"))) || force) progmemToSpiffs(attackhtml, sizeof(attackhtml), String(F("/web/attack.html.gz"))); - if(!SPIFFS.exists(String(F("/web/index.html.gz"))) || force) progmemToSpiffs(indexhtml, sizeof(indexhtml), String(F("/web/index.html.gz"))); - if(!SPIFFS.exists(String(F("/web/info.html.gz"))) || force) progmemToSpiffs(infohtml, sizeof(infohtml), String(F("/web/info.html.gz"))); - if(!SPIFFS.exists(String(F("/web/scan.html.gz"))) || force) progmemToSpiffs(scanhtml, sizeof(scanhtml), String(F("/web/scan.html.gz"))); - if(!SPIFFS.exists(String(F("/web/settings.html.gz"))) || force) progmemToSpiffs(settingshtml, sizeof(settingshtml), String(F("/web/settings.html.gz"))); - if(!SPIFFS.exists(String(F("/web/ssids.html.gz"))) || force) progmemToSpiffs(ssidshtml, sizeof(ssidshtml), String(F("/web/ssids.html.gz"))); - if(!SPIFFS.exists(String(F("/web/style.css.gz"))) || force) progmemToSpiffs(stylecss, sizeof(stylecss), String(F("/web/style.css.gz"))); - if(!SPIFFS.exists(String(F("/web/js/attack.js.gz"))) || force) progmemToSpiffs(attackjs, sizeof(attackjs), String(F("/web/js/attack.js.gz"))); - if(!SPIFFS.exists(String(F("/web/js/scan.js.gz"))) || force) progmemToSpiffs(scanjs, sizeof(scanjs), String(F("/web/js/scan.js.gz"))); - if(!SPIFFS.exists(String(F("/web/js/settings.js.gz"))) || force) progmemToSpiffs(settingsjs, sizeof(settingsjs), String(F("/web/js/settings.js.gz"))); - if(!SPIFFS.exists(String(F("/web/js/site.js.gz"))) || force) progmemToSpiffs(sitejs, sizeof(sitejs), String(F("/web/js/site.js.gz"))); - if(!SPIFFS.exists(String(F("/web/js/ssids.js.gz"))) || force) progmemToSpiffs(ssidsjs, sizeof(ssidsjs), String(F("/web/js/ssids.js.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/cn.lang.gz"))) || force) progmemToSpiffs(cnlang, sizeof(cnlang), String(F("/web/lang/cn.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/cs.lang.gz"))) || force) progmemToSpiffs(cslang, sizeof(cslang), String(F("/web/lang/cs.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/de.lang.gz"))) || force) progmemToSpiffs(delang, sizeof(delang), String(F("/web/lang/de.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/en.lang.gz"))) || force) progmemToSpiffs(enlang, sizeof(enlang), String(F("/web/lang/en.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/es.lang.gz"))) || force) progmemToSpiffs(eslang, sizeof(eslang), String(F("/web/lang/es.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/fi.lang.gz"))) || force) progmemToSpiffs(filang, sizeof(filang), String(F("/web/lang/fi.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/fr.lang.gz"))) || force) progmemToSpiffs(frlang, sizeof(frlang), String(F("/web/lang/fr.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/it.lang.gz"))) || force) progmemToSpiffs(itlang, sizeof(itlang), String(F("/web/lang/it.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/ro.lang.gz"))) || force) progmemToSpiffs(rolang, sizeof(rolang), String(F("/web/lang/ro.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/ru.lang.gz"))) || force) progmemToSpiffs(rulang, sizeof(rulang), String(F("/web/lang/ru.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/lang/tlh.lang.gz"))) || force) progmemToSpiffs(tlhlang, sizeof(tlhlang), String(F("/web/lang/tlh.lang.gz"))); - if(!SPIFFS.exists(String(F("/web/LICENSE.gz"))) || force) progmemToSpiffs(LICENSE, sizeof(LICENSE), String(F("/web/LICENSE.gz"))); +if(settings::getWebSettings().use_spiffs){ + if(!LittleFS.exists(String(F("/web/attack.html.gz"))) || force) progmemToSpiffs(attackhtml, sizeof(attackhtml), String(F("/web/attack.html.gz"))); + if(!LittleFS.exists(String(F("/web/index.html.gz"))) || force) progmemToSpiffs(indexhtml, sizeof(indexhtml), String(F("/web/index.html.gz"))); + if(!LittleFS.exists(String(F("/web/info.html.gz"))) || force) progmemToSpiffs(infohtml, sizeof(infohtml), String(F("/web/info.html.gz"))); + if(!LittleFS.exists(String(F("/web/scan.html.gz"))) || force) progmemToSpiffs(scanhtml, sizeof(scanhtml), String(F("/web/scan.html.gz"))); + if(!LittleFS.exists(String(F("/web/settings.html.gz"))) || force) progmemToSpiffs(settingshtml, sizeof(settingshtml), String(F("/web/settings.html.gz"))); + if(!LittleFS.exists(String(F("/web/ssids.html.gz"))) || force) progmemToSpiffs(ssidshtml, sizeof(ssidshtml), String(F("/web/ssids.html.gz"))); + if(!LittleFS.exists(String(F("/web/style.css.gz"))) || force) progmemToSpiffs(stylecss, sizeof(stylecss), String(F("/web/style.css.gz"))); + if(!LittleFS.exists(String(F("/web/js/attack.js.gz"))) || force) progmemToSpiffs(attackjs, sizeof(attackjs), String(F("/web/js/attack.js.gz"))); + if(!LittleFS.exists(String(F("/web/js/scan.js.gz"))) || force) progmemToSpiffs(scanjs, sizeof(scanjs), String(F("/web/js/scan.js.gz"))); + if(!LittleFS.exists(String(F("/web/js/settings.js.gz"))) || force) progmemToSpiffs(settingsjs, sizeof(settingsjs), String(F("/web/js/settings.js.gz"))); + if(!LittleFS.exists(String(F("/web/js/site.js.gz"))) || force) progmemToSpiffs(sitejs, sizeof(sitejs), String(F("/web/js/site.js.gz"))); + if(!LittleFS.exists(String(F("/web/js/ssids.js.gz"))) || force) progmemToSpiffs(ssidsjs, sizeof(ssidsjs), String(F("/web/js/ssids.js.gz"))); + if(!LittleFS.exists(String(F("/web/lang/cn.lang.gz"))) || force) progmemToSpiffs(cnlang, sizeof(cnlang), String(F("/web/lang/cn.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/cs.lang.gz"))) || force) progmemToSpiffs(cslang, sizeof(cslang), String(F("/web/lang/cs.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/de.lang.gz"))) || force) progmemToSpiffs(delang, sizeof(delang), String(F("/web/lang/de.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/en.lang.gz"))) || force) progmemToSpiffs(enlang, sizeof(enlang), String(F("/web/lang/en.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/es.lang.gz"))) || force) progmemToSpiffs(eslang, sizeof(eslang), String(F("/web/lang/es.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/fi.lang.gz"))) || force) progmemToSpiffs(filang, sizeof(filang), String(F("/web/lang/fi.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/fr.lang.gz"))) || force) progmemToSpiffs(frlang, sizeof(frlang), String(F("/web/lang/fr.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/it.lang.gz"))) || force) progmemToSpiffs(itlang, sizeof(itlang), String(F("/web/lang/it.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/ro.lang.gz"))) || force) progmemToSpiffs(rolang, sizeof(rolang), String(F("/web/lang/ro.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/ru.lang.gz"))) || force) progmemToSpiffs(rulang, sizeof(rulang), String(F("/web/lang/ru.lang.gz"))); + if(!LittleFS.exists(String(F("/web/lang/tlh.lang.gz"))) || force) progmemToSpiffs(tlhlang, sizeof(tlhlang), String(F("/web/lang/tlh.lang.gz"))); + if(!LittleFS.exists(String(F("/web/LICENSE.gz"))) || force) progmemToSpiffs(LICENSE, sizeof(LICENSE), String(F("/web/LICENSE.gz"))); } #endif } diff --git a/esp8266_deauther/wifi.h b/esp8266_deauther/wifi.h index 258da7a..0775904 100644 --- a/esp8266_deauther/wifi.h +++ b/esp8266_deauther/wifi.h @@ -7,7 +7,7 @@ #include #include #include -#include +#include extern "C" { #include "user_interface.h" } @@ -139,10 +139,10 @@ bool handleFileRead(String path) { String contentType = getContentType(path); - if (!SPIFFS.exists(path)) { - if (SPIFFS.exists(path + str(W_DOT_GZIP))) path += str(W_DOT_GZIP); - else if (SPIFFS.exists(wifi_config_path + path)) path = wifi_config_path + path; - else if (SPIFFS.exists(wifi_config_path + path + str(W_DOT_GZIP))) path = wifi_config_path + path + str( + if (!LittleFS.exists(path)) { + if (LittleFS.exists(path + str(W_DOT_GZIP))) path += str(W_DOT_GZIP); + else if (LittleFS.exists(wifi_config_path + path)) path = wifi_config_path + path; + else if (LittleFS.exists(wifi_config_path + path + str(W_DOT_GZIP))) path = wifi_config_path + path + str( W_DOT_GZIP); else { // prntln(W_NOT_FOUND); @@ -150,7 +150,7 @@ bool handleFileRead(String path) { } } - File file = SPIFFS.open(path, "r"); + File file = LittleFS.open(path, "r"); server.streamFile(file, contentType); file.close(); // prnt(SPACE); @@ -167,7 +167,7 @@ void handleFileList() { String path = server.arg("dir"); // Serial.println("handleFileList: " + path); - Dir dir = SPIFFS.openDir(path); + Dir dir = LittleFS.openDir(path); String output = String(OPEN_BRACKET); // { File entry; diff --git a/utils/web_converter/webConverter.py b/utils/web_converter/webConverter.py index 8d2a64d..82d7fd3 100644 --- a/utils/web_converter/webConverter.py +++ b/utils/web_converter/webConverter.py @@ -89,7 +89,7 @@ for file in html_files: hex_formatted_content += "0x" + char + ", " hex_formatted_content = hex_formatted_content[:-2] progmem_definitions += "const char " + array_name + "[] PROGMEM = {" + hex_formatted_content + "};\n" - copy_files_function += ' if(!SPIFFS.exists(String(F("/web/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/' + base_file + '.gz")));\n' + copy_files_function += ' if(!LittleFS.exists(String(F("/web/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/' + base_file + '.gz")));\n' webserver_events += 'server.on(String(F("/' + base_file + '")).c_str(), HTTP_GET, [](){\n sendProgmem(' + array_name + ', sizeof(' + array_name + '), W_HTML);\n});\n' for file in css_files: @@ -117,7 +117,7 @@ for file in css_files: hex_formatted_content += "0x" + char + ", " hex_formatted_content = hex_formatted_content[:-2] progmem_definitions += "const char " + array_name + "[] PROGMEM = {" + hex_formatted_content + "};\n" - copy_files_function += ' if(!SPIFFS.exists(String(F("/web/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/' + base_file + '.gz")));\n' + copy_files_function += ' if(!LittleFS.exists(String(F("/web/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/' + base_file + '.gz")));\n' webserver_events += 'server.on(String(F("/' + base_file + '")).c_str(), HTTP_GET, [](){\n sendProgmem(' + array_name + ', sizeof(' + array_name + '), W_CSS);\n});\n' for file in js_files: @@ -149,7 +149,7 @@ for file in js_files: hex_formatted_content += "0x" + char + ", " hex_formatted_content = hex_formatted_content[:-2] progmem_definitions += "const char " + array_name + "[] PROGMEM = {" + hex_formatted_content + "};\n" - copy_files_function += ' if(!SPIFFS.exists(String(F("/web/js/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/js/' + base_file + '.gz")));\n' + copy_files_function += ' if(!LittleFS.exists(String(F("/web/js/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/js/' + base_file + '.gz")));\n' webserver_events += 'server.on(String(F("/js/' + base_file + '")).c_str(), HTTP_GET, [](){\n sendProgmem(' + array_name + ', sizeof(' + array_name + '), W_JS);\n});\n' for file in lang_files: @@ -179,7 +179,7 @@ for file in lang_files: hex_formatted_content += "0x" + char + ", " hex_formatted_content = hex_formatted_content[:-2] progmem_definitions += "const char " + array_name + "[] PROGMEM = {" + hex_formatted_content + "};\n" - copy_files_function += ' if(!SPIFFS.exists(String(F("/web/lang/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/lang/' + base_file + '.gz")));\n' + copy_files_function += ' if(!LittleFS.exists(String(F("/web/lang/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/lang/' + base_file + '.gz")));\n' webserver_events += 'server.on(String(F("/lang/' + base_file + '")).c_str(), HTTP_GET, [](){\n sendProgmem(' + array_name + ', sizeof(' + array_name + '), W_JSON);\n});\n' if(len(load_lang) > 0): load_lang += ' else if(settings::getLang() == String(F("'+lang_name+'"))) sendProgmem(' + array_name + ', sizeof(' + array_name + '), W_JSON);\n' @@ -206,7 +206,7 @@ for char in hex_content: hex_formatted_content += "0x" + char + ", " hex_formatted_content = hex_formatted_content[:-2] progmem_definitions += "const char " + array_name + "[] PROGMEM = {" + hex_formatted_content + "};\n" -copy_files_function += ' if(!SPIFFS.exists(String(F("/web/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/' + base_file + '.gz")));\n' +copy_files_function += ' if(!LittleFS.exists(String(F("/web/' + base_file + '.gz"))) || force) progmemToSpiffs(' + array_name + ', sizeof(' + array_name + '), String(F("/web/' + base_file + '.gz")));\n' print("[+] Saving everything into webfiles.h...") f = open(arduino_file_path, 'w')