ESPAsyncWebServer icon indicating copy to clipboard operation
ESPAsyncWebServer copied to clipboard

Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+

Open khoih-prog opened this issue 3 years ago • 13 comments

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);
                            ^

khoih-prog avatar Apr 19 '21 19:04 khoih-prog

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.

bluet avatar Nov 23 '21 18:11 bluet

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.

bluet avatar Nov 23 '21 19:11 bluet

This little issue breaks compilation on ESP32C3, no idea why it doesn't get merged

FedericoBusero avatar Dec 29 '21 16:12 FedericoBusero

This does seem like a fairly important fix. Any update or timeline please ?

ndastur avatar May 01 '22 16:05 ndastur

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.

maxgerhardt avatar May 17 '22 11:05 maxgerhardt

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.

MikeyMoMo avatar May 19 '22 08:05 MikeyMoMo

Yet another person running into this here.

maxgerhardt avatar Jun 30 '22 13:06 maxgerhardt

Somebody merge this :) It's very due and fixes the problem.

ayushsharma82 avatar Oct 31 '22 09:10 ayushsharma82

Can someone merge this?

miloit avatar Nov 06 '22 22:11 miloit

Issue still exists !!

Nailik avatar Dec 11 '22 22:12 Nailik

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?

ncmreynolds avatar Jan 30 '23 18:01 ncmreynolds

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

FedericoBusero avatar Feb 12 '23 18:02 FedericoBusero

run also into this issue. return IPAddress((uint32_t)0); fixes the problem.

Adminius avatar Dec 10 '23 20:12 Adminius