Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

In AP, DNS server always redirects to 192.168.4.1 no mater what APStaticIP is set to. #58

@yiancar

Description

@yiancar

Describe the bug

My understanding is that the intention of the code is to auto direct the user connected to the config portal once connected. Currently due to a misconfiguration in the DNS server if APStaticIP is set the user has to enter the IP of APStaticIP to the browser.

This is because the DNS server is configured with WiFi.softAPIP() before softAP itself has been given the value of APStaticIP.

Esentially the DNS entry always redirects to 192.168.4.1.

Steps to Reproduce

Use the ESP32_FSWebServer_DRD sketch.
Connect to AP.
Config page only appears when 192.168.100.1 is used in the browser.

Proposed solution

DNS Setup

if (! dnsServer->start(DNS_PORT, "*", WiFi.softAPIP()))
is before AP ip configuration
if (_WiFi_AP_IPconfig._ap_static_ip)
.
Either move DNS setup after the AP configuration or put another checker at DNS setup to check if APStaticIP is set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions