[GH-ISSUE #777] WifiManager not working with fixed IP #651

Open
opened 2026-02-28 01:26:24 +03:00 by kerem · 11 comments
Owner

Originally created by @eXadra on GitHub (Nov 30, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/777

Dear all.

Using this library with dhcp and parameters for the MQTT everithing works well (code based on your AutoConnectWithFSParametersAndCustomIP).
when I try to use with fixed ip, just adding the line
wifiManager.setSTAStaticIPConfig(kIPAddress, kGateway, kSubnetMask);
After reboot it returns to AP mode again, it seems that the wi parameters are not saved.
Check bellow

_*WM: Configuring access point...
*WM: ESP1795988
*WM: AP IP address:
*WM: 192.168.4.1
*WM: HTTP server started
*WM: Handle root
*WM: Sent config page
*WM: WiFi save
*WM: Parameter
*WM: server
*WM: 192.168.1.246
*WM: Parameter
*WM: port
*WM: 1883
*WM: Parameter
*WM: User
*WM: exadra
*WM: Parameter
*WM: Password
*WM: pass
*WM: static ip
*WM: 192.168.1.12
*WM: static gateway
*WM: 192.168.1.254
*WM: static netmask
*WM: 255.255.255.0
*WM: Sent wifi save page
*WM: Connecting to new AP
*WM: Connecting as wifi client...
*WM: Custom STA IP/GW/Subnet
*WM: 192.168.1.12
*WM: Already connected. Bailing out.

0000047.795: WiFi connected. IP address: 192.168.1.12_

->> It says already connected and gets the IP 192.168.1.12 but thats not true, pinging it, this ip doesn´t exist. After reboot goes back to AP mode

Thanks

Originally created by @eXadra on GitHub (Nov 30, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/777 Dear all. Using this library with dhcp and parameters for the MQTT everithing works well (code based on your AutoConnectWithFSParametersAndCustomIP). when I try to use with fixed ip, just adding the line _wifiManager.setSTAStaticIPConfig(kIPAddress, kGateway, kSubnetMask);_ After reboot it returns to AP mode again, it seems that the wi parameters are not saved. Check bellow _*WM: Configuring access point... *WM: ESP1795988 *WM: AP IP address: *WM: 192.168.4.1 *WM: HTTP server started *WM: Handle root *WM: Sent config page *WM: WiFi save *WM: Parameter *WM: server *WM: 192.168.1.246 *WM: Parameter *WM: port *WM: 1883 *WM: Parameter *WM: User *WM: exadra *WM: Parameter *WM: Password *WM: pass *WM: static ip *WM: 192.168.1.12 *WM: static gateway *WM: 192.168.1.254 *WM: static netmask *WM: 255.255.255.0 *WM: Sent wifi save page *WM: Connecting to new AP *WM: Connecting as wifi client... *WM: Custom STA IP/GW/Subnet *WM: 192.168.1.12 *WM: Already connected. Bailing out. 0000047.795: WiFi connected. IP address: 192.168.1.12_ ->> It says already connected and gets the IP 192.168.1.12 but thats not true, pinging it, this ip doesn´t exist. After reboot goes back to AP mode Thanks
Author
Owner

@tablatronix commented on GitHub (Nov 30, 2018):

you didnt fill out form

<!-- gh-comment-id:443253067 --> @tablatronix commented on GitHub (Nov 30, 2018): you didnt fill out form
Author
Owner

@eXadra commented on GitHub (Nov 30, 2018):

Sorry. :)

Hardware

WiFimanager Branch/Release:

[X ] Master (last version)

Development

Esp8266/Esp32:

[X ] ESP8266

ESP32

Hardware: ESP-12e, esp01, esp25

[X ] ESP12

ESP12 E/F/S (nodemcu, wemos, feather)

Other

ESP Core Version: 2.4.0, staging

2.3.0
[X ] 2.4.1

Settings in IDE

Board - Generic ESP8266
Flash Mode - DIO
Flash Size - 512K (32K SPIFFS)
Debug Port - Disabled
Debug Level - None
lwIP Variant - V2 prebuilt (MSS=536)
Reset Method - ck
Crystal Frequency - 26M
Flash Frequency - 40MHz
CPU Frequency - 80MHz
Upload Speed - 115200

Additional libraries:
#include <FS.h>
#include <Arduino.h>
#include "ArduinoJson.h"
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <ESP8266mDNS.h>
#include <IRremoteESP8266.h>
#include <IRrecv.h>
#include <IRsend.h>
#include <IRutils.h>

<!-- gh-comment-id:443357509 --> @eXadra commented on GitHub (Nov 30, 2018): Sorry. :) Hardware WiFimanager Branch/Release: [X ] Master (last version) Development Esp8266/Esp32: [X ] ESP8266 ESP32 Hardware: ESP-12e, esp01, esp25 [X ] ESP12 ESP12 E/F/S (nodemcu, wemos, feather) Other ESP Core Version: 2.4.0, staging 2.3.0 [X ] 2.4.1 Settings in IDE Board - Generic ESP8266 Flash Mode - DIO Flash Size - 512K (32K SPIFFS) Debug Port - Disabled Debug Level - None lwIP Variant - V2 prebuilt (MSS=536) Reset Method - ck Crystal Frequency - 26M Flash Frequency - 40MHz CPU Frequency - 80MHz Upload Speed - 115200 Additional libraries: #include <FS.h> #include <Arduino.h> #include "ArduinoJson.h" #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <DNSServer.h> #include <ESP8266WebServer.h> #include <WiFiManager.h> #include <ESP8266mDNS.h> #include <IRremoteESP8266.h> #include <IRrecv.h> #include <IRsend.h> #include <IRutils.h>
Author
Owner

@tablatronix commented on GitHub (Dec 1, 2018):

Hmm not a known bug, can you see if this is fixed in development branch?

<!-- gh-comment-id:443442285 --> @tablatronix commented on GitHub (Dec 1, 2018): Hmm not a known bug, can you see if this is fixed in development branch?
Author
Owner

@tablatronix commented on GitHub (Dec 1, 2018):

Maybe try erasing flash, it might think its already connected and not apply the new ip

<!-- gh-comment-id:443442503 --> @tablatronix commented on GitHub (Dec 1, 2018): Maybe try erasing flash, it might think its already connected and not apply the new ip
Author
Owner

@eXadra commented on GitHub (Dec 2, 2018):

Erased Flash, same behavior :(.
I will try with the development branch version.

Thanks

<!-- gh-comment-id:443500247 --> @eXadra commented on GitHub (Dec 2, 2018): Erased Flash, same behavior :(. I will try with the development branch version. Thanks
Author
Owner

@pvihang commented on GitHub (Jul 31, 2019):

Dear @eXadra
Did you find the solution to the Static IP issue using Wifimanager?
I am still not able to set Static IP using the AutoConnectwithStaticIp.ino nor any luck with AutoConnectwithFSparametersandCustomIp.ino
On serial monitor it shows the IP which I have set, but I am unable to ping that IP.
AutoConnect.ino for dhcp works great. But i need static IP configuration which is not working

Thanks

<!-- gh-comment-id:516684401 --> @pvihang commented on GitHub (Jul 31, 2019): Dear @eXadra Did you find the solution to the Static IP issue using Wifimanager? I am still not able to set Static IP using the AutoConnectwithStaticIp.ino nor any luck with AutoConnectwithFSparametersandCustomIp.ino On serial monitor it shows the IP which I have set, but I am unable to ping that IP. AutoConnect.ino for dhcp works great. But i need static IP configuration which is not working Thanks
Author
Owner

@lizard79 commented on GitHub (Oct 12, 2019):

Did you find any solution? Have the same problem ESP-M3 , 8285.

Thanks

<!-- gh-comment-id:541347858 --> @lizard79 commented on GitHub (Oct 12, 2019): Did you find any solution? Have the same problem ESP-M3 , 8285. Thanks
Author
Owner

@eyk107 commented on GitHub (Dec 2, 2019):

Could please someone post a working solution for fix dns and hostname?

<!-- gh-comment-id:560396205 --> @eyk107 commented on GitHub (Dec 2, 2019): Could please someone post a working solution for fix dns and hostname?
Author
Owner

@tablatronix commented on GitHub (Dec 3, 2019):

Use development branch

<!-- gh-comment-id:561199144 --> @tablatronix commented on GitHub (Dec 3, 2019): Use development branch
Author
Owner

@eyk107 commented on GitHub (Dec 3, 2019):

And Do you have a working example for IP, subnet, DNS and hostname?

<!-- gh-comment-id:561322821 --> @eyk107 commented on GitHub (Dec 3, 2019): And Do you have a working example for IP, subnet, DNS and hostname?
Author
Owner

@tablatronix commented on GitHub (Dec 4, 2019):

Not sure but the DEV/ example should have everything possible in it.

<!-- gh-comment-id:561444538 --> @tablatronix commented on GitHub (Dec 4, 2019): Not sure but the DEV/ example should have everything possible in it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#651
No description provided.