Skip to content

yaroniks/wifi_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wi-Fi Manager

Example usage:

Get all Wi-Fi spots and connect:

import logging
from wifi_manager import WiFi

logging.basicConfig(level=logging.INFO)

wifi_spots = WiFi.scan_wifi_spots()  # Get all Wi-Fi spots

for spot in wifi_spots:
    if spot.public:
        spot.connect()  # Connect to public Wi-Fi
        break
    
    if spot.name == "my_router":
        spot.connect("12345678")  # Connect to private Wi-Fi
        break

Custom connect to Wi-Fi:

import logging
from wifi_manager import WiFiSpot, Profile

logging.basicConfig(level=logging.INFO)

# Custom connect
profile = Profile('SSID1', 'Iphone (Ivan)', 'WPA3-Personal', False, 'password')
profile.create()

try:
    profile.connect()  # Try to connect to Wi-Fi
except ConnectionError:  # If profile is invalid
    profile.delete()  # Be sure to delete the profile
else:
    if WiFiSpot.check_connect():  # Check if password is correct
        if not WiFiSpot.check_internet():  # Check internet
            profile.delete()
    else:
        profile.delete()

About

Windows Wi-Fi manager

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages