Posts: 1,445
skidoo
Joined: 09 Feb 2012
#1
debian-packaged version is older (v1.0.0-1) and"depends" on  python-pkg-resources, aka PyPi
Attached to this post is my modded version of 1.0.6, from:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/sivel/speedtest-cli"
linktext was:"https://github.com/sivel/speedtest-cli"
====================================

Code: Select all

speedtest-cli
    Command line interface for testing internet bandwidth using speedtest.net
        version  "1.0.6ski"
DESCRIPTION
    Speedtest.net is a web service for testing your broadband connection by downloading a file from a
    nearby speedtest.net server on the web. This tool allows you to access the service from the command line.
    Speedtest mini is a version of the Speedtest.net server that you can host locally.

=======================
regarding potential inconsistency:
   It is not a goal of this application to be a reliable latency reporting tool.

Latency reported by this tool should not be relied on as a value indicative of ICMP style latency.
It is a relative value used for determining the lowest-latency server for performing the actual speed test against.

There is the potential for this tool to report results inconsistent with Speedtest.net.
There are several concepts to be aware of that factor into the potential inconsistency:

1. Speedtest.net has migrated to using pure socket tests instead of HTTP based tests.
2. This application is written in Python.
3. Different versions of Python will execute certain parts of the code faster than others.
4. CPU and Memory capacity and speed will play a large part in inconsistency between
   Speedtest.net and even other machines on the same network
========================
OPTIONS
Usage: speedtest\-cli [OPTION...]

-h, --help
        Displays usage for the tool

--bytes
        Display values in bytes instead of bits.

--csv
        Suppress verbose output, only show basic information in CSV format.
        Speeds are listed in bits/sec and are not affected by --bytes

--csv-delimiter CSV_DELIMITER
        Single character delimiter to use in CSV output. Default","

--csv-header
        Print CSV headers
--debug
        howdy needa description?

--json
        Suppress verbose output, only show basic information in JSON format.
        Speeds are listed in bits/sec and are not affected by --bytes

--list
        Display a list of speedtest.net servers sorted by distance

--mini MINI
        URL of the Speedtest Mini server

--no-pre-allocate
        Do not pre allocate upload data.
        Pre allocation is enabled by default to improve upload performance. 
        To support systems with insufficient memory,
        use this option to avoid a MemoryError

--numiter
        Number of iterations to run

--secure
        Use HTTPS instead of HTTP when communicating with speedtest.net operated servers

--server SERVER
        Specify a server ID (or city name) to test against

--simple
        Suppress verbose output, only show basic information

--source SOURCE
        Source IP address to bind to

--timeout TIMEOUT
        HTTP timeout in seconds. Default 10

--version
        Show the version number and exit
        
        
###    EXAMPLES
###
###    Automatically find closest server and start testing (no args)
###            speedtest-cli
###
###    Specify testing against server 1491
###            speedtest-cli --server 1491
###
###    Testing against Speedtest Mini
###            speedtest-cli --mini 172.18.66.1        
sample output
demo@antix1:~
$ time /usr/local/bin/speedtest-cli.py

Retrieving speedtest.net configuration...
Testing from Moonshine Cable Co (94.131.128.164)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Moonshine Cable Co (Hootersville, KY) [49.75 km]: 20.8 ms
Testing download speed...................................
Download: 90.31 Mbit/s
Testing upload speed.................................
Upload: 12.23 Mbit/s

real    0m23.057s
user    0m4.165s
sys    0m1.399s
Posts: 325
male
Joined: 04 Nov 2011
#2
😉 Hi skidoo,

with conky 

Code: Select all

### pkill -xf"conky -q -c /home/male/speedtest/conkyspeedrc" & 
### works perfect @male 2017-07-19 
background no
use_xft yes
#xftfont monospace:size=10
xftfont monofur:size=10
xftalpha 1
total_run_times 0
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager  #sticky,
own_window_class Conky
own_window_title Speedtest
own_window_argb_visual yes
#own_window_argb_value 80
double_buffer yes
draw_borders no
border_inner_margin 5  #margin between border and text
border_outer_margin 0  #margin between border and window edge
border_width 5  #border thickness
draw_outline no
draw_graph_borders yes
stippled_borders 0

default_color cyan
default_shade_color black
default_outline_color white
alignment top_right
gap_x 60
gap_y 90
cpu_avg_samples 10
override_utf8_locale yes

minimum_size 160 100
maximum_width 160
update_interval 3  #21600 #86400

#--LUA--#
#lua_load ~/Lua/draw-bg.lua

TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#leet chars: ┤┤└└┴┴┐┐││┘┘┌┌├├┬┬┼┼┴┴── ││ ▽▼△▲▵▴▾▿
┌───────────────┐
│ SPEEDTEST.NET │
└───────────────┘
${texeci 3600 speedtest --simple --server 10963}
${texeci 3600 notify-send -i network-transmit-receive"Speedtest Completed"} 

Code: Select all

-- pkill -xf"conky -q -c /home/male/speedtest/conkyspeedrc" &
-- works perfect @male 2017-07-19
conky.config = {
    background = false,
    use_xft = true,
--xftfont monospace:size=10
    font = 'monofur:size=10',
    xftalpha = 1,
    total_run_times = 0,
    own_window = true,
    own_window_transparent = true,
    own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',--sticky,
    own_window_class = 'Conky',
    own_window_title = 'Speedtest',
    own_window_argb_visual = true,
--own_window_argb_value 80
    double_buffer = true,
    draw_borders = false,
    border_inner_margin = 5,--margin between border and text
    border_outer_margin = 0,--margin between border and window edge
    border_width = 5,--border thickness
    draw_outline = false,
    draw_graph_borders = true,
    stippled_borders = 0,

    default_color = 'cyan',
    default_shade_color = 'black',
    default_outline_color = 'white',
    alignment = 'top_right',
    gap_x = 90,
    gap_y = 80,
    cpu_avg_samples = 10,
    override_utf8_locale = true,

    minimum_width = 160, minimum_height = 100,
    maximum_width = 160,
    update_interval = 3,--21600 --86400

----LUA--#
--lua_load ~/Lua/draw-bg.lua

};

conky.text = [[
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#leet chars: ┤┤└└┴┴┐┐││┘┘┌┌├├┬┬┼┼┴┴── ││ ▽▼△▲▵▴▾▿
┌───────────────┐
│ SPEEDTEST.NET │
└───────────────┘
${texeci 3600 speedtest --simple --server 10963}
${texeci 3600 notify-send -i network-transmit-receive"Speedtest Completed"} 
]];
Posts: 4,164
rokytnji
Joined: 20 Feb 2009
#3
Hootersville, KY Moonshine Cable
Image

Code: Select all

harry@biker:~
$ /usr/local/bin/speedtest-cli.py
Retrieving speedtest.net configuration...
Testing from Windstream Communications (69.40.147.140)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Charter Communications (Fort Worth, TX) [86.00 km]: 79.308 ms
Testing download speed................................................................................
Download: 1.43 Mbit/s
Testing upload speed................................................................................................
Upload: 0.50 Mbit/s
Now you know why. I pay attention to md5.
And wget -c is my friend.
Posts: 850
fatmac
Joined: 26 Jul 2012
#4
Just gave it (yours) a try.

Code: Select all

Testing download speed................................................................................
Download: 45.17 Mbit/s
Testing upload speed................................................................................................
Upload: 5.19 Mbit/s
(That's just about what it was when I last tested via firefox about a week ago.)

Beats having to load a browser to test it. :)