Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Ready for ESP32 V3 &V2 - #2

Open
ednieuw wants to merge 1 commit into
lacamera:masterfrom
ednieuw:master
Open

Ready for ESP32 V3 &V2#2
ednieuw wants to merge 1 commit into
lacamera:masterfrom
ednieuw:master

Conversation

@ednieuw

@ednieuw ednieuw commented May 30, 2024

Copy link
Copy Markdown

Changed ESP32 board to 3.0.0
Changed in Arduino\libraries\ESPAsyncWebServer\src\WebAuthentic
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

 Changed ESP32 board to 3.0.0
               Changed in Arduino\libraries\ESPAsyncWebServer\src\WebAuthentic
               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
@Evs91

Evs91 commented Jun 23, 2024

Copy link
Copy Markdown

For what my opinion is worth (i.e. trying to make a remote relay module with the async library) - this addresses the changes needed to fix for the 3.x version of Arduino core for ESP32.

@jake

jake commented Jun 29, 2024

Copy link
Copy Markdown

also just anecdotal, but after getting error: 'mbedtls_md5_starts_ret' was not declared in this scope; did you mean 'mbedtls_md5_starts'? and similar errors, using this fork works great with my ESP32-S2-WROVER boad

@Evs91

Evs91 commented Jun 30, 2024

Copy link
Copy Markdown

I don't see code to initialize your wifi client? I can assume it is lower but I hate making assumptions if this is partial code. I'm assuming as well that if you do have the wifi initizlized that is outputting the IP address to serial output? Also: Same network or different VLANs (if applicable)?

@AllanOricil

Copy link
Copy Markdown

@Evs91 the issue was that I was declaring AsyncWebServer server(80); inside the function's scope. At the end of the scope the object is gone. After moving it to outside, in the global scope, everything worked as expected.

@giddel

giddel commented Jul 16, 2024

Copy link
Copy Markdown

Same error message here :-(
I've selected the board "ESP32 Dev Module" in Arduino IDE and use a "ESP-32 Dev Kit C 2" from AzDelivery.

What can I do?

@normaligator

Copy link
Copy Markdown

Thank you, this is working for my setup

@mnemocron

Copy link
Copy Markdown

Heya, I just crashed into the ol' issue of mbedtls_md5_starts_ret was not declared in this scope. Maybe someone could actually merge this PR (?)

@giddel

giddel commented May 6, 2025

Copy link
Copy Markdown

Yes, please merge 😗

@ednieuw

ednieuw commented May 15, 2025

Copy link
Copy Markdown
Author

Use the ESPAsyncWebServer regular maintained by Mathieu Carbou.
https://github.com/ESP32Async/ESPAsyncWebServer
it can also be found between the Arduino libraries in the Arduino IDE

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants