Speedtest.net for unRAID 6.1+


dmacias

Recommended Posts

35 minutes ago, stretch886 said:

What's it called? Tried searching apps for his name and didn't see anything.

If CA doesn't find anything on a search that doesn't have an autocomplete entry, try simplifying the search term.

 

ie: searching for henry comes up with the appropriate app

Link to comment

This was a change on the ookla side, and not related to the 6.9.x series updates. My unraid software is a few versions older, and this issue started April 7th for me as well.

Did install the henrywhitaker3/speedtest-tracker after this plugin broke. Still prefer the plugin because it can highlight speed tests below thresholds for both down and up tests, and why I spent some time this weekend looking at the code for the speedtest plugin. It seems someone else here noticed a new version of the script and asked if dmacias could update the plugin. After looking at the code more I found the repository for the speedtest-cli update that is used within this plugin. That file, as of now, was last updated on April 8th to version 2.1.3 by the maintainer of that repo. Applied this version to my system and the speedtest plugin works again. Providing here for others, if so interested.
 

** Notice: Not claiming to be the creator of the plugin, or the creator of the speedtest.py script the plugin uses. Providing a workaround to get the plugin back up and operational.

** Disclaimer: Follow these steps at your own risk. This info is provided as-is. Understand and know what these steps are doing. If you do not know, then don’t run them! 

 


Downloading and modifying this file in /tmp to not cause issues with real data, this was done via ssh to the unraid server.

cd /tmp
mkdir speedtest-new
cd speedtest-new



Now we grab the new version of the script (raw repository location):

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py


The downloaded file, when viewed on the speedtest plugin settings tab will show a lot more “version” info. like this image. Updating the "def versoin():" function will change from this image on the setting page to showing just 2.1.3. This is optional.
image.png.84dddd182aea6c59a720827daaf4ba7f.png


Open speedtest.py and look for “def version():” and update this function to look like below::

Quote

 

def version():
    """Print the version"""

 

    printer(__version__)
    #printer('Python %s' % sys.version.replace('\n', ''))
    sys.exit(0)

 

Save and exit your editor once this section looks like above.

 

Changing the name of the file, to know what version it is. Currently still in our download location, in this example: /tmp/speedtest-new

 

mv speedtest.py speedtest-2.1.3.py

 

Now that we have the file, updated the version function (if you did that) and renamed we can place in the speedtest plugin location.

 

Use this command to copy to the speedtest plugin location:
 

cp speedtest-2.1.3.py /usr/local/emhttp/plugins/speedtest/scripts

 

Change into the speedtest scripts location, backup the current script. Then rename the new version file to the speedtest.py file name and lastly make our new script executable:

cd /usr/local/emhttp/plugins/speedtest/scripts
ls -ltr 

verify you see “speedtest-2.1.3.py”. If not go back to the location you downloaded and copy to this location again.

 

Now backup the old 2.0.0 version file, I’m assuming that is the latest version you had working:
 

cp speedtest.py speedtest-2.0.0.py

 

Copy the new file over and make executable:

cp speedtest-2.1.3.py speedtest.py
chmod 755 speedtest.py

verify rwxr-xr-x for speedtest.py:

ls -ltr


Change to the webui settings page for the speedtest plugin. Refresh the page and the version drop down should now show 2.1.3 (or like the image above with more detailed version info). Hit the apply button. Now hit the Begin Test button to verify speedtest plugin is working again for you.


The last thing to do is to make this survive a reboot. For me that was making a custom directory in the /boot location (this is your flash device, take care when executing commands here. You can wipe your unraid flash device or make unintended change If you do not know what you are doing). Then copy the speedtest-2.1.3py file from tmp to here. Either in the “go” file or from the “user scripts” add-on you can copy the file (and rename in one step) to the speedtest scripts location above. Be sure to include a step to chmod the file in your go or user scripts. Please note the copy,  and chmod, need to be done after plugins have been installed, otherwise the change will be overwritten – or the copy could fail since the directory wouldn’t exist.


You could copy the plugin .tgz file to another computer, unzip (7zip works) find the file and replace it. Then re-zip as (as a TAR archive compresses in GNU Zip) replace the file in the plugins folder on the flash (/boot).
 

Edited by klepel
code blocks show properly on dark forum theme
  • Like 1
  • Thanks 1
Link to comment
  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...
On 6/7/2021 at 2:08 PM, shiftylilbastrd said:

So I just got the notification that my pull request was committed. Now if we can get the plugin updated to pull the latest version(2.1.3) this should be functional again.

If the plugin was ever updated (I'm guessing not since the newest version I see is 2.0.0 and my plugin is dated 2018.02.11), your changes don't seem to have worked for me. I have auto updates turned on, but don't recall having seen the change come through (doesn't mean it didn't, just that I don't recall). My speed tests have been reliably failing before & since your post. :( I appreciate your efforts and hope that it does get updated!

 

On 4/20/2021 at 11:21 PM, truckerCLOCK said:

If you go to setting and go to v0.3.4. It works fine for me.

The V0.3.4 change appears to be working for me as well. A manual test functions, now to wait for my regularly scheduled test to ensure all is good. Thank you for this work-around!

Link to comment
On 4/19/2021 at 8:58 PM, klepel said:

This was a change on the ookla side, and not related to the 6.9.x series updates. My unraid software is a few versions older, and this issue started April 7th for me as well.

 

i made a script for these steps and work fine also servers list enabled,  but its very srange i have a lower speed results than my main comp and also tryed speednet test from firefox plugin in unraid its show more speed . maybe you  know where the problem may be ?

Thanks

Link to comment

Busy work week last week. Glad to hear those worked for you @Masterwishx. I need to update the steps as the speedtest script was updated by the original developer (thanks for the pull request shiftlilbastrd) to present the version the way it had been.

Yes, have noticed the same, seems to be 10% lower than what was previously reported. My latest speed test was 210Mb, and I know to add 10%, which means an older script version would have registered as 231Mb.

Did notice that this version of the speedtest script has many more lines of code than previous ones. Have not compared it to a prior version to see if something was added that is causing the lower speed test results.
 

  • Like 1
Link to comment
On 7/13/2021 at 3:29 PM, klepel said:

Yes, have noticed the same, seems to be 10% lower

 

Unfortunately , i have more than 10% lower , if i have (ping - 12 ,down - 450mbps ,up 10mbps) in main comp

in plugin i have about (ping - 30.468 ms  , down - 323.3 Mbit/s , up - 8.42 Mbit/s )

maybe it will be fixed next versions ?!?

Link to comment
On 7/13/2021 at 3:29 PM, klepel said:

Did notice that this version of the speedtest script has many more lines of code than previous ones

 

Hi,  Do you think the speed problem in speedtest.py ? 

is any chance the problem may be in OpenSSL ?

maybe we should use new ver of pyOpenSSL-17.5.0-x86_64-1_slonly  instead of pyOpenSSL-0.15.1-x86_64-1_slack  ?

Link to comment
  • 3 weeks later...

I get the following error no matter what version I try to use.  Has anyone seen it or know how to get around it?

Internet bandwidth test started


Warning: simplexml_load_file(): /boot/config/plugins/speedtest/speedtest.xml:1: parser error : Document is empty in /usr/local/emhttp/plugins/speedtest/scripts/speedtest-xml on line 59

Warning: simplexml_load_file(): in /usr/local/emhttp/plugins/speedtest/scripts/speedtest-xml on line 59

Warning: simplexml_load_file(): ^ in /usr/local/emhttp/plugins/speedtest/scripts/speedtest-xml on line 59

Fatal error: Uncaught Error: Call to a member function addChild() on bool in /usr/local/emhttp/plugins/speedtest/scripts/speedtest-xml:60
Stack trace:
#0 {main}
thrown in /usr/local/emhttp/plugins/speedtest/scripts/speedtest-xml on line 60

 

 

Link to comment
  • 4 weeks later...
On 9/4/2021 at 8:15 AM, Masterwishx said:

 

Moved to this docker some time ago (2 month) and i can confirm work fine and shows right speed like in speedtest.net .

(speedtest tracker - Selfhosters Unraid Discord Repository)

Don't think this does what you think it does. If I understood correctly, this measures speed to that docker container. For e.g., if you have this docker container running on your Unraid and you visit this container's URL from your mobile phone via Wifi, then the speed you see is the speed experienced by your mobile phone when accessing the Unraid machine.

 

So when I visit this from my mobile phone, I see speeds ranging between 400-400 Mbps over Wifi

When I visit this connected to a 10Gbps switch, I see speeds of around 8Gbps.

 

If your Unraid machine is exposed to the internet, then perhaps, the docker container can be used to do an internet speed test.

Link to comment
8 hours ago, saneguy said:

Don't think this does what you think it does. If I understood correctly, this measures speed to that docker container. For e.g., if you have this docker container running on your Unraid and you visit this container's URL from your mobile phone via Wifi, then the speed you see is the speed experienced by your mobile phone when accessing the Unraid machine.

 

So when I visit this from my mobile phone, I see speeds ranging between 400-400 Mbps over Wifi

When I visit this connected to a 10Gbps switch, I see speeds of around 8Gbps.

 

If your Unraid machine is exposed to the internet, then perhaps, the docker container can be used to do an internet speed test.

 

This isn't what that container does, it always runs the speedtest from the container using ooklas cli. I would guess that the difference in speeds you are seeing would be down to it connecting to different servers each time it runs the test

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.