Skip to main content

WiFi Manager for ESP32 running MicroPython

Project description

WiFiManager (MicroPython – ESP32)

A smart and flexible Wi-Fi manager for ESP32 using MicroPython. Supports auto-connect, AP fallback, JSON-based configuration, and dynamic network management.


🚀 Features

  • Auto-connect to strongest saved network
  • Fallback to Access Point (AP) mode
  • JSON-based configuration (networks + AP settings)
  • Quick connect to new networks
  • Dynamic AP configuration
  • Network scanning
  • Lightweight and optimized for MicroPython

📦 Installation

pip install esp32-wifimanager

Or manually:

  • Copy wifiManager/ folder to ESP32
  • Create wifi.json file (optional)

⚙️ Configuration File (wifi.json)

{
  "networks": [{ "ssid": "Home", "password": "12345678" }],
  "AP": {
    "essid": "ESP32_AP",
    "password": "12345678",
    "channel": 6
  }
}

⚡ Quick Start

from wifiManager import WiFiManager

wifi = WiFiManager(debug=True)
print(wifi.connect())

🔌 Connection Flow

  1. Scan nearby networks
  2. Match with saved networks
  3. Connect to strongest signal
  4. If failed → Start AP mode

📡 Quick Connect (New 🔥)

Connect to a network and save it automatically:

wifi.quick_connect("MyWiFi", "12345678")

📊 Status APIs

STA Status

wifi.status_sta()

Output:

{
  "status": true,
  "ssid": "MyWiFi",
  "ip": "192.168.1.10"
}

AP Status

wifi.status_ap()

📡 Access Point Control

Start AP

wifi._ap()

Update AP Settings

wifi.update_ap(essid="NEW_AP", password="87654321", channel=11)

📁 Network Management

Add Network

wifi.add_network("MyWiFi", "12345678")

Remove Network

wifi.remove_network("MyWiFi")

Clear All Networks

wifi.clear_networks()

⛔ Stop Interfaces

wifi.stop_all()
wifi.stop_sta()
wifi.stop_ap()

📡 Scan Networks

wifi.scanner.scan()

⚠️ Migration Guide (v1 → v2)

❌ Old

wifi = WiFiManager(ap_essid="ESP32", ap_password="12345678")
wifi.connect()

✅ New

wifi = WiFiManager()
wifi.connect()

👉 AP settings are now stored in wifi.json


❌ Old Response

{ "STATUS": "CONNECTED!", "IP": "..." }

✅ New Response

{ "status": true, "ip": "..." }

🧠 Notes

  • AP settings are persistent via JSON
  • quick_connect() automatically saves networks
  • Better memory handling and stability
  • Designed for IoT production use

📜 License

MIT License

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

esp32_wifimanager-2.0.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

esp32_wifimanager-2.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file esp32_wifimanager-2.0.0.tar.gz.

File metadata

  • Download URL: esp32_wifimanager-2.0.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for esp32_wifimanager-2.0.0.tar.gz
Algorithm Hash digest
SHA256 1c8835006441883163c057df193eb8d7b336056cd5774dc27dbe90bfde92284c
MD5 e0b7d22ac94c4493c4f515f3d624ab86
BLAKE2b-256 fcef34921798888fd741962195e05f4103491b475717ba97973fd14c9d741bc3

See more details on using hashes here.

File details

Details for the file esp32_wifimanager-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for esp32_wifimanager-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c8ba8ef2e70983a343bf493c1f364ec9f1ec589f720501020b6f922b3d2c819
MD5 2c50db1fc1fb2527041f6df30cbaddda
BLAKE2b-256 12a861420e4a44a82ef9fc66569c9468393698c4b728ad2652c83c58e5af2db7

See more details on using hashes here.

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