Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Outline

WiFi Connection Checker and Restarter

Overview

This Python script monitors the status of a Wi-Fi connection on a Windows system. When the network becomes inactive or fails to respond to ping requests, the script automatically disables and re-enables the Wi-Fi adapter, then verifies whether the connection has been successfully restored. It uses the schedule package for periodic execution, netsh commands to manage the Wi-Fi interface, and the netifaces package to obtain user-friendly network interface names.

Prerequisites

  • This script is specifically designed for Windows systems.
  • The script requires administrative privileges to perform actions like turning off and on the WiFi interface.

Dependencies

Install the schedule and netifaces packages using the following commands:

pip install schedule
pip install netifaces
Pip3 if using python3

Usage

  1. Run the script with administrative privileges to ensure it can control the WiFi interface.
  2. python wifi_checker.py
  3. The script will schedule a periodic check of the WiFi connection status.
  4. If the WiFi connection is inactive (unable to receive ping packets), the script will automatically turn off and on the WiFi interface.
  5. The script will log the status of the WiFi connection in the console.

Important Notes

  • Ensure that the script is run with administrative privileges to avoid permission issues.
  • The script uses the netsh command to control the WiFi interface. If there are any issues with the execution of netsh, the script may not work as expected.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.