Speedtest CLI. Run speedtest on pfSense box
-
This post is deleted! -
@aln thanks so much for this. can you please clarify how can i bind an specific interface when running a test from your widget?
-
Haha.. this is a hilariously classic pfsense forums discussion. I love the ones where the supposedly knowledgeable "mod" tells people that they are "holding it wrong" because they cant conceive of people actually using their product how they want.
I too want to do a speedtest from the router. And yes gasp, i use old desktops that get upgraded as routers. And i have ever since my first 486 firewall in 1996, with dubble /netbsd that came on two floppies. What the hell else are you going to do with old desktops? stick em in a 2U server case and rack em up.
The reason i personally want to speed test from the firewall is that the level 1 techs at the ISP always want you to connect your own computer directly to the modem. I dont want to rewire my network and do that, so the next best device to run this sort of test on is the firewall itself. And its a good test to see if the problem is on the lan or wan side too.
I took my sons old computer, a i5-2400 and slapped that in to replace my q6600 core2 quad. And pfsense took it no problem and booted right up after i remapped one interface whoes name changed.
If I wanted an appliance, i would have got a mikrotik. But i prefer running on consumer hardware at home so that if something breaks its easy enough to find some parts in the parts bin to fix it. The only reason i really upgraded was because the core 2 quad mobo only had a 100mb interface and now i have a gig. Which was necessary for this speed upgrade here. I am trying to get 700/20 up that i am paying for now.And i have used plenty of firewalls with large pricetags that pfsense runs circles around in terms of ease of use and setup. Running on consumer hardware isn't a flaw in the product, its one of its main strengths.
I installed the widget with the oneline command (thank you muchly), and find it about the same as speedtest/fast.com. I always prefer speedof.me as that cannot be faked. But it almost always skews quite a bit lower on most connections for some reason. On really nice connections i get what is advertised with the speedof.me test but rarely on home or small biz connections. Maybe last mile lag affects that test more.
Anyways got what i needed and it was a fun ride. The widget works and i am grateful for that. The pfsense community delivers once again!
`
-
@andresmorago you will need to modify the widget and add the --source parameter to the cli command. Look it up in the speedtest-cli docs.
-
@ipfftw I'm glad to hear you are using the widget
-
Wonder if anyone's seeing this. When I run speedtest cli from my Windows box to pull the list of servers,
C:\Python27\python.exe C:\Python27\Lib\site-packages\speedtest.py --list > serverlist.txt
normally it returns a list including a half dozen that are within 30 miles or so of my location. My scheduled task is hard-coded to the server that returns the best ping (the server that is normally chosen when I run speedtest without choosing a specific server). Recently, though, the closest servers are over 700km away and the nearby servers are missing.
Retrieving speedtest.net configuration... 12733) WestPAnet, Inc. (Warren, PA, United States) [758.42 km] 9276) ColoCrossing (Buffalo, NY, United States) [775.56 km] 31483) CreeperHost LTD (Buffalo, NY, United States) [775.56 km] 32993) Crowsnest Broadband LLC (Altoona, PA, United States) [849.74 km] 14233) Frontier (Rochester, NY, United States) [879.94 km] 14148) Rochester Institute of Technology (Rochester, NY, United States) [879.94 km] 1239) Synoptek (Rochester, NY, United States) [879.94 km] 39474) University of Rochester (Rochester, NY, United States) [879.94 km]
And needless to say, my data is borked. Strange, when Irun the Windows client Ookla speedtest, it finds the servers w/o issue.
Anyone else see this?
-
@provels said in Speedtest CLI. Run speedtest on pfSense box:
@lastb0isct said in Speedtest CLI. Run speedtest on pfSense box:
Does anyone have the speedtest.py still? I can't seem to find it.
It comes with the package when you install it. SSH to your box and run:
pkg search speedtest [2.4.4-RELEASE][root@fw.workgroup]/root: pkg search speedtest py37-speedtest-cli-2.1.1 Command line interface for testing internet bandwidth
Then run
pkg install py37-speedtest-cli-2.1.1
Have fun!
Anyone seeing this error? I get this when i run any pkg command in this thread. Am on pfsense 2.4.5 on a 3100. Thanks
Shared object "libarchive.so.7" not found, required by "pkg"
-
The binary package from Ookla is so much better than speedtest-cli which is ancient. But: no-source, deal I Guess.
See: https://www.speedtest.net/apps/cli
and:https://bintray.com/ookla/download/download_file?file_path=ookla-speedtest-1.0.0-freebsd.pkgObviously being a binary it's x86_64 only.
I don't suppose anyone's wrapping a page, or better widget, around speedtest? The above one already can output json.
-
@daplumber look for my widget on this topic's history
-
@aln I was hoping fir a widget based on the Ookla binary above. It really is that much more accurate. Yes, I’m running an 8-core AMD with 8GB desktop as a router. Waste not, want not. Good for Suricata too.
-
@alpharulez said in Speedtest CLI. Run speedtest on pfSense box:
@provels said in Speedtest CLI. Run speedtest on pfSense box:
@lastb0isct said in Speedtest CLI. Run speedtest on pfSense box:
Does anyone have the speedtest.py still? I can't seem to find it.
It comes with the package when you install it. SSH to your box and run:
pkg search speedtest
Then run
pkg install py37-speedtest-cli-2.1.1
Have fun!
Anyone seeing this error? I get this when i run any pkg command in this thread. Am on pfsense 2.4.5 on a 3100. Thanks
Shared object "libarchive.so.7" not found, required by "pkg"
For anyone facing this issue with pkg... here is what I did to resolve...
pkg update
this will fail
Instead run:
pkg-static updatethen run:
pkg bootstrap -fthen install:
pkg update
pkg install -y py37-speedtest-clidirectories for reference if you would like to install the widget php file:
/usr/local/bin/speedtestcreate new file with nano, copy paste code from the Github link @aln provided.
/usr/local/www/widgets/widgets/speedtest.widget.phpShould be good to go when you go back into the web portal and add widget (+). dont forget to save...
-
@alpharulez I had no issue installing the py37 speedtest. But the Ookla binary is so much better on the command line, I deinstalled the py37 version.
A widget fir the binary would be nice to have, but I’m not fussed about it.
-
@daplumber Cool. I had 'pkg' issues on the box. So the above steps fixed it.
So what was the difference between the py37 and ookla builds?
My understanding was Ookla did not have an ARM version of the build so might be an issue with my 3100.
-
@alpharulez the py37 build is Open Source, but also ancient, based on the code from when Speedtest was a Flash App! (read the Ookla site). The Ookla binary is closed, only compiled for FreeBSD 11.2, and thus pfSense 2.5.0 (right now). But the binary is based off their current code, is available for MacOS, Linux, and FreeBSD and comes with a plethora of output options, including a nifty text based interactive version. Think htop vs top functionality-wise.
-
This post is deleted! -
Hello,
I have a little problem with speedtest on my pfsense.
I'm using 2 différent widget from this forum.
the php one, and for this version I have everytime an error, shell_exec("speedtest --json"); don't work in php (from the latest version of pfsense I think)
and the .sh file.
I add in a cron the script, if I start manually everything is ok, I have the different time, ...
But with cron (as root) I don't receive different time, in the speed.txt I have:
Retrieving speedtest.net configuration...
Testing from VOO (123.123.123.123)...
Retrieving speedtest.net server list...
Does anyone has an idee of the reason? -
I have a solution, I installed the ookla pkg and now I receive data again (with pfsense 2.5.0).
First I removed speedtest and after I installed ookla version (cf https://www.speedtest.net/apps/cli pkg add ookla-speedtest-1.0.0-freebsd.pkg).
I made some adaptation in script and now I have result :)
-
Hi,
since a few day I got this:[2.5.1-RC][admin@router.local]/usr/local/bin: /usr/local/bin/speedtest-cli Retrieving speedtest.net configuration... Traceback (most recent call last): File "/usr/local/bin/speedtest-cli", line 11, in <module> load_entry_point('speedtest-cli==2.1.2', 'console_scripts', 'speedtest-cli')() File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1986, in main shell() File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1875, in shell secure=args.secure File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1091, in __init__ self.get_config() File "/usr/local/lib/python3.7/site-packages/speedtest.py", line 1174, in get_config map(int, server_config['ignoreids'].split(',')) ValueError: invalid literal for int() with base 10: ''
Any ideas how to fix this?
Cheers
MarcO -
-
@johnpoz
Many thx. That fixed my issue. :)