iot-weather-station-managed-solution

Hands-on-lab IoT Weather Station using Windows 10

As written on hackers.io

//build: Hands-on-lab WeatherStation

This project is part of Microsoft’s Hack the Home initiative, which provides makers with free, open-source components for effortless interfacing with devices and services that makers use most to hack their homes.

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.

Hardware

iot-weather-station-2-managed-solution

Pinout Diagram (Raspberry Pi 2 --> Sparkfun weather shield):

  • GND-------(black)------GND
  • 5V----------(red)---------VIN
  • 3V3-------(brown)------5V (shield hack; not a typo)
  • GPIO2-----(yellow)----SDA
  • GPIO3----(orange)----SCL
  • GPIO5-----(green)-----D8
  • GPIO6-----(blue)-------D7

Software

Identify your computer name:

The weather station is actually two applications! What?!?! That's right. The first is a long running (indefinitely, actually) background task that reads the sensors and acts as a weather station server. The second, a UI that makes a request to port 50001 of the server and displays the data. The UI application is universal and can be deployed on any Windows device from the Raspberry Pi 2 all the way to a desktop PC - and anywhere in between!

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");

iot-weather-station-3-managed-solution

Enable the "Task List" display

iot-weather-station-4-managed-solution

Double-click on any item in the list and jump straight into the source!

iot-weather-station-5-managed-solution

Each //TODO: is preceded by comments and HINTS to help you with the missing sections.

Install the weather station application:

Clone the linked repository (using the --recursive flag)

  • select the "lab" branch (default), if you want to learn the new UWP Windows.Devices API's and complete the code yourself
  • select the "master" branch if you want the completed code

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

  • Select “Remote Device” as “Target device:”
  • Enter the IP address of your Windows IoT Core device in the “Remote machine:” field

Deploy to the Windows IoT Core device

Interface with and/or debug the application:

  • Set a breakpoint in "WeatherStationTask.cs", in the "PopulateWeatherData" function,/li>
  • Step through the individual I2C transactions as they occur

OR

  • Ping the IP address of your Windows IoT Core device on port 50001 in an internet browser window (i.e. http://xxx.xxx.xxx.xxx:50001)

Integrating with ConnectTheDots:

iot-weather-station-6-managed-solution

iot-weather-station-7-managed-solution

Select the "lab_ConnectTheDots" branch, if you want to learn how to use ConnectTheDots and complete the code yourself

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="

  • service bus namespace (Ex: "iotbuildlab-ns")
  • event hub name (Ex: "ehdevices" - always use this)
  • key name (Ex: "D1")
  • key (Ex: " iQFNbyWTYRBwypMtPmpfJVz+NBgR32YHrQC0ZSvId20=")
  • display name (Ex: "WeatherStation1" - This gives a name to the device data)
  • organization (Ex: "IoT Build Lab" - Change to customize)
  • location (Ex: "USA" - Change to customize)

ConnectTheDotsSensor: Contains the information for a sensor

  • guid
  • display name
  • organization
  • location
  • measure name
  • unit of measure
  • time created
  • value

ConnectTheDotsHelper: Helper functions to initialize the Event Hub

  • establishes the connection
  • creates the authentication tokens
  • 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.

 

A teacher’s journey with Skype in the Classroom

By Iro Stefopoulou as written on blogs.skype.com

The start of an inspiring adventure

In August 2013, while all my friends were enjoying the sea and the sun in Greece, I was spending the summer holidays in my new apartment getting ready for the next school year, trying to find new resources and ideas that would attract my students’ interest and motivate them. It was that summer that I discovered Skype in the Classroom. I immediately knew that I had struck gold and that this community would be life changing for my students and me as a teacher.

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

Throughout that first school year of using Skype in my classroom, I met countless teachers who have become friends and mentors. One of them, Dyane Smorokowski encouraged me to apply to become a Skype Master Teacher. I had no idea what it meant at the time but I decided to apply because I had a passion for global learning and the vision for providing my classroom with more opportunities.

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.

Join the Skype Master Teacher Program

We are really excited to announce that the Skype Master Teacher Program is opening its doors to even more teachers. Teachers who have been selected as Microsoft Innovative Educator Experts (MIEEs) can complete their self-nomination to join this program. MIE Experts are teachers work closely with Microsoft to lead innovation in education. They advocate and share their thoughts on the effective use of technology in education with peers and policy makers, provide insight for Microsoft on new products and tools for education, and exchange best practices as they work together to promote innovation in teaching and learning. The self-nominations are open until September 15th.

What other Skype Master Teachers say about the SMT Program

“The Skype Master Teacher Program is special to me because it is about people who empower and impassion me. If I have an idea that I want to try or a project that I’m experimenting with, I know I can count on my SMT tribe to give me input or jump in with me. They are the risk-takers and change makers who make me a better teacher, and help me grow stronger as an educator.” – Gina Ruffcorn, MIEE, Skype Master Teacher, Iowa, USA

“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

Contact us Today!

Chat with an expert about your business’s technology needs.