zhouhan0126 / WIFIMANAGER-ESP32

wifimanager-esp32
MIT License
401 stars 135 forks source link

[HTTP HEAD] problem #17

Open Cyb3rn0id opened 5 years ago

Cyb3rn0id commented 5 years ago

Give me this error:

In file included from C:\Users\Gianni\Documents\Arduino\libraries\WiFiManager-ESP32\examples\AutoConnect\AutoConnect.ino:14:0:

C:\Users\Gianni\Documents\Arduino\libraries\WiFiManager-ESP32/WiFiManager.h:36:22: error: 'const char HTTP_HEAD []' redeclared as different kind of symbol

const char HTTP_HEAD[] PROGMEM = "<!DOCTYPE html><html lang=\"en\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/>{v}";

                  ^

In file included from C:\Users\Gianni\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/WebServer.h:30:0,

             from C:\Users\Gianni\Documents\Arduino\libraries\WiFiManager-ESP32\examples\AutoConnect\AutoConnect.ino:12:

C:\Users\Gianni\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WebServer\src/HTTP_Method.h:10:3: note: previous declaration 'HTTPMethod HTTP_HEAD'

HTTP_HEAD = 0b00100000,

^

Garito commented 5 years ago

Hi! Same problem here Anyone taking care of this? Thanks

Juliothurler commented 5 years ago

I am with the same issue, Could someone help us.

Juliothurler commented 5 years ago

I think nobody os taking Care about this.

Garito commented 5 years ago

There is an async version of this manager without the issues here (I'm already using it) https://github.com/alanswx/ESPAsyncWiFiManager

Juliothurler commented 5 years ago

i will check with your suggestion, thanks a lot , and I will send you how is this working on, again thank you very much.

Em sáb, 15 de set de 2018 às 12:06, Garito notifications@github.com escreveu:

There is an async version of this manager without the issues here (I'm already using it) https://github.com/alanswx/ESPAsyncWiFiManager

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zhouhan0126/WIFIMANAGER-ESP32/issues/17#issuecomment-421583904, or mute the thread https://github.com/notifications/unsubscribe-auth/AoU37xS8Bq_gh21YFdTeI9JiKwshPaoUks5ubReNgaJpZM4Wf-As .

hellocaio commented 5 years ago

I'm having the same issue here.

@Garito, I just tried your suggestion but the author of WiFiAsyncManager says to add "", which is this library. I don't get it.

Garito commented 5 years ago

The guy copied the project and make the modifications but not updated the readme and so Check the examples If implemented even the websocket server using them

bobermen1 commented 5 years ago

I was having this issue with the examples as well. To fix it I replaced

#if defined(ESP8266)
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
#else
#include <WiFi.h>          //https://github.com/esp8266/Arduino
#endif

//needed for library
#include <DNSServer.h>
#if defined(ESP8266)
#include <ESP8266WebServer.h>
#else
#include <WebServer.h>
#endif
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager

With

#include <WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
hellocaio commented 5 years ago

@bobermen1, are you using ESP32 or ESP8266?

I attempted replacing all HTTP_HEAD with HTTP_HEADER and it compiles and uploads it but I couldn't get the library to work. I tried this with the AutoConnect example that comes with the library. This sucks.

kotran88 commented 5 years ago

I tried all the things above, but didn't work any. I replace it to

include

include

include

include

but said ESP8266WebServer.h: No such file or directory

hellocaio commented 5 years ago

Yeh @kotran88, same here. If you have selected the board ESP32, the compiler won't fetch the packages for ESP8266 and vice-versa. Different libraries for different cores. There seems to be a conflict with the variable name HTTP_HEAD and WebServer library.

hellocaio commented 5 years ago

Hey guys, I just got the async version working! Yes! I will be running further tests soon, but I can tell you that it works with ESP32 and its latest core library. One major issue was my USB cable. My cable is faulty even though it seemed to work just fine (it has communication and power), and after getting a better cable the async wifi manager worked.

With that said, maybe this library (synced version) does work after replacing all the HTTP_HEAD with a different name like I had tried. All along it was this piece of shit cable that I actually bought recently. These shit cables from China, I tell you...

hellocaio commented 5 years ago

To be a little more specific (for the people from the future with similar problem to find), this was "Brownout detector was triggered" flag thrown in the serial monitor. So if you have this problem, try a better cable. It seems to be a common problem when using the WiFi module of the ESP32. If you don't use the WiFi module, things seem peachy.

Long story long, initially I thought it was a grounding problem with my USB port on my computer, then I thought maybe it was the cable so I went out and bought a new one... which threw me off because the problem wasn't solved and it was a new cable... Also, when I powered the board with a battery bank, everything worked fine except the WiFi. In the end, after reading a bunch of forums and brainstorming I went out and got a better cable, problem solved.

lacneto commented 5 years ago

I was having the same HTTP_HEAD problem and the solution was simpler than it looked. I just edited the WiFiManager.h files and WifiManager.cpp replacing (HTTP_HEAD) with (HTTP_HEADER) and there was no more compilation problem.

mineirinRV commented 5 years ago

I had the same problem, so I located the file "HTTP_Method.h" in the "C: \ Arduino \ hardware \ espressif \ esp32 \ libraries \ WebServer \ src" folder, modified line 10 HTTP_HEAD = 0b00100000, --> HTTP_HEADER = 0b00100000, and everything worked correctly. MineirinRV

shootdaj commented 5 years ago

A better solution imo is to rename the constant in WifiManager.h:

HTML_HEAD -> HTTP_HEAD_HTML

and then rename all the references in WifiManager.cpp:

HTML_HEAD -> HTTP_HEAD_HTML

I verified that this works. This way you are not breaking WebServer if it references that constant anywhere (or any other libs that depend on it)

TheBrunez commented 5 years ago

There is a pull request pending for this problem. I've created a fork and solved this issue, you can find it here Brunez3BD/WifiManager

FRG7854 commented 5 years ago

Brunez3BD, Thank you very much. I found my WiFiManager files, opened it with Wordpad, replaced with your program and everything is fine. Thank you again.

dalwinder1578singh commented 4 years ago

i am facing problem with esp32 , it was running very good uploading debugging, all of sudden warning came no more support esp board, i have tried all out, re installing ide, reinstalling ,packages,now every thing looks ok board is read on screen , up load ok data verified no error message, but application does not start, can any one give cue what is going one i have 4 esp board all of them same result. thanks in advance.

jotadepicas commented 4 years ago

@shootdaj thanks for the workaround, it worked for me. However, could there be a typo in your message? I think it's not:

HTML_HEAD -> HTTP_HEAD_HTML

but actually:

HTTP_HEAD -> HTTP_HEAD_HTML.

israeloriente commented 4 years ago

I was having this issue with the examples as well. To fix it I replaced

#if defined(ESP8266)
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
#else
#include <WiFi.h>          //https://github.com/esp8266/Arduino
#endif

//needed for library
#include <DNSServer.h>
#if defined(ESP8266)
#include <ESP8266WebServer.h>
#else
#include <WebServer.h>
#endif
#include <WiFiManager.h>         //https://github.com/tzapu/WiFiManager

With

#include <WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>

This fixed for me using LilyGo-T-Call-SIM800L.

ramante commented 4 years ago

There is an async version of this manager without the issues here (I'm already using it) https://github.com/alanswx/ESPAsyncWiFiManager

Hi Garito, thank you so much for the solution, works 100% to me. Regards, Rogerio

Andrisetianabrata commented 2 years ago

A better solution imo is to rename the constant in WifiManager.h:

HTML_HEAD -> HTTP_HEAD_HTML

and then rename all the references in WifiManager.cpp:

HTML_HEAD -> HTTP_HEAD_HTML

I verified that this works. This way you are not breaking WebServer if it references that constant anywhere (or any other libs that depend on it)

Thanks mate thats work as well 👍👍❤️