Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CaptivePortal(Advanced) only works with Google's IP address #7185

Closed
6 tasks done
jan-gerard opened this issue Apr 2, 2020 · 1 comment
Closed
6 tasks done

CaptivePortal(Advanced) only works with Google's IP address #7185

jan-gerard opened this issue Apr 2, 2020 · 1 comment

Comments

@jan-gerard
Copy link

jan-gerard commented Apr 2, 2020

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-12-F
  • Core Version: 2.6.3
  • Development Env: Arduino IDE 1.8.12
  • Operating System: Windows (using Android to connect)

Settings in IDE

  • Module: Generic ESP8266 Module
  • Flash Mode: dout
  • Flash Size: 4MB
  • lwip Variant: v2 Lower Memory
  • Reset Method: nodemcu
  • Flash Frequency: 40Mhz
  • CPU Frequency: 80Mhz
  • Upload Using: OTA

Problem Description

The CaptivePortal.ino and CaptivePortalAdvanced.ino examples only work on newer Android (phones and tablets) when the IP address of the esp8266 AP is set to that of Google.com
IPAddress apIP(172, 217, 28, 1);
If I enter any other other IP address there, the mobile device connects, but is not redirected to the captive portal login page. It just says there is no internet connection (while there actually is a local connection).
The problem doesn't show on IOS devices and Windows, only recent Android devices. So you could argue that it isn't an ESP8266 problem, but the purpose of this library/example is to serve those devices.
I tried many things, different IP and subnet ranges, DNS configurations, etc.
For example, adding a line to my code
webServer.on("/generate_204", []() { webServer.send(204, "text/html", "success"); });
removes the response that there is no internet connection, but still no portal login page is shown when connecting to the network. It only works when I use the specific IP address of Google, and I can imagine that that is not fully future-proof.

MCVE Sketch

Latest CaptivePortal.ino with the line
IPAddress apIP(172, 217, 28, 1);
changed into something else, like
IPAddress apIP(192, 168, 1, 1);

@devyte
Copy link
Collaborator

devyte commented Apr 18, 2020

The SoftAP IP was set to that value on purpose, see #5529 by @nouser2013 and the merge notes for the reasons.
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants