2

Error messages

 Arduino: 1.8.14 Hourly Build 2020年12月15日 11:33 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:62:18: error: 'HTTP_GET' conflicts with a previous declaration
 
 62 | HTTP_GET = 0b00000001,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:29: note: previous declaration 'HTTPMethod HTTP_GET'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:63:18: error: 'HTTP_POST' conflicts with a previous declaration
 
 63 | HTTP_POST = 0b00000010,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:50: note: previous declaration 'HTTPMethod HTTP_POST'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:64:18: error: 'HTTP_DELETE' conflicts with a previous declaration
 
 64 | HTTP_DELETE = 0b00000100,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:83: note: previous declaration 'HTTPMethod HTTP_DELETE'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:65:18: error: 'HTTP_PUT' conflicts with a previous declaration
 
 65 | HTTP_PUT = 0b00001000,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:61: note: previous declaration 'HTTPMethod HTTP_PUT'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:66:18: error: 'HTTP_PATCH' conflicts with a previous declaration
 
 66 | HTTP_PATCH = 0b00010000,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:71: note: previous declaration 'HTTPMethod HTTP_PATCH'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:67:18: error: 'HTTP_HEAD' conflicts with a previous declaration
 
 67 | HTTP_HEAD = 0b00100000,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:39: note: previous declaration 'HTTPMethod HTTP_HEAD'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:68:18: error: 'HTTP_OPTIONS' conflicts with a previous declaration
 
 68 | HTTP_OPTIONS = 0b01000000,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:96: note: previous declaration 'HTTPMethod HTTP_OPTIONS'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:4:
 
 C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncWebServer-master\src/ESPAsyncWebServer.h:69:18: error: 'HTTP_ANY' conflicts with a previous declaration
 
 69 | HTTP_ANY = 0b01111111,
 
 | ^~~~~~~~~~
 
 In file included from C:\Users\JUNAID\Documents\Arduino\iot_project_4\iot_project_4.ino:2:
 
 C:\Users\JUNAID\AppData\Local\Arduino15\packages\esp8266\hardware\esp82663円.0.0\libraries\ESP8266WebServer\src/ESP8266WebServer.h:47:19: note: previous declaration 'HTTPMethod HTTP_ANY'
 
 47 | enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
 
 | ^~~~~~~~
 
 Multiple libraries were found for "ESPAsyncTCP.h"
 
 Used: C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncTCP
 
 Not used: C:\Users\JUNAID\Documents\Arduino\libraries\ESPAsyncTCP-master
 
 exit status 1
 
 Error compiling for board Generic ESP8266 Module.
 
 
 
 This report would have more information with
 "Show verbose output during compilation"
 option enabled in File -> Preferences.

Code

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
int Wifiled = 15;
 
ESP8266WebServer esp(80);
String HTML = "";
 
String FORM = "testing the second website";
void setup() 
{ 
 HTML +="<html>";
 HTML += "<head>";
 HTML += "<title>MY SMART HOME</title>"; 
 HTML +="<style>";
 HTML +="body {background-color:#92e8e2;}";
 HTML +="#wrapper {background-color:#ebf5f4;width:93%;min-height:700px;margin:auto;barder:1px solid #ccc;padding:10px;}";
 HTML +="</style>"; 
 
 HTML += "</head>";
 HTML += "<body>";
 HTML += "<div id='wrapper'>"; 
 HTML += "<h3>WELCOME TO MY SMART SENSOR DATA</h3>";
 HTML += "<h2>PH SENSOR DATA </h2>";
 HTML += "Serial.monitor";
 HTML += "<h2>EC SENSOR DATA </h2>";
 HTML += "</div >"; 
 HTML += "</body>"; 
 HTML +="</html>"; 
 pinMode(Wifiled,OUTPUT);
 delay(1000);
 Serial.begin(115200);
 WiFi.begin("LAPTOP","123456789");
 while(WiFi.status() != WL_CONNECTED)
 {
 Serial.print(".");
 digitalWrite(Wifiled,HIGH);
 delay(250);
 digitalWrite(Wifiled,LOW);
 delay(250); 
 }
 digitalWrite(Wifiled,HIGH);
 Serial.println("wifi connected");
 Serial.println(WiFi.localIP());
 esp.on("/",sendHtml);
 esp.on("/process",sendform);
 esp.begin();
}
void sendform()
{
 esp.send(200,"text/html;",FORM);
}
void sendHtml()
{
 esp.send(200,"text/html;",HTML);
 
}
void loop() 
{
 esp.handleClient();
 delay(200);
 char buffer[20]="";
 if(Serial.available()>0){
 // char data=Serial.read();
 Serial.readBytesUntil('\n',buffer,20);
 Serial.println(buffer);
 }
}
chicks
2274 silver badges10 bronze badges
asked Feb 27, 2023 at 16:06
2
  • ESP8266WebServer conflicts with ESPAsyncWebServer. Both cannot be used in the same program. Your code does not seem to use make use ESPAsyncWebServer or its features, so you could remove the lines #include <ESPAsyncTCP.h> and #include <ESPAsyncWebServer.h> from your code. Commented Feb 27, 2023 at 16:49
  • please add a clear, answerable question to your post Commented Feb 27, 2023 at 17:23

2 Answers 2

2

You've included <ESP8266WebServer.h> and <ESPAsyncWebServer.h>, it's one or the other, you can't have both. Hence you're getting error: 'HTTP_GET' conflicts with a previous declaration

answered Feb 27, 2023 at 16:48
-1

having checked <ElegantOTA.h> src it does include all the mentioned libs in your .ino. You should remove them and replace with #include <ElegantOTA.h>. Then it works fine

answered Jul 12, 2024 at 12:20
1
  • 1
    it includes one of them based on a macro ELEGANTOTA_USE_ASYNC_WEBSERVER. so your answer doesn't solve anything Commented Jul 12, 2024 at 14:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.