@@ -95,12 +95,15 @@ A single JSON file can also contain several versions of a single firmware type:
95
95
{
96
96
"type" :" esp32-fota-http" ,
97
97
"version" :" 0.0.3" ,
98
- "url" :" http://192.168.0.100/fota/esp32-fota-0.0.3.bin"
98
+ "url" :" http://192.168.0.100/fota/esp32-fota-0.0.3.bin" ,
99
+ "spiffs" :" http://192.168.0.100/fota/esp32-fota-0.0.3.spiffs.bin"
99
100
}
100
101
]
101
102
```
102
103
103
104
105
+
106
+
104
107
#### Filesystem image (spiffs/littlefs)
105
108
106
109
Adding ` spiffs ` key to the JSON entry will end up with the filesystem being updated first, then the firmware.
@@ -173,10 +176,12 @@ void setup_wifi()
173
176
174
177
void loop()
175
178
{
176
- bool updatedNeeded = esp32FOTA.execHTTPcheck();
177
- if (updatedNeeded) {
178
- esp32FOTA.execOTA();
179
- }
179
+ esp32FOTA.handle();
180
+ // or ...
181
+ // bool updatedNeeded = esp32FOTA.execHTTPcheck();
182
+ // if (updatedNeeded) {
183
+ // esp32FOTA.execOTA();
184
+ // }
180
185
delay(2000);
181
186
}
182
187
```
@@ -214,16 +219,67 @@ void setup()
214
219
215
220
void loop()
216
221
{
217
- bool updatedNeeded = esp32FOTA.execHTTPcheck();
218
- if (updatedNeeded) {
219
- esp32FOTA.execOTA();
220
- }
222
+ esp32FOTA.handle();
223
+ // or ...
224
+ // bool updatedNeeded = esp32FOTA.execHTTPcheck();
225
+ // if (updatedNeeded) {
226
+ // esp32FOTA.execOTA();
227
+ // }
221
228
delay(2000);
222
229
}
223
230
224
231
```
225
232
226
233
234
+ ### Zlib/gzip support
235
+
236
+ ⚠️ This feature cannot be used with signature check.
237
+
238
+
239
+ For firmwares compressed with ` pigz ` utility (see , file extension must be ` .zz ` :
240
+
241
+ ``` cpp
242
+ #include < flashz.hpp> // http://github.com/vortigont/esp32-flashz
243
+ #include < esp32FOTA.hpp>
244
+ ```
245
+
246
+ ``` bash
247
+ $ pigz -9kzc esp32-fota-http-2.bin > esp32-fota-http-2.bin.zz
248
+ ```
249
+
250
+ ``` json
251
+ {
252
+ "type" : " esp32-fota-http" ,
253
+ "version" : " 2.5.1" ,
254
+ "url" : " http://192.168.0.100/fota/esp32-fota-http-2.bin.zz"
255
+ }
256
+ ```
257
+
258
+
259
+ For firmwares compressed with ` gzip ` utility, file extension must be ` .gz `
260
+
261
+ ``` cpp
262
+ #include < ESP32-targz.h> // http://github.com/tobozo/ESP32-targz
263
+ #include < esp32FOTA.hpp>
264
+ ```
265
+
266
+ ``` bash
267
+ $ gzip -c esp32-fota-http-2.bin > esp32-fota-http-2.bin.gz
268
+ ```
269
+
270
+ ``` json
271
+ {
272
+ "type" : " esp32-fota-http" ,
273
+ "version" : " 2.5.1" ,
274
+ "url" : " http://192.168.0.100/fota/esp32-fota-http-2.bin.gz"
275
+ }
276
+ ```
277
+
278
+
279
+
280
+
281
+
282
+
227
283
### Root Certificates
228
284
229
285
Certificates and signatures can be stored in different places: any fs::FS filesystem or progmem as const char* .
@@ -433,11 +489,14 @@ On the next update-check the ESP32 will download the `firmware.img` extract the
433
489
[ #92 ] : https://github.com/chrisjoyce911/esp32FOTA/pull/92
434
490
435
491
492
+ ### Libraries
436
493
494
+ This library relies on [ semver.c by h2non] ( https://github.com/h2non/semver.c ) for semantic versioning support. semver.c is licensed under [ MIT] ( https://github.com/h2non/semver.c/blob/master/LICENSE ) .
437
495
438
- ### Libraries
496
+ Optional dependencies (zlib/gzip support):
497
+ * [ esp32-flashz] ( https://github.com/vortigont/esp32-flashz )
498
+ * [ esp32-targz] ( https://github.com/tobozo/ESP32-targz )
439
499
440
- This relies on [ semver.c by h2non] ( https://github.com/h2non/semver.c ) for semantic versioning support. semver.c is licensed under [ MIT] ( https://github.com/h2non/semver.c/blob/master/LICENSE ) .
441
500
442
501
### Thanks to
443
502
@@ -446,4 +505,5 @@ This relies on [semver.c by h2non](https://github.com/h2non/semver.c) for semant
446
505
* @tuan-karma
447
506
* @hpsaturn
448
507
* @tobozo
508
+ * @vortigont
449
509
0 commit comments