ESPAsyncWebServer
ESPAsyncWebServer copied to clipboard
Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+
Compile error on ESP32-C3 for even simplest example simple_server
/home/kh/Arduino/libraries/ESPAsyncWebServer-master/src/AsyncWebSocket.cpp: In member function 'IPAddress AsyncWebSocketClient::remoteIP()':
/home/kh/Arduino/libraries/ESPAsyncWebServer-master/src/AsyncWebSocket.cpp:843:28: error: call of overloaded 'IPAddress(unsigned int)' is ambiguous
return IPAddress(0U);
^
Hi wanna know if there's any update?
I'm experiencing the same issue.
Arduino: 1.8.16 (Linux), Board: "ESP32C3 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 160MHz (WiFi), QIO, 80MHz, 4MB (32Mb), 115200, None"
/home/bluet/Arduino/libraries/ESPAsyncWebServer-master/src/AsyncWebSocket.cpp: In member function 'IPAddress AsyncWebSocketClient::remoteIP()':
/home/bluet/Arduino/libraries/ESPAsyncWebServer-master/src/AsyncWebSocket.cpp:832:28: error: call of overloaded 'IPAddress(unsigned int)' is ambiguous
return IPAddress(0U);
^
In file included from /home/bluet/.arduino15/packages/esp32/hardware/esp32/2.0.1/cores/esp32/Arduino.h:163,
from /home/bluet/Arduino/libraries/ESPAsyncWebServer-master/src/AsyncWebSocket.cpp:21:
/home/bluet/.arduino15/packages/esp32/hardware/esp32/2.0.1/cores/esp32/IPAddress.h:51:5: note: candidate: 'IPAddress::IPAddress(const uint8_t*)'
IPAddress(const uint8_t *address);
^~~~~~~~~
/home/bluet/.arduino15/packages/esp32/hardware/esp32/2.0.1/cores/esp32/IPAddress.h:50:5: note: candidate: 'IPAddress::IPAddress(uint32_t)'
IPAddress(uint32_t address);
^~~~~~~~~
/home/bluet/.arduino15/packages/esp32/hardware/esp32/2.0.1/cores/esp32/IPAddress.h:29:7: note: candidate: 'constexpr IPAddress::IPAddress(const IPAddress&)'
class IPAddress: public Printable
^~~~~~~~~
Multiple libraries were found for "WiFi.h"
Used: /home/bluet/.arduino15/packages/esp32/hardware/esp32/2.0.1/libraries/WiFi
Not used: /home/bluet/local/arduino-1.8.16/libraries/WiFi
exit status 1
Error compiling for board ESP32C3 Dev Module.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Got it fixed by manually modify AsyncWebSocket.cpp
:832,
from return IPAddress(0U);
to return IPAddress((uint32_t) 0u);
.
Tested on both ESP32-C3 and ESP32-S2.
This little issue breaks compilation on ESP32C3, no idea why it doesn't get merged
This does seem like a fairly important fix. Any update or timeline please ?
People are also running in this bug when using PlatformIO and using the latest Arduino-ESP32 core here in the forums. This fix PR is valid.
Here is is May 19, 2022 and I just had to fix this, too. Thanks to those who found it. I hope it can be fixed soon in the library for real. Been known for only 1 year.
Yet another person running into this here.
Somebody merge this :) It's very due and fixes the problem.
Can someone merge this?
Issue still exists !!
Just had to fix this manually myself after encountering it, seems like a trivial merge that would fix this for a whole load of people. Any chance this can be merged?
The problem with this PR is that most of the code changes are about mbed TLS, but most of the comments and requests are about one little trivial change in one line of the code to fix the compilation error on RISC-V (ESP32-C3). Probably it is better to split the two issues. Remark that there is another PR with only this one line of code: https://github.com/me-no-dev/ESPAsyncWebServer/pull/1142
run also into this issue.
return IPAddress((uint32_t)0);
fixes the problem.