Bosse_B
Posts: 795
Joined: Thu Jan 30, 2014 9:53 am

speedtest difference Windows-RPi4

Sun Sep 15, 2019 7:26 am

I have installed speedtest-cli on my RPi4 (2 GB version) in order to be able to check Internet connection speed also from the command line.
Installation went well using:

Code: Select all

sudo apt install speedtest-cli
but the measurement results are a bit surprising....

I am on a 250/100 Mbit/s fiber connection and both my Windows laptop and the RPi4 are using Ethernet cable to connect to the network.
THey connect to the same gigabit switch into the router.

Result on RPi4:

Code: Select all

speedtest-cli
Retrieving speedtest.net configuration...
Testing from Bahnhof AB (176.10.164.48)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Tele2 (Kista) [8.47 km]: 7.785 ms
Testing download speed..............
Download: 245.89 Mbit/s
Testing upload speed.................
Upload: 4.13 Mbit/s
When I run a speed test using Ookla Speedtest on my Windows laptop in the GUI I get this:
Download 250.46 Mbps
Upload 106.00 Mbps

Has anyone else tried this and gotten such big upload differences too???

EDIT:
I also installed the speed test tool from the telecom autrhorities in Sweden and tested with that on my RPi4:

Code: Select all

 $ bbk_cli
Start: 2019-09-15 09:33:46
Network operator: Bahnhof AB
Support ID: sth606a5a235
Latency:       1.423 ms
Download:    250.839 Mbit/s
Upload:      116.800 Mbit/s
Measurement ID: 310240597
This shows a much more believable result!
Why is speedtest-cli doing such a poor job of measuring uploads?
Bo Berglund
Sweden

asavah
Posts: 364
Joined: Thu Aug 14, 2014 12:49 am

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 8:49 am

The version of speedtest-cli provided via apt is old and has a bug with uploads.
Uninstall apt version and try installing speedtest-cli with pip3.

Bosse_B
Posts: 795
Joined: Thu Jan 30, 2014 9:53 am

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 9:19 am

Ran into a bit of a problem here (never used pip before)...
First:

Code: Select all

sudo apt remove speedtest-cli
Then:

Code: Select all

pip install speedtest-cli
which speedtest-cli
So it could not be found..
It seems not to have been installed, so I guessed I had to sudo it:

Code: Select all

pip uninstall speedtest-cli
..
  Successfully uninstalled speedtest-cli-2.1.2
sudo pip install speedtest-cli
..
Successfully installed speedtest-cli-2.1.2
speedtest-cli
-bash: /usr/bin/speedtest-cli: No such file or directory
What gives here? Should it not "just work"?
Look here:

Code: Select all

 $ which speedtest-cli
/usr/local/bin/speedtest-cli
Or should the commands have been pip3 instead? (Both are available)
Bo Berglund
Sweden

Bosse_B
Posts: 795
Joined: Thu Jan 30, 2014 9:53 am

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 9:27 am

I ended up symlinking:

Code: Select all

sudo ln -sf /usr/local/bin/speedtest-cli /home/pi/bin/speedtest-cli
Then I ran the test:

Code: Select all

$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from Bahnhof AB (176.10.164.48)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Tele2 (Kista) [8.47 km]: 9.876 ms
Testing download speed....................
Download: 244.02 Mbit/s
Testing upload speed.......................
Upload: 113.14 Mbit/s
So now it works! You were right about the apt version being erroneous!
THANKS A LOT!
Bo Berglund
Sweden

jerrm
Posts: 194
Joined: Wed May 02, 2018 7:35 pm

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 2:40 pm

Bosse_B wrote:
Sun Sep 15, 2019 9:19 am
Ran into a bit of a problem here (never used pip before)...
First:

Code: Select all

sudo apt remove speedtest-cli
Then:

Code: Select all

pip install speedtest-cli
which speedtest-cli
So it could not be found..
It seems not to have been installed, so I guessed I had to sudo it:

Code: Select all

pip uninstall speedtest-cli
..
  Successfully uninstalled speedtest-cli-2.1.2
sudo pip install speedtest-cli
..
Successfully installed speedtest-cli-2.1.2
speedtest-cli
-bash: /usr/bin/speedtest-cli: No such file or directory
What gives here? Should it not "just work"?
Look here:

Code: Select all

 $ which speedtest-cli
/usr/local/bin/speedtest-cli
Or should the commands have been pip3 instead? (Both are available)
Common issue. Google "bash hash command."

Andyroo
Posts: 4471
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 2:59 pm

Be aware you used pip and not pip3.

pip is the support package for Python 2 and is loading old code onto your Pi :cry: where possible, Python code should be moved to Python 3 - Debian are removing Python 2 and that will ripple up to Raspbian in due course.
Need Pi spray - these things are breeding in my house...

DirkS
Posts: 9941
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 3:06 pm

Andyroo wrote:
Sun Sep 15, 2019 2:59 pm
Be aware you used pip and not pip3.

pip is the support package for Python 2
IIRC It's actually more complicated than that. With pip It depends on which version was installed last. If you install pip3 after pip2 then pip will point to pip3.

Andyroo
Posts: 4471
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 3:09 pm

DirkS wrote:
Sun Sep 15, 2019 3:06 pm
Andyroo wrote:
Sun Sep 15, 2019 2:59 pm
Be aware you used pip and not pip3.

pip is the support package for Python 2
IIRC It's actually more complicated than that. With pip It depends on which version was installed last. If you install pip3 after pip2 then pip will point to pip3.
Interesting - not seen that on the Stretch box where I have pip2 and pip3 but it’s possible three was put on first (couple of years ago). I should not get caught as I’m now using pip3 for everything I add in Buster :lol:
Need Pi spray - these things are breeding in my house...

Bosse_B
Posts: 795
Joined: Thu Jan 30, 2014 9:53 am

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 7:50 pm

I got version 2.1.2 when using pip.
Now I have done this to rectify the pip/pip3 difference.:

Code: Select all

sudo pip uninstall speedtest-cli
sudo pip3 install speedtest-cli
Turns out that the new speedtest-cli is again version 2.1.2.
So no difference here.
But I had removed the symlink I put into ~/bin earlier to make it possible to run speedtest-cli.
The new pip3 speedtest-cli version 2.1.2 seems not to need this symlink, it works anyway.
Bo Berglund
Sweden

Rascas
Posts: 531
Joined: Tue Mar 11, 2014 6:18 pm
Location: Porto, Portugal
Contact: Website

Re: speedtest difference Windows-RPi4

Sun Sep 15, 2019 10:57 pm

Speedtest, and other tests depend mostly on the server which it is tested with. Mainly on provider tested and distance. Even on the web interface on a x86 machine, if I select a more distant server, I may get lower results. I believe this is the main reason about the speed differences you are getting. Here is mine using the current Raspbian Buster version, my line is 200Mbits download | 100 Mbits upload:

Code: Select all

pi@raspberrypi:~ $ speedtest-cli
Retrieving speedtest.net configuration...
Testing from MEO (188.251.245.170)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by NOS (Porto) [0.15 km]: 9.476 ms
Testing download speed................................................................................
Download: 196.18 Mbit/s
Testing upload speed......................................................................................................
Upload: 100.03 Mbit/s
pi@raspberrypi:~ $

Bosse_B
Posts: 795
Joined: Thu Jan 30, 2014 9:53 am

Re: speedtest difference Windows-RPi4

Mon Sep 16, 2019 8:07 am

But as pointed out by early replies (by asavah) to this thread the speedtest-cli one gets with apt is outdated and buggy especially for upload.
When I apt remove'd the speedtest-cli and then used pip or pip3 to install directly from the python repository it solved the problems regarding the reported upload speed.

So my thread subject regarding speed differences was caused by a bad version via apt.

Now resolved, even though one might like the raspbian repository maintainers to update apt to get a newer version of speedtest-cli....
Bo Berglund
Sweden

asavah
Posts: 364
Joined: Thu Aug 14, 2014 12:49 am

Re: speedtest difference Windows-RPi4

Mon Sep 16, 2019 11:03 am

Bosse_B wrote:
Mon Sep 16, 2019 8:07 am
Now resolved, even though one might like the raspbian repository maintainers to update apt to get a newer version of speedtest-cli....
That's not as easy as you might think.
Raspbian is just debian rebuilt for armv6 (pi1 + pizero) plus additional repo provided by RPT with raspberry pi specific stuff.
Debian is well known for their bureaucracy and policies, basically they won't bump package versions in a stable release.
They usually do backport fixes.
So to get this fixed in apt someone would need to report the bug to debian and if/when debian mantainers fix the bug it will get into raspbian afterwards.

Heater
Posts: 13329
Joined: Tue Jul 17, 2012 3:02 pm

Re: speedtest difference Windows-RPi4

Mon Sep 16, 2019 12:26 pm

And the Debian maintainers might bump the bug report to the upstream authors of the project to fix. Eventually it gets fixed and the fix trickles back down to Debian and hence to Raspbian.

Other wise the Debian/Raspbian package maintainers would have to be maintaining thousands of forks of upstream projects. A crazy huge task.

Return to “General discussion”