Code Monkey home page Code Monkey logo

Comments (7)

drzony avatar drzony commented on August 28, 2024

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.

williamesp2015 avatar williamesp2015 commented on August 28, 2024

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.

drzony avatar drzony commented on August 28, 2024
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.

williamesp2015 avatar williamesp2015 commented on August 28, 2024

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.

drzony avatar drzony commented on August 28, 2024

Is WiFi your only connection on the PC?

from captive_portal.

williamesp2015 avatar williamesp2015 commented on August 28, 2024

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.

drzony avatar drzony commented on August 28, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.