Comments (7)
Do not change HOSTNAME to any IP, leave it as is. This is the URL that you want to see in the browser bar when connected. It is used for HTTP redirection.
from captive_portal.
Thanks @drzony. No difference when HOSTNAME changed to yahoo.com again redirecting to msd.com.
Problem is in:
Serial.printf("Access Point started, IP: %s\n", WiFi.softAPIP().toString().c_str());
web_server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
if (!redirectToCaptivePortal(request)) {
request->send(200, "text/html", HTML);
}
});
ERROR:
Access Point started, IP: 192.168.4.1
E (6229) event: mismatch or invalid event, id=63
E (6230) event: default event handler failed!
Got domain 'msftconnecttest.com'
from captive_portal.
E (6229) event: mismatch or invalid event, id=63
E (6230) event: default event handler failed!
Those are errors from lower layers, I can see them too on my setup and it works (They are more like warnings)
What do you see when navigating browser to http://wifi.manager.net or http://192.168.4.1 (leave HOSTNAME as "wifi.manager.net")
Is WiFi your only connection?
Is it working on your phone?
from captive_portal.
First PC Browser (chrom) shows http://www.msftconnecttest.com/redirect then redirecting to
https://www.msn.com/en-xl/?ocid=wispr&pc=u477
If I type 192.168.4.1 then Hello captive portal appears. Using phone after connect to wifi nothing happens.
The http://wifi.manager.net does not appear
from captive_portal.
Is WiFi your only connection on the PC?
from captive_portal.
If I have only one WiFi then chrom shows http://wifi.manager.net/ but my iPhone does not show.
I need to load my index.html saved on the SPIFFS or run 192.168.4.1 to load it.
If I change redirect function
//response->addHeader("Location", redirect_address);
response->addHeader ("Location", "http://192.168.4.1/" );
it works by PC but not iphone or android phone.
from captive_portal.
I have tested this code a minute ago on Android phone and tablet. It works without any changes. On other project people reported that changing AP IP address to 8.8.8.8 helped, but I have not verified it. I do not have access to iPhone or PC with WiFi so I'm not able to test it, but it should work if WiFi is your only connection and DNS address is taken from DHCP.
from captive_portal.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from captive_portal.