Setup WiFi on your Odinub board by following the step given here.
Step 1: Update your boardBefore starting the internet speed monitoring on your Odinub board we must make sure that it is up to date.
For update your Odinub execute following commands.
sudo apt-get updatesudo apt-get upgrade
Step 2: Install require packagesHere we are going to use python for scripting and for internet speed monitoring we are utilizing it’s ‘speedtest-cli’ library. Using this library we can quickly retrive our current upload speed, download speed as well as current ping on Speedtest.net. Before we use this library we must first install python pip package as this library is not available on OS repository. So for this run following command.
sudo apt-get install python-pip
So for installing ’speedtest’ packages go to root directory and execute following command.
cd /tmpwget https://github.com/sivel/speedtest-cli/archive/master.zip
Now extract the file you have downloaded.
unzip master.zip
After extracting this file make it executable by going to extracted directory and move this file to usr/local/bin by using following commands.
cd speedtest-cli-master/
chmod 755 speedtest.py
Sudo mv speedtest.py /usr/local/bin/speedtest-cli
Step 3: Test your internet connection speedRun the following command to test your internet or broadband download and upload speed.
speedtest -cli
If you want to check speed result in bytes than execute following command.
speedtest -cli --bytes
If you want to share the result than you can download the image of the result from the URL provided after executing the following command.
speedtest -cli --share
Image source: speedtest.net
If you want the information only about download, upload and ping than run following command.
speedtest -cli --simple
You can also check the list of server based upon the distance in km by using following command.
speedtest -cli --list
By searching the list in terms of distance you will get a big list of servers. If you want to check the result of servers for a specific area than run the following command.
speedtest -cli --list | grep -i india
Create a python script by executing the following command and write the python code given below.
cd ~sudo nano speedtest.py
Step 5: Test the python scriptHere we are storing our output data in speedtest.csv file so we need to make a folder where it would be store.
mkdir ~/speedtest
Now we will go ahead and test the python script by using following command.
python ~/speedtest.py
Once the script finished its execution you can see the output by opening the.CSV file by executing the following command.
sudo nano ~/speedtest/speedtest.csv
Now if we want to automation means if we want to test the internet speed of Odinub right after its booting process than click here and follow the first two steps.
You just have to write the below line into rc.local file.
(sleep 30; python ~/speedtest.py)&
You can see the results when you reboot you Odinub.
So that's it. Now you guys should have your speed monitor on and running. I hope by end of this article you should now have your Odinub automatically internet speed monitor. If you do come across something then please feel free to send us your feedback.
Comments
Please log in or sign up to comment.