mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1076] Changing ssid & password programatically for use by autoConnect() #916
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#916
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 @jg1xmv on GitHub (Jun 8, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1076
When originally connecting I entered a ssid and password via the AP which is then stored in memory by the library for the next start.
How can I change to some new ssid & pw in memory before triggering autoconnect so that it connects to those and not to the originally saved ssid & pw when I first entered those via the AP mode?
I have tried using WiFi.begin(ssidnet,pwnet), where ssidnet & pwnet are the new ones I saved.
It works when using a fixed ip by doing the following:
wifiManager.setSTAStaticIPConfig(fixed ip details here);
WiFi.mode(WIFI_STA);
WiFi.begin(ssidnet, pwnet);
Somehow though, using WiFi.begin(ssidnet, pwnet) before autoconnect() does not seem to make it go and fetch the new ssid & pw I saved but the original ones to which I connected via the AP first time around.
I am wondering of there is a way to make autoConnect() fetch the new ssidnet & pwnet i/o the original ones.
Thanks.
@tablatronix commented on GitHub (Jun 8, 2020):
WiFi.begin(ssidnet, pwnet); should work, we do not save those that is all esp code.
Maybe add a connect loop
@jg1xmv commented on GitHub (Jun 9, 2020):
Yes, in a way once the ssid and pw are saved I do not need the AP anymore and can just call WiFi.begin instead of autoConnect.
I'll add a check to verify if credentials are already saved and then either use autoConnect to use the AP or WiFi.begin with the previously saved credentials otherwise.
Thanks.
@tablatronix commented on GitHub (Jun 9, 2020):
Well either way, that is all autoconnect does. anyway , it just calls begin, the esp lib is what saves it