PlatformIO Community

Unable to remove LittleFS library from ESPAsync_WiFiManager

For my latest project I would like to use the ESPAsync_WiFiManager. However while building the project I run into the following message.

src/main.cpp:87:30: error: 'LittleFS' was not declared in this scope

So I asked khoih-prog on github Unable to figure out why 'LittleFS' was not declared in this scope · Discussion #96 · khoih-prog/ESPAsync_WiFiManager · GitHub. (build log can also be found in that discussion)

What it comes down to: Since the “LittleFS” library is now integrated it can be removed from the dependency’s (for this and newer versions).

So, as suggested, I comment out the lorol/LittleFS_esp32@>=1.0.6 library in the platform.ini located at .pio\libdeps\esp32dev\ESPAsync_WiFiManager\platformio\platformio.ini. As well as the dependency registration in .pio\libdeps\esp32dev\ESPAsync_WiFiManager\library.json. Next I remove the .pio\libdeps\esp32dev\LittleFS_esp32 folder.

However before I know it, it is re-installed automatically.

I did try this with the Arduino IDE as well and there (if I don’t install the LittleFS library) the code works as expected.

Any suggestions on how I can fix this?

Instead of using

lib_deps = 
  khoih-prog/ESPAsync_WiFiManager@^1.12.2

please try

lib_deps = 
  https://github.com/maxgerhardt/ESPAsync_WiFiManager.git#patch-1

Does it work with that?

First off, sorry for the late reply. The notifications still seem to have some issues.

Anyway I just tried and the result is still an error.

Processing esp32dev (platform: espressif32; board: esp-wrover-kit; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Library Manager: Installing git+https://github.com/maxgerhardt/ESPAsync_WiFiManager.git#patch-1
git version 2.33.0.windows.2
Cloning into 'C:\Users\[Username]\.platformio\.cache\tmp\pkg-installing-s03fnhp6'...
remote: Enumerating objects: 110, done.
remote: Counting objects: 100% (110/110), done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 110 (delta 27), reused 81 (delta 18), pack-reused 0
Receiving objects: 100% (110/110), 799.15 KiB | 7.33 MiB/s, done.
Resolving deltas: 100% (27/27), done.
Library Manager: ESPAsync_WiFiManager@1.12.2+sha.6740276 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing me-no-dev/AsyncTCP @ >=1.1.1
Unpacking  [####################################]  100%
Library Manager: AsyncTCP@1.1.1 has been installed!
Library Manager: Installing me-no-dev/ESP Async WebServer @ >=1.2.3
Unpacking  [####################################]  100%
Library Manager: ESP Async WebServer@1.2.3 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing khoih-prog/ESP_DoubleResetDetector @ >=1.3.1
Unpacking  [####################################]  100%
Library Manager: ESP_DoubleResetDetector@1.3.1 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing lorol/LittleFS_esp32 @ ^1.0.6
Unpacking  [####################################]  100%
Library Manager: LittleFS_esp32@1.0.6 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp-wrover-kit.html
PLATFORM: Espressif 32 (5.0.0) > Espressif ESP-WROVER-KIT
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (ftdi) On-board (ftdi) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20003.220626 (2.0.3)
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESPAsync_WiFiManager @ 1.12.2+sha.6740276
|   |-- AsyncTCP @ 1.1.1
|   |-- ESP Async WebServer @ 1.2.3
|   |   |-- AsyncTCP @ 1.1.1
|   |-- ESP_DoubleResetDetector @ 1.3.1
|   |   |-- LittleFS_esp32 @ 1.0.6
Building in release mode
Compiling .pio\build\esp32dev\src\main.cpp.o
Generating partitions .pio\build\esp32dev\partitions.bin
Compiling .pio\build\esp32dev\lib796\AsyncTCP\AsyncTCP.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\AsyncEventSource.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\AsyncWebSocket.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\SPIFFSEditor.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\WebAuthentication.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\WebHandlers.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\WebRequest.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\WebResponses.cpp.o
Compiling .pio\build\esp32dev\lib3d3\ESP Async WebServer\WebServer.cpp.o
Compiling .pio\build\esp32dev\liba16\LittleFS_esp32\LITTLEFS.cpp.o
Compiling .pio\build\esp32dev\liba16\LittleFS_esp32\esp_littlefs.c.o
.pio/libdeps/esp32dev/LittleFS_esp32/src/LITTLEFS.cpp:17:10: fatal error: vfs_api.h: No such file or directory

*****************************************************************
* Looking for vfs_api.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:vfs_api.h"
* Web  > https://registry.platformio.org/search?q=header:vfs_api.h
*
*****************************************************************

 #include "vfs_api.h"
          ^~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32dev\liba16\LittleFS_esp32\LITTLEFS.cpp.o] Error 1
.pio/libdeps/esp32dev/LittleFS_esp32/src/esp_littlefs.c:19:2: warning: #warning ("Use the built-in LITTLEFS library") [-Wcpp]
 #warning("Use the built-in LITTLEFS library")
  ^~~~~~~
In file included from .pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncEventSource.h:29,
                 from .pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncEventSource.cpp:21:
.pio/libdeps/esp32dev/ESP Async WebServer/src/ESPAsyncWebServer.h:27:10: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

 #include "FS.h"
          ^~~~~~
compilation terminated.
*** [.pio\build\esp32dev\lib3d3\ESP Async WebServer\AsyncEventSource.cpp.o] Error 1
In file included from .pio/libdeps/esp32dev/ESP Async WebServer/src/SPIFFSEditor.h:3,
                 from .pio/libdeps/esp32dev/ESP Async WebServer/src/SPIFFSEditor.cpp:1:
.pio/libdeps/esp32dev/ESP Async WebServer/src/ESPAsyncWebServer.h:27:10: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

 #include "FS.h"
          ^~~~~~
compilation terminated.
In file included from .pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.h:32,
                 from .pio/libdeps/esp32dev/ESP Async WebServer/src/AsyncWebSocket.cpp:22:
.pio/libdeps/esp32dev/ESP Async WebServer/src/ESPAsyncWebServer.h:27:10: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

 #include "FS.h"
          ^~~~~~
compilation terminated.
*** [.pio\build\esp32dev\lib3d3\ESP Async WebServer\SPIFFSEditor.cpp.o] Error 1
*** [.pio\build\esp32dev\lib3d3\ESP Async WebServer\AsyncWebSocket.cpp.o] Error 1
In file included from .pio/libdeps/esp32dev/ESP Async WebServer/src/WebHandlers.cpp:21:
.pio/libdeps/esp32dev/ESP Async WebServer/src/ESPAsyncWebServer.h:27:10: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

 #include "FS.h"
          ^~~~~~
compilation terminated.
In file included from .pio/libdeps/esp32dev/ESP Async WebServer/src/WebRequest.cpp:21:
.pio/libdeps/esp32dev/ESP Async WebServer/src/ESPAsyncWebServer.h:27:10: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

 #include "FS.h"
          ^~~~~~
compilation terminated.
*** [.pio\build\esp32dev\lib3d3\ESP Async WebServer\WebHandlers.cpp.o] Error 1
*** [.pio\build\esp32dev\lib3d3\ESP Async WebServer\WebRequest.cpp.o] Error 1
In file included from .pio/libdeps/esp32dev/ESP Async WebServer/src/WebResponses.cpp:21:
.pio/libdeps/esp32dev/ESP Async WebServer/src/ESPAsyncWebServer.h:27:10: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

 #include "FS.h"
          ^~~~~~
compilation terminated.
*** [.pio\build\esp32dev\lib3d3\ESP Async WebServer\WebResponses.cpp.o] Error 1
In file included from .pio/libdeps/esp32dev/ESP Async WebServer/src/WebServer.cpp:21:
.pio/libdeps/esp32dev/ESP Async WebServer/src/ESPAsyncWebServer.h:27:10: fatal error: FS.h: No such file or directory

************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:FS.h"
* Web  > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************

 #include "FS.h"
          ^~~~~~
compilation terminated.
*** [.pio\build\esp32dev\lib3d3\ESP Async WebServer\WebServer.cpp.o] Error 1
======================================================================================= [FAILED] Took 11.13 seconds =======================================================================================

Did you ever get this library working in platformio. I am also looking for a wifi manager but unable to compile the examples with ESPAsync_WifiManager to even test with my ESP32-WROOOM-32D. It complains about LittleFS was not declared in this scope.

I didn’t test it (yet) but the creator of the library just added a comment.

From there it is linked to other comments. So, besides removing LittleFS_esp32@>=1.0.6 from the platformio.ini in ESPAsync_WiFiManager it should also be removed from ESP_DoubleResetDetector.

Let us know if it works. Tomorrow I hope I have time to test it on my side.

@azsoccerpop, for your information,
The patchfiles to get Async_ConfigOnDoubleReset.ino to work can be found in the original github discussion.