mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #913] Non blocking mode is still very much blocking #773
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#773
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 @markg85 on GitHub (Jul 13, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/913
Hi,
I'm on the development branch now :)
So i did set "setConfigPortalBlocking" to false and followed that with a process() call in my loop function.
But that's still blocking.
I'm guessing that only make it non blocking in the config portal, aka when there is no connection or it failed to connect. It's still very much blocking at the point where it tries to make a connection.
The function:
uint8_t WiFiManager::connectWifi(String ssid, String pass)
is the one that triggers waiting. It has this if/else statement:
And if i follow waitForConnectResult then it actually waits (busy waiting loop) till it has a connection. That's the issue.
I'm looking at how to hack that to be not blocking, to be continued.
Cheers,
Mark
@tablatronix commented on GitHub (Jul 14, 2019):
Thats when you save the portal... not sure what you mean
@tablatronix commented on GitHub (Jul 14, 2019):
Do you mean autoconnect? You can simple not use it and use your own connect wait loop
@markg85 commented on GitHub (Jul 14, 2019):
In my code i'm calling autoconnect. I obviously want the features of WiFiManager, aka pop up an AP if it can't make a connection and connect to an existing AP if it can. The
autoconnectfunction eventually callsconnectWifiwhere it is trying to connect to an existing AP if no user/pass is given (if both are emtpy).connectWifiis eventually* callingwaitForConnectResultwhich blocks.I don't think i can use my own connect in my main loop as i would lose the setup part that i also want if i can't make a connection. Unless you tell me otherwise that is :)
I did actually get it to work but it requires quite a different handling of
connectWifiandwaitForConnectResult. In fact,waitForConnectResulthas to be rewritten mostly and put in theprocessmethod. I do have much of that now but i'm quite sure i currently broke the setup part... So that's definitely not something i'm going to share now.* unless it has no credentials, but that defeats the point entirely as i would have no wifi connection.
@tablatronix commented on GitHub (Jul 14, 2019):
You just startconfigportal when you need it.. see the ondemand example
@markg85 commented on GitHub (Jul 14, 2019):
Then how do i make a connection to Wifi?
@tablatronix commented on GitHub (Jul 14, 2019):
The esp automatically connects to wifi or you can call wifi.begin
@kbickham commented on GitHub (Aug 14, 2019):
It's not blocking as much as the original library did, with that my display would not sync with my controller at all. Dev kit C on a prototype for a dehyrdator machine with a bunch of sensors. This whole deal is fairly timing sensitive. It's now syncing fine, portal is popping up on it's own. I have some indicators running off of if (WiFi.status() == WL_CONNECTED) that didn't go on, but I need to go read the debug uart port so can get iron this out. EDIT- NOPE, It's all good. This is pretty sweet.
@tablatronix commented on GitHub (Aug 14, 2019):
I really suggest not using autoconnect, I would require user long press or special boot sequence to enter config mode for a project like that