-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970
base: master
Are you sure you want to change the base?
Conversation
Compile error on ESP32-C3 for even simplest example [simple_server](https://github.com/me-no-dev/ESPAsyncWebServer/tree/master/examples/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); ^ ```
@@ -840,7 +840,7 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer) | |||
|
|||
IPAddress AsyncWebSocketClient::remoteIP() { | |||
if(!_client) { | |||
return IPAddress(0U); | |||
return IPAddress((uint32_t) 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a type cast I'd just use a more specific type suffix:
return IPAddress((uint32_t) 0); | |
return IPAddress(0UL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, using 0UL
breaks ESP32. I think the only proper way to fix this is using a static type cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we return IPADDR_ANY or IPADDR_NONE here? IPADDR_ANY looks good for this, no?
Fix deprecated functions superseded from mbed TLS v2.7.0 - mbedtls_md5_starts() - mbedtls_md5_update() - mbedtls_md5_finish() leading to following compiling error ``` /home/kh/.arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/gcc8_4_0-esp-2021r1/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: libraries/ESPAsyncWebServer-master/WebAuthentication.cpp.o:(.literal._ZL6getMD5PhtPc+0x4): undefined reference to `mbedtls_md5_starts' /home/kh/.arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/gcc8_4_0-esp-2021r1/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: libraries/ESPAsyncWebServer-master/WebAuthentication.cpp.o: in function `getMD5(unsigned char*, unsigned short, char*)': /home/kh/Arduino/libraries/ESPAsyncWebServer-master/src/WebAuthentication.cpp:73: undefined reference to `mbedtls_md5_starts' collect2: error: ld returned 1 exit status exit status 1 Error compiling for board ESP32S2 Dev Module. ```
### Releases v1.9.2 1. Fix MultiWiFi connection issue with ESP32 core v2.0.0-rc1+ 2. Fix AsyncWebServer library compile error with ESP32 core v2.0.0-rc1+. Check [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](me-no-dev/ESPAsyncWebServer#970) 3. Verify compatibility with new ESP32 core v2.0.0-rc1+ 4. Verify compatibility with new ESP8266 core v3.0.2
#### Releases v1.2.4 1. Fix library compile error with ESP32 core v2.0.0-rc1+. Check [Fix compiler error for ESP32-C3 and mbed TLS v2.7.0+ #970](me-no-dev/ESPAsyncWebServer#970) 2. Verify compatibility with new ESP32 core v2.0.0-rc1+
Hi wanna know if there's any update? I'm experiencing the same issue.
|
Got it fixed by manually modify 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. |
still waiting for this PR me-no-dev#970
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. |
run also into this issue. |
Compile error on ESP32-C3 for even simplest example simple_server