- How to Adjust X and Y Axis Scale in Arduino Serial Plotter (No Extra Software Needed)Posted 3 months ago
- Elettronici Entusiasti: Inspiring Makers at Maker Faire Rome 2024Posted 3 months ago
- makeITcircular 2024 content launched – Part of Maker Faire Rome 2024Posted 5 months ago
- Application For Maker Faire Rome 2024: Deadline June 20thPosted 6 months ago
- Building a 3D Digital Clock with ArduinoPosted 11 months ago
- Creating a controller for Minecraft with realistic body movements using ArduinoPosted 12 months ago
- Snowflake with ArduinoPosted 12 months ago
- Holographic Christmas TreePosted 1 year ago
- Segstick: Build Your Own Self-Balancing Vehicle in Just 2 Days with ArduinoPosted 1 year ago
- ZSWatch: An Open-Source Smartwatch Project Based on the Zephyr Operating SystemPosted 1 year ago
Track Internet Dropouts, monitor ADSL bandwidth and Notify Your ISP with RPi
A dream came true for all home internet connection subscriber and a hellish nightmare for the internet providers marketing departments…
If there’s one thing that’s the same about everyone’s broadband connection, it’s that it’s slow. Usually slower than it was advertised to be when you got it. But slow isn’t as irritating as sporadic, when you get constant drops and outages in your internet connection, it can drive you to frustration.
It drove one man in Washington D.C. to monitor his broadband connectionwith a Raspberry Pi, and automatically tweet Comcast when his connection drops to a fraction of advertised speed.
Another project, simpler too, is based on speedtest-cli, a command line interface to the speedtest.net servers written in Python.
It’s really easy to install. Just open up a terminal window on your Raspberry Pi and type the following at the command line,
<strong>$</strong> sudo apt-get install python-pip <strong>$</strong> sudo pip install speedtest-cli
this will install pip — a package management system for Python — if you don’t already have it installed, and then the speedtest-cli package from thepip repositories.
Once installed it’s rather easy to grab and measure your broadband speed.
<strong>$</strong> speedtest-cli Retrieving speedtest.net configuration... Retrieving speedtest.net server list... Testing from Acme Broadband Provider. (XXX.XXX.XXX.XXX)... Selecting best server based on latency... Hosted by Foo Limited (Metropolis) [2.52 km]: 35.27 ms Testing download speed........................................ Download: 14.47 Mbit/s Testing upload speed.................................................. Upload: 1.46 Mbit/s <strong>$</strong>
In any case, now that we have our command line tool installed, we can run it automatically using cron, which allows you to schedule commands to run at specified times (every hour), and log the output to a file.
The easiest way to do this is to create a quick script, let’s call it speedtest-cron.sh, which will log the date and the output of the test to a file,
#!/bin/bash date >> /home/pi/speedtest.log /usr/local/bin/speedtest --simple >> /home/pi/speedtest.log
To format the raw data output from the script and prepare a “communication” to the ISP, IFTTT‘s Maker Channel, introduced towards the middle of last year, comes in handy. I went ahead and created a recipe on IFTTT to take the data passed to a Maker Channel event called “speedtest” and automatically fill a Google Sheet with the output of speedtest-cli script.
The easiest way to get the data from our Raspberry Pi to IFTTT at this point is to modify the speedtest-cli-extras script. Instead of printing out the output to a log file, we’ll make a POST web request with the event name and our secret key — the key is assigned when you connect the channel — of the form,
https://maker.ifttt.com/trigger/speedtest/with/key/<strong>{secret_key}</strong>
with a JSON body consisting of three values — the latency, download, and upload speeds — to be passed on to the action in the recipe.
One Comment