[GH-ISSUE #1518] after connecting it on portal , it keep saying error WIFI_REASON: 2 #1295

Closed
opened 2026-02-28 01:29:27 +03:00 by kerem · 1 comment
Owner

Originally created by @kotran88 on GitHub (Nov 10, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1518

PLEASE TRY DEVELOPMENT BRANCH before submitting bugs on release or master, in case they were already fixed.

Issues without basic info will be ignored or closed!

Please fill the info fields, it helps to get you faster support ;)

*wm:[1] connectTimeout not set, ESP waitForConnectResult...
*wm:[2] [EVENT] WIFI_REASON: 2
*wm:[2] [EVENT] WIFI_REASON: 2
*wm:[2] [EVENT] WIFI_REASON: 2
*wm:[2] [EVENT] WIFI_REASON: 2
*wm:[2] [EVENT] WIFI_REASON: 2
*wm:[2] [EVENT] WIFI_REASON: 2
*wm:[2] [EVENT] WIFI_REASON: 2
*wm:[2] [EVENT] WIFI_REASON: 2

----------------------------- Remove above -----------------------------

Basic Infos

Hardware

WiFimanager Branch/Release: Master
ESP32S


#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager

void setup() {
    WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
    // it is a good practice to make sure your code sets wifi mode how you want it.

    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("hahaha");
    //WiFiManager, Local intialization. Once its business is done, there is no need to keep it around
    WiFiManager wm;

    // reset settings - wipe stored credentials for testing
    // these are stored by the esp library
    //wm.resetSettings();

    // Automatically connect using saved credentials,
    // if connection fails, it starts an access point with the specified name ( "AutoConnectAP"),
    // if empty will auto generate SSID, if password is blank it will be anonymous AP (wm.autoConnect())
    // then goes into a blocking loop awaiting configuration and will return success result

    bool res;
    Serial.println("setup");
    // res = wm.autoConnect(); // auto generated AP name from chipid
    // res = wm.autoConnect("onofflab_esp32"); // anonymous ap
    res = wm.autoConnect("Auto","password"); // password protected ap
    // wm.disconnect();
    Serial.println(res);
    if(!res) {
        Serial.println("Failed to connect");
        // ESP.restart();
    } 
    else {
        //if you get here you have connected to the WiFi    
        Serial.println("connected...yeey :)");
    }

}

void loop() {
    // put your main code here, to run repeatedly:  
}

Originally created by @kotran88 on GitHub (Nov 10, 2022). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1518 ## PLEASE TRY DEVELOPMENT BRANCH before submitting bugs on release or master, in case they were already fixed. ## Issues without basic info will be ignored or closed! Please fill the info fields, it helps to get you faster support ;) *wm:[1] connectTimeout not set, ESP waitForConnectResult... *wm:[2] [EVENT] WIFI_REASON: 2 *wm:[2] [EVENT] WIFI_REASON: 2 *wm:[2] [EVENT] WIFI_REASON: 2 *wm:[2] [EVENT] WIFI_REASON: 2 *wm:[2] [EVENT] WIFI_REASON: 2 *wm:[2] [EVENT] WIFI_REASON: 2 *wm:[2] [EVENT] WIFI_REASON: 2 *wm:[2] [EVENT] WIFI_REASON: 2 ----------------------------- Remove above ----------------------------- ### Basic Infos #### Hardware WiFimanager Branch/Release: Master ESP32S ``` #include <WiFiManager.h> // https://github.com/tzapu/WiFiManager void setup() { WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP // it is a good practice to make sure your code sets wifi mode how you want it. // put your setup code here, to run once: Serial.begin(115200); Serial.println("hahaha"); //WiFiManager, Local intialization. Once its business is done, there is no need to keep it around WiFiManager wm; // reset settings - wipe stored credentials for testing // these are stored by the esp library //wm.resetSettings(); // Automatically connect using saved credentials, // if connection fails, it starts an access point with the specified name ( "AutoConnectAP"), // if empty will auto generate SSID, if password is blank it will be anonymous AP (wm.autoConnect()) // then goes into a blocking loop awaiting configuration and will return success result bool res; Serial.println("setup"); // res = wm.autoConnect(); // auto generated AP name from chipid // res = wm.autoConnect("onofflab_esp32"); // anonymous ap res = wm.autoConnect("Auto","password"); // password protected ap // wm.disconnect(); Serial.println(res); if(!res) { Serial.println("Failed to connect"); // ESP.restart(); } else { //if you get here you have connected to the WiFi Serial.println("connected...yeey :)"); } } void loop() { // put your main code here, to run repeatedly: } ```
kerem closed this issue 2026-02-28 01:29:27 +03:00
Author
Owner

@tablatronix commented on GitHub (Nov 10, 2022):

Are you sure you are up to date with latest version , i remember this being fixed.

<!-- gh-comment-id:1310765963 --> @tablatronix commented on GitHub (Nov 10, 2022): Are you sure you are up to date with latest version , i remember this being fixed.
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#1295
No description provided.