ESPAsyncWebServer icon indicating copy to clipboard operation
ESPAsyncWebServer copied to clipboard

Solved compile error ESP32 platform ESP32 V3.0

Open ednieuw opened this issue 8 months ago • 2 comments

When installing the ESP32 V3.0.0 new some function are removed and or changed changing the following will resolve compile error with the libraries major version V2 and V3.

          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
     and 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  

ednieuw avatar May 30 '24 12:05 ednieuw