<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Scotts Ultimate Guide to Data</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/sqlscott/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/sqlscott/feed.xml</link>
    <description>Your unique source for knowledge and insights about data</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:08:14 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure IoT and Arduino – Part2</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/azure-iot-and-arduino-part2</link>
      <pubDate>Wed, 14 Dec 2016 12:46:28 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=365</guid>
      <description><![CDATA[In Part1 of the Azure IoT and Arduino blog series, I showed how to hook up an Arduino Feather HUZZAH...]]></description>
      <content:encoded><![CDATA[<p>In <a href="https://blogs.msdn.microsoft.com/sqlscott/2016/10/11/azure-iot-and-arduino-part1/">Part1</a> of the Azure IoT and Arduino blog series, I showed how to hook up an Arduino Feather HUZZAH to Windows 10 and get it to run a simple blinky test. This post will build on that and show how to connect a DHT22 temperature and humidity sensor. All of this information is found online but in different locations so this blog will gather it all together into a single post. Part 3 of this series of posts will show how to send the temperature data to Microsoft Azure.
</p><p>To get started, a few additional libraries need to be added to the Arduino IDE in order to work with the DHT sensor. Those two items are:
</p><ul><li>DHT sensor library
</li><li>Adafruit Unified Sensor library
</li></ul><p>The DHT sensor library are drivers and classes for working with DHT sensors, and the Adafruit unified sensor library combines sensor data into a single 'type' while abstracting details for all the different sensors. What this provides is the ability to take any supported sensor and plug it in and it should work. Pretty sweet.
</p><h2>DHT Sensor Library
</h2><p>We'll begin by installing the DHT library first. In the Arduino IDE, click on the Sketch menu, then select <em>Include Library -&gt; Manage Libraries</em>, as shown in Figure 1.
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2016/12/121416_1946_AzureIoTand1.png" alt="" />
	</p><p><strong><em>Figure 1
</em></strong></p><p>In the Library Manager dialog, type in DHT Sensor Library in the search box, as shown in Figure 2. Click the DHT sensor library, select the version, then click Install. When I built this solution, version 1.2.3 was the latest, but in checking at the time of this writing, version 1.3.0 is the latest. Either should work. 
</p><p style="background: white"><img src="https://msdnshared.blob.core.windows.net/media/2016/12/121416_1946_AzureIoTand2.png" alt="" /><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><strong><em>Figure 2</em></strong><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><span style="color:#333333;font-family:Segoe UI;font-size:10pt">Once the DHT sensor library is installed, click Close on the Library Manager dialog. 
</span></p><h2>Unified Sensor Driver
</h2><p><span style="color:#333333;font-family:Segoe UI;font-size:10pt">Now do the same thing for the Adafruit DHT Unified library but the install for this is a little different. Open your favorite browser and navigate to the following URL:</span>
	</p><p style="background: white"><a href="https://github.com/adafruit/Adafruit_Sensor"><span style="font-family:Segoe UI;font-size:10pt">https://github.com/adafruit/Adafruit_Sensor</span></a><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><span style="color:#333333;font-family:Segoe UI;font-size:10pt">On the Adafruit sensor page, click green <em>Clone or download</em> link, and select <em>Download ZIP</em>, as shown in Figure 3, and save it to a location on your PC. The file will be called <em>Adafruit-sensor-master.zip</em>.
</span></p><p style="background: white">
 </p><p style="background: white"><img src="https://msdnshared.blob.core.windows.net/media/2016/12/121416_1946_AzureIoTand3.png" alt="" /><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><strong><em>Figure 3</em></strong><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><span style="color:#333333;font-family:Segoe UI;font-size:10pt">Back in the Arduino IDE, click on the Sketch menu, the select <em>Include Library -&gt; Add .ZIP Library</em>, as shown in Figure 4. 
</span></p><p style="background: white"><img src="https://msdnshared.blob.core.windows.net/media/2016/12/121416_1946_AzureIoTand4.png" alt="" /><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><strong><em>Figure 4</em></strong><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><span style="color:#333333;font-family:Segoe UI;font-size:10pt">Browse to the location where you saved the zip file and select it, then click Open. The Arduino will install the necessary library into the IDE. The install is very short, and you can verify that both the DHT sensor and the Adafruit Unified Sensor libraries have both been successfully installed by selecting Include Library from the Sketch menu, and you will see both listed in the Recommended libraries section of the menu, as shown in Figure 5.
</span></p><p style="background: white"><img src="https://msdnshared.blob.core.windows.net/media/2016/12/121416_1946_AzureIoTand5.png" alt="" /><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p style="background: white"><strong><em>Figure 5</em></strong><span style="color:#333333;font-family:Segoe UI;font-size:10pt">
		</span></p><p>
 </p><p>At this point, it's time to hook up the sensor and write the code to read the sensor data.
</p><h2>Hooking up the Sensor
</h2><p>Figure 6 shows how I hooked up the sensor to the Arduino board. The DHT22 sensor needs to be wired up as follows:
</p><ul><li>Pin 1 of the DHT22 sensor connects to the VCC (3 to 5V power) on the Arduino (red wire)
</li><li>Pin 2 of the DHT22 is the data pin and connects to pin 2 on the Arduino (white wire)
</li><li>Ignore pin 3
</li><li>Pin 4 of the DHT22 is the ground pin and connects to ground on the Arduino (black wire)
</li></ul><p>Next, place a 10K resistor between the VCC (power) and data pin. This will act as a medium-strength pull on the data line.
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2016/12/121416_1946_AzureIoTand6.jpg" alt="" />
	</p><p><strong><em>Figure 6</em></strong>
	</p><p>Once you have the sensor hooked up, it's time to write some code.
</p><h2>The Code
</h2><p>If you don't want to write any code, that's good because it's already been written for you. Simply go to <a href="https://learn.adafruit.com/dht/downloads">https://learn.adafruit.com/dht/downloads</a> and click on the <em>Arduino library and example code for DHT sensors</em> link. This will download a .ZIP file called <em>DHT-sensor-library-master</em>, and in that zip file is a library and example scripts for testing the DHT sensors. Extract the zip file into a directory and navigate to the \examples\DHTtester folder. Open the file in that directory called DHTtester in the Arduino IDE. Notice that it has support for the DHT11 and DHT22 sensors. Simply uncomment the sensor type you are using (in this case the DHT22).  Also notice that in this file, all sensor data is sent to the output logs via <em>Serial.print</em>.
</p><p>You're ready to go! Plug in the Arduino board (as shown in Figure 6) and give it a minute to boot. While it's booting, click the Verify button to compile the sketch. Once it has compiled, click the Upload button to deploy the code to the Arduino board. While it is uploading, select Serial Monitor from the Tools menu which will allow you to see the logs and data read (which is where the Serial.print statements are sending the data). Once the code is uploaded, the Arduino will start reading the DHT sensor data and outputting the results to the serial monitor, as shown in figure 7. 
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2016/12/121416_1946_AzureIoTand7.png" alt="" />
	</p><p><strong><em>Figure 7
</em></strong></p><p>There you go, you are up and running! The next blog post in this series will modify the code to send the sensor data to Azure. </p>]]></content:encoded>
    </item>
    <item>
      <title>Data Exposed: Azure Data Lake GA!</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/data-exposed-azure-data-lake-ga</link>
      <pubDate>Wed, 16 Nov 2016 17:19:33 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=295</guid>
      <description><![CDATA[This week's episode of Data Exposed welcomes Saveen Reddy and Rajesh Dadhia to the show to make the...]]></description>
      <content:encoded><![CDATA[<span style="color: black;font-family: Times New Roman;font-size: 12pt">This week's episode of Data Exposed welcomes Saveen Reddy and Rajesh Dadhia to the show to make the important announcement that Azure Data Lake Store and Azure Data Lake Analytics is now Generally available! This is exciting news! Barely a minute into the show and Saveen and Rajesh, both of whom are GPMs in the Big Data team at Microsoft, give us the great news. For those who are unfamiliar with Azure Data Lake, Rajesh and Saveen give us quick overview of both Azure Data Lake Store and Azure Data Lake Analytics are all about.
</span>

<span style="color: black;font-family: Times New Roman;font-size: 12pt">Rajesh focuses on Azure Data Lake Store, a hyper-scale data repository for big data analytic workloads. He explains how ADLS compares to other cloud storage options, and talks about how enterprises can leverage ADLS for storage of any type of data without limitations to size. Saveen then takes over to discuss Azure Data Lake Analytics and shows how ADLA compares in relation to HDInsight and the other compute components. Both Rajesh and Saveen talk about how easy it is to get started and create an ADLS and ADLA account and the ease at which you can develop massively parallel programs to gain insights into your data. They provide insight into the architecture, how compute and data work together to provide highly optimized and scalable analytical solutions.
</span>

Learn more about Azure Data Lake Store: <a href="https://azure.microsoft.com/en-us/services/data-lake-store/">https://azure.microsoft.com/en-us/services/data-lake-store/</a>

Learn more about Azure Data Lake Analytics: <a href="https://azure.microsoft.com/en-us/services/data-lake-analytics/">https://azure.microsoft.com/en-us/services/data-lake-analytics/</a>

<iframe src="https://channel9.msdn.com/Shows/Data-Exposed/Azure-Data-Lake-GA/player" width="960" height="540" allowFullScreen frameBorder="0"></iframe>
]]></content:encoded>
    </item>
    <item>
      <title>Data Exposed: More with SQL Server on Linux</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/data-exposed-more-with-sql-server-on-linux</link>
      <pubDate>Thu, 03 Nov 2016 14:28:37 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=285</guid>
      <description><![CDATA[In this SQL on Linux follow-up episode of Data Exposed, Scott welcomes back Tobias Ternstrom and...]]></description>
      <content:encoded><![CDATA[In this SQL on Linux follow-up episode of Data Exposed, Scott welcomes back Tobias Ternstrom and Slava Oks to the show us more of SQL Server on Linux. Linux. Again, no slides, just pure demos.

Tobias shows how to install, configure and get an application running on RHEL (Red Hat Enterprise Linux). The install and configuration only took seconds, and within a matter of minutes Tobias had SQL Server installed and configured running on Linux. Mext he shows off SQL Server on Linux with In-memory OLTP by running an application in a Docker container on the REL installation, followed by running a workload generator application to show the performance of SQL on Linux using In-memory technology. All very awesome!

Slava then takes over and shows what they have been working on lately to improve the quality or SQL Server running on Linux. Slava gives us some insight into the types of tests they run in their performance labs to improve the SQL Server on Linux performance experience. Slava shows off the htop tool to run OLTP workloads to load test SQL Server on Linux. Slava spends several minutes giving insight into how they test and the different environments they test on.
<iframe width="960" height="540" frameborder="0" allowfullscreen="allowfullscreen" src="https://channel9.msdn.com/Shows/Data-Exposed/More-with-SQL-Server-on-Linux/player"></iframe>]]></content:encoded>
    </item>
    <item>
      <title>Data Exposed: SQL Server 2016 In-memory OLTP</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/data-exposed-sql-server-2016-in-memory-oltp</link>
      <pubDate>Thu, 20 Oct 2016 14:44:49 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=275</guid>
      <description><![CDATA[Data Exposed has had Jos de Bruijn in the studio a couple of times, and today he is back to talk...]]></description>
      <content:encoded><![CDATA[Data Exposed has had Jos de Bruijn in the studio a couple of times, and today he is back to talk specifically about In-memory OLTP in SQL Server 2016. Jos is a Senior PM on the SQL team and today dives right in with a fantastic demo to first show how much easier it is to get started with In-memory OLTP, but also the performance improvements with this technology in SQL Server 2016 to make it even faster. Jos shows off a familiar demo which really highlights the capabilities of the In-memory technology, showcasing the awesome performance gains as well as how easy it is to get started with and use In-memory OLTP.

Jos jumps in to a couple of important PowerPoint slides, first providing an overview of the In-memory technology and the performance levels one should expect when using the technology. Then, at the 21:15 mark, Jos covers scenarios when the In-memory OLTP technology should be used and even when it should NOT be used.

Great show and we will soon be having Jos back to talk more about this fantastic topic!

<iframe width="960" height="540" frameborder="0" allowfullscreen="allowfullscreen" src="https://channel9.msdn.com/Shows/Data-Exposed/SQL-Server-2016-In-memory-OLTP/player"></iframe>

Learn more about In-Memory OLTP: <a href="https://msdn.microsoft.com/library/dn133186.aspx">https://msdn.microsoft.com/library/dn133186.aspx</a>

What's new for In-Memory OLTP in SQL Server 2016: <a href="https://blogs.msdn.microsoft.com/sqlserverstorageengine/2015/11/12/in-memory-oltp-whats-new-in-sql2016-ctp3/">Part 1</a> and <a href="https://blogs.msdn.microsoft.com/sqlserverstorageengine/2016/03/25/whats-new-for-in-memory-oltp-in-sql-server-2016-since-ctp3/">Part 2</a>

Download the demo shown in the video: <a href="https://github.com/Microsoft/sql-server-samples/releases/tag/in-memory-oltp-demo-v1.0">In-Memory OLTP Performance Demo v1.0</a>]]></content:encoded>
    </item>
    <item>
      <title>Tessel 2 and Microsoft Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/tessel-2-and-microsoft-azure</link>
      <pubDate>Mon, 17 Oct 2016 14:23:58 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=265</guid>
      <description><![CDATA[In part 1 of the Tessel 2 series, I discussed how to get the Tessel 2 working on Windows 10. In this...]]></description>
      <content:encoded><![CDATA[In <a href="https://blogs.msdn.microsoft.com/sqlscott/2016/09/28/tessel-2-and-windows-10/">part 1</a> of the Tessel 2 series, I discussed how to get the Tessel 2 working on Windows 10. In this blog post I'll discuss how to get your Tessel 2 connected to Microsoft Azure and sending data to Azure IoT Hub. What the first blog post did not do is connect the Tessel 2 to any network, which is needed when sending data to Azure (obviously <span style="font-family: Wingdings">J</span>). The easiest way to do this is to enable wifi on the Tessel. Open a command prompt as administrator and execute the following to enable wifi:

<span style="font-family: Times New Roman">t2 wifi -n &lt;<em>networkname</em>&gt; -p &lt;<em>password</em>&gt;
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM1.png" />

In the example above the network didn't need a password so I didn't need to pass one. If your wifi network needs a password, use -p to supply it. With wifi enabled, you are ready to rock. The key step in getting the Tessel 2 communicating with Azure IoT Hub is registering the device, the same as with other devices such as Raspberry Pi. The cool thing about this is that you can use the Tessel to register itself with IoT Hub. This post also assumes that you already have an IoT Hub created. If you don't, follow the instructions in the "Create an IoT Hub" section <a href="https://azure.microsoft.com/en-us/documentation/articles/iot-hub-csharp-csharp-getstarted/">here</a> to create your IoT Hub. Once it is created, you will need the Connection String, and you can grab it from the Azure portal (same place you created the IoT Hub) by clicking on the Shared Access Policies property, click the iothubowner policy, then copying the primary connection string.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM2.png" />

Next, there are a few node modules that you need to install in order for the Tessel to connect and communicate with Azure and the IoT Hub. Create a directory called Tessel (if you don't already have one) and then open a command prompt as administrator, navigate to that directory and execute the following command to install both the <em>azure-iot-device</em> and <em>azure-iot-device-amqp</em> modules.

<span style="font-family: Times New Roman">npm install azure-iot-device azure-iot-device-amqp --save
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM3.png" />

While you're at it, do the same thing to install the azure-iothub module:

<span style="font-family: Times New Roman">npm install azure-iothub --save</span>

Once those packages are installed, open up Visual Studio Code (or another editor) and type in the following code, replacing the <em>&lt;connectionstring&gt;</em> with the connection string copied earlier.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM4.png" />
<p style="background: navy"><span style="color: white;font-family: Verdana;font-size: 10pt"><strong>Code Snippet
</strong></span></p>
<p style="background: white"><span style="color: #a31515;font-family: Consolas;font-size: 10pt">'use strict'<span style="color: black">;<span style="color: #a31515"></span></span></span></p>
<span style="color: blue">var<span style="color: black"> iothub = require(<span style="color: #a31515">'azure-iothub'<span style="color: black">);<span style="color: #a31515"></span></span></span></span></span>

<span style="color: blue">var<span style="color: black"> connectionString = <span style="color: #a31515">'&lt;connectionstring&gt;'<span style="color: black">;<span style="color: #a31515"></span></span></span></span></span>

<span style="color: blue">var<span style="color: black"> registry = iothub.Registry.fromConnectionString(connectionString);<span style="color: #a31515"></span></span></span>

<span style="color: blue">var<span style="color: black"> device = <span style="color: blue">new<span style="color: black"> iothub.Device(<span style="color: blue">null<span style="color: black">);<span style="color: #a31515">
<span style="color: black">device.deviceId = <span style="color: #a31515">'tessel2'<span style="color: black">;<span style="color: #a31515">
<span style="color: black">registry.create(device, <span style="color: blue">function<span style="color: black">(err, deviceInfo, res) {<span style="color: #a31515">
<span style="color: black">  <span style="color: blue">if<span style="color: black"> (err) {<span style="color: #a31515">
<span style="color: black">registry.get(device.deviceId, printDeviceInfo);<span style="color: #a31515">
<span style="color: black">  }<span style="color: #a31515">
<span style="color: black">  <span style="color: blue">if<span style="color: black"> (deviceInfo) {<span style="color: #a31515">
<span style="color: black">printDeviceInfo(err, deviceInfo, res)<span style="color: #a31515">
<span style="color: black">  }<span style="color: #a31515">
<span style="color: black">});<span style="color: #a31515"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: blue">function<span style="color: black"> printDeviceInfo(err, deviceInfo, res) {<span style="color: #a31515">
<span style="color: black">  <span style="color: blue">if<span style="color: black"> (deviceInfo) {<span style="color: #a31515">
<span style="color: black">console.log(<span style="color: #a31515">'Device id: '<span style="color: black"> + deviceInfo.deviceId);<span style="color: #a31515">
<span style="color: black">console.log(<span style="color: #a31515">'Device key: '<span style="color: black"> + deviceInfo.authentication.SymmetricKey.primaryKey);<span style="color: #a31515">
<span style="color: black">  }<span style="color: #a31515">
<span style="color: black">}<span style="color: #a31515">
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

Save the file as CreateDeviceIdentity.js in the Tessel folder, and then back in the command prompt, execute the file by running the following command:

<span style="font-family: Times New Roman">t2 run CreateDeviceIdentity.js</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM5.png" />

Once the command finishes executing, go back to the Azure portal and refresh the properties blade for the IoT Hub. You'll notice a new entry for the Tessel2.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM6.png" />

At this point we can modify the climate code used in the first blog post to send the temperature data to Azure. However, instead of modifying that code, create a new file in Visual Studio Code and type in the following. The code below uses the same code as in the first blog post to get the temperature data from the Tessel, but modifies it slightly to send the temperature information to Azure IoT Hub. As you did earlier, you'll need to replace the <em>&lt;connectionstring&gt;</em> with the actual IoT Hub connection string. The code below also formats the temperate data into JSON, and also sends the data to the screen as well as sends it to Azure IoT Hub.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM7.png" />
<p style="background: navy"><span style="color: white;font-family: Verdana;font-size: 10pt"><strong>Code Snippet
</strong></span></p>
<p style="background: white"><span style="color: blue;font-family: Consolas;font-size: 10pt">var<span style="color: black"> https = require(<span style="color: #a31515">'https'<span style="color: black">);<span style="color: blue">
var<span style="color: black"> crypto = require(<span style="color: #a31515">'crypto'<span style="color: black">);<span style="color: blue">
var<span style="color: black"> tessel = require(<span style="color: #a31515">'tessel'<span style="color: black">);<span style="color: blue">
var<span style="color: black"> climatelib = require(<span style="color: #a31515">'climate-si7020'<span style="color: black">);<span style="color: blue">
<span style="color: green">//var moment = require('moment');<span style="color: blue">
var<span style="color: black"> climate = climatelib.use(tessel.port[<span style="color: #a31515">'A'<span style="color: black">]);<span style="color: blue"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
<span style="color: black">climate.on(<span style="color: #a31515">'ready'<span style="color: black">, <span style="color: blue">function<span style="color: black"> () {<span style="color: blue">
<span style="color: black">  console.log(<span style="color: #a31515">'Connected to si7020'<span style="color: black">);<span style="color: blue">
<span style="color: black">});<span style="color: blue"></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: #a31515">'use strict'<span style="color: black">;<span style="color: blue"></span></span></span>

var<span style="color: black"> ClientFromConnectionString = require(<span style="color: #a31515">'azure-iot-device-amqp'<span style="color: black">).clientFromConnectionString;<span style="color: blue">
var<span style="color: black"> Message = require(<span style="color: #a31515">'azure-iot-device'<span style="color: black">).Message;<span style="color: blue"></span></span></span></span></span></span></span></span>

var<span style="color: black"> date = <span style="color: blue">new<span style="color: black"> Date();<span style="color: blue"></span></span></span></span>

var<span style="color: black"> connectionString = <span style="color: #a31515">'&lt;connectionstring&gt;'<span style="color: black">;<span style="color: blue"></span></span></span></span>

var<span style="color: black"> client = ClientFromConnectionString(connectionString);<span style="color: blue"></span></span>

function<span style="color: black"> printResultFor(op) {<span style="color: blue">
<span style="color: black">  <span style="color: blue">return<span style="color: black">
<span style="color: blue">function<span style="color: black"> printResult(err, res) {<span style="color: blue">
if<span style="color: black"> (err) console.log(op + <span style="color: #a31515">' error: '<span style="color: black"> + err.ToString());<span style="color: blue">
if<span style="color: black"> (res) console.log(op + <span style="color: #a31515">' status: '<span style="color: black"> + res.constructor.name);<span style="color: blue">
<span style="color: black">  };<span style="color: blue">
<span style="color: black">}<span style="color: blue"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

var<span style="color: black"> connectCallback = <span style="color: blue">function<span style="color: black"> (err) {<span style="color: blue">
<span style="color: black">  <span style="color: blue">if<span style="color: black"> (err) {<span style="color: blue">
<span style="color: black">console.log(<span style="color: #a31515">'Could not connect: '<span style="color: black"> + err);<span style="color: blue">
<span style="color: black">  }<span style="color: blue">
<span style="color: black">  <span style="color: blue">else<span style="color: black"> {<span style="color: blue">
<span style="color: black">console.log(<span style="color: #a31515">'Client connected'<span style="color: black">);<span style="color: blue"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: black">setInterval(<span style="color: blue">function<span style="color: black">(){<span style="color: blue">
<span style="color: black">climate.readTemperature(<span style="color: #a31515">'f'<span style="color: black">, <span style="color: blue">function<span style="color: black"> (err, temp) {<span style="color: blue">
<span style="color: black">climate.readHumidity(<span style="color: blue">function<span style="color: black"> (err, humid) {<span style="color: blue">
var<span style="color: black"> data = JSON.stringify({ Device: <span style="color: #a31515">'tessel2'<span style="color: black">, Temp: temp.toFixed(4), Humidity: humid.toFixed(4), Time: date.toString()});<span style="color: blue">
var<span style="color: black"> message = <span style="color: blue">new<span style="color: black"> Message(data);<span style="color: blue">
<span style="color: black">console.log(<span style="color: #a31515">"Sending message: "<span style="color: black"> + message.getData());<span style="color: blue">
<span style="color: black">client.sendEvent(message, printResultFor(<span style="color: #a31515">'send'<span style="color: black">));<span style="color: blue">
<span style="color: black">});<span style="color: blue">
<span style="color: black">});<span style="color: blue">
<span style="color: black">}, 1000)<span style="color: blue">
<span style="color: black">  }<span style="color: blue">
<span style="color: black">};<span style="color: blue"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: black">client.open(connectCallback);<span style="color: blue"></span></span>

<span style="color: black">climate.on(<span style="color: #a31515">'error'<span style="color: black">, <span style="color: blue">function<span style="color: black">(err) {<span style="color: blue">
<span style="color: black">  console.log(<span style="color: #a31515">'error connecting module'<span style="color: black">, err);<span style="color: blue">
<span style="color: black">});<span style="color: blue">
</span></span></span></span></span></span></span></span></span></span></span></span>

Save the file as Climate-IoTHub.js and then back in the command prompt, execute the file by running the following command:

<span style="font-family: Times New Roman">t2 run Climate-IoTHub.js</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/12/121516_1717_Tessel2andM8.png" />

And there you have it, a Tessel 2 sending data to Azure. If you have any question, put them in the comment section.]]></content:encoded>
    </item>
    <item>
      <title>Azure IoT and Arduino – Part1</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/azure-iot-and-arduino-part1</link>
      <pubDate>Tue, 11 Oct 2016 15:56:27 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=195</guid>
      <description><![CDATA[As part of my IoT book, I showed how to use both a Raspberry Pi and Tessel to generate data and send...]]></description>
      <content:encoded><![CDATA[As part of my IoT book, I showed how to use both a Raspberry Pi and Tessel to generate data and send it to Azure for processing. The awesome Tech Reviewers of my book suggested that I also show one other common board simply because the other two boards may not be generally available in some countries. One of the boards they suggested was an Arduino board from Adafruit. Adafruit sells several IoT Starter Kits for Microsoft Azure, including <a href="https://www.adafruit.com/products/3032">this</a> Adafruit Feather HUZZAH board and kit.

Unfortunately, there wasn't time to get the Adafruit example into the chapter for the book, but I did mention in the chapter that I would include the Adafruit example in my blog. Thus, the reason for this post and a few other posts to show how to use an Adafruit board in an Azure IoT scenario.

Like the Tessel blogs, I'll break this up into several posts so there isn't a single massive blog. This post will show how to connect it up to your PC and get it working. The reason for this is that the instructions for doing this on the web is spread out amongst many different web sites (MSDN and Arduino) and so it can take some time to figure it all out. Plus, some of the links on the sites are incorrect and make the setup and configuration confusing. This post will break it all down into a few easy steps. Further blog posts will show how to connect the sensor and send the data to Azure.
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">To get started, you first need to download a couple of items:
</span></p>

<ol>
 	<li>
<div style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Latest Arduino IDE Software <a href="https://www.arduino.cc/en/Main/Software"><span style="color: #337ab7">here</span></a>.
</span></div></li>
 	<li>
<div style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">CP2104 USB driver <a href="https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx"><span style="color: #337ab7">here</span></a>.
</span></div></li>
</ol>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">The USB driver is needed to have the COM/Serial port appear and work properly with the Arduino board, and the Arduino IDE is used to configure the Arduino board as well as to author and deploy code to the board.
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">I don't think it matters when the Arduino needs to be connected, but I installed the software first because it recommends that you restart the PC after installing and configuring everything. Thus, go ahead and install both the Arduino IDE software and the USB driver software. The USB driver install is extremely quick and the Arduino IDE install isn't much longer.
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Once the installs complete, launch the Arduino IDE program because you need to select and configure the appropriate board. From the Tools menu, you'll notice that the Adafruit feather HAZZAH ESP8266 board is not listed.
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand1.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Thus, the next step is to install the ESP8266 Board package which includes all the necessary drivers to communicate with the HAZZAH board. So, from the File menu, select Preferences and enter the following URL into the Additional Boards Manager URL box:
</span></p>
<p style="background: white"><a href="http://arduino.esp8266.com/stable/package_esp8266com_index.json"><span style="font-family: Times New Roman">http://arduino.esp8266.com/stable/package_esp8266com_index.json</span></a><span style="color: #333333;font-family: Times New Roman">
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand2.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt"><em>
</em></span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Click OK on the Preferences dialog, then from the Tools menu, select Board -&gt; Boards Manager
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand3.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">In the Boards Manager dialog, scroll down to the very bottom of the list and select the esp8266 by ESP8266 Community driver and click Install. The latest version is 2.3.0.
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand4.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Once the installation is complete, close the Boards Manager dialog and then close the Arduino IDE program. At this point I would reboot the PC. Is it necessary? I have no idea but I did it anyway. Plus, one of the web sites says "When you've restarted, …" but it doesn't say what to restart. One can assume, but hey…
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Anyway, once you're restarted whatever you restarted, plug in the HAZZAH to the breadboard then connect the HAZZAH to power via the USB cable.
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand5.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Next, start up the Arduino IDE again and from the Tools menu, select Board: and you'll see the Adafruit HAZZAH ESP8266 listed.
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand6.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">Next, from the Tools menu, you'll need to configure the CPU Frequency, Flash Size, Upload Speed, and Port. For the HAZZAH ESP8266, select 80 MHz for the CPU Frequency, and4M (3M SPIFFS) for the Flash Size. For the Upload speed, I have selected 256000, but it works great with 115200 as well and according to the documentation, 921600 also works but may fail on occasion. I have had great success with 256000. For the Port, select the appropriate port your HUZZAH is plugged in to.
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand7.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">
</span></p>
<p style="background: white"><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">At this point your configuration is all set and it's time to run a test. Back in the Arduino IDE, replace the default code in the Sketch window with the following code, then click the Upload button. The IDE will ask you to save the file. You don't need to, simply click cancel and it will still deploy the code to the Feather HUZZAH (it just won't save the file).
</span></p>
<p style="background: white"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/10/101116_2256_AzureIoTand8.png" /><span style="color: #333333;font-family: Segoe UI;font-size: 10pt">
</span></p>
<span style="color: #333333;font-family: Segoe UI;font-size: 10pt">After several seconds, the blue LED on the feather HUZZAH will start to blink. In Part 2 of this series I will show how to hook up the temperature sensor. </span>]]></content:encoded>
    </item>
    <item>
      <title>Data Exposed: SQL Server 2016 – It’s Just Faster</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/data-exposed-sql-server-2016-its-just-faster</link>
      <pubDate>Tue, 11 Oct 2016 10:01:03 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=95</guid>
      <description><![CDATA[This week's episode of Data Exposed welcomes back Bob Ward and newcomer Bob Dorr to the show. Bob...]]></description>
      <content:encoded><![CDATA[This week's episode of Data Exposed welcomes back Bob Ward and newcomer Bob Dorr to the show. Bob Ward, Principle PM Architect in the SQL Server group, and Bob Dorr, Principle Software Engineer in the SQL Server group, stop by Data Exposed to talk about the great improvements in SQL Server 2016 to allow it to "just run faster" out of the box. A fantastic discussion in this video sheds light on the process the SQL engineering team went through, the different SQL Server internals they looked at, current hardware architecture, and other areas to see where they could improve the design, fix and upgraded things, and also take advantage of newer hardware to significantly improve the native performance of SQL Server 2016. They provide several examples of things the SQL team looked at and changes they made to significantly improve SQL Server 2016. Great discussion with Bob Ward and Bob Door that truly highlights the deep and tremendous work over the last couple of years and how it has also prepared the SQL team for future versions of SQL Server.

<iframe src="https://channel9.msdn.com/Shows/Data-Exposed/SQL-Server-2016-Its-Just-Faster/player" width="560" height="315" allowFullScreen frameBorder="0"></iframe>

You can find a whole series of "It Just Runs Faster" blogs by both Bob's <a href="http://aka.ms/bobsql">here</a>.

View more Data Exposed videos on the Data Exposed Channel 9 page <a href="https://channel9.msdn.com/shows/data-exposed">here</a>.]]></content:encoded>
    </item>
    <item>
      <title>Tessel 2 and Windows 10</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/tessel-2-and-windows-10</link>
      <pubDate>Wed, 28 Sep 2016 13:28:30 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=65</guid>
      <description><![CDATA[I spent many a day earlier this month trying to get the Tessel2 to work with Windows 10. I sifted...]]></description>
      <content:encoded><![CDATA[<p>I spent many a day earlier this month trying to get the Tessel2 to work with Windows 10. I sifted through all of the forum posts and other online information try to sort out the issues and try all the different workarounds and possible solutions regarding the USB drivers and such. Kudos to the Tessel team and others on the forum helping test. After several attempts I was able to successfully able to get my Tessel 2 to work with Windows 10. To prevent you from needed to sift through all the forum posts other docs and you are trying to get the Tessel 2 to work on Windows 10, this blog post will walk through the steps I took to get it to work. A quick disclaimer though, I had an extra laptop laying around so I wiped it and started fresh with a clean install of Windows 10. 
</p><p>To get started, you first need to download a couple of items:
</p><ol><li>Node.js version 4.4.4 from <a href="https://nodejs.org/en/download/releases/">here</a>.
</li><li>Zadig USB driver installation tool from <a href="http://zadig.akeo.ie/">here</a>. 
</li></ol><p>Don't plug in your Tessel yet, but install Node.js and the Zadig USB driver. Next, open a command prompt as Administrator.
</p><p>Next connect your Tessel via the USB. A lot of the forum posts state that you need to hold down the reset button on the Tessel to put it in DFU mode but I did not need to do this and I'll explain why shortly.
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2016/09/092816_2028_Tessel2andW1.png" alt="" />
	</p><p>Once the Tessel is connected, run the Zadig tool and simply accept all the default on the screen and click the Install button. The Zadig application is a simple tool that installs generic USB drivers, including WinUSB. Installing these drivers allows the Tessel to more efficiently communicate over USB.  This process will only take a few seconds.
</p><p>Return to the command prompt and type in the following to install the Tessel client:
</p><p><span style="font-family:Times New Roman">npm i -g t2-cli
</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2016/09/092816_2028_Tessel2andW2.png" alt="" />
	</p><p>Once the client drivers are installed, type in the following command to list your Tessel:
</p><p><span style="font-family:Times New Roman">t2 list</span>
	</p><p>You should see your Tessel listed along with any others connected to the same network. Next, you need to authorize your Tessel so you can push code to the Tessel and run the code. Thus, type in and run the following command: 
</p><p><span style="font-family:Times New Roman">t2 provision</span>
	</p><p><img src="https://msdnshared.blob.core.windows.net/media/2016/09/092816_2028_Tessel2andW3.png" alt="" />
	</p><p>At this point you are up and running. You can test your Tessel by running the Blinky example <a href="http://tessel.github.io/t2-start/blinky.html">here</a>. A fun sensor to test is the <a href="http://tessel.github.io/t2-start/modules/climate.html">climate</a> sensor or any of the other Tessel sensors.
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2016/09/092816_2028_Tessel2andW4.png" alt="" />
	</p><p>As a closing note, you may need a few extra steps if you aren't installing on a clean Windows 10 machine. You may need to download and unzip <a href="https://gist.github.com/tcr/992978a5dbe5bff2e18f495c5c0973c3">this</a> zip file, unplug your Tessel, run node driver-clean.js from the zip file, then plug in your Tessel and run run Zadig and the rest of the steps. From the majority of the posts I have read, Tessel works best with Node v4.4.4. Let me know if you have any questions and we'll try and get you up and running. <span style="font-family:Wingdings">J</span>
	</p><p>Again, thank you to all the fine folks at Tessel and on the forums who were the real workhorses on this!
</p><p>
 </p>]]></content:encoded>
    </item>
    <item>
      <title>Hello world!</title>
      <link>https://docs.microsoft.com/archive/blogs/sqlscott/hello-world</link>
      <pubDate>Sat, 03 Sep 2016 10:54:14 GMT</pubDate>
      <dc:creator><![CDATA[Scott Klein [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/sqlscott/?p=1</guid>
      <description><![CDATA[Welcome to Developer Network. This is your first post. Edit or delete it, then start blogging!]]></description>
      <content:encoded><![CDATA[Welcome to <a href="http://blogs.msdn.microsoft.com/">Developer Network</a>. This is your first post. Edit or delete it, then start blogging!]]></content:encoded>
    </item>
  </channel>
</rss>