mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #721] setAPStaticIPConfig failed #603
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#603
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 @rodri16 on GitHub (Sep 5, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/721
Basic Infos
Hardware
WiFimanager Branch/Release:
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
ESP Core Version: 2.4.0, staging
SDK Version 2.2.1
Core version 2.4.1
Boot version 4
Description
I am using autoconnect and callbacks, to connect to a stored WiFi SSID. In callback I am putting static IP 10.0.1.1 for the config portal.
myWiFiManager->setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
If Wifi does not connect because I do a resetSettings(), config portal starts ok on 10.0.1.1.
When WiFi is connected using autoconnect and press a button which runs startConfigPortal() it goes to 192.168.4.1. Even adding setAPStaticIPConfig before startConfigPortal()
Settings in IDE
Module: Generic ESP8266 module
Flash size: 4M (3M SPIFFS)
all other parameters default
Additional libraries:
ESP8266mDNS.h
TimeLib.h
NtpClientLib.h
DNSServer.h
HLW8012.h
ArduinoJson.h
Debug Messages
Doing a wifiManager.resetSettings(); It works ok
*WM: [1] SETTINGS ERASED
*WM: [3] WiFi station enable
*WM: [3] enableSTA PERSISTENT ON
*WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: TimeZone
*WM: [1] AutoConnect
*WM: [2] Connecting as wifi client...
*WM: [3] WIFI station disconnect
*WM: [1] No saved credentials, skipping wifi
*WM: [2] Connection result: WL_NO_SSID_AVAIL
*WM: [3] lastconxresult: WL_NO_SSID_AVAIL
*WM: [1] AutoConnect: FAILED
*WM: [2] AccessPoint set password is VALID
*WM: [1] xxxx
*WM: [3] WIFI station disconnect
*WM: [3] WiFi station enable
*WM: [2] Disabling STA
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: xxxx
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [1] AP IP address: 10.0.1.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 10.0.1.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] WiFi Scan ASYNC completed in 2186 ms
*WM: [2] WiFi Scan ASYNC found: 9
And then pressing the button to start config portal
*WM: [2] AccessPoint set password is VALID
*WM: [1] xxxx
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: xxxx
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [0] [ERROR] softAPConfig failed!
*WM: [1] AP IP address: 10.0.1.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 10.0.1.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] Portal Timeout In 118 seconds
*WM: [2] WiFi Scan ASYNC completed in 1589 ms
*WM: [2] WiFi Scan ASYNC found: 8
THEN aftera reboot with Wifi settings and press the button
*WM: [2] AccessPoint set password is VALID
*WM: [1] XXXXX
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: XXXXX
Entered config mode
0.0.0.0
XXXXX
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [0] [ERROR] softAPConfig failed!
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 192.168.4.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] Portal Timeout In 118 seconds
*WM: [2] WiFi Scan ASYNC completed in 1589 ms
*WM: [2] WiFi Scan ASYNC found: 5
*WM: [2] Portal Timeout In 88 seconds
Thanks
@tablatronix commented on GitHub (Sep 5, 2018):
Do you have sketch ?
Is WM global or are you setting apconfig in loop where button is pressed?
@tablatronix commented on GitHub (Sep 5, 2018):
I am just not seeing this at all
Probably need to figure out why
*WM: [0] [ERROR] softAPConfig failed!@tablatronix commented on GitHub (Sep 5, 2018):
you need to enable esp debugging wifi
@rodri16 commented on GitHub (Sep 5, 2018):
WM is global
*WM: [2] AccessPoint set password is VALID
*WM: [1] Dispositive
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: Disp_3
Entered config mode
0.0.0.0
Disp_3
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [0] [ERROR] softAPConfig failed!
mode : sta(ec:fa:bc:00:a2:5f) + softAP(ee:fa:bc:00:a2:5f)
add if1
pm close 7
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
bcn 0
del if1
pm open,type:2 0
add if1
pm close 7
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 192.168.4.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] Portal Timeout In 118 seconds
scandone
*WM: [2] WiFi Scan ASYNC completed in 1599 ms
*WM: [2] WiFi Scan ASYNC found: 10
Sketch
@rodri16 commented on GitHub (Sep 5, 2018):
*WM: [2] AccessPoint set password is VALID
*WM: [1] Dispositive
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: Disp_3
Entered config mode
0.0.0.0
Disp_3
*WM: [1] Custom AP IP/GW/Subnet:
[APConfig] local_ip: 10.0.1.1 gateway: 10.0.1.1 subnet: 255.255.255.0
[APConfig] wifi_softap_dhcps_stop failed!
[APConfig] wifi_set_ip_info failed!
[APConfig] DHCP IP start: 10.0.1.100
[APConfig] DHCP IP end: 10.0.1.200
[APConfig] wifi_set_ip_info failed!
[APConfig] wifi_softap_set_dhcps_lease_time failed!
[APConfig] wifi_softap_dhcps_start failed!
[APConfig] IP config Invalid?!
*WM: [0] [ERROR] softAPConfig failed!
mode : sta(ec:fa:bc:00:a2:5f) + softAP(ee:fa:bc:00:a2:5f)
add if1
pm close 7
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
wifi evt: 8
wifi evt: 8
bcn 0
del if1
pm open,type:2 0
add if1
pm close 7
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 192.168.4.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] Portal Timeout In 118 seconds
scandone
*WM: [2] WiFi Scan ASYNC completed in 1600 ms
*WM: [2] WiFi Scan ASYNC found: 12
wifi evt: 7
@tablatronix commented on GitHub (Sep 5, 2018):
cant reproduce, it has something to do with your other code, or the mode its in
wifi_softap_dhcps_stop failedI have no idea why this would be failing, maybe conflict with starting mode, or is not switching ap correctly.
It could also be an open issue I have in esp with enableAP
you can maybe add a delay in
@tablatronix commented on GitHub (Sep 5, 2018):
I also wonder if swapping the order of these 2 would help
and place the enableap before the softAPConfig
@rodri16 commented on GitHub (Sep 6, 2018):
Yes you are right @tablatronix! Swapping enableAP before softAPConfig problem solved!!! Thank you!
@tablatronix commented on GitHub (Sep 20, 2018):
#722
@tablatronix commented on GitHub (Oct 12, 2018):
I moved the wifiManager.setAPCallback(); after startap, I think will break this implementation
It now fires after ap is started , so it can get ip and stuff
do we need a startapconfig callback, is there anything that needs to be done here that cannot be set via wm ahead of time ?
@tablatronix commented on GitHub (May 11, 2020):
Where did we leave off here ? ughh
I think its safe to close, might need to reopen a new issue for more callbacks if needed