A ESP32 Captive Portal written in Arduino C++ (think airport Wi-Fi sign-in page) demo that works on all devices.
This code is an example of a captive portal for the ESP32, using the AsyncTCP library. The code sets up a soft access point with the given SSID and no password and configures a DNS server to redirect all traffic to the captive portal web server running on the ESP32. The captive portal serves an HTML page with a message that all requests will be redirected to this page.
The code also includes some workarounds and documents limitations for different devices and browsers, such as a workaround for Windows 11 captive portal and limitations on the Safari (iOS) browser.
Original Repository: CDFER/Captive-Portal-ESP32
RAM: [= ] 13.8% (used 45236 bytes from 327680 bytes)
Flash: [=== ] 33.9% (used 1067117 bytes from 3145728 bytes)
-
Download and unpack the project ESP32-Captive-Portal-Google
-
Download and install Visual Studio Code by Microsoft from here
-
Open Visual Studio Code and go to the Extensions manager (the icon with the stacked blocks in the left bar)
-
Search for "platformio" and install the PlatformIO extension.
-
In VS Code, go to File -> Open Folder... and open the folder "ESP32-Captive-Portal-Google-main" (the one that contains platformio.ini, NOT the src folder)
-
Upload firmware to the ESP32 using the right arrow button in the bottom left corner of VS Code (it takes a while for the first compile)
-
Click PlatformIO extension (the icon with the Alien in the left bar) to upload spiffs file system
-
Go to mydebug -> Platform. Click Build Filesystem Image then Upload Filesystem Image
- Your ESP32 is ready!