Captive portal for MicroPython using ESP32 (WeMos)

A captive portal (system) implemented on MicroPython running on a ESP32 (WeMos board)

Similar projects worth following
There is more than one way to implement a captive portal. I used the "redirect by DNS". Every time a client requests a website, a DNS query is started. I implemented a DNS server that answers all the DNS lookups returning the IP address of the ESP32 and thus, as a result, the captive portal page. Moreover, the message "connect to a network" or "sign in to a network" appears.

Project Components

WeMos WeMos WiFi ESP32 Development Tool x 1 buy
INR18650 INR18650 3.7v Battery x 1 buy buy
Python MicroPython download tutorial
Python uPyPortal download

Portal optimization is required! This is only a sample and a very beta code. The portal is far away from stable :S, but it works.

  • 1
    Get the required hardware.

    Check the component list

  • 2
    Install MicroPython on the ESP32.
    You need a nightly version greater than esp32-20171031 (31 Oct. 2017)! Versions older than this one have a problem with the DNS address of the access point (see here). A tutorial to install MicroPython on the ESP32 can be found here.
  • 3
    Using the PyMark console, connect the WeMos to the Internet.
    Install the captive-portal dependencies (picoweb, micropython-logging, utemplate, micropython-pkg_resources, micropython-btreedb). I included the file ``. You need to change the `your_ssid`, and the `wpa2_password` to the corresponding of your network and execute the file on the PyMark console (click on the run button).

View all 10 instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates