ESP32 WiFi Manager using MicroPython
Project description
ESP32 WiFi Config
A lightweight and user-friendly WiFi Manager for ESP32 using MicroPython. It enables dynamic WiFi configuration via a web portal — similar to how modern IoT devices (like smart plugs, routers, etc.) connect to WiFi.
Features
- Web-based setup: No USB/serial terminal required
- Access Point mode: Creates temporary WiFi AP for configuration
- Signal strength: Shows RSSI (signal quality) for each network
- Auto-save: Remembers WiFi credentials between reboots
- Mobile-friendly: Works on phones and tablets
- Lightweight: Minimal dependencies (uses built-in network, socket, time)
Installation
1. Method 1: Using mip (Recommended for MicroPython)
import mip
mip.install("github:sachin98241/ESP_WiFi_Manager")
2. Method 2: As a Python Module (via PyPI)
pip install esp-wifi-manager
3. Method 3: Manual Installation
- Flash MicroPython to your ESP32
- Copy
esp32_config.pyto your ESP32 - Use your favorite MicroPython IDE (Thonny, VS Code + PyMicroPython, etc.)
- Create
main.pywith the usage code below
First Time Setup
- Power on your ESP32
- Wait 2-3 seconds for boot
- On your phone/computer, look for WiFi network:
ESP32_Config - Connect with password:
12345678 - Open browser and go to:
http://192.168.4.1 - Select your WiFi network from the list
- Enter password and click "Connect"
- Done! ESP32 will restart and connect to your WiFi
Subsequent Startups
- If saved WiFi is available → Auto-connects (no AP needed)
- If saved WiFi fails → Starts AP mode again (follow setup steps)
Initialize the WiFi manager.
Parameters:
ap_name(str): Name of the Access Point (visible when scanning WiFi)ap_pass(str): Password for the Access Point (8+ characters recommended)
wifi.start()
Start the WiFi manager. This method:
- Tries to connect to saved WiFi
- If successful → returns (ESP32 is connected)
- If fails → starts AP mode with web server (blocks forever until user connects)
Troubleshooting
"Can't see ESP32_Config WiFi"
- Ensure ESP32 is powered on
- Wait 5 seconds after power on
- Check if your device supports 2.4GHz WiFi (ESP32 doesn't support 5GHz)
- Try restarting the ESP32
"Connection failed"
- Double-check the password
- Ensure WiFi is 2.4GHz (not 5GHz)
- Check WiFi signal strength on the page
- Try connecting to a different network
"Forgotten WiFi - how to reset"
- On the setup page, click "Forget WiFi"
- Device will restart and show AP again
- Or delete
wifi.txtfile if you have file system access
"Password with special characters doesn't work"
- Use the web interface (recommended)
- Avoid special characters if using serial input
- The web form handles encoding automatically
How It Works
- When ESP32 starts: The system tries to load saved WiFi credentials from local storage.
- If failed → creates Access Point
- Open browser at: http://192.168.4.1
- When user connects to ESP32 WiFi: Opens browser → visits 192.168.4.1 ESP32 scans nearby WiFi networks Displays list of SSIDs with signal strength (RSSI)
- User selects SSID and provides password and ESP32 attempts connection.
System Flow:
Power ON
│
▼
Load saved WiFi
│
┌──────┴──────┐
▼ ▼
Connect OK Connect FAIL
│ │
▼ ▼
DONE Start AP Mode
│
▼
Start Web Server
│
▼
User Inputs WiFi
│
▼
Try Connect Again
Modules & Libraries Used
network module: Controls WiFi/AP mode
socket module: Creates HTTP server
time module: Handles delays and timeouts
File I/O: Saves credentials to wifi.txt
URL decoding: Handles special characters in passwords
Requirements
- ESP32
- MicroPython firmware
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file esp_wifi_manager-0.1.1.tar.gz.
File metadata
- Download URL: esp_wifi_manager-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89de50f9818be8064c11552b3444b04f22c436ed22dbe9b1cf24b6e8e586e93a
|
|
| MD5 |
835ddd32b9370215825140fa60fc9132
|
|
| BLAKE2b-256 |
488f1dbec79c8149531912794a1b500deeef9368125d150ba7240296edf986d9
|
Provenance
The following attestation bundles were made for esp_wifi_manager-0.1.1.tar.gz:
Publisher:
pypi-publish.yml on sachin98241/esp_wifi_manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esp_wifi_manager-0.1.1.tar.gz -
Subject digest:
89de50f9818be8064c11552b3444b04f22c436ed22dbe9b1cf24b6e8e586e93a - Sigstore transparency entry: 1328124604
- Sigstore integration time:
-
Permalink:
sachin98241/esp_wifi_manager@b429b1389687cb79843b99c4eb1f97343aeb6f2d -
Branch / Tag:
refs/tags/v0.1.12 - Owner: https://github.com/sachin98241
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b429b1389687cb79843b99c4eb1f97343aeb6f2d -
Trigger Event:
push
-
Statement type:
File details
Details for the file esp_wifi_manager-0.1.1-py3-none-any.whl.
File metadata
- Download URL: esp_wifi_manager-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dff25b92b658d3611c542df9542ebd74f35137ce1eb4183c55887567034b131
|
|
| MD5 |
eb4f3a87ed8e84702f742f0b7323cb76
|
|
| BLAKE2b-256 |
8b12244d26f48659b5f767f53e5f3d49919976577617c3e130d33bfaefd9db79
|
Provenance
The following attestation bundles were made for esp_wifi_manager-0.1.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on sachin98241/esp_wifi_manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esp_wifi_manager-0.1.1-py3-none-any.whl -
Subject digest:
0dff25b92b658d3611c542df9542ebd74f35137ce1eb4183c55887567034b131 - Sigstore transparency entry: 1328124611
- Sigstore integration time:
-
Permalink:
sachin98241/esp_wifi_manager@b429b1389687cb79843b99c4eb1f97343aeb6f2d -
Branch / Tag:
refs/tags/v0.1.12 - Owner: https://github.com/sachin98241
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b429b1389687cb79843b99c4eb1f97343aeb6f2d -
Trigger Event:
push
-
Statement type: