Giter Site home page Giter Site logo

netpi's Introduction

NetPi

This project sets up a Flask server on a Raspberry Pi to facilitate network connectivity tests using Python scripts. It runs speed tests and ping tests periodically, saves the results, and provides a web interface to view the results.

While this project is under development it works best if you can setup this project up in /home/admin/projects/speedtest You can install and run this anywhere if you change the paths to your desired structure.

Project Structure

speedtest/ │ ├── app.py ├── install.sh ├── ping.py ├── requirements.txt ├── run.sh ├── speedtest.py ├── startup.sh

└── templates/ └── index.html

├── results/ │ ├── ping/ │ └── speedtest/

app.py: Flask web application to display the test results. install.sh: Script to install Python dependencies. ping.py: Script to perform ping tests. requirements.txt: Python dependencies. run.sh: Script to run the application. speedtest.py: Script to perform network speed tests. startup.sh: Script to set up the project environment. instance/: Flask instance folder. results/: Folder to store test results. templates/: Folder for HTML templates.

Prerequisites Python 3 Git

Installation

Create your own directory for the project:

mkdir -p /home/admin/projects/speedtest

Replace /home/admin/projects/speedtest with the directory path where you want to install the project.

Navigate to your project directory:

cd /home/admin/projects/speedtest

Clone the repository into your directory:

git clone https://github.com/Yob42/NetPi.git .

Make the scripts executable:

chmod +x run.sh install.sh startup.sh

Set up the cronjob to start the application on reboot: Edit your crontab using:

crontab -e

@reboot /home/admin/projects/speedtest/run.sh

Usage You can also manually start it by running:

./run.sh

Web Interface Once the server is running, you can access the web interface by navigating to http://:5000 in your web browser.

Network Speed Results: Displays the latest network speed test results. Ping Results: Displays the latest ping results and the last disconnect time.

Running Tests Manually You can manually trigger the speed test and ping test by running the respective scripts:

Speed Test: source /home/admin/projects/speedtest/st_env/bin/activate python speedtest.py

Ping Test: source /home/admin/projects/speedtest/st_env/bin/activate python ping.py

Contributing This project is under development, please feel free to provide feedback. Contributions are welcome! Please create an issue or submit a pull request for any improvements or bug fixes.

netpi's People

Contributors

yob42 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.