Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 3c72285

Browse files
authored
v1.7.6 to autodetect ESP32 core version
### Releases v1.7.6 1. Auto detect ESP32 core and use either built-in LittleFS or [LITTLEFS](https://github.com/lorol/LITTLEFS) library 2. Update `library.json` to use new `headers` for PIO
1 parent d97b5f1 commit 3c72285

File tree

32 files changed

+394
-158
lines changed

32 files changed

+394
-158
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.16) or Platform.io version
18-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.0)
18+
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.1)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.16
3030
ESP8266 Core Version 3.0.2
3131
OS: Ubuntu 20.04 LTS
32-
Linux Inspiron 5.4.0-86-generic #97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux Inspiron 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered an endless loop while trying to connect to Local WiFi.

README.md

Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ It's using a web ConfigPortal, served from the `ESP32 / ESP8266`, and operating
219219

220220
1. [`Arduino IDE 1.8.16+` for Arduino](https://www.arduino.cc/en/Main/Software)
221221
2. [`ESP8266 Core 3.0.2+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/). To use ESP8266 core 2.7.1+ for LittleFS.
222-
3. [`ESP32 Core 2.0.0+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
223-
4. [`ESP_DoubleResetDetector v1.1.2+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) if using DRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector). Use v1.1.0+ if using LittleFS for ESP32.
224-
5. [`ESP_MultiResetDetector v1.1.2+`](https://github.com/khoih-prog/ESP_MultiResetDetector) if using MRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_MultiResetDetector.svg?)](https://www.ardu-badge.com/ESP_MultiResetDetector).
225-
6. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [esp32 core v1.0.6](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS).
222+
3. [`ESP32 Core 2.0.1+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
223+
4. [`ESP_DoubleResetDetector v1.2.0+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) if using DRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector). Use v1.1.0+ if using LittleFS for ESP32.
224+
5. [`ESP_MultiResetDetector v1.2.0+`](https://github.com/khoih-prog/ESP_MultiResetDetector) if using MRD feature. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_MultiResetDetector.svg?)](https://www.ardu-badge.com/ESP_MultiResetDetector).
225+
6. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS with ESP32 core v1.0.4-. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [ESP32 core v1.0.6+](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS) and you don't need to install it if using ESP32 core v1.0.6+
226226

227227
---
228228

@@ -388,13 +388,25 @@ then connect WebBrowser to configurable ConfigPortal IP address, default is 192.
388388
// Use LittleFS
389389
#include "FS.h"
390390

391-
// The library will be depreciated after being merged to future major Arduino esp32 core release 2.x
392-
// At that time, just remove this library inclusion
393-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
391+
// Check cores/esp32/esp_arduino_version.h
392+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
393+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
394+
// The library has been merged into esp32 core from release 1.0.6
395+
#include <LittleFS.h>
396+
397+
FS* filesystem = &LittleFS;
398+
#define FileFS LittleFS
399+
#define FS_Name "LittleFS"
400+
#else
401+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
402+
// The library has been merged into esp32 core from release 1.0.6
403+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
404+
405+
FS* filesystem = &LITTLEFS;
406+
#define FileFS LITTLEFS
407+
#define FS_Name "LittleFS"
408+
#endif
394409

395-
FS* filesystem = &LITTLEFS;
396-
#define FileFS LITTLEFS
397-
#define FS_Name "LittleFS"
398410
#elif USE_SPIFFS
399411
#include <SPIFFS.h>
400412
FS* filesystem = &SPIFFS;
@@ -2097,7 +2109,7 @@ ESP_wifiManager.setRemoveDuplicateAPs(false);
20972109
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
20982110
#endif
20992111

2100-
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.5"
2112+
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.6"
21012113

21022114
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
21032115
#define _WIFIMGR_LOGLEVEL_ 3
@@ -2135,12 +2147,25 @@ ESP_wifiManager.setRemoveDuplicateAPs(false);
21352147
// Use LittleFS
21362148
#include "FS.h"
21372149

2138-
// The library has been merged into esp32 core release 1.0.6
2139-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
2150+
// Check cores/esp32/esp_arduino_version.h
2151+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
2152+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
2153+
// The library has been merged into esp32 core from release 1.0.6
2154+
#include <LittleFS.h>
2155+
2156+
FS* filesystem = &LittleFS;
2157+
#define FileFS LittleFS
2158+
#define FS_Name "LittleFS"
2159+
#else
2160+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
2161+
// The library has been merged into esp32 core from release 1.0.6
2162+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
2163+
2164+
FS* filesystem = &LITTLEFS;
2165+
#define FileFS LITTLEFS
2166+
#define FS_Name "LittleFS"
2167+
#endif
21402168

2141-
FS* filesystem = &LITTLEFS;
2142-
#define FileFS LITTLEFS
2143-
#define FS_Name "LittleFS"
21442169
#elif USE_SPIFFS
21452170
#include <SPIFFS.h>
21462171
FS* filesystem = &SPIFFS;
@@ -3442,7 +3467,7 @@ This is terminal debug output when running [ConfigOnSwitchFS_MQTT_Ptr](examples/
34423467
34433468
```
34443469
Starting ConfigOnSwichFS_MQTT_Ptr using LittleFS on ESP8266_NODEMCU_ESP12E
3445-
ESP_WiFiManager v1.7.5
3470+
ESP_WiFiManager v1.7.6
34463471
Configuration file not found
34473472
Failed to read configuration file, using default values
34483473
[WM] RFC925 Hostname = ConfigOnSwichFS-MQTT
@@ -3554,8 +3579,8 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](examples/ESP3
35543579
35553580
```cpp
35563581
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using SPIFFS on ESP32_DEV
3557-
ESP_WiFiManager v1.7.5
3558-
ESP_DoubleResetDetector v1.1.2
3582+
ESP_WiFiManager v1.7.6
3583+
ESP_DoubleResetDetector v1.2.0
35593584
FS File: /ConfigSW.json, size: 150B
35603585
FS File: /CanadaFlag_1.png, size: 40.25KB
35613586
FS File: /CanadaFlag_2.png, size: 8.12KB
@@ -3619,8 +3644,8 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](examples/ESP3
36193644

36203645
```
36213646
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using LittleFS on ESP32_DEV
3622-
ESP_WiFiManager v1.7.5
3623-
ESP_DoubleResetDetector v1.1.2
3647+
ESP_WiFiManager v1.7.6
3648+
ESP_DoubleResetDetector v1.2.0
36243649
FS File: /CanadaFlag_1.png, size: 40.25KB
36253650
FS File: /CanadaFlag_2.png, size: 8.12KB
36263651
FS File: /CanadaFlag_3.jpg, size: 10.89KB
@@ -3678,8 +3703,8 @@ This is terminal debug output when running [ConfigOnDRD_FS_MQTT_Ptr_Complex](exa
36783703

36793704
```
36803705
Starting ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP32_DEV
3681-
ESP_WiFiManager v1.7.5
3682-
ESP_DoubleResetDetector v1.1.2
3706+
ESP_WiFiManager v1.7.6
3707+
ESP_DoubleResetDetector v1.2.0
36833708
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
36843709
Config File successfully parsed
36853710
LittleFS Flag read = 0xd0d04321
@@ -3721,8 +3746,8 @@ WWWW WTWWWW WWTWWW WWWTWW WWWWTW WWWWW
37213746

37223747
```
37233748
Starting ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP32_DEV
3724-
ESP_WiFiManager v1.7.5
3725-
ESP_DoubleResetDetector v1.1.2
3749+
ESP_WiFiManager v1.7.6
3750+
ESP_DoubleResetDetector v1.2.0
37263751
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
37273752
Config File successfully parsed
37283753
LittleFS Flag read = 0xd0d01234
@@ -3806,8 +3831,8 @@ This is terminal debug output when running [ConfigOnDRD_FS_MQTT_Ptr_Complex](exa
38063831

38073832
```
38083833
Starting ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP8266_NODEMCU_ESP12E
3809-
ESP_WiFiManager v1.7.5
3810-
ESP_DoubleResetDetector v1.1.2
3834+
ESP_WiFiManager v1.7.6
3835+
ESP_DoubleResetDetector v1.2.0
38113836
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
38123837
Config File successfully parsed
38133838
LittleFS Flag read = 0xd0d04321
@@ -3846,8 +3871,8 @@ TWWWW WTWWWW WWTWWW WWWTWW WWWWTW WWWWW
38463871

38473872
```
38483873
Starting ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP8266_NODEMCU_ESP12E
3849-
ESP_WiFiManager v1.7.5
3850-
ESP_DoubleResetDetector v1.1.2
3874+
ESP_WiFiManager v1.7.6
3875+
ESP_DoubleResetDetector v1.2.0
38513876
{"AIO_KEY_Label":"aio_key","AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name"}
38523877
Config File successfully parsed
38533878
LittleFS Flag read = 0xd0d01234
@@ -3923,8 +3948,8 @@ This is terminal debug output when running [ConfigOnDoubleReset](examples/Config
39233948

39243949
```
39253950
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32S2_DEV
3926-
ESP_WiFiManager v1.7.5
3927-
ESP_DoubleResetDetector v1.1.2
3951+
ESP_WiFiManager v1.7.6
3952+
ESP_DoubleResetDetector v1.2.0
39283953
[WM] RFC925 Hostname = ConfigOnDoubleReset
39293954
[WM] setAPStaticIPConfig
39303955
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
@@ -3973,8 +3998,8 @@ This is terminal debug output when running [ConfigOnDoubleReset](examples/Config
39733998

39743999
```
39754000
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
3976-
ESP_WiFiManager v1.7.5
3977-
ESP_DoubleResetDetector v1.1.2
4001+
ESP_WiFiManager v1.7.6
4002+
ESP_DoubleResetDetector v1.2.0
39784003
[WM] RFC925 Hostname = ConfigOnDoubleReset
39794004
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
39804005
ESP Self-Stored: SSID = HueNet1, Pass = password
@@ -4083,8 +4108,8 @@ Local Date/Time: Thu May 6 21:29:18 2021
40834108

40844109
```
40854110
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
4086-
ESP_WiFiManager v1.7.5
4087-
ESP_DoubleResetDetector v1.1.2
4111+
ESP_WiFiManager v1.7.6
4112+
ESP_DoubleResetDetector v1.2.0
40884113
[WM] RFC925 Hostname = ConfigOnDoubleReset
40894114
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
40904115
ESP Self-Stored: SSID = HueNet1, Pass = password
@@ -4134,8 +4159,8 @@ This is terminal debug output when running [ConfigOnDoubleReset](examples/Config
41344159

41354160
```
41364161
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32S2_DEV
4137-
ESP_WiFiManager v1.7.5
4138-
ESP_DoubleResetDetector v1.1.2
4162+
ESP_WiFiManager v1.7.6
4163+
ESP_DoubleResetDetector v1.2.0
41394164
[WM] RFC925 Hostname = ConfigOnDoubleReset
41404165
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
41414166
ESP Self-Stored: SSID = HueNet1, Pass = password
@@ -4280,8 +4305,8 @@ Local Date/Time: Thu May 6 21:29:18 2021
42804305

42814306
```
42824307
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32S2_DEV
4283-
ESP_WiFiManager v1.7.5
4284-
ESP_DoubleResetDetector v1.1.2
4308+
ESP_WiFiManager v1.7.6
4309+
ESP_DoubleResetDetector v1.2.0
42854310
[WM] RFC925 Hostname = ConfigOnDoubleReset
42864311
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
42874312
ESP Self-Stored: SSID = HueNet1, Pass = password
@@ -4333,8 +4358,8 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](examples/ESP3
43334358

43344359
```
43354360
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using SPIFFS on ESP32C3_DEV
4336-
ESP_WiFiManager v1.7.5
4337-
ESP_DoubleResetDetector v1.1.2
4361+
ESP_WiFiManager v1.7.6
4362+
ESP_DoubleResetDetector v1.2.0
43384363
FS File: wm_cp.dat, size: 4B
43394364
FS File: wm_cp.bak, size: 4B
43404365
FS File: wmssl_conf.dat, size: 376B

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
## Table of Contents
1414

1515
* [Changelog](#changelog)
16+
* [Releases v1.7.6](#releases-v176)
1617
* [Releases v1.7.5](#releases-v175)
1718
* [Releases v1.7.4](#releases-v174)
1819
* [Releases v1.7.3](#releases-v173)
@@ -46,6 +47,11 @@
4647

4748
## Changelog
4849

50+
### Releases v1.7.6
51+
52+
1. Auto detect ESP32 core and use either built-in LittleFS or [LITTLEFS](https://github.com/lorol/LITTLEFS) library
53+
2. Update `library.json` to use new `headers` for PIO
54+
4955
### Releases v1.7.5
5056

5157
1. Update `platform.ini` and `library.json` to use original `khoih-prog` instead of `khoih.prog` after PIO fix

examples/AutoConnect/AutoConnect.ino

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
1616
#endif
1717

18-
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.3"
18+
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.6"
1919

2020
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2121
#define _WIFIMGR_LOGLEVEL_ 3
@@ -44,12 +44,25 @@
4444
// Use LittleFS
4545
#include "FS.h"
4646

47-
// The library has been merged into esp32 core release 1.0.6
48-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
47+
// Check cores/esp32/esp_arduino_version.h
48+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
49+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
50+
// The library has been merged into esp32 core from release 1.0.6
51+
#include <LittleFS.h>
52+
53+
FS* filesystem = &LittleFS;
54+
#define FileFS LittleFS
55+
#define FS_Name "LittleFS"
56+
#else
57+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
58+
// The library has been merged into esp32 core from release 1.0.6
59+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
60+
61+
FS* filesystem = &LITTLEFS;
62+
#define FileFS LITTLEFS
63+
#define FS_Name "LittleFS"
64+
#endif
4965

50-
FS* filesystem = &LITTLEFS;
51-
#define FileFS LITTLEFS
52-
#define FS_Name "LittleFS"
5366
#elif USE_SPIFFS
5467
#include <SPIFFS.h>
5568
FS* filesystem = &SPIFFS;

examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
1616
#endif
1717

18-
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.3"
18+
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.6"
1919

2020
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2121
#define _WIFIMGR_LOGLEVEL_ 3
@@ -46,12 +46,25 @@
4646
// Use LittleFS
4747
#include "FS.h"
4848

49-
// The library has been merged into esp32 core release 1.0.6
50-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
49+
// Check cores/esp32/esp_arduino_version.h
50+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
51+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
52+
// The library has been merged into esp32 core from release 1.0.6
53+
#include <LittleFS.h>
54+
55+
FS* filesystem = &LittleFS;
56+
#define FileFS LittleFS
57+
#define FS_Name "LittleFS"
58+
#else
59+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
60+
// The library has been merged into esp32 core from release 1.0.6
61+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
62+
63+
FS* filesystem = &LITTLEFS;
64+
#define FileFS LITTLEFS
65+
#define FS_Name "LittleFS"
66+
#endif
5167

52-
FS* filesystem = &LITTLEFS;
53-
#define FileFS LITTLEFS
54-
#define FS_Name "LittleFS"
5568
#elif USE_SPIFFS
5669
#include <SPIFFS.h>
5770
FS* filesystem = &SPIFFS;

examples/AutoConnectWithFeedback/AutoConnectWithFeedback.ino

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
1616
#endif
1717

18-
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.3"
18+
#define ESP_WIFIMANAGER_VERSION_MIN_TARGET "ESP_WiFiManager v1.7.6"
1919

2020
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
2121
#define _WIFIMGR_LOGLEVEL_ 3
@@ -44,12 +44,25 @@
4444
// Use LittleFS
4545
#include "FS.h"
4646

47-
// The library has been merged into esp32 core release 1.0.6
48-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
47+
// Check cores/esp32/esp_arduino_version.h
48+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
49+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
50+
// The library has been merged into esp32 core from release 1.0.6
51+
#include <LittleFS.h>
52+
53+
FS* filesystem = &LittleFS;
54+
#define FileFS LittleFS
55+
#define FS_Name "LittleFS"
56+
#else
57+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
58+
// The library has been merged into esp32 core from release 1.0.6
59+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
60+
61+
FS* filesystem = &LITTLEFS;
62+
#define FileFS LITTLEFS
63+
#define FS_Name "LittleFS"
64+
#endif
4965

50-
FS* filesystem = &LITTLEFS;
51-
#define FileFS LITTLEFS
52-
#define FS_Name "LittleFS"
5366
#elif USE_SPIFFS
5467
#include <SPIFFS.h>
5568
FS* filesystem = &SPIFFS;

0 commit comments

Comments
 (0)