Bandwidth PiMonitor
Turn your Raspberry Pi into a simple Bandwidth monitor.
Constantly monitor your internet connection speed to ensure it's consistent.
Supplies
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
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
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
Few things that might be added to the project.
- Add mqtt integration
- Add thingsboard.io integration
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!