Speedtest-cli doesnt work

hello,
trying to execute
python3-speedtest-cli

OpenWrt 21.02.1, r16325-88151b8303

root@OpenWrt-main-router:~# speedtest
Retrieving speedtest.net configuration...
Traceback (most recent call last):
  File "/usr/bin/speedtest", line 33, in <module>
    sys.exit(load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest')())
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1986, in main
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1872, in shell
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1091, in __init__
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1173, in get_config
ValueError: invalid literal for int() with base 10: ''
root@OpenWrt-main-router:~# speedtest-cli
Retrieving speedtest.net configuration...
Traceback (most recent call last):
  File "/usr/bin/speedtest-cli", line 33, in <module>
    sys.exit(load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')())
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1986, in main
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1872, in shell
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1091, in __init__
  File "/usr/lib/python3.9/site-packages/speedtest.py", line 1173, in get_config
ValueError: invalid literal for int() with base 10: ''
root@OpenWrt-main-router:~#

any idea?thx

Not really answer to your question ..

but you can use:

root@OpenWrt-3370:~# speedtest-netperf.sh

I believe this a general issue with the package upstream due to an API change. It looks like it was fixed in 2.1.3, but 21.02 package is currently 2.1.2, the package version needs bumping in OpenWrt for it to work, or you can manually patch the python files required.

There are alternatives, Ookla themselves also have a speedtest CLI package for certain architectures: https://www.speedtest.net/apps/cli. It is statically compiled but does run on compatible routers.

It looks like 2.1.3 was updated in master, I have cherry picked this commit to the 21.02 branch for review: https://github.com/openwrt/packages/pull/17390. When it hopefully gets merged, the package should be updated within 24 hours and you can update via opkg.

Hi James, any update for this , seem the package do not update

do we need to reinstall the Python to 3.7?

Simplie to upgrade the package was work for me.

pip install --upgrade speedtest-cli

2 Likes