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

no matching function for call to 'ElegantOTAClass::begin(AsyncWebServer*)' #169

Open
StefanL38 opened this issue Mar 9, 2024 · 3 comments

Comments

@StefanL38
Copy link

I get a compiler error
no matching function for call to 'ElegantOTAClass::begin(AsyncWebServer*)'

what is wrong?
Is this a problem because I have used the older AsyncElegantOTA?

Arduino: 1.8.19 (Windows 10), TD: 1.58, Board: "ESP32 Dev Module, Disabled, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None, Disabled"

Using board 'esp32' from platform in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14

Using core 'esp32' from platform in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14

cmd /c if exist "C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\partitions.csv" COPY /y "C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\partitions.csv" "C:\Users\dipl-\AppData\Local\Temp\arduino_build_776315\partitions.csv"

esptool.py v4.5.1

Creating esp32 image...

Merged 1 ELF section

Successfully created esp32 image.

cmd /c type nul > "C:\Users\dipl-\AppData\Local\Temp\arduino_build_776315/file_opts"

Detecting libraries used...

Alternatives for WiFi.h: [WiFiNINA@1.8.14 WiFi@2.0.0 WiFi@1.2.7]

ResolveLibrary(WiFi.h)

-> candidates: [WiFiNINA@1.8.14 WiFi@2.0.0 WiFi@1.2.7]

Alternatives for AsyncTCP.h: [AsyncTCP@1.1.4]

ResolveLibrary(AsyncTCP.h)

-> candidates: [AsyncTCP@1.1.4]

Alternatives for ESPAsyncWebServer.h: [ESPAsyncWebServer@1.2.3]

ResolveLibrary(ESPAsyncWebServer.h)

-> candidates: [ESPAsyncWebServer@1.2.3]

Alternatives for FS.h: [FS@2.0.0]

ResolveLibrary(FS.h)

-> candidates: [FS@2.0.0]

Alternatives for ElegantOTA.h: [ElegantOTA@3.1.0]

ResolveLibrary(ElegantOTA.h)

-> candidates: [ElegantOTA@3.1.0]

Alternatives for Update.h: [Update@2.0.0]

ResolveLibrary(Update.h)

-> candidates: [Update@2.0.0]

Alternatives for WebServer.h: [WebServer@2.0.0]

ResolveLibrary(WebServer.h)

-> candidates: [WebServer@2.0.0]

Generating function prototypes...

Compiling sketch...

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/HTTP_Method.h:4,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/WebServer.h:30,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:73,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:95:6: error: 'HTTP_DELETE' conflicts with a previous declaration

XX(0, DELETE, DELETE) \

  ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:138:45: note: in definition of macro 'XX'

#define XX(num, name, string) HTTP_##name = num,

                                         ^~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP'

HTTP_METHOD_MAP(XX)

^~~~~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:33:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer\src/ESPAsyncWebServer.h:64:3: note: previous declaration 'WebRequestMethod HTTP_DELETE'

HTTP_DELETE = 0b00000100,

^~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/HTTP_Method.h:4,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/WebServer.h:30,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:73,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:96:6: error: 'HTTP_GET' conflicts with a previous declaration

XX(1, GET, GET) \

  ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:138:45: note: in definition of macro 'XX'

#define XX(num, name, string) HTTP_##name = num,

                                         ^~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP'

HTTP_METHOD_MAP(XX)

^~~~~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:33:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer\src/ESPAsyncWebServer.h:62:3: note: previous declaration 'WebRequestMethod HTTP_GET'

HTTP_GET = 0b00000001,

^~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/HTTP_Method.h:4,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/WebServer.h:30,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:73,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:97:6: error: 'HTTP_HEAD' conflicts with a previous declaration

XX(2, HEAD, HEAD) \

  ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:138:45: note: in definition of macro 'XX'

#define XX(num, name, string) HTTP_##name = num,

                                         ^~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP'

HTTP_METHOD_MAP(XX)

^~~~~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:33:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer\src/ESPAsyncWebServer.h:67:3: note: previous declaration 'WebRequestMethod HTTP_HEAD'

HTTP_HEAD = 0b00100000,

^~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/HTTP_Method.h:4,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/WebServer.h:30,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:73,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:98:6: error: 'HTTP_POST' conflicts with a previous declaration

XX(3, POST, POST) \

  ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:138:45: note: in definition of macro 'XX'

#define XX(num, name, string) HTTP_##name = num,

                                         ^~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP'

HTTP_METHOD_MAP(XX)

^~~~~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:33:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer\src/ESPAsyncWebServer.h:63:3: note: previous declaration 'WebRequestMethod HTTP_POST'

HTTP_POST = 0b00000010,

^~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/HTTP_Method.h:4,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/WebServer.h:30,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:73,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:99:6: error: 'HTTP_PUT' conflicts with a previous declaration

XX(4, PUT, PUT) \

  ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:138:45: note: in definition of macro 'XX'

#define XX(num, name, string) HTTP_##name = num,

                                         ^~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP'

HTTP_METHOD_MAP(XX)

^~~~~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:33:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer\src/ESPAsyncWebServer.h:65:3: note: previous declaration 'WebRequestMethod HTTP_PUT'

HTTP_PUT = 0b00001000,

^~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/HTTP_Method.h:4,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/WebServer.h:30,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:73,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:102:6: error: 'HTTP_OPTIONS' conflicts with a previous declaration

XX(6, OPTIONS, OPTIONS) \

  ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:138:45: note: in definition of macro 'XX'

#define XX(num, name, string) HTTP_##name = num,

                                         ^~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP'

HTTP_METHOD_MAP(XX)

^~~~~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:33:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer\src/ESPAsyncWebServer.h:68:3: note: previous declaration 'WebRequestMethod HTTP_OPTIONS'

HTTP_OPTIONS = 0b01000000,

^~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/HTTP_Method.h:4,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer\src/WebServer.h:30,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:73,

             from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:128:6: error: 'HTTP_PATCH' conflicts with a previous declaration

XX(28, PATCH, PATCH) \

  ^~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:138:45: note: in definition of macro 'XX'

#define XX(num, name, string) HTTP_##name = num,

                                         ^~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/nghttp/port/include/http_parser.h:139:3: note: in expansion of macro 'HTTP_METHOD_MAP'

HTTP_METHOD_MAP(XX)

^~~~~~~~~~~~~~~

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:33:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer\src/ESPAsyncWebServer.h:66:3: note: previous declaration 'WebRequestMethod HTTP_PATCH'

HTTP_PATCH = 0b00010000,

^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino: In function 'void setup()':

Async-OTA-Demo-001:88:27: error: no matching function for call to 'ElegantOTAClass::begin(AsyncWebServer*)'

ElegantOTA.begin(&server); // Start ElegantOTA

                       ^

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\Async-OTA-Demo-001\Async-OTA-Demo-001.ino:34:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:107:10: note: candidate: 'void ElegantOTAClass::begin(WebServer*, const char*, const char*)'

 void begin(ELEGANTOTA_WEBSERVER *server, const char * username = "", const char * password = "");

      ^~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA\src/ElegantOTA.h:107:10: note: no known conversion for argument 1 from 'AsyncWebServer*' to 'WebServer*'

Multiple libraries were found for "WiFi.h"

Used: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WiFi

Not used: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\WiFiNINA

Not used: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\WiFi

Using library WiFi at version 2.0.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WiFi

Using library AsyncTCP at version 1.1.4 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\AsyncTCP

Using library ESPAsyncWebServer at version 1.2.3 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ESPAsyncWebServer

Using library FS at version 2.0.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\FS

Using library ElegantOTA at version 3.1.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ElegantOTA

Using library Update at version 2.0.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\Update

Using library WebServer at version 2.0.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\esp32\hardware\esp32\2.0.14\libraries\WebServer

exit status 1

no matching function for call to 'ElegantOTAClass::begin(AsyncWebServer*)'

@StefanL38
Copy link
Author

I found the solution this modifying of the file ElegantOTA.h.

This modification is far from beeing userfriendly

You should find a way that this will be adjusted through a
#define
inside your demo.ino-file
or
as a variant of the constructor with a parameter inside the demo.ino-file

best regards Stefan

@mathieucarbou
Copy link

You should find a way that this will be adjusted through a
#define
inside your demo.ino-file

There are 2 ways to fix this:

  1. re-order the includes in order to put ESPAsyncWebServer at the end
  2. If you use ESPAsyncWebServer, use async mode: https://docs.elegantota.pro/async-mode/

@ednieuw
Copy link

ednieuw commented Mar 27, 2024

I hope you solve the error with this define.
" Locate the ELEGANTOTA_USE_ASYNC_WEBSERVER macro in the ElegantOTA.h file, and set it to 1: #define ELEGANTOTA_USE_ASYNC_WEBSERVER 1"

After een upgrade to a newer version the define is overwritten and you get a compile error

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

3 participants