Fake internet access?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
stina
Posts: 1
Joined: Sun Aug 14, 2022 4:26 am

Fake internet access?

Post by stina » Sun Aug 14, 2022 4:34 am

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?

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Fake internet access?

Post by jimmo » Wed Aug 17, 2022 3:15 am

stina wrote:
Sun Aug 14, 2022 4:34 am
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?
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.

butzel
Posts: 3
Joined: Sat Jun 10, 2017 10:02 pm

Re: Fake internet access?

Post by butzel » Sun Aug 21, 2022 3:54 pm

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"

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"/>
- Google
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

- Apple
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>
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

Post Reply