Jump to content
Sign in to follow this  
NCC10281982B

python IndexError

Recommended Posts

For fun I am trying to implement the python speed test discussed here: http://forums.overclockersclub.com/topic/203885-irate-comcast-subscriber-turns-raspberry-pi-into-a-watchdog-for-slow-internet-speeds/?p=2151728On my ubuntu box.

 

I think I have all the modules (that was fun) i need.

 

[email protected]:~$ ./speed_test
running test
/usr/bin/python: can't find '__main__' module in '/home/jeff/speedtest-cli'
ran

Traceback (most recent call last):
  File "./speed_test", line 67, in <module>
    test()
  File "./speed_test", line 28, in test
    d = lines[1][10:14]
IndexError: list index out of range

Share this post


Link to post
Share on other sites

Looks like something is bugging with the download lines its pulling from. Just for fun, try removing that line and see if the upload works?

Edited by Onion

Share this post


Link to post
Share on other sites
[email protected]:~$ ./speed_test
running test
/usr/bin/python: can't find '__main__' module in '/home/jeff/speedtest-cli/'
ran

Traceback (most recent call last):
  File "./speed_test", line 67, in <module>
    test()
  File "./speed_test", line 28, in test
    d = lines[1][10:14]
IndexError: list index out of range

I think this has to do with can't find main... wherever main is supposed to be,,,

Share this post


Link to post
Share on other sites

Did you install the additional speedtest-cli utility?

 

If you paste the code I could probably be more help. I know it is posted on the pastebin site but there are some edits that you would have to make in there to get it to work on your machine I believe.

Share this post


Link to post
Share on other sites

That problemm went away after I visited the link I posted in the last post in the Comcast thread. Now the problem is getting the script to write the logfile to the Public dir. Blasted permissions.

Share this post


Link to post
Share on other sites

I did this before in Linux Mint.

 

1. Download a copy of the python script speediest-cli . Or copy and paste the code into a file and rename it.

 

2.On Ubuntu or Linux you have to make it a executable to run  so open a terminal window and type  'sudo chmod a+x filename'.

  Now  if you type 'ls' to list what is in the directory you should see that the file name has changed color in my case green, Now its executable.

 

3. Run the file ' sudo python ./Filename. Thats it I think !!.

 

The 'a+x' I got off the internet some where it might not be the best practice but it works perfectly. Now you can schedule this to run when ever you want with crontab if you wish and pipe the results out to a file to have a look at later.

 

I hope this helps.

 

I have not been approved yet so I only get one post a day so I cant reply.

If you come across a way to change the servers for the speed test please let me know it could be useful Thanks !

 

Also I had a problem with 777 also and I found that above and it worked like a charm.

Edited by steelchizzle

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×