tzapu / WiFiManager

ESP8266 WiFi Connection manager with web captive portal
http://tzapu.com/esp8266-wifi-connection-manager-library-arduino-ide/
MIT License
6.62k stars 1.98k forks source link

WifiManager not working with fixed IP #777

Open eXadra opened 5 years ago

eXadra commented 5 years ago

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

tablatronix commented 5 years ago

you didnt fill out form

eXadra commented 5 years ago

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

include

include "ArduinoJson.h"

include

include

include

include

include

include

include

include

include

include

tablatronix commented 5 years ago

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

tablatronix commented 5 years ago

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

eXadra commented 5 years ago

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

Thanks

pvihang commented 5 years ago

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

lizard79 commented 5 years ago

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

Thanks

eyk107 commented 4 years ago

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

tablatronix commented 4 years ago

Use development branch

eyk107 commented 4 years ago

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

tablatronix commented 4 years ago

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