srwi / ESPEssentials

Essentials to get you started with your Arduino projects using the ESP8266 and ESP32.
GNU Lesser General Public License v2.1
26 stars 5 forks source link

Don't require reset after wifi configuration #1

Open trostmarvin opened 3 years ago

trostmarvin commented 3 years ago

The wifimanager part works just fine for me, it connects successfully to my network but after that I can't reach any of the routes. I tried every route with the specified http method. The device ip address is also correct and I can ping the ESP without any problems. Anyone has an idea what the problem might be?

srwi commented 3 years ago

Hi! Would it be possible for you to upload a minimal sketch that would allow me to reproduce the problem?

trostmarvin commented 3 years ago

Hi, thank you for your response. Here is my sketch:

#include <ESPEssentials.h>

void setup()
{
  initESPEssentials("ESP8266-001 CAPTIVE PORTAL");

  /* Reset WIFI Settings Route */
  WebServer.on("/reset_wifi", HTTP_GET, [&]() {
    WebServer.send(200, "text/plain", "Wifi settings reset.");
    Wifi.resetSettings();
  });
}

void loop()
{
  handleESPEssentials();
}
srwi commented 3 years ago

This works for me actually. Did you try resetting the esp8266 after setting up wifi credentials with WifiManager? Also make sure you are opening http://192.168.0.xxx/edit rather than https://192.168.0.xxx/edit.

If that does not work I would be interested in the serial output. The default baud rate is 115200.

trostmarvin commented 3 years ago

Thank you for your help, now it works. Although I'm not exactly sure what the problem was. I restarted my router and opened the serial monitor. It then just worked after resetting the ESP two or three times.

srwi commented 3 years ago

Thanks for the update!

I will reopen the issue since I think it should not be necessary to reset the ESP after entering wifi credentials.