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

Commit bc845f5

Browse files
authored
v1.9.5 to autodetect ESP32 core version
### Releases v1.9.5 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 5b7c443 commit bc845f5

File tree

32 files changed

+424
-159
lines changed

32 files changed

+424
-159
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 xy-Inspiron-3593 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 xy-Inspiron-3593 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: 71 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ This [**ESPAsync_WiFiManager** library](https://github.com/khoih-prog/ESPAsync_W
196196

197197
1. [`Arduino IDE 1.8.16+` for Arduino](https://www.arduino.cc/en/Main/Software)
198198
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/)
199-
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/)
199+
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/)
200200
4. [`ESPAsyncWebServer v1.2.3+`](https://github.com/me-no-dev/ESPAsyncWebServer) for all ESP32/ESP8266-based boards. You have to use the latest [forked ESPAsyncWebServer](https://github.com/khoih-prog/ESPAsyncWebServer) if the PR [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](https://github.com/me-no-dev/ESPAsyncWebServer/pull/970) hasn't been merged.
201201
5. [`ESPAsyncTCP v1.2.2+`](https://github.com/me-no-dev/ESPAsyncTCP) for ESP8266-based boards.
202202
6. [`AsyncTCP v1.1.1+`](https://github.com/me-no-dev/AsyncTCP) for ESP32-based boards
203-
7. [`ESP_DoubleResetDetector v1.1.1+`](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 EP32.
204-
8. [`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).
203+
7. [`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 EP32.
204+
8. [`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+
205205

206206
---
207207

@@ -264,7 +264,7 @@ to
264264
#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
265265
```
266266

267-
It's advisable to use the latest [`LittleFS_esp32 v1.0.5+`](https://github.com/lorol/LITTLEFS) to avoid the issue.
267+
It's advisable to use the latest [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) to avoid the issue.
268268

269269
Thanks to [Roshan](https://github.com/solroshan) to report the issue in [Error esp_littlefs.c 'utime_p'](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/28)
270270

@@ -507,13 +507,25 @@ WM_Config WM_config;
507507
// Use LittleFS
508508
#include "FS.h"
509509

510-
// The library will be depreciated after being merged to future major Arduino esp32 core release 2.x
511-
// At that time, just remove this library inclusion
512-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
510+
// Check cores/esp32/esp_arduino_version.h
511+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
512+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
513+
// The library has been merged into esp32 core from release 1.0.6
514+
#include <LittleFS.h>
515+
516+
FS* filesystem = &LittleFS;
517+
#define FileFS LittleFS
518+
#define FS_Name "LittleFS"
519+
#else
520+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
521+
// The library has been merged into esp32 core from release 1.0.6
522+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
523+
524+
FS* filesystem = &LITTLEFS;
525+
#define FileFS LITTLEFS
526+
#define FS_Name "LittleFS"
527+
#endif
513528

514-
FS* filesystem = &LITTLEFS;
515-
#define FileFS LITTLEFS
516-
#define FS_Name "LittleFS"
517529
#elif USE_SPIFFS
518530
#include <SPIFFS.h>
519531
FS* filesystem = &SPIFFS;
@@ -2083,7 +2095,7 @@ ESPAsync_wifiManager.setRemoveDuplicateAPs(false);
20832095
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
20842096
#endif
20852097

2086-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.4"
2098+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.9.5"
20872099

20882100
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
20892101
#define _ESPASYNC_WIFIMGR_LOGLEVEL_ 3
@@ -2118,12 +2130,25 @@ ESPAsync_wifiManager.setRemoveDuplicateAPs(false);
21182130
// Use LittleFS
21192131
#include "FS.h"
21202132

2121-
// The library has been merged into esp32 core release 1.0.6
2122-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
2133+
// Check cores/esp32/esp_arduino_version.h
2134+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
2135+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
2136+
// The library has been merged into esp32 core from release 1.0.6
2137+
#include <LittleFS.h>
2138+
2139+
FS* filesystem = &LittleFS;
2140+
#define FileFS LittleFS
2141+
#define FS_Name "LittleFS"
2142+
#else
2143+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
2144+
// The library has been merged into esp32 core from release 1.0.6
2145+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
2146+
2147+
FS* filesystem = &LITTLEFS;
2148+
#define FileFS LITTLEFS
2149+
#define FS_Name "LittleFS"
2150+
#endif
21232151

2124-
FS* filesystem = &LITTLEFS;
2125-
#define FileFS LITTLEFS
2126-
#define FS_Name "LittleFS"
21272152
#elif USE_SPIFFS
21282153
#include <SPIFFS.h>
21292154
FS* filesystem = &SPIFFS;
@@ -3435,8 +3460,8 @@ This is terminal debug output when running [Async_ConfigOnDRD_FS_MQTT_Ptr_Medium
34353460
34363461
```
34373462
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP32_DEV
3438-
ESPAsync_WiFiManager v1.9.4
3439-
ESP_DoubleResetDetector v1.1.1
3463+
ESPAsync_WiFiManager v1.9.5
3464+
ESP_DoubleResetDetector v1.2.0
34403465
Config File not found
34413466
Can't read Config File, using default values
34423467
LittleFS Flag read = 0xd0d01234
@@ -3454,8 +3479,8 @@ Opening Configuration Portal. No timeout : DRD or No stored Credentials..
34543479
34553480
```
34563481
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Medium using LittleFS on ESP32_DEV
3457-
ESPAsync_WiFiManager v1.9.4
3458-
ESP_DoubleResetDetector v1.1.1
3482+
ESPAsync_WiFiManager v1.9.5
3483+
ESP_DoubleResetDetector v1.2.0
34593484
Config File not found
34603485
Can't read Config File, using default values
34613486
LittleFS Flag read = 0xd0d04321
@@ -3542,8 +3567,8 @@ This is terminal debug output when running [Async_ConfigOnDRD_FS_MQTT_Ptr_Comple
35423567
35433568
```
35443569
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP8266_NODEMCU_ESP12E
3545-
ESPAsync_WiFiManager v1.9.4
3546-
ESP_DoubleResetDetector Version v1.1.1
3570+
ESPAsync_WiFiManager v1.9.5
3571+
ESP_DoubleResetDetector v1.2.0
35473572
{"AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name","AIO_KEY_Label":"aio_key"}
35483573
Config File successfully parsed
35493574
LittleFS Flag read = 0xd0d04321
@@ -3582,8 +3607,8 @@ TWWWW WTWWW
35823607
35833608
```
35843609
Starting Async_ConfigOnDRD_FS_MQTT_Ptr_Complex using LittleFS on ESP8266_NODEMCU_ESP12E
3585-
ESPAsync_WiFiManager v1.9.4
3586-
ESP_DoubleResetDetector Version v1.1.1
3610+
ESPAsync_WiFiManager v1.9.5
3611+
ESP_DoubleResetDetector v1.2.0
35873612
{"AIO_SERVER_Label":"io.adafruit.com","AIO_SERVERPORT_Label":"1883","AIO_USERNAME_Label":"user_name","AIO_KEY_Label":"aio_key"}
35883613
Config File successfully parsed
35893614
LittleFS Flag read = 0xd0d01234
@@ -3672,8 +3697,8 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/
36723697
36733698
```cpp
36743699
Starting Async_ConfigOnDoubleReset with DoubleResetDetect using SPIFFS on ESP32_DEV
3675-
ESPAsync_WiFiManager v1.9.4
3676-
ESP_DoubleResetDetector v1.1.1
3700+
ESPAsync_WiFiManager v1.9.5
3701+
ESP_DoubleResetDetector v1.2.0
36773702
[WM] RFC925 Hostname = ConfigOnDoubleReset
36783703
[WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS
36793704
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
@@ -3731,8 +3756,8 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/
37313756

37323757
```cpp
37333758
Starting Async_ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP8266_NODEMCU_ESP12E
3734-
ESPAsync_WiFiManager v1.9.4
3735-
ESP_DoubleResetDetector v1.1.1
3759+
ESPAsync_WiFiManager v1.9.5
3760+
ESP_DoubleResetDetector v1.2.0
37363761
[WM] RFC925 Hostname = ConfigOnDoubleReset
37373762
[WM] setSTAStaticIPConfig for USE_CONFIGURABLE_DNS
37383763
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
@@ -3791,8 +3816,8 @@ This is terminal debug output when running [Async_ESP_FSWebServer_DRD](examples/
37913816
37923817
```cpp
37933818
Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU_ESP12E
3794-
ESPAsync_WiFiManager v1.9.4
3795-
ESP_DoubleResetDetector v1.1.1
3819+
ESPAsync_WiFiManager v1.9.5
3820+
ESP_DoubleResetDetector v1.2.0
37963821
Opening / directory
37973822
FS File: CanadaFlag_1.png, size: 40.25KB
37983823
FS File: CanadaFlag_2.png, size: 8.12KB
@@ -3869,8 +3894,8 @@ This is terminal debug output when running [Async_ESP32_FSWebServer_DRD](example
38693894

38703895
```
38713896
Starting Async_ESP32_FSWebServer_DRD using LittleFS on ESP32_DEV
3872-
ESPAsync_WiFiManager v1.9.4
3873-
ESP_DoubleResetDetector v1.1.1
3897+
ESPAsync_WiFiManager v1.9.5
3898+
ESP_DoubleResetDetector v1.2.0
38743899
FS File: /CanadaFlag_1.png, size: 40.25KB
38753900
FS File: /CanadaFlag_2.png, size: 8.12KB
38763901
FS File: /CanadaFlag_3.jpg, size: 10.89KB
@@ -3980,8 +4005,8 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset](examples/
39804005

39814006
```
39824007
Starting Async_ConfigOnDoubleReset using LittleFS on ESP32S2_DEV
3983-
ESPAsync_WiFiManager v1.9.4
3984-
ESP_DoubleResetDetector v1.1.1
4008+
ESPAsync_WiFiManager v1.9.5
4009+
ESP_DoubleResetDetector v1.2.0
39854010
ESP Self-Stored: SSID = HueNet1, Pass = 12345678
39864011
[WM] * Add SSID = HueNet1 , PW = 12345678
39874012
Got ESP Self-Stored Credentials. Timeout 120s for Config Portal
@@ -4017,8 +4042,8 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset_TZ](exampl
40174042

40184043
```
40194044
Starting Async_ConfigOnDoubleReset_TZ using LittleFS on ESP32_DEV
4020-
ESPAsync_WiFiManager v1.9.4
4021-
ESP_DoubleResetDetector v1.1.1
4045+
ESPAsync_WiFiManager v1.9.5
4046+
ESP_DoubleResetDetector v1.2.0
40224047
ESP Self-Stored: SSID = HueNet1, Pass = password
40234048
[WM] * Add SSID = HueNet1 , PW = password
40244049
Got ESP Self-Stored Credentials. Timeout 120s for Config Portal
@@ -4061,8 +4086,8 @@ Local Date/Time: Sat May 1 00:17:30 2021
40614086

40624087
```
40634088
Starting Async_ConfigOnDoubleReset_TZ using LittleFS on ESP32_DEV
4064-
ESPAsync_WiFiManager v1.9.4
4065-
ESP_DoubleResetDetector v1.1.1
4089+
ESPAsync_WiFiManager v1.9.5
4090+
ESP_DoubleResetDetector v1.2.0
40664091
ESP Self-Stored: SSID = HueNet1, Pass = password
40674092
[WM] * Add SSID = HueNet1 , PW = password
40684093
Got ESP Self-Stored Credentials. Timeout 120s for Config Portal
@@ -4108,8 +4133,8 @@ This is terminal debug output when running [Async_ESP_FSWebServer_DRD](examples/
41084133

41094134
```
41104135
Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU_ESP12E
4111-
ESPAsync_WiFiManager v1.9.4
4112-
ESP_DoubleResetDetector v1.1.1
4136+
ESPAsync_WiFiManager v1.9.5
4137+
ESP_DoubleResetDetector v1.2.0
41134138
Opening / directory
41144139
FS File: drd.dat, size: 4B
41154140
FS File: wifi_cred.dat, size: 334B
@@ -4181,8 +4206,8 @@ Local Date/Time: Sat May 1 03:12:54 2021
41814206

41824207
```
41834208
Starting Async_ESP_FSWebServer_DRD using LittleFS on ESP8266_NODEMCU_ESP12E
4184-
ESPAsync_WiFiManager v1.9.4
4185-
ESP_DoubleResetDetector v1.1.1
4209+
ESPAsync_WiFiManager v1.9.5
4210+
ESP_DoubleResetDetector v1.2.0
41864211
Opening / directory
41874212
FS File: drd.dat, size: 4B
41884213
FS File: wifi_cred.dat, size: 334B
@@ -4240,8 +4265,8 @@ This is terminal debug output when running [Async_ConfigOnDoubleReset_TZ](exampl
42404265

42414266
```
42424267
Starting Async_ConfigOnDoubleReset_TZ using SPIFFS on ESP32C3_DEV
4243-
ESPAsync_WiFiManager v1.9.4
4244-
ESP_DoubleResetDetector v1.1.1
4268+
ESPAsync_WiFiManager v1.9.5
4269+
ESP_DoubleResetDetector v1.2.0
42454270
ESP Self-Stored: SSID = HueNet1, Pass = 12345678
42464271
[WM] * Add SSID = HueNet1 , PW = 12345678
42474272
Got ESP Self-Stored Credentials. Timeout 120s for Config Portal
@@ -4332,6 +4357,7 @@ Submit issues to: [ESPAsync_WiFiManager issues](https://github.com/khoih-prog/ES
43324357
14. Thanks to [yiancar](https://github.com/yiancar) to report the issue and propose a fix in [In AP, DNS server always redirects to 192.168.4.1 no mater what APStaticIP is set to. #58](https://github.com/khoih-prog/ESP_WiFiManager/issues/58) leading to v1.7.1
43334358
15. Thanks to [Stephen Lavelle](https://github.com/increpare) and [Ben Peart](https://github.com/benpeart) for requesting enhancement in [_timezoneName never getting set? #51](https://github.com/khoih-prog/ESP_WiFiManager/issues/51) and [How to retrieve timezone? #51](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/51) leading to new v1.8.0
43344359
16. Thanks to [eth0up](https://github.com/eth0up) to make the PR [Add support for Wifi hidden SSID scanning. #66](https://github.com/khoih-prog/ESP_WiFiManager/pull/66) leading to v1.7.4
4360+
17. Thanks to [Francisco Trillo](https://github.com/Frtrillo) for reporting [Not working with ESP32 and Core 2.0.1 (or 2.0.0+) #74](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/74) leading to v1.9.5
43354361

43364362

43374363
<table>
@@ -4361,6 +4387,7 @@ Submit issues to: [ESPAsync_WiFiManager issues](https://github.com/khoih-prog/ES
43614387
</tr>
43624388
<tr>
43634389
<td align="center"><a href="https://github.com/eth0up"><img src="https://github.com/eth0up.png" width="100px;" alt="eth0up"/><br /><sub><b>eth0up</b></sub></a><br /></td>
4390+
<td align="center"><a href="https://github.com/Frtrillo"><img src="https://github.com/Frtrillo.png" width="100px;" alt="Frtrillo"/><br /><sub><b>Francisco Trillo</b></sub></a><br /></td>
43644391
</tr>
43654392
</table>
43664393

changelog.md

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

1414
* [Changelog](#changelog)
15+
* [Releases v1.9.5](#releases-v195)
1516
* [Releases v1.9.4](#releases-v194)
1617
* [Releases v1.9.3](#releases-v193)
1718
* [Releases v1.9.2](#releases-v192)
@@ -41,6 +42,12 @@
4142

4243
## Changelog
4344

45+
### Releases v1.9.5
46+
47+
1. Auto detect ESP32 core and use either built-in LittleFS or [LITTLEFS](https://github.com/lorol/LITTLEFS) library
48+
2. Update `library.json` to use new `headers` for PIO
49+
50+
4451
### Releases v1.9.4
4552

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

examples/Async_AutoConnect/Async_AutoConnect.ino

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,25 @@
4747
// Use LittleFS
4848
#include "FS.h"
4949

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

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

examples/Async_AutoConnectWithFSParameters/Async_AutoConnectWithFSParameters.ino

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,25 @@
5050
// Use LittleFS
5151
#include "FS.h"
5252

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

56-
FS* filesystem = &LITTLEFS;
57-
#define FileFS LITTLEFS
58-
#define FS_Name "LittleFS"
5972
#elif USE_SPIFFS
6073
#include <SPIFFS.h>
6174
FS* filesystem = &SPIFFS;

examples/Async_AutoConnectWithFSParametersAndCustomIP/Async_AutoConnectWithFSParametersAndCustomIP.ino

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,25 @@
5151
// Use LittleFS
5252
#include "FS.h"
5353

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

57-
FS* filesystem = &LITTLEFS;
58-
#define FileFS LITTLEFS
59-
#define FS_Name "LittleFS"
6073
#elif USE_SPIFFS
6174
#include <SPIFFS.h>
6275
FS* filesystem = &SPIFFS;

0 commit comments

Comments
 (0)