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

Compiling issues #1410

Description

@c0debreaker

I'm getting the errors below. If I remove #include <ESPAsyncWebServer.h> and other related code, the compile becomes successful. What did I do someting wrong?

/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/WebAuthentication.cpp: In function 'bool getMD5(uint8_t*, uint16_t, char*)':
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/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
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/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
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/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
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncEventSource.cpp: In member function 'void AsyncEventSourceClient::_queueMessage(AsyncEventSourceMessage*)':
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncEventSource.cpp:188:7: error: 'ets_printf' was not declared in this scope; did you mean 'vswprintf'?
  188 |       ets_printf("ERROR: Too many messages queued\n");
      |       ^~~~~~~~~~
      |       vswprintf
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp: In member function 'void AsyncWebSocketClient::_queueMessage(AsyncWebSocketMessage*)':
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp:551:7: error: 'ets_printf' was not declared in this scope; did you mean 'vswprintf'?
  551 |       ets_printf("ERROR: Too many messages queued\n");
      |       ^~~~~~~~~~
      |       vswprintf
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp: In member function 'IPAddress AsyncWebSocketClient::remoteIP()':
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp:832:28: error: call of overloaded 'IPAddress(unsigned int)' is ambiguous
  832 |         return IPAddress(0U);
      |                            ^
In file included from /home/rcamara/.arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/Arduino.h:196,
                 from /home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp:21:
/home/rcamara/.arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/IPAddress.h:115:3: note: candidate: 'IPAddress::IPAddress(const ip_addr_t*)'
  115 |   IPAddress(const ip_addr_t *addr);
      |   ^~~~~~~~~
/home/rcamara/.arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/IPAddress.h:73:3: note: candidate: 'IPAddress::IPAddress(const IPAddress&)'
   73 |   IPAddress(const IPAddress &address);
      |   ^~~~~~~~~
/home/rcamara/.arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/IPAddress.h:72:3: note: candidate: 'IPAddress::IPAddress(const char*)'
   72 |   IPAddress(const char *address);
      |   ^~~~~~~~~
/home/rcamara/.arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/IPAddress.h:69:3: note: candidate: 'IPAddress::IPAddress(const uint8_t*)'
   69 |   IPAddress(const uint8_t *address);
      |   ^~~~~~~~~
/home/rcamara/.arduino15/packages/esp32/hardware/esp32/3.0.0/cores/esp32/IPAddress.h:67:3: note: candidate: 'IPAddress::IPAddress(uint32_t)'
   67 |   IPAddress(uint32_t address);
      |   ^~~~~~~~~
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp: In constructor 'AsyncWebSocketResponse::AsyncWebSocketResponse(const String&, AsyncWebSocket*)':
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp:1262:3: error: 'mbedtls_sha1_starts_ret' was not declared in this scope; did you mean 'mbedtls_sha1_starts'?
 1262 |   mbedtls_sha1_starts_ret(&ctx);
      |   ^~~~~~~~~~~~~~~~~~~~~~~
      |   mbedtls_sha1_starts
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp:1263:3: error: 'mbedtls_sha1_update_ret' was not declared in this scope; did you mean 'mbedtls_sha1_update'?
 1263 |   mbedtls_sha1_update_ret(&ctx, (const unsigned char*)key.c_str(), key.length());
      |   ^~~~~~~~~~~~~~~~~~~~~~~
      |   mbedtls_sha1_update
/home/rcamara/Arduino/libraries/ESP_Async_WebServer/src/AsyncWebSocket.cpp:1264:3: error: 'mbedtls_sha1_finish_ret' was not declared in this scope; did you mean 'mbedtls_sha1_finish'?
 1264 |   mbedtls_sha1_finish_ret(&ctx, hash);
      |   ^~~~~~~~~~~~~~~~~~~~~~~
      |   mbedtls_sha1_finish
Multiple libraries were found for "WiFi.h"
  Used: /home/rcamara/.arduino15/packages/esp32/hardware/esp32/3.0.0/libraries/WiFi
  Not used: /home/rcamara/Arduino/libraries/WiFiNINA
exit status 1

Compilation error: exit status 1

and my source code is

#include <Arduino.h>
#include <WiFi.h>
#include <LittleFS.h>
#include <ESPAsyncWebServer.h>

// Replace with your network credentials
const char* ssid = "******";
const char* password = "******";

AsyncWebServer server(80);

void setup() {
  // Start Serial for debug output
  Serial.begin(115200);

  // Initialize LittleFS
  if (!LittleFS.begin()) {
    Serial.println("An Error has occurred while mounting LittleFS");
    return;
  }

  // Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  Serial.println("Connected to WiFi");

  // Serve static files from LittleFS
  server.serveStatic("/", LittleFS, "/").setDefaultFile("index.html");

  // Handle 404 (Not Found)
  server.onNotFound([](AsyncWebServerRequest *request) {
    request->send(404, "text/plain", "Not found");
  });

  // Start server
  server.begin();
}

void loop() {
  // Nothing needed here
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions