The new Windows.Devices namespace from the Universal Windows Platform (UWP) APIs in Windows 10, enable developers to leverage the power of Windows while interacting with the real world via sensors and actuators.
This project uses the I2C bus and general purpose input/output (GPIO) ports available on the Raspberry Pi 2, to create an internet connected weather station using the SparkFun weather shield.
The instructions provided will give a developer first-hand experience setting up the required hardware along with writing and debugging the newly available Windows 10, UWP Windows.Devices API's. This lab will also demonstrate how to aggregate your data in cloud using the Azure Event Hub, via the easy-to-use ConnectTheDots API.
You need to find the following line in the `Mainpage.xaml.cs` file from the `build2015-weather-station` project, and replace the computer name, "minwinpc", in the URL with the name of your IoT device.
//TODO: On the following line, replace "minwinpc" with the computer name of your IoT device (i.e. "http://:50001").
private Uri weatherUri = new Uri("http://minwinpc:50001");
Enable the "Task List" display
Double-click on any item in the list and jump straight into the source!
Each //TODO: is preceded by comments and HINTS to help you with the missing sections.
Open "WeatherStationWeatherStation.sln" in Visual Studio 2015
Navigate to "WeatherShield.cs" in the "Solution Explorer" pane
If you chose the lab branch, Navigate to “View >> Other Windows >> Task List”, to view the remaining work (depicted above).
You will notice there is quite a bit of detail in the comment to help you complete the task. However, if you still need that extra nudge, there will be a “HINT” provided to remind you to look to nearby code for help (illustrated above).
Once the //TODO:'s have been completed, click the “Debug” menu item, and select “WeatherStation Properties…”
Under the “Debug” tab, in the “Start options” section
Deploy to the Windows IoT Core device
OR
Open "WeatherStationWeatherStation.sln" in Visual Studio 2015
Navigate to "WeatherStationTask.cs" in the "Solution Explorer" pane
Use the "Task List" to jump to each “//TODO:” and write the necessary code
The AppSettings, ConnectTheDotsSensor, and ConnectTheDotsHelper files are all part of the code created to help you use the ConnectTheDots interface to the Azure Event Hub.
AppSettings: Saves the settings for connecting to the Event Hub
This information can be found under your ServiceBus in Azure.
Go to your "*-ns" servicebus instance -> Event Hubs -> ehdevices -> Connection Information -> Look for the SAS "D1"
Copy the connection string which should look like this (It contains information for your AppSettings)
"Endpoint=sb://iotbuildlab-ns.servicebus.windows.net/;SharedAccessKeyName=D1;SharedAccessKey=iQFNbyWTYRBwypMtPmpfJVz+NBgR32YHrQC0ZSvId20="
ConnectTheDotsSensor: Contains the information for a sensor
ConnectTheDotsHelper: Helper functions to initialize the Event Hub
If you would like to setup your own Event Hub back-end, follow the instructions in the ConnectTheDots GitHub repository: https://github.com/msopentech/connectthedots/blob/master/Azure/AzurePrep/AzurePrep.md
Once you have it deployed, it should start sending data to the event hub and the data should be viewable on http://iotbuildlab.azurewebsites.net/ or your own website.
I started exploring the possibilities and was like a kid on Christmas day: Skype lessons, guest speakers, virtual field trips to places around the world and classroom projects and collaborations. What would that mean for my learners? How would it influence their learning experience? Could it transform the way students perceive the world? Would my students feel that they are part of a global learning community?
Going back to school that year, I was super excited about my new discovery that could virtually break down the walls of my classroom. I had searched the Skype in the Classroom lessons for days to decide where to begin, and settled on the Night Zookeeper’s lesson. I scheduled a Skype call to meet the person who would deliver the lesson and chatted with him for a while. I now feel really proud to call Paul Hutson the Night Zookeeper my friend as what he did for me and my students was unique, unforgettable and the stepping stone for what followed next.
During the rest of 2013, I used Skype every week. I started participating in global projects with my classes, making use of Skype in the Classroom to create a global environment for my students. At the end of that school year it was clear that my students had started thinking beyond the walls of our classroom and every connection or project they participated in was turning them into thinkers, leaders and doers. The borders of our small town seemed non-existent as we communicated in real time with schoolchildren from all over the world, doing various activities and projects together. Not only did my pupils practice their English (Greek is our first language), they also became citizens of the world, and learn about facts and problems concerning other communities, the natural world, traditions, customs and so much more.
Becoming a Skype Master Teacher, and joining this amazing group of innovative and game-changing educator pioneers, has allowed me to develop as a person and as an educator. It gave me to opportunity to collaborate with teachers from around the globe on several global projects that had a great impact on my students’ lives and changed their perspective and understanding of the world. I also started sharing best practices with other educators at conferences and delivering online professional development courses through Skype.
After joining this program, in addition to feeling excited and proud to be part of this amazing group of teachers from all around the globe, I felt that I belonged to a family. I can proudly say that I belong to a family of like-minded educators with whom I can share ideas, best practices, collaborate on projects and help each other when needed.
“I love being part of the SMT Program because it connects me with an amazing group of passionate educators who inspire me constantly.” – Steve Auslander, MIEE, Skype Master Teacher, Indianapolis, USA
“Being a part of the Skype Master Teacher Program has definitely made me a better teacher. This is a group of inspiring, innovative and supportive educators who are doing game-changing things for kids. Skype Master Teachers dream big for kids, and support each other to make dreams and ideas, big or small, a reality.” – Stacey Ryan, MIEE, Skype Master Teacher, Kansas, USA
Chat with an expert about your business’s technology needs.