- Download and install the Azure Storage Emulator
- Start the emulator from the Start Menu
- Add
127.0.0.1 protocol-gateway.contoso.com
to your windows hosts file:C:\Windows\System32\drivers\etc\hosts
git clone https://github.com/Azure/azure-iot-protocol-gateway
- Right Click Visual Studio and select
Run As Administrator
- Open the Protocol Gateway Solution
- Modify the VS Solution
host\ProtocolGateway.Host.Console\appSettings.config.user
file with your IoT Hub Connection String - Run the Solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Lights Off (No Motion) | |
description: Turn off lights when multiple motion sensors are nolonger occupied | |
domain: automation | |
input: | |
motion_sensors: | |
name: Motion Sensors | |
description: The pair of sensors that will control the light | |
selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM buildpack-deps:jessie-scm | |
# Install .NET CLI dependencies | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
libc6 \ | |
libcurl3 \ | |
libgcc1 \ | |
libgssapi-krb5-2 \ | |
libicu52 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
# ENV vars for setup | |
ENV IoTHubName {iot_hub_name} | |
ENV IoTHubSuffix azure-devices.net | |
ENV device1 {device1_name} | |
ENV device1key {device1_key} | |
ENV device2 {device2_name} | |
ENV device2key {device2_key} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM resin/raspberrypi3-node | |
ENV INITSYSTEM=on | |
# Update image | |
RUN apt-get update | |
RUN apt-get install curl build-essential libcurl4-openssl-dev git cmake pkg-config libssl-dev uuid-dev valgrind jq libglib2.0-dev libtool autoconf autogen vim | |
# Checkout code | |
WORKDIR /usr/src/app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connectCallback = function (err) { | |
if (err) { | |
logCommand('Could not connect: ' + err); | |
completed(log); | |
} else { | |
logCommand('Client connected'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
Cast (DataTimestamp as datetime) as datetimestamp, | |
device_type, | |
(Cast(address_30002 AS float) / 65535 * 100) as cnt | |
INTO | |
[power-bi] | |
FROM | |
[iot-hub] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load up the visucal c envirionment varaibles for use in the build, and call the SDKs build script | |
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64_x86 | |
.\tools\build.cmd --skip-unittests | |
# with the build complete, restore our environment variables | |
Restore-Environment $env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
location.Latitude, | |
location.Longitude, | |
windSpeed, | |
deviceId, | |
obsTime | |
INTO | |
[powerbi-out] | |
FROM | |
[decompshred-in] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<string> Compress(this IEnumerable<string> stream) | |
{ | |
foreach (var message in stream) | |
{ | |
// this string compression code is lifted & modified from | |
// http://madskristensen.net/post/Compress-and-decompress-strings-in-C | |
var buffer = Encoding.UTF8.GetBytes(message); | |
var ms = new MemoryStream(); | |
using (var zip = new GZipStream(ms, CompressionMode.Compress, true)) | |
{ |
NewerOlder