FlashFS now gzip-Updatefiles & FS-Versioning imp.
This commit is contained in:
		| @@ -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ählen</label> |               <label class="custom-file-label" for="fw-update-file">Firmware-Update auswählen</label> | ||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|   | |||||||
| @@ -1 +1 @@ | |||||||
| 1.01 | 1.2 | ||||||
| @@ -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) | ||||||
|   | |||||||
| @@ -29,7 +29,7 @@ | |||||||
| #define SW_VERSION_MAJOR 1 | #define SW_VERSION_MAJOR 1 | ||||||
| #define SW_VERSION_MINOR 1 | #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 | ||||||
|   | |||||||
| @@ -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); | ||||||
|   } |   } | ||||||
| @@ -361,7 +361,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)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user