Skip to content

Commit 316f3eb

Browse files
committed
Updated Readme
1 parent e38b722 commit 316f3eb

File tree

1 file changed

+71
-11
lines changed

1 file changed

+71
-11
lines changed

README.md

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,15 @@ A single JSON file can also contain several versions of a single firmware type:
9595
{
9696
"type":"esp32-fota-http",
9797
"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"
99100
}
100101
]
101102
```
102103

103104

105+
106+
104107
#### Filesystem image (spiffs/littlefs)
105108

106109
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()
173176

174177
void loop()
175178
{
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+
// }
180185
delay(2000);
181186
}
182187
```
@@ -214,16 +219,67 @@ void setup()
214219
215220
void loop()
216221
{
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+
// }
221228
delay(2000);
222229
}
223230
224231
```
225232

226233

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+
227283
### Root Certificates
228284

229285
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
433489
[#92]: https://github.com/chrisjoyce911/esp32FOTA/pull/92
434490

435491

492+
### Libraries
436493

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).
437495

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)
439499

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).
441500

442501
### Thanks to
443502

@@ -446,4 +505,5 @@ This relies on [semver.c by h2non](https://github.com/h2non/semver.c) for semant
446505
* @tuan-karma
447506
* @hpsaturn
448507
* @tobozo
508+
* @vortigont
449509

0 commit comments

Comments
 (0)