Skip to content

Example CaptivePortal from DNSServer.h #10422

Closed
@RodrigoStefanini

Description

@RodrigoStefanini

Related area

Esp32

Hardware specification

Esp32 wroom

Is your feature request related to a problem?

The example of CaptivePortal do not work for me, and i modify the code for be usefull.

Describe the solution you'd like

The proposal is to make the example functional, if this occurs for other users.

Describe alternatives you've considered

Change this:
"if (dnsServer.start()) {
Serial.println("Started DNS server in captive portal-mode");
} else {
Serial.println("Err: Can't start DNS server!");
}
"

Additional context

The code only work for me wen i put:

"dnsServer.start(53, "*", WiFi.softAPIP());"

I dont know if this is about some version, i used the 3.0.5 esp32 lib for arduino.

I have checked existing list of Feature requests and the Contribution Guide

  • I confirm I have checked existing list of Feature requests and Contribution Guide.

Activity

lbernstone

lbernstone commented on Oct 5, 2024

@lbernstone
Contributor

Already fixed in #10366
Please include version in your issue description. It's there for a reason.

N0edL

N0edL commented on Feb 24, 2025

@N0edL

Why doesnt it open the captive portal automaticly when connected on phone ?

lbernstone

lbernstone commented on Feb 24, 2025

@lbernstone
Contributor

@N0edL Many android phones are hard coded to use 8.8.8.8 as their DNS server. If you set the softAP to use that address, it can redirect those phones.

WiFi.softAPConfig(IPAddress(8,8,8,8), IPAddress(8,8,8,8), IPAddress(255,255,255,0));
N0edL

N0edL commented on Feb 24, 2025

@N0edL

@lbernstone Ahh okay what about apple ?

lbernstone

lbernstone commented on Feb 25, 2025

@lbernstone
Contributor

Please don't hijack this issue, unless the exact same workaround works for you. Turn verbose logging on and open a new issue with the log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Example CaptivePortal from DNSServer.h · Issue #10422 · espressif/arduino-esp32