Skip to main content

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

  1. Flash MicroPython to your ESP32
  2. Copy esp32_config.py to your ESP32
  3. Use your favorite MicroPython IDE (Thonny, VS Code + PyMicroPython, etc.)
  4. Create main.py with the usage code below

First Time Setup

  1. Power on your ESP32
  2. Wait 2-3 seconds for boot
  3. On your phone/computer, look for WiFi network: ESP32_Config
  4. Connect with password: 12345678
  5. Open browser and go to: http://192.168.4.1
  6. Select your WiFi network from the list
  7. Enter password and click "Connect"
  8. 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:

  1. Tries to connect to saved WiFi
  2. If successful → returns (ESP32 is connected)
  3. 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.txt file 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

  1. When ESP32 starts: The system tries to load saved WiFi credentials from local storage.
  2. If failed → creates Access Point
  3. Open browser at: http://192.168.4.1
  4. 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)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

esp_wifi_manager-0.1.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

esp_wifi_manager-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

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

Hashes for esp_wifi_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89de50f9818be8064c11552b3444b04f22c436ed22dbe9b1cf24b6e8e586e93a
MD5 835ddd32b9370215825140fa60fc9132
BLAKE2b-256 488f1dbec79c8149531912794a1b500deeef9368125d150ba7240296edf986d9

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file esp_wifi_manager-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for esp_wifi_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0dff25b92b658d3611c542df9542ebd74f35137ce1eb4183c55887567034b131
MD5 eb4f3a87ed8e84702f742f0b7323cb76
BLAKE2b-256 8b12244d26f48659b5f767f53e5f3d49919976577617c3e130d33bfaefd9db79

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page