mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1237] cannot create an AP after autoConnect failed #1057
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1057
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yuan910715 on GitHub (Apr 7, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1237
Basic Infos
Hardware
WiFimanager Branch/Release: Release
Esp8266/Esp32:
Hardware: ESP8266
Core Version: Release v2.0.3-apha Development
Description
I want to create an offline mode access point to provide some web pages after the autoConnect timeout, but after the autoConnect timeout, I can't search the offline mode access point, whether it's AP or AP_ STA mode, below it's a minimum version program, please help me , thanks
Settings in IDE
Module: NodeMcu
Additional libraries:
Sketch
Debug Messages
@tablatronix commented on GitHub (Apr 7, 2021):
You will want to use non blocking mode in master branch.
See the examples to keep running the ap or webserver all the time
@yuan910715 commented on GitHub (Apr 8, 2021):
I mean, if autoConnect timeout , I want to create an access point and display some my own pages (not WiFi manager portal) , I change WiFi.mode(WIFI_AP_STA); and create softAP after timeout ,but I can't search the AP .
I've looked at the non blocking example you mentioned, and I found it's to keep the wifimanager portal page after connect failed.
Do you have any suggestions? thanks.
@tablatronix commented on GitHub (Apr 8, 2021):
you have to start it WiFi.softAP() look at esp examples
@yuan910715 commented on GitHub (Apr 9, 2021):
yes, I started AP use WiFi.softAP() , please see my code:
#include <WiFiManager.h>
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFiManager wm;
wm.setDebugOutput(true);
wm.setTimeout(30);
bool res;
Serial.println("auto_test.");
res = wm.autoConnect("auto_test");
if(!res) {
Serial.println("offline mode");
WiFi.mode(WIFI_AP_STA);
IPAddress apIP(192, 168, 4, 1);
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
WiFi.softAP("Offline");
}
else {
Serial.println("connected.");
}
}
void loop() {
// put your main code here, to run repeatedly:
}
If I didn't use wm.autoConnect ,I can see Offline AP successfully, and use autoConnect , after timeout ,no AP , I really don't know why.
@tablatronix commented on GitHub (Apr 9, 2021):
oh I didnt see offline mode condition
@tablatronix commented on GitHub (Apr 9, 2021):
I would guess WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0)); is a problem
turn esp debugging on , it will say softap failed to start
@yuan910715 commented on GitHub (Apr 9, 2021):
Hi
I have deleted these two lines , but it still not work.
res = wm.autoConnect("auto_test");if(!res) {Serial.println("offline mode");WiFi.mode(WIFI_AP_STA);// IPAddress apIP(192, 168, 10, 1);// WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));WiFi.softAP("Offline");}and it works after I didn't use wm.autoConnect:
res = false; //wm.autoConnect("auto_test");if(!res) {Serial.println("offline mode");WiFi.mode(WIFI_AP_STA);IPAddress apIP(192, 168, 10, 1);WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));WiFi.softAP("Offline");}So I believe that it is some code of wifiManger that affects create AP after autoConnect timeout, and I also check wifiManager source code and try ,but still not solved .
Please help me, thanks a lot.
@tablatronix commented on GitHub (Apr 9, 2021):
I will try to test this tomorrow
add a wm.disconnect(); before starting the ap see if that helps.
esp likes to get stuck when changing modes, might add a delay there also
@yuan910715 commented on GitHub (May 10, 2021):
hello tablatronix
have you tested it?
@tablatronix commented on GitHub (May 10, 2021):
I have not, sorry forgot about this
@JanithGan commented on GitHub (Jun 20, 2021):
Yes, I also have the same problem. WiFi manager prevents creating an AP after configuring SSID Password with the portal.
Need to restart the esp to resolve this.
Any updates?
@tablatronix commented on GitHub (Jun 20, 2021):
Sorry I keep forgetting this, So does esp give you a AP create failed error?
@JanithGan commented on GitHub (Jun 28, 2021):
Nope, this is the debug output, It just says
softap config unchangedeven though I changed the Mode and SoftAP name.And the esp SoftAP shows as a
Hidden Network.Debug Output:
Note that there is no SSID name even though I gave it in the below code.
My Code:
I have to reset the esp each time (Only if the wifi manager portal is accessed to change SSID passwords) to overcome this.
Any suggestions?
@tablatronix commented on GitHub (Jun 28, 2021):
I do not have this issue, what happens if autoconnet fails and you have a portaltimeout set?
@tablatronix commented on GitHub (Jun 28, 2021):
Ok I think I have it now, let me play with it a bit
@JanithGan commented on GitHub (Jun 28, 2021):
Same issue for a timeout bro.
Debug Output:
@tablatronix commented on GitHub (Jun 28, 2021):
try to add a delay after changing the mode?
worked for me once but not always, very strange
@tablatronix commented on GitHub (Jun 28, 2021):
ok well that didn't work, hmm off to next idea
@JanithGan commented on GitHub (Jun 28, 2021):
Nope adding a delay does not help :-)
@tablatronix commented on GitHub (Jun 28, 2021):
There is some kind of corruption going on of the soft ap config...
Turn persistent off before doing your stuff, for some reason persistent flash is not initializing properly or has bad flash and needs a full erase.
I will try to figure out that later, but that should get you working
@JanithGan commented on GitHub (Jun 29, 2021):
Thank you for your answer I will try it and let you know
@KyoshoTom commented on GitHub (Oct 27, 2021):
Was anyone able to resolve this issue? I set mine to offline (timeout to 30 seconds) and cannot reconnect.
@tablatronix commented on GitHub (Nov 3, 2021):
I have not researched this any further, this issue is about starting ap not reconnecting however
@KyoshoTom commented on GitHub (Nov 6, 2021):
Thank you. Would anyone know how to make this work using 2x Max7219 modules (8 in 1)? I wanted to add an extra for the text scrolling feature. I looked through the code, but I do not see any way to change this :( Am I missing something?
