[GH-ISSUE #859] AP connection not saved up on power failures #725

Open
opened 2026-02-28 01:26:46 +03:00 by kerem · 9 comments
Owner

Originally created by @ghost on GitHub (Mar 27, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/859

Basic Infos

Hardware

WiFimanager Branch/Release:

  • [x ] Master
  • Development

Esp8266/Esp32:

  • [x ] ESP8266
  • ESP32

Hardware: ESP-12e, esp01, esp25

  • ESP01
  • [x ] ESP12 E/F/S (nodemcu, wemos, feather)
  • Other

ESP Core Version: 2.4.0, staging

  • 2.3.0
  • [x ] 2.4.0
  • staging (master/dev)

Description

hi guys, i have 2 problems that i looking for solutions.

1, how can i make sure the AP credentials got saved, lets say if power failures happens ?
but got deleted up on pressing the reset button on the side of the module ?
right now either way just clear the credentials.
Also if i just disconnect power im not able to login back (only if i use ESP.eraseConfig(); once than comment out that line)
please see debug info:

*WM: Sent config page
*WM: Request redirected to captive portal
*WM: Handle root
*WM: WiFi save
*WM: Sent wifi save page
*WM: Connecting to new AP
*WM: Connecting as wifi client...
*WM: Waiting for connection result with time out
*WM: Connection timed out
*WM: Connection result:
*WM: 0
*WM: Failed to connect.

2, if the password didn't entered correctly the screen stays at (Please connect to 123's WIFI)
what i have to add to show a massage that "wifi password failed plz restart"
please see debug info

*WM: Request redirected to captive portal
*WM: Handle root
*WM: WiFi save
*WM: Sent wifi save page
*WM: Connecting to new AP
*WM: Connecting as wifi client...
*WM: Connection result:
*WM: 4
*WM: Failed to connect.
*WM: Request redirected to captive portal
*WM: Handle root

Settings in IDE

Module: LOLIN D1 mini V3.1.0

Additional libraries:
#include "SPI.h"
#include "TFT_22_ILI9225.h"
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <WiFiManager.h>

Sketch




void setup() {


 
 WiFiManager wifiManager;

 tft.setFont(Terminal6x8);
 tft.drawText(0, 10, "Please connect to 123's WIFI");
 

    if (!wifiManager.startConfigPortal("123")) {
      Serial.println("failed to connect and hit timeout");
      ESP.reset();
      delay(5000);
    }

    //if you get here you have connected to the WiFi
    Serial.println("connected...yeey :)");
    tft.setFont(Terminal6x8);
    tft.drawText(10, 25, "SUCCESS!!!!");
    delay(1000);
    tft.clear();

 

}

void loop() {

}

Debug Messages

Originally created by @ghost on GitHub (Mar 27, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/859 ### Basic Infos #### Hardware **WiFimanager Branch/Release:** - [x ] Master - [ ] Development **Esp8266/Esp32:** - [x ] ESP8266 - [ ] ESP32 **Hardware: ESP-12e, esp01, esp25** - [ ] ESP01 - [x ] ESP12 E/F/S (nodemcu, wemos, feather) - [ ] Other **ESP Core Version: 2.4.0, staging** - [ ] 2.3.0 - [x ] 2.4.0 - [ ] staging (master/dev) ### Description hi guys, i have 2 problems that i looking for solutions. 1, how can i make sure the AP credentials got saved, lets say if power failures happens ? but got deleted up on pressing the reset button on the side of the module ? right now either way just clear the credentials. Also if i just disconnect power im not able to login back (only if i use ESP.eraseConfig(); once than comment out that line) please see debug info: *WM: Sent config page *WM: Request redirected to captive portal *WM: Handle root *WM: WiFi save *WM: Sent wifi save page *WM: Connecting to new AP *WM: Connecting as wifi client... *WM: Waiting for connection result with time out *WM: Connection timed out *WM: Connection result: *WM: 0 *WM: Failed to connect. 2, if the password didn't entered correctly the screen stays at (Please connect to 123's WIFI) what i have to add to show a massage that "wifi password failed plz restart" please see debug info *WM: Request redirected to captive portal *WM: Handle root *WM: WiFi save *WM: Sent wifi save page *WM: Connecting to new AP *WM: Connecting as wifi client... *WM: Connection result: *WM: 4 *WM: Failed to connect. *WM: Request redirected to captive portal *WM: Handle root ### Settings in IDE Module: LOLIN D1 mini V3.1.0 Additional libraries: #include "SPI.h" #include "TFT_22_ILI9225.h" #include <ESP8266WiFi.h> #include <ESP8266HTTPClient.h> #include <ESP8266WebServer.h> #include <DNSServer.h> #include <WiFiManager.h> ### Sketch ```cpp void setup() { WiFiManager wifiManager; tft.setFont(Terminal6x8); tft.drawText(0, 10, "Please connect to 123's WIFI"); if (!wifiManager.startConfigPortal("123")) { Serial.println("failed to connect and hit timeout"); ESP.reset(); delay(5000); } //if you get here you have connected to the WiFi Serial.println("connected...yeey :)"); tft.setFont(Terminal6x8); tft.drawText(10, 25, "SUCCESS!!!!"); delay(1000); tft.clear(); } void loop() { } ``` ### Debug Messages
Author
Owner

@tablatronix commented on GitHub (Mar 27, 2019):

Simple dont clear the settings and start configportal

<!-- gh-comment-id:477377946 --> @tablatronix commented on GitHub (Mar 27, 2019): Simple dont clear the settings and start configportal
Author
Owner

@ghost commented on GitHub (Mar 28, 2019):

i didn't clear settings thats the thing.
also i still have the issue that fail to reconnect when turned off for some reason.

once i use ESP.eraseConfig(); it works again

<!-- gh-comment-id:477559028 --> @ghost commented on GitHub (Mar 28, 2019): i didn't clear settings thats the thing. also i still have the issue that fail to reconnect when turned off for some reason. once i use ESP.eraseConfig(); it works again
Author
Owner

@tablatronix commented on GitHub (Mar 28, 2019):

You said clear credentials by pressing reset on side of device?

If your credentials are not working everytime, then your flash might be corrupt, do a full erase from esptool or arduino

<!-- gh-comment-id:477567518 --> @tablatronix commented on GitHub (Mar 28, 2019): You said clear credentials by pressing reset on side of device? If your credentials are not working everytime, then your flash might be corrupt, do a full erase from esptool or arduino
Author
Owner

@ghost commented on GitHub (Mar 28, 2019):

it turns out i had issue with the latest release of esp8266 v2.5.0
when i downgraded back to v2.4.0 works fine everything.

is there any way to configure the wifimanager without a 3rd device?
i have touchscreen lolin tft 2.4 , was wondering if possible to bring up a keyboard on a screen and enter the credentials that get saved later.

<!-- gh-comment-id:477596693 --> @ghost commented on GitHub (Mar 28, 2019): it turns out i had issue with the latest release of esp8266 v2.5.0 when i downgraded back to v2.4.0 works fine everything. is there any way to configure the wifimanager without a 3rd device? i have touchscreen lolin tft 2.4 , was wondering if possible to bring up a keyboard on a screen and enter the credentials that get saved later.
Author
Owner

@tablatronix commented on GitHub (Mar 28, 2019):

Yeah but then why would you need wm

<!-- gh-comment-id:477661156 --> @tablatronix commented on GitHub (Mar 28, 2019): Yeah but then why would you need wm
Author
Owner

@ghost commented on GitHub (Mar 28, 2019):

i guess if there is a way for it, i might dont need wm, can you share witch one you think of ?
thanks

<!-- gh-comment-id:477701296 --> @ghost commented on GitHub (Mar 28, 2019): i guess if there is a way for it, i might dont need wm, can you share witch one you think of ? thanks
Author
Owner

@tablatronix commented on GitHub (Mar 28, 2019):

Wm is a webportal for entering settings if younare going to ise a touchscreen the what is the point of using wm?

Not sure what you mean by a third device?

<!-- gh-comment-id:477741050 --> @tablatronix commented on GitHub (Mar 28, 2019): Wm is a webportal for entering settings if younare going to ise a touchscreen the what is the point of using wm? Not sure what you mean by a third device?
Author
Owner

@ghost commented on GitHub (Mar 28, 2019):

if you use wm you need a 3rd party device.
i already told you, im not necessarily want to use wm if i can make it with touchscreen. my question is still up.

<!-- gh-comment-id:477744560 --> @ghost commented on GitHub (Mar 28, 2019): if you use wm you need a 3rd party device. i already told you, im not necessarily want to use wm if i can make it with touchscreen. my question is still up.
Author
Owner

@tablatronix commented on GitHub (Mar 29, 2019):

You mean a second device to connect to the websserver.

No idea you would need a popup keyboard generator and save the inouts and call begin(ssid,password) this is all normal esp stuff not wm

<!-- gh-comment-id:477826231 --> @tablatronix commented on GitHub (Mar 29, 2019): You mean a second device to connect to the websserver. No idea you would need a popup keyboard generator and save the inouts and call begin(ssid,password) this is all normal esp stuff not wm
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#725
No description provided.