Unable to compile basic example for NodeMCU-32s #28
Description
Describe the bug
Using PlatformIO with Clion I am unable to compile the basic example in ESPAsync_WiFi due to a dependency on https://registry.platformio.org/libraries/devyte/ESPAsyncDNSServer. Per the specifications of this library, it only supports the platform espressif.
I am able to get the example to compile successfully for the espressif platform. (Note: I had to figure out that I needed to add
build_flags = -D USE_LITTLEFS=true to my [env] section. This would be nice to have in the release notes)
When I compile for the espressif32 platform I get the following: (I've omitted the include path because its a few hundred lines :-) )
`xtensa-esp32-elf-g++ -o .pio/build/nodemcu-32s/lib1b5/AsyncTCP/AsyncTCP.cpp.o -c -Wno-frame-address -std=gnu++11 -fexceptions -fno-rtti -mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -MMD -Og -g2 -ggdb2 -DPLATFORMIO=60105 -DARDUINO_NodeMCU_32S -DUSE_LITTLEFS=true -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER=\"v4.4.3\" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -DARDUINO_ARCH_ESP32 -DESP32 -DF_CPU=240000000L -DARDUINO=10812 -DARDUINO_VARIANT=\"nodemcu-32s\" -DARDUINO_BOARD=\"NodeMCU-32S\" -DARDUINO_PARTITION_default -D__PLATFORMIO_BUILD_DEBUG__ .pio/libdeps/nodemcu-32s/AsyncTCP/src/AsyncTCP.cpp
In file included from src/defines.h:135,
from src/main.cpp:7:
.pio/libdeps/nodemcu-32s/ESPAsync_WiFiManager_Lite/src/ESPAsync_WiFiManager_Lite.h:142:8: warning: #warning Using ESP32 Core 1.0.6 or 2.0.0+ [-Wcpp]
#warning Using ESP32 Core 1.0.6 or 2.0.0+
^~~~~~~
In file included from .pio/libdeps/nodemcu-32s/ESPAsync_WiFiManager_Lite/src/ESPAsync_WiFiManager_Lite.h:182,
from src/defines.h:135,
from src/main.cpp:7:
.pio/libdeps/nodemcu-32s/ESPAsyncDNSServer/src/ESPAsyncDNSServer.h:4:10: fatal error: ESPAsyncUDP.h: No such file or directory
*********************************************************************
* Looking for ESPAsyncUDP.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:ESPAsyncUDP.h"
* Web > https://registry.platformio.org/search?q=header:ESPAsyncUDP.h
*
*********************************************************************`
Steps to Reproduce
With the following platform.ini, copy the contents of https://registry.platformio.org/libraries/khoih-prog/ESPAsync_WiFiManager_Lite/examples/ESPAsync_WiFi into the src directory of your PIO project.
Rename main.ino to main.cpp and add #include <Arduino.h>
Run the platformio init for clion and get your targets fixed
Try to build for nodemcuv2:Success
Try to build for nodemcu-32s:Failure
[env]
build_flags = -D USE_LITTLEFS=true
[env:nodemcuv2]
monitor_speed = 57600
upload_speed = 115200
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps=
khoih-prog/ESPAsync_WiFiManager_Lite
[env:nodemcu-32s]
monitor_speed = 115200
platform = espressif32
board = nodemcu-32s
framework = arduino
lib_deps=
khoih-prog/ESPAsync_WiFiManager_Lite
Expected behavior
After some research, I found this old post about a similar issue: forkineye/ESPAsyncE131#4 (comment)
That comment said "An ESP32 build should reference AsnycUDP and not ESPAsyncUDP." This seems to line up with the fact that ESPAsyncDNSServer only supports espressif.
I see that you have some alternate implementations of ESPAsyncDNSServer, but the library dependencies don't reference them, so I figure you have your reasons. I did download your version of AsyncDNSServer_ESP32_W5500 and I was able to get the example to compile, but I actually don't know which version of that library I should be using for my ESP32-WROOM-32D powered NodeMCU-32s.
Actual behavior
In file included from .pio/libdeps/nodemcu-32s/ESPAsync_WiFiManager_Lite/src/ESPAsync_WiFiManager_Lite.h:182,
from src/defines.h:135,
from src/main.cpp:7:
.pio/libdeps/nodemcu-32s/ESPAsyncDNSServer/src/ESPAsyncDNSServer.h:4:10: fatal error: ESPAsyncUDP.h: No such file or directory
Information
Please ensure to specify the following:
- PlatformIO 6.1.5
- Ubuntu 22.04.1 lts
- CLion 2022.3.1
- NodeMCUv2 for ESP and NodeMCU-32s for ESP32