-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ESP32 Captive Portal not loading on Android #553
Comments
Dnsserver is no longer required, use the one in core |
Hey @tablatronix, thanks for the reply! I am using the DNSServer library from the core, I am using the latest version of the core and am having the results stated above. |
|
nope nevermind, I had the configportal timeout to short |
cant reproduce, windows 10 and IOS, both redirect to captive portal. What do your logs show ? |
Hi @tablatronix, thanks for your reply. I realized that the issue on my mac and pc was due to my antivirus blocking captive portals. (Sorry about that!) However there still seems to be an issue with android devices finding the captive portal. I've tried on both a Google Pixel and a Galaxy S8. The Debug output simply states the following on connect: The devices do seem to be getting the dns information properly however (see examples from pixel at end of this post). When attempting to navigate to a non https page (using chrome), or even directly via 192.168.4.1, the phones don't seem to even be making requests to the ESP. I have tested the devices on other captive portal systems (such as the guest wifi functionality on my home router, and both android phones pick up those portals fine). If there is any more information I may be able to give you to help determine the problem please let me know! |
I do not have an android device to test unfortunately. I will try to obtain one. |
I've also been experiencing this trouble for some time. I have plenty of extra systems, wifi adapters, etc. around as well as multiple android and other devices. (no iOS but I can gain access to some if needed). I've been needing a pop-up style portal for over a year and have been searching and/or posting occasionally to try to find a solution. |
On android only works if you try to open a http page (not https). And is not automatic as in ios or a pc. |
dns service should give an external ip and then do some kind of http redirection (that i havent been able to do it with esp8266). Do you know if there is a way of intercepting http packet to an external ip and deliver a 302 redirection to the captive portal? |
Yeah I will keep tracking this here espressif/arduino-esp32#1037 (comment) I will keep it open in case we can find a workaround or solution for us, then update the captiveportal examples and vice versa. I don't understand why this stuff is hard to come by, there should just be a developer whitepaper on this for andoid that clearly specifies what the deal is and how to get captive portals working. |
Got it working on android by setting AP IP host to 172.217.28.1 (like if it was a wan ip) and network mask to 255.255.255.0. |
@nicogon How did you exactly do it? I have been struggling with this problem for about two months. |
I think the gist of it is that whatever the device will reject local IP dns responses for addresses it knows - or at least rejects local ips it knows for something it knows should be on the internet at large. |
Anyone figure anything new out? |
On your Android device, go to Advanced wifi options and disable the option to "Switch to mobile data - Switch to mobile data whenever your Wi-Fi internet connection is slow or unstable." |
P |
I got this working by setting ip to 8.8.8.8 ot 8.8.4.4 and using port 53 |
Workaround In file WiFiManager.cpp, in function replacing solves the issue of pop-up not appearing on my Windows 10 device. I tested this on the AutoConnect example in Sloeber IDE on NodeMCU 1.0 board. I don't know why it worked but it did, and if someone can explain kindly do. Whereas for my Android P & Windows 10 devices, |
Thats interesting indeed, all requests should return the portal if its active.. That handler should never be reached. |
On building the project in the previously mentioned environment -
============================================================== On connecting to WiFi on Android Pie mobile device -
No pop-up appears, so I open Google Chrome
Then I open https://www.debian.org and also https://www.debian.org/ Then I open 192.168.4.1 When my Android Device is idle, this randomly appears multiple times - Now I open http://www.debian.org and also http://www.debian.org/
and it successfully redirects me to the captive portal in both the cases. ============================================================== I turn off and turn on my NodeMCU and on connecting to WiFi on Windows 10 laptop -
My default browser opens automatically and -
it redirects to the captive portal. On opening HTTPS and HTTP links, it is the same story as with the Android Pie device. |
I found a similar behaviour when using WifiServer library: When providing HTTP server for captive portal you generally have two options:
If you are doing number 1 and pretend using by connecting with an Android device I suggest adding a handler for the error case showing the captive portal:
I noticed that for Android 10, to properly detect the captive portal and make the phone to show "Touch to log in the network" message is necesary. If not you must navigate to any HTTP address and let the DNS do the job for you (not HTTPS). |
So is this a problem with these dns failing and refusing to redirect? Ill look again but I am still confused how we are hitting the 404 |
Basic Infos
Hi,
I just pulled the latest development build of WiFiManager (as well as the latest version of the Arduino-ESP32 core which includes the latest DNSServer library (as suggested in espressif/arduino-esp32#1186), however when running The AutoConnect Example (and others) I do not get a captive portal on any device. On Windows 10 and macOS (both latest) I am able to navigate to 192.168.4.1 or another non https page and it resolves to the ESP32, however no captive portal pops up on load. On android (8.1.0, latest) the issue seems to be more problematic, the device does not see any internet connection so it defaults to LTE and does not allow navigation to the ESP32 (even though it stays connected to the AP).
Are there some configuration steps I might be missing?
Thanks! - FC
Hardware
WiFimanager Branch/Release: Development
Hardware: espressif ESP32 DevKitC
Core Version: latest
The text was updated successfully, but these errors were encountered: