.gz SPIFFS OTA via WebUpdater w/ATOMIC_FS_UPDATE problem
Posted: Tue Mar 31, 2020 2:44 am
I have a problem with uploading a compressed (.gz gzip) SPIFFS FS image file. If I upload the uncompressed .bin file, it's working fine, but if I compress the .bin file with gzip (7zip), it's uploading, but the result is an empty file system on my ESP8266. I have compiled my sketch with a line
included as described in https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#compression.
I use a "Generic EPS8266 module" with setting "Flash size = 4MB (FS:2MB OTA:~1019KB)".
I created the SPIFFS image .bin file with
where %sketchdir% is the sketch folder (I copied mkspiffs.exe there for convenience) and %gzip% points to 7z.exe on my machine.
I based my sketch upon https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater. When I connect to it, and go to the update folder, I see four buttons. I select the spiffs.file.bin.gz file with the FileSystem button, and press "Update FileSystem". Then I wait, until the confirmation comes that it was successful. I reboot, but then the FS is empty. While if I upload the non-compressed file spiffs.file.bin, the filesystem contains the desired files correctly.
According to https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#compression this should work when I define ATOMIC_FS_UPDATE. However, I cannot find an example anywhere of a sketch that includes this option.
Code: Select all
#define ATOMIC_FS_UPDATE
included as described in https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#compression.
I use a "Generic EPS8266 module" with setting "Flash size = 4MB (FS:2MB OTA:~1019KB)".
I created the SPIFFS image .bin file with
Code: Select all
%sketchdir%\mkspiffs.exe --size 0x1FA000 --page 256 --block 8192 -d 5 --create %sketchdir%\data %sketchdir%\spiffs.file.bin
%gzip% a -tgzip -mx9 %sketchdir%\spiffs.file.bin.gz %sketchdir%\spiffs.file.bin
where %sketchdir% is the sketch folder (I copied mkspiffs.exe there for convenience) and %gzip% points to 7z.exe on my machine.
I based my sketch upon https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater. When I connect to it, and go to the update folder, I see four buttons. I select the spiffs.file.bin.gz file with the FileSystem button, and press "Update FileSystem". Then I wait, until the confirmation comes that it was successful. I reboot, but then the FS is empty. While if I upload the non-compressed file spiffs.file.bin, the filesystem contains the desired files correctly.
According to https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#compression this should work when I define ATOMIC_FS_UPDATE. However, I cannot find an example anywhere of a sketch that includes this option.