Compare commits

..

3 Commits

7 changed files with 18 additions and 13 deletions

View File

@ -534,7 +534,7 @@
<div class="form-group row"> <div class="form-group row">
<div class="custom-file"> <div class="custom-file">
<input type="file" name="fw-update-file" class="custom-file-input" id="fw-update-file" <input type="file" name="fw-update-file" class="custom-file-input" id="fw-update-file"
accept=".fw.bin,.fs.bin" required /> accept=".fw.bin,.fs.gz" required />
<label class="custom-file-label" for="fw-update-file">Firmware-Update ausw&auml;hlen</label> <label class="custom-file-label" for="fw-update-file">Firmware-Update ausw&auml;hlen</label>
</div> </div>
</div> </div>

View File

@ -1 +1 @@
1.01 1.2

View File

@ -31,6 +31,7 @@ build_flags =
-DADMIN_PASSWORD=${wifi_cred.admin_password} -DADMIN_PASSWORD=${wifi_cred.admin_password}
-DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password} -DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
-DWIFI_AP_IP_GW=10,0,0,1 -DWIFI_AP_IP_GW=10,0,0,1
-DATOMIC_FS_UPDATE
-DFEATURE_ENABLE_WIFI_CLIENT -DFEATURE_ENABLE_WIFI_CLIENT
-DFEATURE_ENABLE_REMOTE_DEBUG -DFEATURE_ENABLE_REMOTE_DEBUG
-DFEATURE_ENABLE_OLED -DFEATURE_ENABLE_OLED

View File

@ -101,6 +101,16 @@ def gzip_webfiles(source, target, env):
else: else:
print('GZIP: Compressed correctly.\n') print('GZIP: Compressed correctly.\n')
return
def gzip_binffiles(source, target, env):
littlefsbin = target[0].get_abspath()
targetbin = os.path.join(os.path.dirname(littlefsbin), 'filesystem.fs')
shutil.copyfile(littlefsbin, targetbin)
gzip_file(targetbin, os.path.join(str(targetbin) + '.gz'))
os.remove(targetbin)
return
# IMPORTANT, this needs to be added to call the routine # IMPORTANT, this needs to be added to call the routine
env.AddPreAction('$BUILD_DIR/littlefs.bin', gzip_webfiles) env.AddPreAction('$BUILD_DIR/littlefs.bin', gzip_webfiles)
env.AddPostAction('$BUILD_DIR/littlefs.bin', gzip_binffiles)

View File

@ -26,10 +26,9 @@
#define HOST_NAME "ChainLube_%06X" // Use printf-Formatting - Chip-ID (uin32_t) will be added #define HOST_NAME "ChainLube_%06X" // Use printf-Formatting - Chip-ID (uin32_t) will be added
#endif #endif
#define SW_VERSION_MAJOR 1 #define SW_VERSION 1.2
#define SW_VERSION_MINOR 1
#define FLASH_FS_VERSION 1.1 #define FLASH_FS_VERSION 1.2
#ifndef OTA_DELAY #ifndef OTA_DELAY
#define OTA_DELAY 50 // ticks -> 10ms / tick #define OTA_DELAY 50 // ticks -> 10ms / tick
@ -51,6 +50,4 @@
#define STARTUP_DELAY 5000 #define STARTUP_DELAY 5000
#define SHUTDOWN_DELAY_MS 5000 #define SHUTDOWN_DELAY_MS 5000
#define ATOMIC_FS_UPDATE
#endif #endif

View File

@ -327,7 +327,7 @@ void RemotDebug_printSystemInfo()
: "UNKNOWN")); : "UNKNOWN"));
debugA("OTA-Pass: %s", QUOTE(ADMIN_PASSWORD)); debugA("OTA-Pass: %s", QUOTE(ADMIN_PASSWORD));
debugA("Git-Revison: %s", GIT_REV); debugA("Git-Revison: %s", GIT_REV);
debugA("Sw-Version: %d.%02d", SW_VERSION_MAJOR, SW_VERSION_MINOR); debugA("Sw-Version: %s", QUOTE(SW_VERSION));
} }
void RemoteDebug_dumpConfig() void RemoteDebug_dumpConfig()

View File

@ -22,7 +22,7 @@ void initWebUI()
GetFlashVersion(globals.FlashVersion, sizeof(globals.FlashVersion)); GetFlashVersion(globals.FlashVersion, sizeof(globals.FlashVersion));
if (!strcmp(globals.FlashVersion, QUOTE(FLASH_FS_VERSION))) if (strcmp(globals.FlashVersion, QUOTE(FLASH_FS_VERSION)))
{ {
MaintainDTC(DTC_FLASHFS_VERSION_ERROR, DTC_WARN, true); MaintainDTC(DTC_FLASHFS_VERSION_ERROR, DTC_WARN, true);
} }
@ -210,9 +210,7 @@ String processor(const String &var)
return String(globals.systemStatustxt); return String(globals.systemStatustxt);
if (var == "SW_VERSION") if (var == "SW_VERSION")
{ {
char buffer[7]; return String(QUOTE(SW_VERSION));
sprintf(buffer, "%d.%02d", SW_VERSION_MAJOR, SW_VERSION_MINOR);
return String(buffer);
} }
if (var == "FS_VERSION") if (var == "FS_VERSION")
return String(globals.FlashVersion); return String(globals.FlashVersion);
@ -361,7 +359,6 @@ void WebserverFirmwareUpdate_Callback(AsyncWebServerRequest *request, const Stri
{ {
Serial.println("Update"); Serial.println("Update");
size_t content_len = request->contentLength(); size_t content_len = request->contentLength();
// if filename includes spiffs, update the spiffs partition
int cmd = (filename.indexOf(".fs") > -1) ? U_FS : U_FLASH; int cmd = (filename.indexOf(".fs") > -1) ? U_FS : U_FLASH;
Update.runAsync(true); Update.runAsync(true);
if (!Update.begin(content_len, cmd)) if (!Update.begin(content_len, cmd))