Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ferreira-igor/micropython-wifi_manager
WiFi Manager for ESP8266 and ESP32 using MicroPython.
https://github.com/ferreira-igor/micropython-wifi_manager
esp32 esp8266 library micropython python wifi wifi-configuration wifimanager
Last synced: 3 months ago
JSON representation
WiFi Manager for ESP8266 and ESP32 using MicroPython.
- Host: GitHub
- URL: https://github.com/ferreira-igor/micropython-wifi_manager
- Owner: ferreira-igor
- License: mit
- Created: 2021-01-28T23:06:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T08:44:05.000Z (about 1 year ago)
- Last Synced: 2024-04-29T11:33:53.499Z (6 months ago)
- Topics: esp32, esp8266, library, micropython, python, wifi, wifi-configuration, wifimanager
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 49
- Watchers: 6
- Forks: 24
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micropython - micropython-wifi_manager - WiFi Manager for ESP8266 and ESP32 using MicroPython. (Libraries / Communications)
README
# WiFi Manager
WiFi Manager for ESP8266 and ESP32 using MicroPython. It might work in any other board since it only uses standard MicroPython libraries, but that's not tested.
![ESP8266](https://img.shields.io/badge/ESP-8266-000000.svg?longCache=true&style=flat&colorA=CC101F)
![ESP32](https://img.shields.io/badge/ESP-32-000000.svg?longCache=true&style=flat&colorA=CC101F)## What's new?
Version 2.0 comes with some improvements:
- Better documentation (I hope);
- Some aesthetical changes in the code;
- Removal of unnecessary messages;
- Removal of the ability to set the ip address (to avoid unexpected problems);
- Option to reboot after network configuration (needs improvement);## Wishlist
- [ ] Allow user to customize CSS;
- [ ] Custom fields for extra configuration (like mqtt server, etc)
- [ ] Turn this into a real python library with the option to be installed using pip;## How It Works
- When your device starts up, it will try to connect to a previously saved wifi.
- If there is no saved network or if it fails to connect, it will start an access point;
- By connecting to the access point and going to the address 192.168.4.1 you be able to find your network and input the credentials;
- It will try to connect to the desired network, and if it's successful, it will save the credentials for future usage;
- Be aware that the wifi credentials will be saved in a plain text file, and this can be a security fault depending on your application;## Installation and Usage
```python
# Download the "wifi_manager.py" file to your device;# Import the library:
from wifi_manager import WifiManager# Initialize it
wm = WifiManager()# By default the SSID is WiFiManager and the password is wifimanager.
# You can customize the SSID and password of the AP for your needs:
wm = WifiManager(ssid="my ssid",password="my password")# Start the connection:
wm.connect()
```## Methods
### .connect()
Tries to connect to a network and if it doesn't work start the configuration portal.
### .disconnect()
Disconnect from network.
### .is_connected()
Returns True if it's connected and False if it's not. It's the simpler way to test the connection inside your code.
### .get_address()
Returns a tuple with the network interface parameters: IP address, subnet mask, gateway and DNS server.
## Notes
- Do not use this library with other ones that works directly with the network interface, since it might have conflicts;
## Thanks To
https://github.com/tayfunulu/WiFiManager/