<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Windows on Devices</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/iot/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/iot/feed.xml</link>
    <description>The Internet of Things (IoT) brings together devices, sensors, cloud, data and your imagination.  Here, you&amp;#039;ll find helpful tips for developing Windows applications and services for small devices</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:48:21 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Connecting to Azure IoT Hub with Node.js</title>
      <link>https://docs.microsoft.com/archive/blogs/iot/connecting-to-azure-iot-hub-with-node-js</link>
      <pubDate>Fri, 12 Feb 2016 23:55:18 GMT</pubDate>
      <dc:creator><![CDATA[Munyiri Kamau]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/iot/?p=522</guid>
      <description><![CDATA[Hello IoT Community!

You can now use Node.js on Windows 10 IoT Core to communicate with Azure IoT...]]></description>
      <content:encoded><![CDATA[<span style="font-size: 11.0pt;font-family: 'Calibri',sans-serif"><span style="color: #000000">Hello IoT Community!</span></span>

<span style="font-size: 11.0pt;font-family: 'Calibri',sans-serif"><span style="color: #000000">You can now use Node.js on Windows 10 IoT Core to communicate with </span><a href="https://azure.microsoft.com/en-us/services/iot-hub/"><span style="color: #0563c1">Azure IoT Hub</span></a>.</span>

<span style="font-size: 11.0pt;font-family: 'Calibri',sans-serif"><span style="color: #000000">The IoT team published a tutorial (found </span><a href="https://ms-iot.github.io/content/en-US/win10/samples/nodejs-wu-azure.htm"><span style="color: #0563c1">here</span></a><span style="color: #000000">) that will take you through steps to get started with Azure IoT hub. </span></span>

<span style="font-size: 11.0pt;font-family: 'Calibri',sans-serif"><span style="color: #000000">In this tutorial, you will send data to your IoT hub from a light sensor connected to an Arduino using a Node.js app running on a Raspberry Pi 2. The app you create will make use of </span><a href="https://www.npmjs.com/package/johnny-five"><span style="color: #0563c1">Johnny-Five</span></a><span style="color: #000000"> to communicate with the light sensor and </span><a href="https://www.npmjs.com/package/azure-iot-device-mqtt"><span style="color: #0563c1">azure-iot-device-mqtt</span></a><span style="color: #000000"> to send the data to the hub.</span></span>]]></content:encoded>
    </item>
    <item>
      <title>Using Power BI to Visualize Sensor Data from Windows 10 IoT Core</title>
      <link>https://docs.microsoft.com/archive/blogs/iot/using-power-bi-to-visualize-sensor-data-from-windows-10-iot-core</link>
      <pubDate>Tue, 26 Jan 2016 22:13:26 GMT</pubDate>
      <dc:creator><![CDATA[Artur Laksberg]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/iot/?p=371</guid>
      <description><![CDATA[Gathering data from devices is an important part of any IoT solution. Visualizing that data allows...]]></description>
      <content:encoded><![CDATA[Gathering data from devices is an important part of any IoT solution. Visualizing that data allows us to gain insights into the health of the devices and how they interact with the environment.

In this post, we will look at using Power BI REST APIs to securely stream data from a headless Windows 10 IoT Core device, using the new Azure Active Directory authentication protocol for headless devices. To demonstrate the capabilities of Power BI and Azure Active Directory, we're going to build a weather station application.
<h2>Introduction</h2>
Building a weather station is the rite of passage for beginning IoT enthusiasts. It's easy to put together from inexpensive components and provides immediate gratification. For example, you can blow air on your sensor and watch the temperature graph spike up or down. You can leave the weather station in your home and monitor humidity and temperature remotely. The list goes on.

At the same time, the project presents some unique challenges. How do you send the data from your device to the cloud? How do you visualize it in interesting ways? Finally -- how do you make sure you're looking at <em>your</em> data? In other words, how do you reliably authenticate your device?
<h2>Authenticating a Headless Device</h2>
In a typical OAuth 2.0 authorization flow, the user is presented with a browser window where they can enter their credentials. The application then obtains an access token that is used to communicate with the desired cloud service. Alas, this approach is not suitable for headless IoT devices without the mouse and keyboard attached, or devices that only offer console I/O.

This problem is solved with the latest version of the Active Directory Authentication Library (still in preview) that introduces <a href="https://azure.microsoft.com/en-us/documentation/samples/active-directory-dotnet-deviceprofile/">a new authentication flow tailored for headless devices</a>. The approach goes like this: when a user authentication is required, instead of bringing up a browser window, the app asks the user to use another device to navigate to <a title="https://aka.ms/devicelogin" href="https://aka.ms/devicelogin">https://aka.ms/devicelogin</a> and enter a specific code. Once the code is provided, the web page will lead the user through a normal authentication experience, including consent prompts and multi factor authentication if necessary. Upon successful authentication, the app will receive the required access tokens through a back channel and use it to access the desired cloud service.
<h2>Hardware Setup</h2>
For this example, we will use a humidity and temperature sensor, such as the HTU21D, which is available from a number of vendors (e.g., <a href="https://www.sparkfun.com/products/12064">Sparkfun</a>, <a href="https://www.amazon.com/SparkFun-Humidity-Sensor-Breakout-HTU21D/dp/B00L8ELNCQ/ref=sr_1_1?ie=UTF8&amp;qid=1453412873&amp;sr=8-1&amp;keywords=HTU21D">Amazon</a>).

The sensor connects to your device via I²C bus, as shown on the following wiring diagram (the location of the pins might be slightly different if you're using a device other than Raspberry Pi 2):

<a href="https://msdnshared.blob.core.windows.net/media/2016/01/humidity-htu21d_bb.png"><img class="alignnone size-medium wp-image-451" src="https://msdnshared.blob.core.windows.net/media/2016/01/humidity-htu21d_bb-291x300.png" alt="humidity-htu21d_bb" width="291" height="300" /></a>
<h2>Software Setup</h2>
The software setup will require several steps. First, we'll need to register an application in the Azure Active Directory. Then, we'll copy the client ID from the application and use it in our UWP app running on the device. Finally, we'll create a dashboard in Power BI to visualize data coming from our device.
<h3>Registering an Application in Azure</h3>
This step assumes that your organization already has an Azure Active Directory set up. If not, you can get started <a href="https://azure.microsoft.com/en-us/trial/get-started-active-directory/">here</a>.

You can register your application from the Azure Portal, however it's easier to do it from the dedicated Power BI application registration page: <a href="https://dev.powerbi.com/apps" target="_blank">https://dev.powerbi.com/apps</a>.

Navigate to the above page, log in with your Power BI credentials and fill out the information about your app:

<img class="alignnone size-full wp-image-461" src="https://msdnshared.blob.core.windows.net/media/2016/01/Register_app_step2.png" alt="Register_app_step2" width="992" height="352" />

Note that I used a dummy URL for the redirect -- our app will not need this information but we cannot leave this field empty.

In the next step, enable the "Read All Datasets" and "Read and Write All Datasets" APIs and click "Register App".

Once this is done, click "Register App". The web page will generate the Client ID, which looks like this:

<img class="alignnone size-full wp-image-472" src="https://msdnshared.blob.core.windows.net/media/2016/01/Register_app_step4.png" alt="Register_app_step4" width="996" height="301" />

Leave the browser page open -- we will need to copy the Client ID and paste it into our C# app.
<h3>Build the App</h3>
The C# app UWP that we're going to use combines the Power BI REST APIs (more on this <a href="https://github.com/Microsoft/PowerBI-CSharp/tree/master/samples/consoleapp/getting-started-for-dotnet">here</a>) with the use of headless device flow from the Azure Active Directory Library described <a href="https://github.com/Azure-Samples/active-directory-dotnet-deviceprofile/">here</a>.

The full source of the app is available on our GitHub repository <a href="https://github.com/ms-iot/samples/tree/develop/Azure/WeatherStation.PowerBI">here</a>.

To run your application on your device, you need to get the source code and find the <em>clientID</em> constant in <em>PBIClient.cs</em>:
<pre style="padding-left: 30px"> // WeatherPBIApp: replace with the actual Client ID from the Azure Application:
 private const string clientID = "&lt;replace&gt;";</pre>
Replace the value with the string obtained from the registered Azure Application at the previous step and compile the app for ARM architecture. For this app, you will need to connect your Raspberry Pi to a monitor (keyboard and mouse are not required) to display the user code from the device. While this means that the device is no longer completely headless, you might imagine a slightly more advanced version of the app where the user code is communicated via an SMS message, an HTTP POST request, or is displayed on an <a href="https://www.raspberrypi.org/products/sense-hat/">LED matrix</a>.

Deploy the app to your Raspberry Pi. If all goes well, you should see the following:

<a href="https://msdnshared.blob.core.windows.net/media/2016/01/App_running.png"><img class="alignnone wp-image-431" src="https://msdnshared.blob.core.windows.net/media/2016/01/App_running.png" alt="App_running" width="800" height="409" /></a>

Now switch to another device -- either a desktop PC or a phone and navigate to the specified URL. Type in the specified user code and press Continue:

<a href="https://msdnshared.blob.core.windows.net/media/2016/01/signin1.png"><img class="alignnone size-full wp-image-491" src="https://msdnshared.blob.core.windows.net/media/2016/01/signin1.png" alt="signin" width="396" height="332" /></a>

Once the user code is accepted, the application will receive the access code and start sending data to Power BI.
<h3>Configure Power BI Dashboard</h3>
Log in to your <a href="https://powerbi.com">Power BI</a> account and look for the "WeatherReport" dataset in the navigation bar on the left. In the Visualization pane create a "Temperature by Time" line chart:

<a href="https://msdnshared.blob.core.windows.net/media/2016/01/TemperaturexTime.png"><img class="alignnone size-medium wp-image-441" src="https://msdnshared.blob.core.windows.net/media/2016/01/TemperaturexTime-276x300.png" alt="TemperaturexTime" width="276" height="300" /></a>

You can then create a "Humidity by Time" chart in a similar way. Alternatively, you can plot both temperature and humidity on the same axis.

Now save your report and pin it to the dashboard. You should see something that looks like this:

<a href="https://msdnshared.blob.core.windows.net/media/2016/01/dashboard.png"><img class="alignnone wp-image-382" src="https://msdnshared.blob.core.windows.net/media/2016/01/dashboard.png" alt="dashboard" width="800" height="279" /></a>

&nbsp;

That's it! Enjoy your weather station!
<h2>Summary</h2>
In this post we explored how to use PowerBI REST APIs on Windows 10 IoT Core together with the new Azure Authentication Library headless authentication flow. Unlike <a href="https://blogs.msdn.com/b/powerbidev/archive/2015/04/30/monitor-your-iot-sensors-using-power-bi.aspx">some previous attempts</a> at this, this approach allows you to send data to Power BI directly from your headless device, without using additional Azure services such as <a href="https://azure.microsoft.com/en-us/services/event-hubs/">Azure Event Hub</a> or <a href="https://azure.microsoft.com/en-us/services/stream-analytics/">Stream Analytics</a>. The authentication is performed using an accompanying device, obviating the need for a desktop gateway device.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Announcing the Windows 10 IoT Core Update</title>
      <link>https://docs.microsoft.com/archive/blogs/iot/announcing-the-windows-10-iot-core-update</link>
      <pubDate>Mon, 11 Jan 2016 15:03:04 GMT</pubDate>
      <dc:creator><![CDATA[Marcus Russell [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/iot/?p=331</guid>
      <description><![CDATA[Hello IoT Community!

We're pleased to announce that a new update for Windows 10 IoT Core has just...]]></description>
      <content:encoded><![CDATA[Hello IoT Community!

We're pleased to announce that a new update for Windows 10 IoT Core has just been released, and it's on its way to your devices!

<strong>What's New</strong>

This update brings some enhancements to existing functionality, and some new features we'd like you to try:
<ul>
	<li>New stability improvements to the <a title="Windows 10 IoT Core Secure Shell (SSH)" href="https://ms-iot.github.io/content/en-US/win10/samples/SSH.htm" target="_blank">Windows 10 IoT Core secure shell (SSH)</a> experience and</li>
	<li>Enhancements to the <a title="Windows Device Portal" href="https://ms-iot.github.io/content/en-US/win10/tools/DevicePortal.htm" target="_blank">Windows Device Portal</a></li>
</ul>
<strong>What to Expect</strong>

Windows 10 IoT Core devices will get this new update automatically.  Here's what you can expect to see on your devices:
<ol>
	<li>Devices will reboot within a few days of receiving the update.</li>
	<li>The following image will be displayed on-screen when the update begins:</li>
</ol>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2016/01/gears.jpg"><img class="alignnone  wp-image-343" src="https://msdnshared.blob.core.windows.net/media/2016/01/gears-300x289.jpg" alt="gears" width="180" height="173" /></a></p>

<ol>
	<li>When the update completes, the OS Version of the Windows 10 IoT Core device will be 10586.<strong>63</strong>.</li>
</ol>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2016/01/gears.jpg"> </a></p>
That's it!

Let us know what you think!
<ul>
	<li>Join the community, and share your experience with this update.
<a title="Windows 10 IoT Community Resources" href="https://ms-iot.github.io/content/en-US/Community.htm" target="_blank">https://ms-iot.github.io/content/en-US/Community.htm</a></li>
	<li>Use Windows Feedback to send feedback directly to Microsoft engineers.</li>
</ul>
&nbsp;]]></content:encoded>
    </item>
  </channel>
</rss>