lbussy / AsyncWiFiManager

ESP8266 Async WiFi Connection Manager with Captive Web Portal
https://github.com/lbussy/AsyncWiFiManager
MIT License
8 stars 4 forks source link

Does not work with ESP32 #10

Closed thomasjec closed 3 years ago

thomasjec commented 3 years ago

This AsyncWiFiManager does not work with ESP32 - not sure why though...

I see in the documentation both that it's supposed to work with ESP32, as that it should be updated to work with it... Are there any plans to update this to work?

thomasjec commented 3 years ago

In fact, I think the WiFiManager does not use the AsyncWebServer at all... When I compile BrewBubbles, this is the dependency graph, where you can see the regular ESP8266WebServer library is used.

Dependency Graph
|-- <ArduinoJson> 6.15.0
|-- <OneWire> 2.3.5+sha.459af04
|-- <DS18B20> 0.1.1-a+sha.1cd2bde
|   |-- <OneWire> 2.3.5+sha.459af04
|-- <ArduinoLog> 1.0.3+sha.be71b9e
|-- <ESP Async WebServer> 1.2.3+sha.f6fff3f
|   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ArduinoJson> 6.15.0
|   |-- <ESP8266WiFi> 1.0
|-- <AsyncWiFiManager> 1.0.0+sha.7b0e85b
|   |-- <DNSServer> 1.1.1
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266WebServer> 1.0
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP Async WebServer> 1.2.3+sha.f6fff3f
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <Hash> 1.0
|   |   |-- <ArduinoJson> 6.15.0
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncTCP> 1.2.2+sha.87da78b
|   |-- <ESP8266WiFi> 1.0
|-- <asyncHTTPrequest> 1.2.1+sha.b350f96
|   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <CircularBuffer> 1.3.3+sha.98e638a
|-- <LCBUrl> 1.1.3+sha.4c74c2c
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESPTelnet> 0.0.1+sha.94b718b
|   |-- <ESP8266WiFi> 1.0
|-- <ESP_DoubleResetDetector> 1.1.1
|   |-- <EEPROM> 1.0
|   |-- <LittleFS(esp8266)> 0.1.0
|-- <ThingSpeak> 1.5.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266httpUpdate> 1.3
|   |-- <ESP8266HTTPClient> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <LittleFS(esp8266)> 0.1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <Ticker> 1.0
|-- <ESPAsyncTCP> 1.2.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266HTTPClient> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <EEPROM> 1.0

When I add the build flag WM_ASYNC, I get these kind of errors:

.pio/libdeps/d1_mini/AsyncWiFiManager/src/AsyncWiFiManager.cpp:2267:13: error: 'class AsyncWebServer' has no member named 'send'
     server->send(200, FPSTR(HTTP_HEAD_CT), page);

So exactly the kind of errors you'd expect, since the AsyncWebServer doesn't use this, although the wifimanager code does use this...

thomasjec commented 3 years ago

Okay, now I see the AsyncWebServer appears in both dependency graphs, but for some reason, it ends up using the classic webserver instead of the asynchronous one... I believe it has to do with these lines of code:

#if defined(ESP32) && defined(WM_WEBSERVERSHIM)
    using WM_WebServer = WebServer;
#else
#ifdef WM_ASYNC
    using WM_WebServer = AsyncWebServer;
#else
    using WM_WebServer = ESP8266WebServer;
#endif

(lines 321-328 in AsyncWiFiManager.h)

lbussy commented 3 years ago

I apologize, for some reason, my notifications were turned off. I merged upstream and changed a TON of code. I also use this on my ESP32 projects so see how it works for you now.

This is also not really meant for public consumption. If you get some use out of it that's great.