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

Incompatibility with Async #7

Closed
lbussy opened this issue Oct 30, 2020 · 5 comments
Closed

Incompatibility with Async #7

lbussy opened this issue Oct 30, 2020 · 5 comments

Comments

@lbussy
Copy link
Owner

lbussy commented Oct 30, 2020

The upstream is not well suited to use in an Async environment. Reportedly, this will allow it.

@lbussy lbussy pinned this issue Oct 30, 2020
@lbussy lbussy changed the title Incompatibility with Wsync Incompatibility with Async Oct 30, 2020
@firasRihan
Copy link

Hello Dear @lbussy ,
I am using your wifi manager library that you forked but still I'm getting an error when I'm putting it in my project that has the async web server library.

I hope you have any solution for this, I'm so in need for this library to work.
Thank you a lot.

This is the error:

In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:62:18: error: redeclaration of 'HTTP_GET'
HTTP_GET = 0b00000001,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:29: note: previous declaration 'HTTPMethod HTTP_GET'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
^
In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:63:18: error: redeclaration of 'HTTP_POST'
HTTP_POST = 0b00000010,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:50: note: previous declaration 'HTTPMethod HTTP_POST'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
^
In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:64:18: error: redeclaration of 'HTTP_DELETE'
HTTP_DELETE = 0b00000100,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:83: note: previous declaration 'HTTPMethod HTTP_DELETE'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
^
In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:65:18: error: redeclaration of 'HTTP_PUT'
HTTP_PUT = 0b00001000,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:61: note: previous declaration 'HTTPMethod HTTP_PUT'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
^
In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:66:18: error: redeclaration of 'HTTP_PATCH'
HTTP_PATCH = 0b00010000,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:71: note: previous declaration 'HTTPMethod HTTP_PATCH'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
^
In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:67:18: error: redeclaration of 'HTTP_HEAD'
HTTP_HEAD = 0b00100000,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:39: note: previous declaration 'HTTPMethod HTTP_HEAD'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
^
In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:68:18: error: redeclaration of 'HTTP_OPTIONS'
HTTP_OPTIONS = 0b01000000,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:96: note: previous declaration 'HTTPMethod HTTP_OPTIONS'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
^
In file included from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:14:0:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:69:18: error: redeclaration of 'HTTP_ANY'
HTTP_ANY = 0b01111111,
^
In file included from C:\Users\firas\Documents\Arduino\libraries\AsyncWiFiManager-development\src/AsyncWiFiManager.h:59:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:1:
C:\Users\firas\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WebServer\src/ESP8266WebServer.h:34:19: note: previous declaration 'HTTPMethod HTTP_ANY'
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };

@lbussy
Copy link
Owner Author

lbussy commented Apr 28, 2021

The original WiFiManager is now updated to support Async. To address the error you are seeing however,:

#define WEBSERVER_H // <- Define this before you import ESPAsyncWebServer lib
#include "ESPAsyncWebServer.h"

@firasRihan
Copy link

@lbussy well all the above errors disappeared except this one :
In file included from C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:467:0,
from C:\Users\firas\Desktop\UNI\Spring 2021\Senior Project\Smart Irrigation\Smart_Irrigation_Test2\Smart_Irrigation_Test2\Smart_Irrigation_Test2.ino:2:
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/WebHandlerImpl.h: In constructor 'AsyncCallbackWebHandler::AsyncCallbackWebHandler()':
C:\Users\firas\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/WebHandlerImpl.h:76:49: error: 'HTTP_ANY' was not declared in this scope
AsyncCallbackWebHandler() : _uri(), _method(HTTP_ANY), _onRequest(NULL), _onUpload(NULL), _onBody(NULL), _isRegex(false) {}

I am using the onDemandConfigPortal example with my code.

Thanks for your efforts

@firasRihan
Copy link

I tried to use the original WiFiManager but it had the same error as the first one

@lbussy
Copy link
Owner Author

lbussy commented Apr 29, 2021

Unfortunately, it's still an include ordering issue. I've never found a better way to get past that than to deconstruct the project (comment out includes) and put it back together again slowly. You will find a nested inclusion somewhere that is responsible.

@lbussy lbussy closed this as completed May 23, 2021
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

2 participants