When running ESP32 wifi in access point mode, I can connect to it with my android phone. However phone doesn't stay connected to this network because there is no internet access.
Is there a way to fake internet access on ESP32 (AP-mode), so that phone stays connected to accesss point?
Fake internet access?
Re: Fake internet access?
Yeah this is really annoying. I'm not sure if there's a solution to this. Would be interested to know if anyone else has solved this.stina wrote: ↑Sun Aug 14, 2022 4:34 amWhen running ESP32 wifi in access point mode, I can connect to it with my android phone. However phone doesn't stay connected to this network because there is no internet access.
Is there a way to fake internet access on ESP32 (AP-mode), so that phone stays connected to accesss point?
Re: Fake internet access?
Hi,
tl;dr set up a dns record for connectivitycheck.gstatic.com and respond with HTTP code 204.
Some background information: Your phone is trying to connect to an internet service. If successful, it believes it is online.
So if you want your device (phone, OS, etc.) believe it's online, you need to emulate the service for that.
There are many such "services", only the most commonly used:
- Firefox
Answer of HTTP-Request "detectportal.firefox.com/canonical.html"
- Google
Answer of HTTP-Request "connectivitycheck.gstatic.com/generate_204" with HTTP-Code 204:
- Apple
Answer of HTTP-Request "captive.apple.co Answer of HTTP-Request "detectportal.firefox.com/canonical.html"
m"
Keep in mind, that you need a little (self written) HTTP-Server and DNS-Resolver on your ESP32. The DNS-Server must answer the request with the IP (192.168.4.1) of the ESP32 device. So the http request is redirected to your ESP32 HTTP server.
greetings
butzel
tl;dr set up a dns record for connectivitycheck.gstatic.com and respond with HTTP code 204.
Some background information: Your phone is trying to connect to an internet service. If successful, it believes it is online.
So if you want your device (phone, OS, etc.) believe it's online, you need to emulate the service for that.
There are many such "services", only the most commonly used:
- Firefox
Answer of HTTP-Request "detectportal.firefox.com/canonical.html"
Code: Select all
HTTP/1.1 200 OK
Server: nginx
Content-Length: 90
Via: 1.1 google
Date: Mon, 23. May 1949 13:37 GMT
Age: 4711
Content-Type: text/html
Cache-Control: public,must-revalidate,max-age=0,s-maxage=3600
<meta http-equiv="refresh" content="0;url=https://support.mozilla.org/kb/captive-portal"/>
Answer of HTTP-Request "connectivitycheck.gstatic.com/generate_204" with HTTP-Code 204:
Code: Select all
HTTP/1.1 204 No Content
Content-Length: 0
Cross-Origin-Resource-Policy: cross-origin
Date: Sun, 23. Mai 1949 13:37 GMT
Answer of HTTP-Request "captive.apple.co Answer of HTTP-Request "detectportal.firefox.com/canonical.html"
m"
Code: Select all
<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>
greetings
butzel