Skip to content
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

Problem resolved ? "Arduino\libraries\ESPAsyncWebSrv\src\WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?" #1419

Closed
A2028 opened this issue Jun 28, 2024 · 10 comments

Comments

@A2028
Copy link

A2028 commented Jun 28, 2024

As the ESP32 Boards Package updated to V3 in Arduino IDE, many issues or compilation errors come out, any updated version of ESPAsyncWebServer resolve the above problem?

@me-no-dev
Copy link
Owner

update your ESPAsyncWebServer library. It has been fixed to compile and work with v3

@iammatis
Copy link

iammatis commented Jul 3, 2024

I don't think it's been fixed yet

/Arduino/libraries/ESPAsyncWebServer/src/WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)':
/Arduino/libraries/ESPAsyncWebServer/src/WebAuthentication.cpp:74:3: error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'?
   74 |   mbedtls_md5_starts_ret(&_ctx);
      |   ^~~~~~~~~~~~~~~~~~~~~~
      |   mbedtls_md5_starts
/Arduino/libraries/ESPAsyncWebServer/src/WebAuthentication.cpp:75:3: error: 'mbedtls_md5_update_ret' was not declared in this scope; did you mean 'mbedtls_md5_update'?
   75 |   mbedtls_md5_update_ret(&_ctx, data, len);
      |   ^~~~~~~~~~~~~~~~~~~~~~
      |   mbedtls_md5_update
/Arduino/libraries/ESPAsyncWebServer/src/WebAuthentication.cpp:76:3: error: 'mbedtls_md5_finish_ret' was not declared in this scope; did you mean 'mbedtls_md5_finish'?
   76 |   mbedtls_md5_finish_ret(&_ctx, _buf);
      |   ^~~~~~~~~~~~~~~~~~~~~~
      |   mbedtls_md5_finish
/Arduino/libraries/ESPAsyncWebServer/src/AsyncEventSource.cpp: In member function 'void AsyncEventSourceClient::_queueMessage(AsyncEventSourceMessage*)':
/Arduino/libraries/ESPAsyncWebServer/src/AsyncEventSource.cpp:189:7: error: 'ets_printf' was not declared in this scope; did you mean 'vswprintf'?
  189 |       ets_printf("ERROR: Too many messages queued\n");
      |       ^~~~~~~~~~
      |       vswprintf
/Arduino/libraries/ESPAsyncWebServer/src/AsyncWebSocket.cpp: In member function 'void AsyncWebSocketClient::_queueMessage(AsyncWebSocketMessage*)':
/Arduino/libraries/ESPAsyncWebServer/src/AsyncWebSocket.cpp:549:7: error: 'ets_printf' was not declared in this scope; did you mean 'vswprintf'?
  549 |       ets_printf("ERROR: Too many messages queued\n");
      |       ^~~~~~~~~~
      |       vswprintf

Error during build: exit status 1

Versions:

ESPAsyncWebServer: 3.1.0
esp32: 3.0.2

@Ollie9T7
Copy link

Ollie9T7 commented Jul 3, 2024

Still not fixed

@al-TideLight
Copy link

No fixed for me either, latest versions:
ESPAsyncWebServer: 3.1.0
esp32: 3.0.2

@lizardb0y
Copy link

No fixed for me either, latest versions: ESPAsyncWebServer: 3.1.0 esp32: 3.0.2

The library available through the Arduino Library Manager (ESPAsyncWebServer: 3.1.0 ) is a different fork maintained by someone else. At the time I write this that fork is still failing to build.

This fork, maintained by me-no-dev, does not have those errors.

You will need to remove the ESPAsyncWebServer library then install the library from this repository manually.

@al-TideLight
Copy link

al-TideLight commented Jul 6, 2024 via email

@A2028
Copy link
Author

A2028 commented Jul 7, 2024

Well, the version is ESPAsyncWebSrv Version 1.2.7

It still has error ....
Error captured 20240707

@A2028
Copy link
Author

A2028 commented Jul 7, 2024

The compilation was successful at ESP32 V2 and no AsyncWebServer installed, just installed the AsyncWebSrv (up to 1.2.7)

NOT successful at ESP32 V3.x

@ednieuw
Copy link

ednieuw commented Jul 7, 2024

I solved your error in the library from this fork
lacamera#2
That will probably also work here

Changed in Arduino\libraries\ESPAsyncWebServer\src\WebAuthentication.cpp
at line 75,76,77
//-----------------
#ifdef ESP_ARDUINO_VERSION_MAJOR
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
// Code for version 3.x
mbedtls_md5_init(&_ctx);
mbedtls_md5_starts(&_ctx);
mbedtls_md5_update(&_ctx, data, len);
mbedtls_md5_finish(&_ctx, _buf);
#else
// Code for version 2.x
#ifdef ESP32
mbedtls_md5_init(&_ctx);
mbedtls_md5_starts_ret(&_ctx);
mbedtls_md5_update_ret(&_ctx, data, len);
mbedtls_md5_finish_ret(&_ctx, _buf);
#else
MD5Init(&_ctx);
MD5Update(&_ctx, data, len);
MD5Final(_buf, &_ctx);
#endif
#endif
#endif
//--------------------
in AsyncEventSource.cpp changed at line 189 ets_printf --> log_e for V3
in AsyncWebSocket.cpp changed at line 549 ets_printf --> log_e for V3
#ifdef ESP_ARDUINO_VERSION_MAJOR
#if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
// Code for version 3.x
log_e("ERROR: Too many messages queued\n");
#else
// Code for version 2.x
ets_printf("ERROR: Too many messages queued\n");
#endif
#endif

@A2028
Copy link
Author

A2028 commented Jul 8, 2024

👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants