ESP32-C3 Captive Portal with DNS Redirection and Auto Popup Implementation #11558
                  
                    
                      Jayden1Joe
                    
                  
                
                  started this conversation in
                Question - Community Help
              
            Replies: 1 comment 1 reply
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
When I connect to the Wi-Fi Soft AP, it prints the received DNS requests as expected as you can see below. However, the webpage does not automatically pop up on my smartphone.
I believe it should work because the code sends a DNS response with the predefined IP address “192.168.4.1” using sendto(sock, response, pos, 0, (struct sockaddr *)&client_addr, addr_len);. The DNS request is caught and answered correctly, but the browser does not open the page automatically.
BTW, the web server and HTTP handlers seem to be functioning properly because when I manually enter “192.168.4.1” in the browser, the HTML page defined in the code is displayed.
I would really appreciate your help with this.
I (23669) dns_redirect: Received DNS request for: connectivitycheckgstaticcom
Response size: 512
Response position: 63
I (23679) dns_redirect: Received DNS request for: wwwgooglecom
Response size: 512
Response position: 48
I (23749) dns_redirect: Received DNS request for: mtalkgooglecom
Response size: 512
Response position: 50
Beta Was this translation helpful? Give feedback.
All reactions