mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1314] First 30 seconds in AP mode #1128
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#1128
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 @GabrielLAPU on GitHub (Nov 23, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1314
Good morning everyone,
First of all, congratulations for the library, it is one of the most complete and useful I have seen.
I am doing a project using an ESP32 Devkit V4 microprocessor, with which I intend to control some lamps. For the connectivity management I want to use the library with the following working mode:
When the ESP32 is started during the first 30 seconds we enter a configuration mode leaving the micro in access point mode, in case nobody enters the captive portal, the module should try to connect with the last credentials with which it was connected to internet the ESP.
I have thought about spending this code but I do not know if it is possible to do it like that, or should I save the credentials for example in SPIFF and if no one connects, do a reading of the SSID and the password and connect with them.
Sketch
Debug Messages
@tablatronix commented on GitHub (Nov 23, 2021):
setConfigPortalTimeout()
@GabrielLAPU commented on GitHub (Nov 29, 2021):
Hi tablatronix,
Thanks for your reply. A question about the setConfigPortalTimeout (40) command. This command starts the captive pool for 40 seconds, if no one enters it, does it connect to the Wi-Fi with the last credentials it had? or is it necessary to include some other command to force this connection with those credentials?
Yhank you in advance!
@tablatronix commented on GitHub (Nov 29, 2021):
you mean if autoconnect fails? There is no automatic retry after timeout, other than autoreconnects that the esp library might do.
If you want to ALWAYS enter cp mode, then use startconfigportal functions instead of autoconnect, I do a variation of this on some devices(always cp for 30 seconds, note that sometimes it takes that long to connect to ap, so it might be too short). Or add a check if no credentials are saved or by storing some kind of flag in flash that the wifi has been down for a while etc.
@GabrielLAPU commented on GitHub (Nov 30, 2021):
Hi tablatronix, Thank you for your replay. The operation mode that I would like implement in the device is the next, when I switch on the device, during a little bit time (maybe 30 seconds is really poor) I need start with a configuration mode,
I need to start with a configuration mode, allowing to change the Wi-Fi to the I connect, if there is no Wi-Fi change I should try to connect to the Wi-Fi with the last credentials that I did last time, if I cannot connect to that Wi-Fi I will detect it entering an Off-line mode of operation.
Do you still recommend using the setConfigPortalTimeout function?
@GabrielLAPU commented on GitHub (Dec 1, 2021):
Hi, I finally seem to have something that works.
Indeed tablatronix use the startConfigPortal function configuring the calls setAPClientCheck (true) and setConfigPortalTimeout, after this I use an autoconnect in case the wifi has not been modified to reconnect with the old credentials.
Thanks for your support.