I get the following error, trying to compile the most basic code “template”.
Archiving .pio\build\esp32\libc06\libWiFi.a
Compiling .pio\build\esp32\lib182\ESP Async WebServer\WebServer.cpp.o
.pio/libdeps/esp32/ESP Async WebServer/src/AsyncWebSocket.cpp: In member function 'IPAddress AsyncWebSocketClient::remoteIP()':
.pio/libdeps/esp32/ESP Async WebServer/src/AsyncWebSocket.cpp:840:28: error: call of overloaded 'IPAddress(unsigned int)' is ambiguous
return IPAddress(0U);
^
In file included from C:/Users/MiKo/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:180,
from .pio/libdeps/esp32/ESP Async WebServer/src/AsyncWebSocket.cpp:21:
C:/Users/MiKo/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.h:51:5: note: candidate: 'IPAddress::IPAddress(const uint8_t*)'
IPAddress(const uint8_t *address);
^~~~~~~~~
C:/Users/MiKo/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.h:50:5: note: candidate: 'IPAddress::IPAddress(uint32_t)'
IPAddress(uint32_t address);
^~~~~~~~~
C:/Users/MiKo/.platformio/packages/framework-arduinoespressif32/cores/esp32/IPAddress.h:29:7: note: candidate: 'constexpr IPAddress::IPAddress(const IPAddress&)'
class IPAddress: public Printable
^~~~~~~~~
Compiling .pio\build\esp32\FrameworkArduino\Esp.cpp.o
*** [.pio\build\esp32\lib182\ESP Async WebServer\AsyncWebSocket.cpp.o] Error 1
What’s wrong ???
#include <Arduino.h>
#if defined(ESP8266)
#define ONBOARDLED 2 // Built in LED
#include <ESP8266WiFi.h> // WiFi
#include <ESPAsyncTCP.h> // Webserver
#endif
#if defined(ESP32)
#define ONBOARDLED 5 // Built in LED
#include <WiFi.h> // WiFi
#include "AsyncTCP.h" // Webserver
#ifndef IRAM_ATTR // This is required on ESP32 to put the ISR in IRAM. Define as
#define IRAM_ATTR
#endif
#endif
#include "ESPAsyncWebServer.h"
AsyncWebServer websvr(80);
AsyncEventSource events("/events");
// #include "webconfig_v002.h"
// ---------------------------------------------------------------
// function declarations
// ---------------------------------------------------------------
int myFunction(int, int);
// ---------------------------------------------------------------
// SETUP
// ---------------------------------------------------------------
void setup() {
// put your setup code here, to run once:
int result = myFunction(2, 3);
}
// ---------------------------------------------------------------
// LOOP
// ---------------------------------------------------------------
void loop() {
// put your main code here, to run repeatedly:
}
// ---------------------------------------------------------------
// functions
// ---------------------------------------------------------------
int myFunction(int x, int y) {
return x + y;
}
; platformio.ini
[env:esp32]
board = esp32-c3-devkitc-02
framework = arduino
platform = espressif32
lib_deps =
me-no-dev/ESP Async WebServer@^1.2.3
me-no-dev/ESPAsyncTCP@^1.2.2
me-no-dev/AsyncTCP@^1.1.1
;ayushsharma82/WebSerial@^1.4.0