khoih-prog / ESP_WiFiManager_Lite

Light-Weight MultiWiFi/Credentials Manager for ESP32 (including ESP32-S2 and ESP32-C3) and ESP8266 boards boards. Powerful-yet-simple-to-use feature to enable adding dynamic custom parameters. paragraph=Library to configure MultiWiFi/Credentials at runtime for ESP32/ESP8266 boards. You can also specify DHCP HostName, static AP and STA IP. Use much less memory compared to full-fledge WiFiManager. Config Portal will be auto-adjusted to match the number of dynamic custom parameters. Optional default Credentials to be autoloaded into Config Portal to use or change instead of manually input. Credentials are saved in LittleFS, SPIFFS or EEPROM. New powerful-yet-simple-to-use feature to enable adding dynamic custom parameters from sketch and input using the same Config Portal. Double or MultiDetectDetector as well as Virtual Switches feature permits entering Config Portal as requested.
MIT License
49 stars 15 forks source link

fatal error: vfs_api.h: No such file or directory #11

Closed mahboud closed 2 years ago

mahboud commented 2 years ago

I believe I followed the steps to install, but when I go to build I get this error:

Compiling .pio/build/esp32-c3-devkitm-1/lib5f6/LittleFS_esp32/LITTLEFS.cpp.o
.pio/libdeps/esp32-c3-devkitm-1/LittleFS_esp32/src/LITTLEFS.cpp:17:10: fatal error: vfs_api.h: No such file or directory

My platform.ini:

[env:esp32-c3-devkitm-1]
platform = https://github.com/Jason2866/platform-espressif32.git
board = esp32-c3-devkitm-1
framework = arduino
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
monitor_speed = 115200
monitor_port = /dev/cu.usbserial-1420
upload_port = /dev/cu.usbserial-1420
build_flags = -D c3_devkitm_01=1
lib_deps = 
    HTTPUpdate @ ^1.3
    khoih-prog/ESP_WiFiManager_Lite@^1.8.2
khoih-prog commented 2 years ago

First try to compile / run your code in Arduino IDE to see if OK. If OK, then move to PIO, which requires more experience, manual settings, and knowledge.

If only PIO creates problem, research more about PIO or post the issue on PIO Forum

Anywhere, you have to post Minimal, Reproducible Example, or your post will be ignored / deleted.

I'm closing this now and won't open until you prove this is a reproducible bug of this library.

AdrianRibao commented 2 years ago

@khoih-prog Hello, this is happening to me too.

I attach a Platform.io minimal reproducible example. Is just an empty project with this library added.

It also fails in the Arduino IDE.

Could we reopen this issue?

Minimal Reproducible Example.tar.gz

This is the output:

Processing firebeetle32 (platform: espressif32; board: firebeetle32; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/firebeetle32.html
PLATFORM: Espressif 32 (5.0.0) > FireBeetle-ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) 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 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESP_WiFiManager_Lite @ 1.8.2
|   |-- ESP_DoubleResetDetector @ 1.3.1
|   |   |-- LittleFS_esp32 @ 1.0.6
|   |-- ESP_MultiResetDetector @ 1.3.1
|   |   |-- LittleFS_esp32 @ 1.0.6
|   |-- LittleFS_esp32 @ 1.0.6
Building in release mode
Compiling .pio/build/firebeetle32/src/main.cpp.o
Generating partitions .pio/build/firebeetle32/partitions.bin
Compiling .pio/build/firebeetle32/lib2c4/LittleFS_esp32/LITTLEFS.cpp.o
.pio/libdeps/firebeetle32/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.
Compiling .pio/build/firebeetle32/lib2c4/LittleFS_esp32/esp_littlefs.c.o
Compiling .pio/build/firebeetle32/lib2c4/LittleFS_esp32/lfs.c.o
.pio/libdeps/firebeetle32/LittleFS_esp32/src/esp_littlefs.c:19:2: warning: #warning ("Use the built-in LITTLEFS library") [-Wcpp]
 #warning("Use the built-in LITTLEFS library")
  ^~~~~~~
Compiling .pio/build/firebeetle32/lib2c4/LittleFS_esp32/lfs_util.c.o
Compiling .pio/build/firebeetle32/lib2c4/LittleFS_esp32/littlefs_api.c.o
Compiling .pio/build/firebeetle32/FrameworkArduino/Esp.cpp.o
*** [.pio/build/firebeetle32/lib2c4/LittleFS_
[Minimal Reproducible Example.tar.gz](https://github.com/khoih-prog/ESP_WiFiManager_Lite/files/9147795/Minimal.Reproducible.Example.tar.gz)
esp32/LITTLEFS.cpp.o] Error 1
================================================================================ [FAILED] Took 2.50 seconds ================================================================================
khoih-prog commented 2 years ago

Check Unable to figure out why 'LittleFS' was not declared in this scope #96


You have to remove / comment out LittleFS_esp32 in all the related libraries when using ESP32 core v1.0.6+ (as you're using ESP32 core v2.0.3) such as platformio.ini and library.json

For example:

1) ESP_WiFiManager_Lite

https://github.com/khoih-prog/ESP_WiFiManager_Lite/blob/bc8fb7ed5159e78f4cba35e07bf8cb18a7925320/platformio/platformio.ini#L41

https://github.com/khoih-prog/ESP_WiFiManager_Lite/blob/bc8fb7ed5159e78f4cba35e07bf8cb18a7925320/library.json#L39-L44

  1. ESP_MultiResetDetector

https://github.com/khoih-prog/ESP_MultiResetDetector/blob/main/platformio/platformio.ini#L37

The complex example is compiled OK using latest ESP32 core v2.0.4 / Arduino IDE v1.8.19

Selection_020

Good Luck,

AdrianRibao commented 2 years ago

Thanks @khoih-prog, so If I understand correctly, do I have to fork or download the libraries and modify them?

khoih-prog commented 2 years ago

You only have to modify in your local PIO library