mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1006] Exception when using wifiManager.setAPStaticIPConfig() #857
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#857
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 @flavio-fernandes on GitHub (Feb 7, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1006
Basic Infos
Hardware
WiFimanager Branch/Release:
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
ESP Core Version: 2.4.0, staging
Description
While trying to configure setAPStaticIPConfig using the following code:
I see the following exception as soon as my laptop connects to the portal:
This is what I see in the Serial output when it happens:
This is 100% reproducible. And it never happens if I avoid making the
wifiManager.setAPStaticIPConfig()call.Settings in IDE
Arduino IDE 1.8.10
IDE setting here: https://imgur.com/a/JDwuLlt
WifiManager library, on branch
developmentAdditional libraries:
N/A
Please see
github.com/flavio-fernandes/persistWifiSetting@879c848996for code used to make it happen.@tablatronix commented on GitHub (Feb 7, 2020):
What happen if you use regular const or vars? Not defines.
have you tried a plain sketch without wm ?
@flavio-fernandes commented on GitHub (Feb 7, 2020):
The same issue happens when I use const, static or plain variables.
See:
github.com/flavio-fernandes/persistWifiSetting@17f485ee65@tablatronix commented on GitHub (Feb 8, 2020):
I am assuming you tried inline also? Ill try to test , in the meantime I am sure there is a example for static ip try that also as this exception seems to make it to the esp lib so see if its a esp bug
@tablatronix commented on GitHub (Feb 8, 2020):
You using arduino for idf?
@tablatronix commented on GitHub (Feb 8, 2020):
Wrong thread
@Craigzyc commented on GitHub (May 12, 2020):
I have been experiencing this issue.
It seems like if you do an erase_flash through esptool.py you get some reboots out of it before it starts causing issues.
Some reboots, it will listen and set the IP as requested (8.8.8.8 in my case) but other reboots it doesn't get properly set, defaults to 192.168.4.1 then reboots on the first client connecting. I see yours does seem to set the IP so this may be similar but unrelated.

After a few reboots, I have about a 20% success rate where it will correctly set 8.8.8.8 which fixes the captive portal not appearing on android.
I'm setting the IP like so:
wm.setAPStaticIPConfig(IPAddress(8,8,8,8), IPAddress(8,8,8,8), IPAddress(255,255,255,0));It consistently works as expected any time it successfully sets the IP and consistently crashes when it doesn't

@tablatronix commented on GitHub (May 12, 2020):
hmm, not able to reproduce, ill keep trying
I am running latest of course development branch
wm.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));@Boguinhos commented on GitHub (Mar 14, 2021):
I can't really check right away but i'm on ESP8266 and i think i'm passing thru the same issue.
After setting static STA addresses and wm.debug is on, if the ESP does not connect some exception pops up. if Debug is off , ESP runs without crashing but something weird is happening to me. if i always use DCHP connection is perfect. if i am forcing STAIpConfig , the ESP will only connect at second try. first try nothing happens and it seems like its hung up. if i power cycle the device by removing the cable and power it again it will connect with success. just never at first time. if i'm using the computer and serial terminal it seems like this issue does not occur as often, even with wm.debug false.