- NIXIE STYLE LED DISPLAYPosted 2 months ago
- TOTEM: learning by experimentingPosted 3 months ago
- Google Assistant Voice Controlled Switch – NodeMCU IOT ProjePosted 3 months ago
- Water Softener Salt Level MonitorPosted 3 months ago
- Sparkly Air SensorPosted 3 months ago
- Ultra sonic distance finder with live statusPosted 3 months ago
- Windows interface to have total control over lampsPosted 3 months ago
- Smart AquariumPosted 3 months ago
- Wearable ProjectionPosted 4 months ago
- Write programs with the Arduino Web EditorPosted 4 months 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’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,
with a JSON body consisting of three values — the latency, download, and upload speeds — to be passed on to the action in the recipe.