The speedtest-cli is an application that is used to find the speed of the internet through the command line and in this guide, we will explore the methods to install and use the speedtest-cli. We will install the speedtest-cli on RaspberryPi using the methods:
- By downloading the speedtest-cli package from its website
- Through the pip
- Through the Python script
Method 1: How to install the speedtest-cli by downloading its package from its website
The speedtest-cli is not usually come in the default repository of the Raspberry Pi operating system, so we will install its deb package from its official website using a command:
In the above command, the “s” flag is used to specify the certificate file, once the package has been downloaded, we will install it using the command:
Now, if we want to delete the package, we can use the purge command:
Method 2: How to install the speedtest-cli through the pip
We can also install the speedtest-cli application through the pip, but as we know the speedtest-cli is dependent on the python language, so first we will install the python packages using the command:
After the successful installation of the python packages, we will install speedtest-cli using the pip3:
To uninstall the speedtest-cli using the pip3, we will use the command:
Method 3: How to install the speedtest-cli through Python script
The other way to install the speedtest-cli on Raspberry Pi is by using the Python script of the speedtest.py, for this we will download its script from the githubusercontent.com using the wget command:
Now, we will change the permissions of speedtest-cli:
We will move the downloaded package of the speedtest-cli to the “/usr/bin/” directory using the command:
We have moved the speedtest-cli to the “/usr/bin/” so that when we use the application to measure the speed of the internet, we are not supposed to direct its path.
How to measure the speed of the internet using speedtest-cli on Raspberry Pi
To measure the speed of the internet, launch the application of speedtest-cli using the command:
In the above output, you can see the results in which the internet speed is shown of download as well as upload, similarly, if you want to display the output in bytes instead of bits unit, use the command:
To share these results with anyone else, use the command:
A link is displayed where the results of your internet has been shown, you can share this link to anyone with whom you want to share the results, if you open the URL, a image will be displayed as:
Conclusion
The internet speed can be measured using the application of the speedtest-cli on Raspberry Pi and this application is useful as it can measure the speed of the internet and we can also share the results of speedtest-cli by simply sharing the URL with other users. In this write-up, we have discussed different methods of installation of the speedtest-cli on Raspberry Pi and also discuss how to use it for measuring the internet speed.