WiFiManager: AP connect failures when stored client fails.

So this is a pretty normal thing. You move your board from one network to another ( I do this everyday for development )

And I noticed if there is a stored config, and it fails to connect or find the SSID, then soft AP mode does 2 things.

  1. connection failures on some devices, method unknown
  2. web responses are very slow or fail entirely.

I am tracking this issue as similar https://github.com/esp8266/Arduino/issues/1094

also see my notes on it.

I added an explicit disconnect to startConfigPortal() and it seems to have stabilized my setup. ( IOS always fails to connect to AP )

I am not sure why changing mode doesn’t handle this alone, but it seems some channel scan or something keeps running in the background ( no debugging revealed what it was ), maybe some interrupt problem or memory problem or by design.

fyi ESP.eraseConfig() and reboot also fixes the issue, but not ideal solution obviously.

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 30 (12 by maintainers)

Most upvoted comments

For a low effort flash erasure, there is an Arduino sketch at https://github.com/kentaylor/EraseEsp8266Flash

Hey guys,

Figured something out! Turns out the host definition in both the WiFiClientBasic and WifiClient example scripts was wrong.

Change this: const char * host = "192.168.4.1"; // ip or dns To this: const IPAddress host = IPAddress(192,168,4,1);

Something about the way the libraries define whether we are asking for a IP or a DNS. Especially working with teeny dumb boards (I am on a NodeMCU 0.9). And I could connect to google via my home wifi but then couldn’t seem to connect to 192.168.4.1 on my second NodeBoard

And wow that’s like 10 hours of my life I won’t get back. Also the WifiClientBasic script doesn’t have a GET command so doesn’t ever print out the webpage, but at least the WifiClient example script does.

Things that didn’t help WiFi.setPhyMode(WIFI_PHY_MODE_11G); WiFi.disconnect(); WiFi.mode(WIFI_STA); the erase script by KenTaylor (thanks but I guess not relevant right now)

For seeing the IPaddress thingo in action look up the ChatServer example