ayushsharma82 / ElegantOTA

OTA updates made slick and simple for everyone!
https://elegantota.pro
GNU Affero General Public License v3.0
622 stars 116 forks source link

on Examples AsyncDemo error #139

Closed anwfeb closed 9 months ago

anwfeb commented 11 months ago
AsyncDemo:88:20: error: cannot convert 'AsyncWebServer' to 'ESP8266WebServer' {aka 'esp8266webserver::ESP8266WebServerTemplate*'} 88 ElegantOTA.begin(&server); // Start ElegantOTA ^~~
AsyncWebServer*
ScruffR commented 11 months ago

I got a similar issue with ESP32

error: no matching function for call to 'ElegantOTAClass::begin(AsyncWebServer*)'
   ElegantOTA.begin(&server);

note: candidate: 'void ElegantOTAClass::begin(WebServer*, const char*, const char*)'
     void begin(ELEGANTOTA_WEBSERVER *server, const char * username = "", const char * password = "");

note:   no known conversion for argument 1 from 'AsyncWebServer*' to 'WebServer*'

(and a host of other errors about mismatching definitions - probably due to that incompatibility with AsyncWebServer)

Although the example explicitly refers to ESPAsyncWebServer.h https://github.com/ayushsharma82/ElegantOTA/blob/master/examples/AsyncDemo/AsyncDemo.ino#L33C1-L34C1

bmgmo-iscteiulpt commented 11 months ago

I got the exact same error, cant figure out how to fix it :/

ayushsharma82 commented 11 months ago

Did you guys enable Async Mode as per docs before compiling the example?

bmgmo-iscteiulpt commented 11 months ago

Yes, but same error

ayushsharma82 commented 11 months ago

Weird, CI gave it a pass. I'll need the following details to further diagnose it:

  1. Are you using Arduino IDE or PlatformIO?
  2. Which MCU are you using?
  3. Board/Platform version of your microcontroller
bmgmo-iscteiulpt commented 11 months ago

Arduino IDE Its an Expressif ESP32-s2 wrover The version I'm not sure how to get it

20231101_174810

bmgmo-iscteiulpt commented 11 months ago

When the Async mode is set on the library file, it gives the following errors

erger

ayushsharma82 commented 11 months ago

@bmgmo-iscteiulpt This is a different error compared to what this issue was initially created for.

You can fix it by downgrading to a stable "arduino-esp32" release in Board Manager. Currently you are using v3.0.0-alphav2 which is not stable.

bmgmo-iscteiulpt commented 11 months ago

worked! didnt even noticed the alpha version when installed the boards .. thank you!

ScruffR commented 11 months ago

For an older project had it enabled but forgot to do that again after a library update cycle overrode that 😳

ayushsharma82 commented 11 months ago

@ScruffR Yeah that's inevitable with Arduino IDE. I'll suggest moving to PlatformIO with this approach so that the async flag is persisted within the project itself. One time learning effort, PIO offers a better experience in terms of compile time etc once you are familiar with it.

ayushsharma82 commented 11 months ago

@anwfeb Status update on your issue? If it was resolved, please close the issue.

Luckas007666 commented 11 months ago

@ayushsharma82 : Please also have a look at issue #141 . The issue itself is solved, but with a manual fix - maybe this can be added by you to the original ? https://github.com/ayushsharma82/ElegantOTA/issues/141#issuecomment-1808890201