mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1124] Help with AutoConnectWithFSParameters example with simple modification. #961
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#961
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 @Shalabyer on GitHub (Sep 13, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1124
Esp8266/Esp32:
**Hardware:
Description
In the great example AutoConnectWithFSParameters it tries to save SSID, Password, localIP, gatewayIP and subnetMask of a WI-FI network for the ESP8266 by giving these data via web while the ESP acts as a hotspot.
Well that's all okay but what i need help with and i need to do is to give these data to the ESP to save via code and not via link,
here is an example of what i want to do :
@tablatronix commented on GitHub (Sep 13, 2020):
Then just use the esp functions for this
@Shalabyer commented on GitHub (Sep 13, 2020):
Thank for your help,
i searched throught all the public function on the library and found non to set SSID name and Password of the Wi-Fi
But i have made it to save a new IP address here is the new code
What i want here is to save new SSID name and Password to the ESP8266 file manually without the need to enter the data through ESP Access Point.
If you could please help me with function names that i can use to save these two paramters.
@tablatronix commented on GitHub (Sep 13, 2020):
WiFi.begin()
WiFi.setConfig()
These are not wm functions
@Shalabyer commented on GitHub (Sep 13, 2020):
For WiFi.setConfig() function, i didn't found any info, hope you mean WiFi.config() which only do config the IP address.
now for the WiFi.begin() function,
i added it to my code like the following:
It prints that it connected successfully which is good but the bad thing here that it doesn't save these two parameters as when it resets it enters AP mode as it didn't save the SSID and PASS but it saved All the new IP Addresses .
This is what i get when it resets to make it more clear:
NOTE: "192.168.43.99" is the new IP address
What i need is a way to save the SSID and Password to the ESP like we saved the IP addresses, i.e: with code.
@tablatronix commented on GitHub (Sep 14, 2020):
Sorry I meant WiFi.config it takes all addresses
@Shalabyer commented on GitHub (Sep 14, 2020):
Iam sorry man but what about saving wifi data like ssid and password, Wifi.begin doesn't save these data it just starts the connection for one time.
@tablatronix commented on GitHub (Sep 14, 2020):
No it saves it
@Shalabyer commented on GitHub (Sep 14, 2020):
Allrigth here is my full code if you please may help me with that if iam getting it wrong
Now let us consider that it has default data and connected with local ip "192.168.43.60" which i give it to the esp via the web link now here is the data that i get on Serial monitor with the following porecedures:
1.reset the esp
2.hitting "192.168.43.60/v" via my laptop.
What should i expect is that it will reset the esp configration then tries to change the local ip to 192.168.43.99 then reconnect to the Wi-Fi -and at this point i will change the wi-fi SSID and PASS to the new given one in the code but i didn't here in this example-.
Anyway here is what i get on the serial monitor :
Also i tried to put this line:
WiFi.begin("Xperia","88888888m");after the this line:
configFile.close();and still the same response , No save for the SSID and PASS.
I would be pleased for help,Thanks anyway :)
@Shalabyer commented on GitHub (Sep 25, 2020):
Any help :)
@tablatronix commented on GitHub (Sep 25, 2020):
alot going on here, first off why are you parsing the web server, you can just add a route and a callback and then check if the arguments exist for querystrings. There are web server functions to do this.
It looks like you are still connected after resetsettings, that is odd, maybe it is ok after reboot.
Not sure when you say not saved,
WiFi.begin("Xperia","88888888m");is saved by the espMaybe your flash is corrupt
You will need to present this in smaller pieces, its hard to follow