GithubHelp home page GithubHelp logo

gruvw / nmwifi Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 53 KB

Python API (and CLI) to configure a Wi-Fi device through NetworkManager using a fallback Access Point.

Home Page: https://pypi.org/project/nmwifi

Python 100.00%
ap api network-manager networking wifi

nmwifi's Introduction

nmwifi

The Python package nmwifi provides an API (and a CLI) to configure a Wi-Fi device through NetworkManager using a fallback Access Point.

Take a look at the project's roadmap to see upcoming features (and all the work accomplished).

Note - Check out the nmwifi python package on PyPI: https://pypi.org/project/nmwifi (managed using Poetry).

This package was initially developed for the Raspberry Pi to headlessly set up a Wi-Fi connection to a home router. However it works for any device that has at least one wireless network interface and that has NetworkManager installed.

Installation

  • Install by running: pip install nmwifi
  • Usage: nmwifi --help

Basic usage

The most common usage of the nmwifi tool is to first call setup (to configure the connections) and then keep the balance loop running forever. This will set up a Wi-Fi connection to the given SSID and password along with an Access Point (with default SSID and no password). When the Wi-Fi network is not available, NetworkManager will automatically switch to the Access Point (AP). The balance loop will periodically try to reconnect to the Wi-Fi network on AP mode.

Note: the synchronous calls can take some time to respond depending on the underlying NetworkManager behavior.

List every network interface on your machine by running the nmcli d command, select one that has the "wifi" type (often wlan0).

CLI

nmwifi setup -i <network-interface> -ws <wifi-ssid> -wp <wifi-password>
nmwifi balance -i <network-interface>

Python

import nmwifi

nmwifi.setup("<network-interface>", "<wifi-ssid>", "<wifi-password>")
nmwifi.balance("<network-interface>")

Contributions

Feel free to contribute by submitting pull requests, whether to add new features, improve existing functionality, or fix bugs :)

Before opening a new PR, make sure to open an issue to discuss it beforehand (first check if a similar issue does not already exist).

Powered by

This project would not be possible without the wonderful technologies below:

nmwifi's People

Contributors

gruvw avatar

Watchers

 avatar

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.