Giter Site home page Giter Site logo

ferreira-igor / micropython-wifi_manager Goto Github PK

View Code? Open in Web Editor NEW
50.0 6.0 25.0 43 KB

WiFi Manager for ESP8266 and ESP32 using MicroPython.

License: MIT License

Python 100.00%
esp8266 esp32 micropython wifi wifimanager wifi-configuration python library

micropython-wifi_manager's Introduction

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 ESP32

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

# 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/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.