[GH-ISSUE #1691] Problem *wm:[ERROR] Connect to new AP Failed #1436

Open
opened 2026-02-28 01:30:04 +03:00 by kerem · 1 comment
Owner

Originally created by @mridzkyf on GitHub (Dec 27, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1691

Hello, i have a problem with WifiManager in my ESP32 Devkit. When i want to connect my ESP32 with WiFi using AP Mode, in serial monitor always show the error like this :
*wm:[ERROR] Connect to new AP Failed
Im so very confused, the password that I typed in the SSID that I chose is already correct, but the AP mode is still error and cannot connect to the WiFi SSID selected.
For the information, in this project i use a 2 core management and use a Menu Library, so if i want to use a WiFiManager I have to access the Wifi Manager menu on my device using the keypad.
i have put a snippet program code below.
I hope there is a solution to my problem, thank you!

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

Basic Infos

Hardware

WiFimanager Branch/Release: Master

Esp8266/Esp32:

Hardware: ESP32 Devkit V1

Description

*wm:[ERROR] Connect to new AP Failed

Settings in IDE

Module: ESP32 Devkit Module

Additional libraries:
#include <Blynk.h>
#include <BlynkSimpleEsp32.h>
#include <Keypad.h>
#include <LiquidCrystal_I2C.h>
#include <ItemSubMenu.h>
#include <ItemCommand.h>
#include <LcdMenu.h>
#include <WiFiManager.h>
#include <WiFi.h>
#include <DHT.h>
#include <MQUnifiedsensor.h>
#include <Fuzzy.h>
#include <HTTPClient.h>

Sketch

#BEGIN
#include <Arduino.h>

void setup() {
Serial.begin(115200);
    xTaskCreatePinnedToCore(
                    Task1code,   /* Task function. */
                    "Task1",     /* name of task. */
                    40000,       /* Stack size of task */
                    NULL,        /* parameter of the task */
                    0,           /* priority of the task */
                    &Task1,      /* Task handle to keep track of created task */
                    0);          /* pin task to core 0 */                  
//  delay(500); 
    xTaskCreatePinnedToCore(
                    Task2code,   /* Task function. */
                    "Task2",     /* name of task. */
                    40000,       /* Stack size of task */
                    NULL,        /* parameter of the task */
                    1,           /* priority of the task */
                    &Task2,      /* Task handle to keep track of created task */
                    1);          /* pin task to core 0 */                  
//  delay(500); 
}

}

void Task1code( void * pvParameters ){
  for(;;){
    wifi_ap();
    noInterrupts();
    read_data_sensor();
    sendData();
    postData();
    wifi_alert();
    interrupts();
    delay(5000);
  }
}

void Task2code( void * pvParameters ){
  menu.setupLcdWithMenu(0x27, mainMenu);
  for(;;){
       menu_act();
  } 
}

//The function below is the function that I use to run AP Mode
void wifi_con(){
  char key = keypad.getKey();
  while(key != '#'){
    currentTime = millis();
    key = keypad.getKey();
    if((currentTime - lastTime) > 4000){
    if (WiFi.status() != WL_CONNECTED){
      menu.lcd->clear();
      menu.lcd->setCursor(0,0);
      menu.lcd->print("AP Connection : ");
      menu.lcd->setCursor(0,1);
      menu.lcd->print("UserName:SAMO Device");
      menu.lcd->setCursor(0,2);
      menu.lcd->print("pass:bpmsphbersih");
//      if(on_wifi == false){
//        key = '#';
//       }
      on_wifi = true;
      wifi_ap();
    } else {
        menu.lcd->clear();
        menu.lcd->setCursor(0,0);
        menu.lcd->print("Device connected");
        menu.lcd->setCursor(0,1);
        menu.lcd->print("Wifi IP : ");
        menu.lcd->setCursor(0,2);     
        menu.lcd->print(WiFi.localIP());
        menu.lcd->setCursor(0,3);
        menu.lcd->print("Was Connected");
    }
    lastTime = currentTime;
    }
  }
    menu.back();
    menu.resetMenu();
}
//=================================================
void wifi_ap(){
  if(on_wifi){
    on_wifi = false;
    Serial.print("On Wifi Aktif");
    currentTime = millis();
//    menu.back();
//    menu.resetMenu();
    res = wm.autoConnect("SAMO Device", "bpmsphbersih");
    Serial.print(res);
    if (res){
      Serial.print("Sukses");
      const char* ssid1 = WiFi.SSID().c_str();
      const char* pass1 = WiFi.psk().c_str();
      ssid = ssid1;
      pass = pass1;
      Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
      on_wifi = false;
//      telahOn = true;
      wifi_con();
      } 
  }
}
#END

Debug Messages

*wm:[ERROR] Connect to new AP Failed 
Originally created by @mridzkyf on GitHub (Dec 27, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1691 Hello, i have a problem with WifiManager in my ESP32 Devkit. When i want to connect my ESP32 with WiFi using AP Mode, in serial monitor always show the error like this : *wm:[ERROR] Connect to new AP Failed Im so very confused, the password that I typed in the SSID that I chose is already correct, but the AP mode is still error and cannot connect to the WiFi SSID selected. For the information, in this project i use a 2 core management and use a Menu Library, so if i want to use a WiFiManager I have to access the Wifi Manager menu on my device using the keypad. i have put a snippet program code below. I hope there is a solution to my problem, thank you! ----------------------------- Remove above ----------------------------- ### Basic Infos #### Hardware WiFimanager Branch/Release: Master Esp8266/Esp32: Hardware: ESP32 Devkit V1 ### Description *wm:[ERROR] Connect to new AP Failed ### Settings in IDE Module: ESP32 Devkit Module Additional libraries: #include <Blynk.h> #include <BlynkSimpleEsp32.h> #include <Keypad.h> #include <LiquidCrystal_I2C.h> #include <ItemSubMenu.h> #include <ItemCommand.h> #include <LcdMenu.h> #include <WiFiManager.h> #include <WiFi.h> #include <DHT.h> #include <MQUnifiedsensor.h> #include <Fuzzy.h> #include <HTTPClient.h> ### Sketch ```cpp #BEGIN #include <Arduino.h> void setup() { Serial.begin(115200); xTaskCreatePinnedToCore( Task1code, /* Task function. */ "Task1", /* name of task. */ 40000, /* Stack size of task */ NULL, /* parameter of the task */ 0, /* priority of the task */ &Task1, /* Task handle to keep track of created task */ 0); /* pin task to core 0 */ // delay(500); xTaskCreatePinnedToCore( Task2code, /* Task function. */ "Task2", /* name of task. */ 40000, /* Stack size of task */ NULL, /* parameter of the task */ 1, /* priority of the task */ &Task2, /* Task handle to keep track of created task */ 1); /* pin task to core 0 */ // delay(500); } } void Task1code( void * pvParameters ){ for(;;){ wifi_ap(); noInterrupts(); read_data_sensor(); sendData(); postData(); wifi_alert(); interrupts(); delay(5000); } } void Task2code( void * pvParameters ){ menu.setupLcdWithMenu(0x27, mainMenu); for(;;){ menu_act(); } } //The function below is the function that I use to run AP Mode void wifi_con(){ char key = keypad.getKey(); while(key != '#'){ currentTime = millis(); key = keypad.getKey(); if((currentTime - lastTime) > 4000){ if (WiFi.status() != WL_CONNECTED){ menu.lcd->clear(); menu.lcd->setCursor(0,0); menu.lcd->print("AP Connection : "); menu.lcd->setCursor(0,1); menu.lcd->print("UserName:SAMO Device"); menu.lcd->setCursor(0,2); menu.lcd->print("pass:bpmsphbersih"); // if(on_wifi == false){ // key = '#'; // } on_wifi = true; wifi_ap(); } else { menu.lcd->clear(); menu.lcd->setCursor(0,0); menu.lcd->print("Device connected"); menu.lcd->setCursor(0,1); menu.lcd->print("Wifi IP : "); menu.lcd->setCursor(0,2); menu.lcd->print(WiFi.localIP()); menu.lcd->setCursor(0,3); menu.lcd->print("Was Connected"); } lastTime = currentTime; } } menu.back(); menu.resetMenu(); } //================================================= void wifi_ap(){ if(on_wifi){ on_wifi = false; Serial.print("On Wifi Aktif"); currentTime = millis(); // menu.back(); // menu.resetMenu(); res = wm.autoConnect("SAMO Device", "bpmsphbersih"); Serial.print(res); if (res){ Serial.print("Sukses"); const char* ssid1 = WiFi.SSID().c_str(); const char* pass1 = WiFi.psk().c_str(); ssid = ssid1; pass = pass1; Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass); on_wifi = false; // telahOn = true; wifi_con(); } } } #END ``` ### Debug Messages ``` *wm:[ERROR] Connect to new AP Failed ```
Author
Owner

@tablatronix commented on GitHub (Dec 29, 2023):

More debug what reason

<!-- gh-comment-id:1871683312 --> @tablatronix commented on GitHub (Dec 29, 2023): More debug what reason
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#1436
No description provided.