mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 17:15:53 +03:00
[GH-ISSUE #856] Static IP wrong connection fix #722
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#722
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 @dzanis on GitHub (Mar 22, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/856
Hi. I got the problem of static IP .If you enter it incorrectly or if the router is turned on DHCP, then even if you remove the settings of the static address, it still connects to it. Solved the problem before wifi connection enter
WiFi.config(IPAddress(NULL), IPAddress(NULL), IPAddress(NULL));Then added a condition to the code
github.com/tzapu/WiFiManager@740005b21e/WiFiManager.cpp (L280)@sorriso93 commented on GitHub (Apr 1, 2019):
Is it possible to configure also DNS with staticip config?
@tablatronix commented on GitHub (Apr 1, 2019):
What do you mean “remove the settings”?
@dzanis commented on GitHub (Apr 2, 2019):
If you incorrectly enter the address of the router, then do not connect until you delete the static ip settings can not connect.
@tablatronix commented on GitHub (Apr 2, 2019):
I still do not understand can you explain in detailed steps to reproduce.
Can you not change or remove the static settings in the portal ?
@dzanis commented on GitHub (Apr 6, 2019):
Yes, I can not change the static settings on the portal, if DHTP is enabled on the router. I decided to make it easier to use the scanner ip address to find what address the esp was connected to
@tablatronix commented on GitHub (Apr 6, 2019):
I have no idea what you are doing. You should be able to just delete static ip settings if not using them and just use dhcp, where is the problem actually occuring?
@dzanis commented on GitHub (Apr 6, 2019):
Of course, I can delete static ip settings in the code. The problem is that without a pre-project this cannot be done.
@tablatronix commented on GitHub (Apr 7, 2019):
Right so what exactly happens when you erase in portal?? You say it still uses it, can you add a toggle or something?
@dzanis commented on GitHub (Apr 7, 2019):
You can enter the AP MODE only by turning off the router. After you can reconnect the connection. But after you entered the wrong static ip, it will no longer connect to the network again, even with the correct settings. The problem is solved only if you change the ssid in the router.
@tablatronix commented on GitHub (Apr 7, 2019):
you can enter the ap mode whenever you want if you add a button or something to do it, or add an erase config method,
I will have to test this cause I still am not getting the whole picture.
So if you have a short sketch or example.
Do you think the esp is remembering the static ip ?
Or do you think the web form is not saving when it is empty ?
@dzanis commented on GitHub (Apr 7, 2019):
If incorrectly entered static IP,then I will go through the access point to change the connection,settings are not reset, the output shows
Already connected. Bailing out.Because the previous settings are reset only if connected, in this place the code
github.com/tzapu/WiFiManager@740005b21e/WiFiManager.cpp (L201)To reset the previous settings, you need to erase the settings. But they do not erase until you connect. That's why you need to connect to another network. But not everyone has a few open networks. For example, I have one. And I cannot connect to my own because the static ip address for it was incorrectly configured.
Ansvers:
The sketch is too big, if I separate it, I can show it.
It turns out that he remembers.
web form is fine.
@dzanis commented on GitHub (Apr 7, 2019):
I decided that it is better not to use a static address, because many routers are enabled DHCP
It's easier to find the address of the esp program https://github.com/dzanis/IPScanner
@tablatronix commented on GitHub (Apr 7, 2019):
Oh you are still using master branch? Yeah that is a known issue if the wifi is the same it just ignores the save
@Berzegeri commented on GitHub (Apr 20, 2019):
Hi,
yes, but it's redundant a bit...
After you set the static IP, only thing you need to do is to set it with WiFi.config().
in setup:
WiFiManager wifiManager;wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,110), IPAddress(192,168,0,1), IPAddress(255,255,255,0));WiFi.config(ip,gateway,subnet,dns1,dns2);