Hello. I’ve been trying to use Plattform.io as an Arduino editor (mainly for ESP) for a couple of weeks now. I often have problems with the library integrations - It compiles without problems in Arduino IDE, but raises many errors in Plattform.io. For example, i needed to copy the SD library from Arduino into the lib folder because the “internal” library for the ESP32 did not work (although it should be the same).
Current problem which i dont understand: I use AsyncElegantOTA (togetger with ESPAsyncWebServer). The AsyncElegantOTA library ( ayushsharma82/AsyncElegantOTA @ ^2.2.5) did install without any problems, but although the AsyncElegantOTA .h header file is clearly in the library source folder, i get an error (it seems AsyncElegantOTA is not added to the dependency graph althouhg included):
Processing esp-wrover-kit (platform: espressif32; board: esp-wrover-kit; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp-wrover-kit.html
PLATFORM: Espressif 32 (3.2.0) > Espressif ESP-WROVER-KIT
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (ftdi) On-board (ftdi) External (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.10006.210326 (1.0.6)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ strict
Found 30 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <WiFi> 1.0
|-- <ESP Async WebServer> 1.2.3
| |-- <AsyncTCP> 1.1.1
| |-- <FS> 1.0
| |-- <WiFi> 1.0
|-- <AsyncTCP> 1.1.1
Building in release mode
Compiling .pio\build\esp-wrover-kit\src\main.cpp.o
Archiving .pio\build\esp-wrover-kit\lib79f\libWiFi.a
Archiving .pio\build\esp-wrover-kit\libd37\libAsyncTCP.a
Compiling .pio\build\esp-wrover-kit\libe01\FS\FS.cpp.o
Compiling .pio\build\esp-wrover-kit\libe01\FS\vfs_api.cpp.o
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\AsyncEventSource.cpp.o
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\AsyncWebSocket.cpp.o
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\SPIFFSEditor.cpp.o
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\WebAuthentication.cpp.o
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\WebHandlers.cpp.o
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\WebRequest.cpp.o
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\WebResponses.cpp.o
src\main.cpp:28:29: fatal error: AsyncElegantOTA.h: No such file or directory
*************************************************************************
* Looking for AsyncElegantOTA.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:AsyncElegantOTA.h"
* Web > https://platformio.org/lib/search?query=header:AsyncElegantOTA.h
*
*************************************************************************
compilation terminated.
*** [.pio\build\esp-wrover-kit\src\main.cpp.o] Error 1
Compiling .pio\build\esp-wrover-kit\lib03b\ESP Async WebServer\WebServer.cpp.o
Also changing the lib ldf mode to chain+ did not work.
minimal plattformio.ini:
[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
lib_compat_mode = strict
lib_ldf_mode = chain+
lib_deps =
WiFi
ESP Async WebServer
ayushsharma82/AsyncElegantOTA @ ^2.2.5
minimal sourcecode example:
#include "Arduino.h"
#include <WiFi.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <AsyncElegantOTA.h>
const char* ssid = "REPLACE_WITH_YOUR_SSID";
const char* password = "REPLACE_WITH_YOUR_PASSWORD";
AsyncWebServer server(80);
void setup(void) {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", "Hi! I am ESP8266.");
});
AsyncElegantOTA.begin(&server); // Start ElegantOTA
server.begin();
Serial.println("HTTP server started");
}
void loop(void) {
AsyncElegantOTA.loop();
}