[GH-ISSUE #964] Cannot Connect to Config Portal when AP Config is Saved #817

Closed
opened 2026-02-28 01:27:11 +03:00 by kerem · 11 comments
Owner

Originally created by @lbussy on GitHub (Nov 13, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/964

There's been a number of issues posted which circle around this, I posted one and asked for it to be closed since frankly, I was having a hard time reproducing. I can give you the workflow that I think demonstrates the issue, however, I am remote from my dev setup for the rest of the week so actually working with the portal will have to wait.

Here is the workflow which demonstrates the issue:

  1. Properly configure the controller to connect to a given AP via captive portal
  2. Verify connectivity wifiManager.autoConnect
  3. Disable AP and restart controller
  4. Observe controller timeout on AP connection, and start config portal
  5. Attempt to connect to captive portal and receive failure (different messages depending upon platform)

This seems to not be new information, judging by the below section of code (specifically @ 541):

github.com/tzapu/WiFiManager@2447a3fd74/WiFiManager.cpp (L532-L543)

It's possible that I'm "doing it wrong" but I believe my code is very aligned to your examples. The intent of this method is to provide a fall-back if the AP cannot be connected to, but that fails if the AP was configured previously so that seems at odds with your intent.

Is there something else I can provide to show you what I mean?

Originally created by @lbussy on GitHub (Nov 13, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/964 There's been a number of issues posted which circle around this, I posted one and asked for it to be closed since frankly, I was having a hard time reproducing. I can give you the workflow that I think demonstrates the issue, however, I am remote from my dev setup for the rest of the week so actually working with the portal will have to wait. Here is the workflow which demonstrates the issue: 1. Properly configure the controller to connect to a given AP via captive portal 1. Verify connectivity wifiManager.autoConnect 1. Disable AP and restart controller 1. Observe controller timeout on AP connection, and start config portal 1. Attempt to connect to captive portal and receive failure (different messages depending upon platform) This *seems* to not be new information, judging by the below section of code (specifically @ 541): https://github.com/tzapu/WiFiManager/blob/2447a3fd7408c5718997b3fce75cdbcca2b4ce0e/WiFiManager.cpp#L532-L543 It's possible that I'm "doing it wrong" but I believe my code is very aligned to your examples. The intent of this method is to provide a fall-back if the AP cannot be connected to, but that fails if the AP was configured previously so that seems at odds with your intent. Is there something else I can provide to show you what I mean?
kerem 2026-02-28 01:27:11 +03:00
Author
Owner

@tablatronix commented on GitHub (Nov 13, 2019):

No idea, without any information whatsovever, it is hard to know what is going on.

<!-- gh-comment-id:553542645 --> @tablatronix commented on GitHub (Nov 13, 2019): No idea, without any information whatsovever, it is hard to know what is going on.
Author
Owner

@lbussy commented on GitHub (Nov 13, 2019):

That actually is a lot of information. You have a note there in your own code that says:

// @todo even if sta is connected, it is possible that softap connections will fail, IOS says "invalid password", windows says "cannot connect to this network" researching

Are you researching? Because that's exactly what's happening.

My steps to reproduce are environmental, not code-based. What information is it you think would be more prescriptive?

<!-- gh-comment-id:553568967 --> @lbussy commented on GitHub (Nov 13, 2019): That actually is a lot of information. You have a note there in your own code that says: ``` // @todo even if sta is connected, it is possible that softap connections will fail, IOS says "invalid password", windows says "cannot connect to this network" researching ``` Are you researching? Because that's exactly what's happening. My steps to reproduce are environmental, not code-based. What information is it you think would be more prescriptive?
Author
Owner

@tablatronix commented on GitHub (Nov 13, 2019):

The entire form you deleted when you opened this issue for starters. versions, lib, serial logs..

<!-- gh-comment-id:553570335 --> @tablatronix commented on GitHub (Nov 13, 2019): The entire form you deleted when you opened this issue for starters. versions, lib, serial logs..
Author
Owner

@tablatronix commented on GitHub (Nov 13, 2019):

also you say AP 4 times, and I have no idea which ap you are talking about , some are the router ssid, some the wm portal.. again , i have no idea what issue you are having.

I Dont even know if you are using esp8266 or esp32...

<!-- gh-comment-id:553571152 --> @tablatronix commented on GitHub (Nov 13, 2019): also you say AP 4 times, and I have no idea which ap you are talking about , some are the router ssid, some the wm portal.. again , i have no idea what issue you are having. I Dont even know if you are using esp8266 or esp32...
Author
Owner

@lbussy commented on GitHub (Nov 13, 2019):

I didn't delete the form, I was surprised I was not presented with one. I'll leave debugging why that didn't happen to the GitHub people.

I also apologize - when I said I opened an issue here previously, I was mistaken. We discussed this in #866 and I left to try out the development branch.

Here is the typical information I used in a diffferent repo which should satisfty the immediate need:

Platform

  • Hardware: ESP-12S
  • Core Version: SDK:2.2.1(cfd48f3)/Core:2.5.2=20502000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3/BearSSL:a143020
  • Development Env: PlatformIO
  • Operating System: Windows

Settings in IDE

  • Module: Wemos D1 mini r2
  • Flash Mode: qio
  • Flash Size: 4Mb
  • lwip Variant: v2 Lower Memory
  • Reset Method: ck
  • Flash Frequency: 40Mhz
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 460800

As I said I am using your development branch.

Allow me to restate the steps to reproduce using your terms:

  1. Properly configure the ESP8266 (WemosD1) controller to connect to a given router SSID via captive portal
  2. Verify connectivity (to access point) via wifiManager.autoConnect
  3. Disable router and restart the controller
  4. Observe controller timeout on router SSID connection, and start your captive portal
  5. Attempt to connect to the captive portal and receive failure (different messages depending upon platform)

Does that help? I am never able to connect to your captive portal, be it from Windows, iOS or Linux.

<!-- gh-comment-id:553580637 --> @lbussy commented on GitHub (Nov 13, 2019): I didn't delete the form, I was surprised I was not presented with one. I'll leave debugging why that didn't happen to the GitHub people. I also apologize - when I said I opened an issue here previously, I was mistaken. We discussed this in #866 and I left to try out the development branch. Here is the typical information I used in a diffferent repo which should satisfty the immediate need: #### Platform - Hardware: ESP-12S - Core Version: SDK:2.2.1(cfd48f3)/Core:2.5.2=20502000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3/BearSSL:a143020 - Development Env: PlatformIO - Operating System: Windows ### Settings in IDE - Module: Wemos D1 mini r2 - Flash Mode: qio - Flash Size: 4Mb - lwip Variant: v2 Lower Memory - Reset Method: ck - Flash Frequency: 40Mhz - CPU Frequency: 80Mhz - Upload Using: SERIAL - Upload Speed: 460800 As I said I am using your development branch. Allow me to restate the steps to reproduce using your terms: 1. Properly configure the ESP8266 (WemosD1) controller to connect to a given router SSID via captive portal 1. Verify connectivity (to access point) via wifiManager.autoConnect 1. Disable router and restart the controller 1. Observe controller timeout on router SSID connection, and start your captive portal 1. Attempt to connect to the captive portal and receive failure (different messages depending upon platform) Does that help? I am never able to connect to your captive portal, be it from Windows, iOS or Linux.
Author
Owner

@tablatronix commented on GitHub (Nov 13, 2019):

No form ? that is indeed interesting. If you click new issue you are supposed to have prefilled info form.. Sorry about that.

Can you elaborate on the messages you are seeing?
Can you try esp staging as there was some fatal ap things fixed.
Also when in doubt I do a flash erase to clean the esp out.

<!-- gh-comment-id:553635650 --> @tablatronix commented on GitHub (Nov 13, 2019): No form ? that is indeed interesting. If you click new issue you are supposed to have prefilled info form.. Sorry about that. Can you elaborate on the messages you are seeing? Can you try esp staging as there was some fatal ap things fixed. Also when in doubt I do a flash erase to clean the esp out.
Author
Owner

@tablatronix commented on GitHub (Nov 13, 2019):

Screen Shot 2019-11-13 at 4 31 48 PM
<!-- gh-comment-id:553635803 --> @tablatronix commented on GitHub (Nov 13, 2019): <img width="760" alt="Screen Shot 2019-11-13 at 4 31 48 PM" src="https://user-images.githubusercontent.com/807787/68810282-65d86280-0633-11ea-88f2-48b78154da4d.png">
Author
Owner

@lbussy commented on GitHub (Nov 13, 2019):

I clicked on the new issue button again when you said that and it was there, it just didn’t pop up when I opened the issue. Strange, but that’s why I said it was a GitHub thing. That or I just happened to hit an amazingly accurate series of keystrokes as the page was loading.

When I get home on Friday I can try staging as well. It’s tough to walk the wife at home through connecting to a captive portal no matter how many times we stay in a hotel.

I’ll also post some screen grabs when it fails to connect and turn up the logging so it captures something interesting.

There’s a 98% chance I tried a flash erase since that’s what I always tell my users but I’ll do that again as well.

<!-- gh-comment-id:553657136 --> @lbussy commented on GitHub (Nov 13, 2019): I clicked on the new issue button again when you said that and it was there, it just didn’t pop up when I opened the issue. Strange, but that’s why I said it was a GitHub thing. That or I just happened to hit an amazingly accurate series of keystrokes as the page was loading. When I get home on Friday I can try staging as well. It’s tough to walk the wife at home through connecting to a captive portal no matter how many times we stay in a hotel. I’ll also post some screen grabs when it fails to connect and turn up the logging so it captures something interesting. There’s a 98% chance I tried a flash erase since that’s what I always tell my users but I’ll do that again as well.
Author
Owner

@lbussy commented on GitHub (Nov 16, 2019):

You seem to have pushed some new changes. I've got a new WAP here to test with however the portal now fails to display for me (#970). So, not sure if I can reproduce this till that's resolved.

<!-- gh-comment-id:554682392 --> @lbussy commented on GitHub (Nov 16, 2019): You seem to have pushed some new changes. I've got a new WAP here to test with however the portal now fails to display for me (#970). So, not sure if I can reproduce this till that's resolved.
Author
Owner

@tablatronix commented on GitHub (Nov 17, 2019):

The portal does not show via what ip address? How are you testing

<!-- gh-comment-id:554690225 --> @tablatronix commented on GitHub (Nov 17, 2019): The portal does not show via what ip address? How are you testing
Author
Owner

@lbussy commented on GitHub (Nov 17, 2019):

This can be closed (I'll go ahead and do that.) Since updating to the latest from the development branch I cannot reproduce the issue I was having.

<!-- gh-comment-id:554777469 --> @lbussy commented on GitHub (Nov 17, 2019): This can be closed (I'll go ahead and do that.) Since updating to the latest from the development branch I cannot reproduce the issue I was having.
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#817
No description provided.