-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updating ESP32 arduino core to 3.1.0 seems to break wm.startConfigPortal() #1797
Comments
If you remove getwificredentials? |
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> void setup() {
} void loop() { } |
chip is: ESP32-S3-WROOM-1-N8 |
Works for me, super example
|
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. |
Ah good point, could be a race condition |
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));
}
}
The text was updated successfully, but these errors were encountered: