Azure, Windows Phone, Netduino, and some Ice makes for an interesting Ice Bucket Challenge...
- Posted: Sep 03, 2014 at 6:00 AM
- 9,062 Views
- 2 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Today's post would normally be a Hardware Friday post, but I've already got something queued and I wanted to get this one out, so instead of Hardware Friday I'll call this a Windows Phone Wednesday post... :)
Matt of rougecode recently took the Ice Bucket Challenge, and being the dev geek he is, well...
Now, a number of people have a problem with this challenge, but I am all for it because:
a) It is raising awareness. I had no idea what ALS was, and now I do. It’s made me do a lot of reading about something I was clueless about, which is great.
b) It is raising money. Some say it is taking money that might have gone to other charities away, but in my case that simply isn’t true. I had no plans to donate other money that I cancelled due to this. I would have spent the money on electronics I probably don’t need.
The real issue is that most people simply seem to forget it is about the money. So I’d encourage people posting videos to remind viewers of that fact.
I donate to ProjectALS. They have a great score on Charity Navigator, and are one of the more reputable organizations, who apparently give 90% of the donations directly to research.
OK, onto the technology!
I was originally going to use Cortana, sort of like in my previous post. “Cortana, I’m not cool enough” -> *Bucket falls*. But Dom suggested the stakes were too low.
So the final solution was to use a Netduino Plus 2 that was controlling a servo to drop the bucket. The Netduino was polling an Azure service waiting for a command of “1″. Then 10,000 KM away, I gave a Windows Phone app to Dom that would push a command to the Azure service.
If that wasn’t enough Microsoft tech already, we used Skype to sync up, and Dom was using his Xbox One. Finally, the video is recorded with my Lumia 1020.
I made a very technical to-scale drawing to explain better:
In the video you’ll see him holding the button and then releasing. The command is sent when he releases. There is about a 2 second delay which is pretty impressive considering the number of things that happen along the way.
The code for all of this is really simple. I could have made it a lot better, and also used push instead of polling to reduce latency.
The Azure service simply had a static variable that a POST writes to. Then a GET will return it. This is a naive approach for any real-word scenario with multiple peers.
This post comes via Gordon Beeming and speaking of Ice Bucket Challenges, every time I watch his son cracking up makes me laugh...