Giter VIP home page Giter VIP logo

pyaccesspoint's Introduction

Introduction

PyAccessPoint is a package to create a wifi access point on linux. Itdepends on hostapd for AP provisioning and dnsmasq to assign IP addresses to devices.

Dependencies

So, there 2 types of dependencies.

System dependencies:
  • dnsmasq
  • hostapd
  • python3
Python dependencies
  • wireless
  • netifaces
  • psutil

You can not install python dependencies manually, they will be installed while installing the package. If you want to do it manually, just type (or copy, it's better way :D)

sudo apt install python3-dev python3-pip && sudo pip3 install wireless netifaces psutil

Installation

Easy way by using pip

sudo apt update && sudo apt --yes --force-yes install dnsmasq hostapd python3-dev python3-pip && sudo pip3 install pyaccesspoint

Hard way

  1. Install system dependencies

    sudo apt update && sudo apt --yes --force-yes install dnsmasq hostapd python3-dev unzip python3-pip
    
  2. Download latest package

    cd ~ && wget --output-document=pyaccesspoint-master.zip https://github.com/Goblenus/pyaccesspoint/archive/master.zip
    
  3. Unpack downloaded package

    unzip pyaccesspoint-master.zip && cd pyaccesspoint-master
    
  4. Install it

    sudo python3 setup.py install
    
  5. Remove files

    cd ~ && sudo rm -rf pyaccesspoint-master.zip pyaccesspoint-master
    

That is all. Now you can use PyAccessPoint.

One line install:

sudo apt update && sudo apt --yes --force-yes install dnsmasq hostapd python3-dev unzip python3-pip && cd ~ && wget --output-document=pyaccesspoint-master.zip https://github.com/Goblenus/pyaccesspoint/archive/master.zip && unzip pyaccesspoint-master.zip && cd pyaccesspoint-master && sudo python3 setup.py install && cd ~ && sudo rm -rf pyaccesspoint-master.zip pyaccesspoint-master

Usage

You can use it as standalone command line utility: To start

sudo pyaccesspoint start

It will create hotspot named "MyAccessPoint" on wlan0 with "1234567890" password.

All arguments you may obtain by typing:

pyaccesspoint --help

To stop

sudo pyaccesspoint stop

You can configure and save config file. This will save you time at them next start

sudo pyaccesspoint configure

You config file file will be placed at /etc/accesspoint/accesspoint.json. To start it with config file just type:

sudo pyaccesspoint --config start

Code usage

  1. Import

    from PyAccessPoint import pyaccesspoint
    
  2. Create AccessPoint class

    access_point = pyaccesspoint.AccessPoint()
    
  3. Start it

    access_point.start()
    
  4. Stop it

    access_point.stop()
    
To check is accesspoint started use is_running
access_point.is_running()

You can change accesspoint parameters while creating AccessPoint class

Class parameters:
  • wlan - wlan interface
  • inet - wlan forward to interface (use None to off forwarding)
  • ip - just ip of your accesspoint wlan interface
  • netmask - so... -> (wiki link)
  • ssid - name of your accesspoint
  • password - password of your accesspoint

Tested

  • OrangePi Plus with Armbian 5.23

Note

This project is python3 compatible only, python2 is not tested at all.

Idea

This project is fork of https://github.com/prahladyeri/hotspotd (Prahlad Yeri - [email protected])

pyaccesspoint's People

Contributors

goblenus avatar prahladyeri avatar mrahul17 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.