[GH-ISSUE #1797] updating ESP32 arduino core to 3.1.0 seems to break wm.startConfigPortal() #1513

Open
opened 2026-02-28 01:30:22 +03:00 by kerem · 6 comments
Owner

Originally created by @GrantSando on GitHub (Feb 1, 2025).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1797

If I call wm.startConfigPortal(ssid, pass) with arduino-esp32 3.0.7 or earlier it creates the portal.

If I call it with arduino-esp32 3.1.0 or later installed it causes a "Guru Meditation Error: Core 1 panic'ed." and restarts device.

code looks like this,

#include "Arduino.h"
#include <WiFiManager.h>
#include <string.h>
#include <Preferences.h>

Preferences preferences;
WiFiManager wm;
char ssidString[50] = "";
char pwString[50] = "";
const int setupPin = 21;

void setup() {
Serial.begin(9600);
delay(1500);
pinMode(setupPin, INPUT_PULLUP);
getWiFiCredentials();
// InitWiFi();
}

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

}

void getWiFiCredentials(){

//load ssid and password from preferences
preferences.begin("credentials", false);
String ssid = preferences.getString("ssid", "");
ssid.toCharArray(ssidString, sizeof(ssidString));
String pw = preferences.getString("password", "");
pw.toCharArray(pwString, sizeof(pwString));
preferences.end();

WiFi.mode(WIFI_STA);

//if ssid and password have not been setup then start portal for user input
if (ssid == "" | digitalRead(setupPin) == 0)
{
if (!wm.startConfigPortal("MY_WIFI", "PASS1234"))
{
Serial.println("failed to connect and hit timeout");
delay(3000);
ESP.restart();
delay(5000);
}
else
{
//get ssid and password from portal
String ssid = wm.getWiFiSSID();
ssid.toCharArray(ssidString, sizeof(ssidString));
String pw = wm.getWiFiPass();
pw.toCharArray(pwString, sizeof(pwString));

  //save ssid and password to preferences
  preferences.begin("credentials", false);
    preferences.putString("ssid", ssidString); 
    preferences.putString("password", pwString);
  preferences.end();
}

}
}

Originally created by @GrantSando on GitHub (Feb 1, 2025). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1797 If I call wm.startConfigPortal(ssid, pass) with arduino-esp32 3.0.7 or earlier it creates the portal. If I call it with arduino-esp32 3.1.0 or later installed it causes a "Guru Meditation Error: Core 1 panic'ed." and restarts device. code looks like this, #include "Arduino.h" #include <WiFiManager.h> #include <string.h> #include <Preferences.h> Preferences preferences; WiFiManager wm; char ssidString[50] = ""; char pwString[50] = ""; const int setupPin = 21; void setup() { Serial.begin(9600); delay(1500); pinMode(setupPin, INPUT_PULLUP); getWiFiCredentials(); // InitWiFi(); } void loop() { // put your main code here, to run repeatedly: } void getWiFiCredentials(){ //load ssid and password from preferences preferences.begin("credentials", false); String ssid = preferences.getString("ssid", ""); ssid.toCharArray(ssidString, sizeof(ssidString)); String pw = preferences.getString("password", ""); pw.toCharArray(pwString, sizeof(pwString)); preferences.end(); WiFi.mode(WIFI_STA); //if ssid and password have not been setup then start portal for user input if (ssid == "" | digitalRead(setupPin) == 0) { if (!wm.startConfigPortal("MY_WIFI", "PASS1234")) { Serial.println("failed to connect and hit timeout"); delay(3000); ESP.restart(); delay(5000); } else { //get ssid and password from portal String ssid = wm.getWiFiSSID(); ssid.toCharArray(ssidString, sizeof(ssidString)); String pw = wm.getWiFiPass(); pw.toCharArray(pwString, sizeof(pwString)); //save ssid and password to preferences preferences.begin("credentials", false); preferences.putString("ssid", ssidString); preferences.putString("password", pwString); preferences.end(); } } }
Author
Owner

@tablatronix commented on GitHub (Feb 1, 2025):

If you remove getwificredentials?

<!-- gh-comment-id:2629061761 --> @tablatronix commented on GitHub (Feb 1, 2025): If you remove getwificredentials?
Author
Owner

@GrantSando commented on GitHub (Feb 1, 2025):

Thanks for your reply. I have now simplified the code and uninstalled all additional libraries apart from WiFiManager.h and still get the same result. (starts portal with 3.0.7, crashes chip with 3.1.0). I should add this is Arduino IDE 2.3.4

Are there some other files I should delete before testing?

Code now is,

#include <WiFiManager.h>
WiFiManager wm;

void setup() {
Serial.begin(9600);
delay(1500);

WiFi.mode(WIFI_STA);
wm.startConfigPortal("MY_WIFI", "PASS1234");

}

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

}

<!-- gh-comment-id:2629081617 --> @GrantSando commented on GitHub (Feb 1, 2025): Thanks for your reply. I have now simplified the code and uninstalled all additional libraries apart from WiFiManager.h and still get the same result. (starts portal with 3.0.7, crashes chip with 3.1.0). I should add this is Arduino IDE 2.3.4 Are there some other files I should delete before testing? Code now is, #include <WiFiManager.h> WiFiManager wm; void setup() { Serial.begin(9600); delay(1500); WiFi.mode(WIFI_STA); wm.startConfigPortal("MY_WIFI", "PASS1234"); } void loop() { // put your main code here, to run repeatedly: }
Author
Owner

@GrantSando commented on GitHub (Feb 1, 2025):

chip is: ESP32-S3-WROOM-1-N8
partition scheme is: 8mb with spiffs (or 4mb with spiffs - same result)

<!-- gh-comment-id:2629085938 --> @GrantSando commented on GitHub (Feb 1, 2025): chip is: ESP32-S3-WROOM-1-N8 partition scheme is: 8mb with spiffs (or 4mb with spiffs - same result)
Author
Owner

@tablatronix commented on GitHub (Feb 9, 2025):

Works for me, super example

*wm:[2] [SYS] WM version:  v2.0.17 D:4
*wm:[2] [SYS] Arduino version:  3.1.1
*wm:[2] [SYS] ESP SDK version:  5.3.2.250120
*wm:[2] [SYS] Free heap:        347712
*wm:[2] [SYS] Chip ID: 3245692124
*wm:[2] [SYS] Chip Model: ESP32-S3
*wm:[2] [SYS] Chip Cores: 2
*wm:[2] [SYS] Chip Rev: 1
[  4003][V][AP.cpp:108] _onApEvent(): AP Started
[  4007][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 130 - AP_START
[  4015][V][AP.cpp:88] _onApArduinoEvent(): Arduino AP Event: 130 - AP_START
*wm:[2] AP IP address: 192.168.4.1
*wm:[3] [CB] _apcallback calling 
[CALLBACK] configModeCallback fired
*wm:[4] setupConfigPortal 
*wm:[2] Starting Web Portal 
[  4503][V][NetworkServer.h:41] NetworkServer(): NetworkServer::NetworkServer(port=80, ...)
[  4512][V][WebServer.cpp:49] WebServer(): WebServer::Webserver(port=80)
*wm:[3] [CB] _webservercallback calling 
*wm:[3] HTTP server started 
*wm:[4] setupDNSD 
*wm:[4] dns server started with ip:  192.168.4.1
*wm:[3] Config Portal Running, blocking, waiting for clients... 
*wm:[3] Portal Timeout In 90 seconds
*wm:[3] Portal Timeout In 63 seconds
<!-- gh-comment-id:2646080911 --> @tablatronix commented on GitHub (Feb 9, 2025): Works for me, super example ``` *wm:[2] [SYS] WM version: v2.0.17 D:4 *wm:[2] [SYS] Arduino version: 3.1.1 *wm:[2] [SYS] ESP SDK version: 5.3.2.250120 *wm:[2] [SYS] Free heap: 347712 *wm:[2] [SYS] Chip ID: 3245692124 *wm:[2] [SYS] Chip Model: ESP32-S3 *wm:[2] [SYS] Chip Cores: 2 *wm:[2] [SYS] Chip Rev: 1 ``` ``` [ 4003][V][AP.cpp:108] _onApEvent(): AP Started [ 4007][V][NetworkEvents.cpp:113] _checkForEvent(): Network Event: 130 - AP_START [ 4015][V][AP.cpp:88] _onApArduinoEvent(): Arduino AP Event: 130 - AP_START *wm:[2] AP IP address: 192.168.4.1 *wm:[3] [CB] _apcallback calling [CALLBACK] configModeCallback fired *wm:[4] setupConfigPortal *wm:[2] Starting Web Portal [ 4503][V][NetworkServer.h:41] NetworkServer(): NetworkServer::NetworkServer(port=80, ...) [ 4512][V][WebServer.cpp:49] WebServer(): WebServer::Webserver(port=80) *wm:[3] [CB] _webservercallback calling *wm:[3] HTTP server started *wm:[4] setupDNSD *wm:[4] dns server started with ip: 192.168.4.1 *wm:[3] Config Portal Running, blocking, waiting for clients... *wm:[3] Portal Timeout In 90 seconds *wm:[3] Portal Timeout In 63 seconds ```
Author
Owner

@GrantSando commented on GitHub (Feb 9, 2025):

OK thanks, just tested that and it worked for me also.

I noticed WiFi.mode(WIFI_STA) was removed from the super example. When I remove this from my examples above they also work without issue.

Seems that with core 3.1.0 and higher this line shouldn't be called.

Thanks for your help and the work you've done with this library.

<!-- gh-comment-id:2646122253 --> @GrantSando commented on GitHub (Feb 9, 2025): OK thanks, just tested that and it worked for me also. I noticed WiFi.mode(WIFI_STA) was removed from the super example. When I remove this from my examples above they also work without issue. Seems that with core 3.1.0 and higher this line shouldn't be called. Thanks for your help and the work you've done with this library.
Author
Owner

@tablatronix commented on GitHub (Feb 9, 2025):

Ah good point, could be a race condition
But that also is working for me without issue

<!-- gh-comment-id:2646309469 --> @tablatronix commented on GitHub (Feb 9, 2025): Ah good point, could be a race condition But that also is working for me without issue
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#1513
No description provided.