brennentsmith / internet-speed-logger

Open source application to track your internet download and upload speeds with an elegant web interface.
GNU General Public License v3.0
178 stars 33 forks source link

Set speedtest server #7

Closed timmay2 closed 4 years ago

timmay2 commented 4 years ago

Hi. Not an issue as such but I'm wondering how I set the speedtest server to use. I had though that I just needed to edit nano internet-speed-logger/config/default.json

"... "commandString": "bin/speedtest -f json --accept-license --accept-gdpr", ..."

to

"... "commandString": "bin/speedtest --server 28236 -f json --accept-license --accept-gdpr", ..."

However this didn't work.

With default settings it seems to randomly select a server and not many are Gbps+ capable. Hence the need to manually set a server that is capable of multi Gbps.

brennentsmith commented 4 years ago

What error did you get timmay2? One key thing is that the server ID needs to be included in the list from speedtest -L.

timmay2 commented 4 years ago

root@ubuntu-speedtest:~/internet-speed-logger/config# speedtest --server 28236 -f json --accept-license --accept-gdpr usage: speedtest [-h] [--no-download] [--no-upload] [--single] [--bytes] [--share] [--simple] [--csv] [--csv-delimiter CSV_DELIMITER] [--csv-header] [--json] [--list] [--server SERVER] [--exclude EXCLUDE] [--mini MINI] [--source SOURCE] [--timeout TIMEOUT] [--secure] [--no-pre-allocate] [--version] speedtest: error: unrecognized arguments: -f json --accept-license --accept-gdpr

It seems that as soon as I add "--server 28236" to the command it is broken.

However, the command string on its own as-is from the config file doesn't run in the terminal.

Clearly I'm not understanding how you are running the speedtest command and can not just add "--server 28236" to specify the server to use.

brennentsmith commented 4 years ago

It looks like you are using the unofficial third party Speedtest CLI from here: https://github.com/sivel/speedtest-cli which isn't supported. Even if you could get it to run, I'm not sure the output format is compatible and the accuracy is known to be poor with the unofficial client.

Make sure that you are calling against the official CLI located here: https://www.speedtest.net/apps/cli and use the argument --server-id rather than --server.

It's best if you remove the unofficial CLI, but if you have to keep both installed, make sure you use the full path so that you target the correct binary.

The Docker image as well includes the correct binary.

timmay2 commented 4 years ago

Thanks!

Yes I was using the speedtest-cli version as a reference for the flags. I was not aware there was two versions.

All working now and set to a server that actually has capacity to test 1Gbps+ connections.

brennentsmith commented 4 years ago

Fantastic! Glad you got it working!