Bandwidth PiMonitor

by ZaNgAbY in Circuits > Raspberry Pi

10665 Views, 193 Favorites, 0 Comments

Bandwidth PiMonitor

5.png

Turn your Raspberry Pi into a simple Bandwidth monitor.

Constantly monitor your internet connection speed to ensure it's consistent.

Supplies

ETH-USB-HUB-HAT-B-1.jpg
RASP_PI_ZERO_00.jpg
SD.jpg
2.13inch-e-paper-hat-intro.jpg

Raspberry Pi Zero W (you can also use other models)

MicroSD card

Waveshare ETH/USB HUB HAT

Waveshare 2.13inch e-Paper HAT

Connect the Parts

1.png
2.png
3.png

Connect the boards together.

First connect the ethernet HAT to the Pi by using the included screws, then add the e-Paper HAT on top.

There is also the possibility of using a Raspberry pi B that already has the ethernet port. Another option would be to connect the Pi using WiFi, but the speed might be limited.

Prepare the Software

Linux-Terminal-icon.png

Install a fresh copy of Raspbian lite.

I like to use Raspberry Pi Imager


SSH is disabled by default so you need to enable it by adding a file called "ssh" in /boot.

Once the Pi is up you can SSH into it and continue with the next steps.


Enable the SPI interface

sudo raspi-config

Choose Interfacing Options -> SPI -> Yes

sudo reboot


Install BCM2835 libraries

wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz
tar zxvf bcm2835-1.60.tar.gz 
cd bcm2835-1.60/
sudo ./configure
sudo make
sudo make check
sudo make install


Install WiringPi libraries

sudo apt-get install wiringpi
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v


Install Python2 libraries

sudo apt-get update
sudo apt-get install python-pip python-pil python-numpy
sudo pip install RPi.GPIO
sudo pip install spidev


Install Python3 libraries

sudo apt-get update
sudo apt-get install python3-pip python3-pil python3-numpy
sudo pip3 install RPi.GPIO
sudo pip3 install spidev


Install the speedtest-cli module

pip install speedtest-cli


Clone the project files:

sudo git clone https://github.com/zangaby/bpimon


Test the python script:

sudo python bpimon.py

or

sudo python3 bpimon.py


Add a cronjob to perform the test every 1 hour.

sudo crontab -e 

add the following line

0 * * * * /usr/bin/python /home/pi/bpimon.py

Further Ideas

4.png

Few things that might be added to the project.

  • Add mqtt integration
  • Add thingsboard.io integration

thank-you.jpg

Credits: https://www.instructables.com/Bandwidth-Monitor/

Hope you enjoyed this project and if you have any questions feel free to ask.

Thank you for reading!