mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1388] BUG, non-bocking, AP is shut aften connect when set first time #1189
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#1189
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 @0x0fe on GitHub (Apr 8, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1388
In non blocking mode, with a timeout (15*60) the AP is shut down right after STA connection succeed, after the wifi password has been set.
This bug does not occur on subsequent boot (so, when the password is already saved).
@tablatronix commented on GitHub (Apr 9, 2022):
What bug? What is the expected behavior?
non blocking doesn't mean always on, if you are using autoconnect that is the expected behavior.
@0x0fe commented on GitHub (Apr 9, 2022):
When non blocking and timeout are set the portal keeps running after connect, except at first time when you set the password, i am not sure ifs its a bug or a feature, but i feel should be consistent, either stop portal after connect or leave it open, regardless if its the first time you set the password or not, no?
I also notice something very strange, when adding a custom label it works fine at first time when we set password, however the datas are corrupted for any subsequent access to the portal (within the same sessions at least).
@tablatronix commented on GitHub (Apr 9, 2022):
The portal should NOT keep running after connect, the portal should never run unless no wifi or you ask it too.
What is the code? Which example are you using , i can test
@tablatronix commented on GitHub (Apr 9, 2022):
You are calling wm.startConfigPortal("FillLand Smart Parasol");
ok so I see, which version you running?
@0x0fe commented on GitHub (Apr 9, 2022):
last version from manager. I think i know the problem : char devId[16]; this buffer was initially used for the UUID only, its too small for the HTML tags, shame on me
@tablatronix commented on GitHub (Apr 9, 2022):
yeah that shouds like a memory issue ( also length)
are you calling wm.process(); in loop?
@0x0fe commented on GitHub (Apr 9, 2022):
yes, the application is a free running state machine. By the way is there a define or call to avoid closing the AP after connect?
@tablatronix commented on GitHub (Apr 9, 2022):
The process of connecting turns off the softap by design, as sta connections cannot be made with it on
@0x0fe commented on GitHub (Apr 9, 2022):
ESP32C has AP-STA mode, with hardware handling of both, how comes it is a softAP?
@tablatronix commented on GitHub (Apr 9, 2022):
Also there was some changed to the code recently to non blocking timeouts, it might only be in git
sta+ap mode can only operate on the same channel, so trying to connect to an ssid on another channel than the softap is already on cause instability and errors
@0x0fe commented on GitHub (Apr 9, 2022):
i recall now, ok i will pull from the master branch, thank you for all the clarifications
@tablatronix commented on GitHub (Apr 9, 2022):
If you really want softap+sta you can do it, let me see , the best is probably to startap after sta is connected.
I might have some code in there to play with this
@0x0fe commented on GitHub (Apr 9, 2022):
nice, that is convenient
@tablatronix commented on GitHub (Apr 9, 2022):
So I am thinking it should be working like that already, let me check and see
@tablatronix commented on GitHub (Apr 9, 2022):
Mine seems to work,
Serial.println(wm.getModeString(WiFi.getMode()));But for saving a new connection, we always turn off softap, let me see if I added a test for that to play with, I know i did at some point
@tablatronix commented on GitHub (Apr 9, 2022):
remove this line
WiFi_Mode(_usermode); // restore users wifi mode, BUG https://github.com/esp8266/Arduino/issues/4372But that wont keep the portal open let me check one more thing
@tablatronix commented on GitHub (Apr 9, 2022):
ok if you remove
in processConfigportal
shutdownConfigPortal(); it will keep running even on saves
Ill see how to make this a toggle, it seems to work OK, depends on your wifi environment.
I will eventually test this fully when I add wifi save status to the webpage, in the past the SDK has been very buggy in dual modes especially on esp8266
@tablatronix commented on GitHub (Apr 9, 2022):
also if you are gonna run the cp portal always, no reason to start it in autoconnect
// if true (default) then start the config portal from autoConnect if connection failed void setEnableConfigPortal(boolean enable);@tablatronix commented on GitHub (Apr 9, 2022):
7bffda3fe6wm.setDisableConfigPortal(false);I will probably change name by release, as it is confusing, just made to match the other one
good enough to test