wifinigel / wiperf

Utility to run various UX perf tests from an RPi/WLAN Pi and send results to various data repos
Other
26 stars 15 forks source link

Speedtest from ookla is not working #63

Closed lealog closed 3 years ago

lealog commented 3 years ago

Hi Nigel,

Since yesterday that the speedtest from ookla is not working.

I'm receiving the following error:

wlanpi@wlanpi:~$ speedtest-cli Retrieving speedtest.net configuration... Traceback (most recent call last): File "/usr/local/bin/speedtest-cli", line 10, in sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/speedtest.py", line 1986, in main shell() File "/usr/local/lib/python3.7/dist-packages/speedtest.py", line 1875, in shell secure=args.secure File "/usr/local/lib/python3.7/dist-packages/speedtest.py", line 1091, in init self.get_config() File "/usr/local/lib/python3.7/dist-packages/speedtest.py", line 1174, in get_config map(int, server_config['ignoreids'].split(',')) ValueError: invalid literal for int() with base 10: '

wifinigel commented 3 years ago

Oscar, is this on all platforms, or just one?

lealog commented 3 years ago

I tested on wlanpi and also on RPI4 and both are having the issue.

A sábado, 10/04/2021, 09:10, Nigel Bowden @.***> escreveu:

Oscar, is this on all platforms, or just one?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wifinigel/wiperf/issues/63#issuecomment-817098369, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6363XKZ6DTKRPZAXFJAU3TIABY5ANCNFSM42UZK7OQ .

wifinigel commented 3 years ago

Looks like the Python module speedtest-cli v2.1.2 was broken.

Fix by updating the speedtest module as follows:

python3 -m pip install --upgrade speedtest-cli

This should install speedtest-cli v 2.1.3.

Blazerfi commented 3 years ago

Awesome! Thanks! Sorry I missed this one.

credmond06 commented 3 years ago

I've tried loading in the root and in "/usr/local/lib/python3.7/dist-packages/" with no luck. Am I missing a step or loading in the wrong file? image

wifinigel commented 3 years ago

@credmond06 If you ssh to the probe and run the following command you will see all installed packages. You should see the current speedtest version listed among the packages:

sudo python3 -m pip list

If the version is still shown as 2.1.2, update it using the following command in the ssh session:

sudo  python3 -m pip install --upgrade speedtest-cli

Re-check the version after updating with the command:

sudo python3 -m pip list

Please let me know how you get on.

lealog commented 3 years ago

Hi @wifinigel,

After installing the new speedest version, I can run the speedtest manually. However, the wiperf speedtest is not working.

wifinigel commented 3 years ago

Ok, sorry, did not realize there was still an issue with speedtest....will check it out today.

wifinigel commented 3 years ago

@lealog I initially saw this when running with the old 2.1.2 version of speedtest-cli:

image

I then ran:

image

And it seemed to run OK:

image

Can you please post the issues seen in wiperf_agent.log for the speedtest section? thanks.

credmond06 commented 3 years ago

Just updated speedtest-cli. saw the following: image

image

seems to be working. image

lealog commented 3 years ago

I tried to upgrade the speedtest using the following command:

python3 -m pip install --upgrade speedtest-cli

Version:

pi@raspberrypiredewifi:~ $ speedtest --version speedtest-cli 2.1.3 Python 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0]

With this upgrade, the wiperf speedtest can't work.

cat /var/log/wiperf_agent.log ... ... 2021-04-21 22:11:19,006 - Probe_Log - DEBUG - IP Address = 192.168.1.151 2021-04-21 22:11:19,226 - Probe_Log - ERROR - Speedtest error: invalid literal for int() with base 10: '' 2021-04-21 22:11:19,227 - Probe_Log - ERROR - Error running speedtest #1 - check logs for info. ... ...

Then, I tried the following command and realize that the version is still the older one.

python3 -m pip list Package Version


asn1crypto 0.24.0 certifi 2018.8.24 chardet 3.0.4 cryptography 2.6.1 entrypoints 0.3 idna 2.6 influxdb 5.3.0 influxdb-client 1.10.0 iperf3 0.1.11 keyring 17.1.1 keyrings.alt 3.1.1 msgpack 0.6.1 pip 18.1 pycrypto 2.6.1 PyGObject 3.30.4 python-apt 1.8.4.1 python-dateutil 2.8.1 pytz 2020.1 pyxdg 0.25 requests 2.21.0 Rx 3.1.1 SecretStorage 2.3.1 setuptools 40.8.0 six 1.12.0 > speedtest-cli 2.1.2 Splunk-HEC 1.9 ssh-import-id 5.7 timeout-decorator 0.4.1 urllib3 1.24.1 wheel 0.32.3 wiperf-poller 0.4.0

Decided to use the following commands:

root@wlanpi:/home/wlanpi# sudo python3 -m pip install --upgrade speedtest-cli Collecting speedtest-cli Downloading https://files.pythonhosted.org/packages/9f/39/65259b7054368b370d3183762484fa2c779ddc41633894d895f9d1720f45/speedtest_cli-2.1.3-py2.py3-none-any.whl Installing collected packages: speedtest-cli Found existing installation: speedtest-cli 2.1.2 Uninstalling speedtest-cli-2.1.2: Successfully uninstalled speedtest-cli-2.1.2 Successfully installed speedtest-cli-2.1.3 root@wlanpi:/home/wlanpi# sudo python3 -m pip list Package Version


argcomplete 1.12.2 certifi 2020.12.5 chardet 4.0.0 click 7.1.2 distro 1.5.0 distro-info 0.21 idna 2.10 importlib-metadata 3.4.0 influxdb 5.3.1 influxdb-client 1.13.0 iotop 0.6 iperf3 0.1.11 msgpack 1.0.2 numpy 1.16.2 Pillow 5.4.1 pip 18.1 pipx 0.15.4.0 protobuf 3.6.1 pycurl 7.43.0.2 PyGObject 3.30.4 pyserial 3.4 python-apt 1.8.4.3 python-dateutil 2.8.1 pytz 2020.5 pyusb 1.0.2 requests 2.25.1 Rx 3.1.1 scapy 2.4.0 setuptools 40.8.0 six 1.12.0 speedtest-cli 2.1.3 Splunk-HEC 1.9 timeout-decorator 0.5.0 typing-extensions 3.7.4.3 ufw 0.36 unattended-upgrades 0.1 urllib3 1.26.3 userpath 1.4.2 wheel 0.32.3 wiperf-poller 0.4.0 zipp 3.4.0

Probably I was missing the "sudo" on the first installation. Everything is working now :) Can be closed.

huckle23 commented 2 years ago

Hi Nigel, I also have the issue, that Speedtest is't working.

ImportError Traceback (most recent call last) Input In [1], in <cell line: 15>() 13 import ecapture as ec
14 import pyjokes # pip install pyjokes ---> 15 from speedtest import Speedtest # pip install speedtest-cli 16 from pywikihow import search_wikihow # pip install pywikihow 17 import pyautogui # pip install pyAutoGUI

ImportError: cannot import name 'Speedtest' from 'speedtest' (/usr/local/lib/python3.8/dist-packages/speedtest/init.py)

I'm a Python beginner, i tried the suggested solutions given here, but without a working solution.

huckle@huckle23:~$ sudo python3 -m pip list [sudo] Passwort für huckle: Package Version


speedtest 0.0.1 speedtest-cli 2.1.3 systemd-python 234

Please, can you help me?