-
1Step 1
data.sparkfun.com
First up, lets get a feed set up for our data to get posted into.
- Head to data.sparkfun.com
- Hit Create
- Fill out the Create a Data Stream page with all your details. There is only one box you need to have specific information in. In the Fields box, type speed
- Hit Save
- You now have your stream! Make sure you keep all of the information on this page, it is crucial! If you lose it, you'll have to start again. You can email the information to yourself down the bottom there if you want.
- Click on the Public URL link now, we will have a look at it in the next step.
-
2Step 2
Powershell script
Now that you have your account set up, we can get the powershell script running!
- Open up a blank text document in your favourite editor. Notepad would do just fine.
- Paste the following in:
$a=Get-Date; Invoke-WebRequest http://client.akamai.com/install/test-objects/10MB.bin|Out-Null; $url = "https://data.sparkfun.com/input/<public key>?private_key=<private key>&speed="+$((10/((Get-Date)-$a).TotalSeconds)*8); Invoke-WebRequest $url|Out-Null;
- This may look scary, but its not really! You don't need to understand it, but you do need to update two parts of this script.
- Change <public key> to be the 'Public Key' value from your sparkfun data stream
- Change <private key> to be the 'Private Key' value from your sparkfun data stream
- Save the document as SpeedTest.ps1. Make sure you don't have .txt on the end, this will make your script not work!
Your script is done! To test it, browse to your script location in Windows Explorer, right click it, and hit 'Run with Powershell'. Depending on how crap your internet is, this will take a little while. When it is done, you should be able to go to your Public URL page on data.sparkfun.com and see a new line that has been added in there.
Setting up a schedule
There is already plenty of information on this topic out there on the net, I figure I won't repeat it. I did a quick google search for 'scheduled task powershell script' and the first hit came up as this: http://www.metalogix.com/help/Content Matrix Console/SharePoint Edition/002_HowTo/004_SharePointActions/012_SchedulingPowerShell.htm
Set the schedule to repeat every 30 minutes, or however often you'd like to report on the data. Please note though, every time you run this script, you download another 10MB. So if you have data limits, take this into consideration! 10MB every half hour adds up to almost 15GB in a month.
-
3Step 3
Getting that pretty graph
analog.io is a great little website to take a dataset and get a nice graph out of it.
- Head to this website, and create an account.
- Click the Import Stream button
- Change the host to Sparkfun if it isn't already set
- Paste your Public Key into the box provided
- You'll get the graph listed right there! Pretty easy huh?
- You might also want to claim this stream as your own. Press the Claim button, and paste your Private Key in there. I know you aren't supposed to give it away, but its connection speed data. Can't really go too wrong.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.