├── HOL └── IOTHubPiHackathon │ ├── 1 │ └── README.md │ ├── 2 │ └── README.md │ ├── 3 │ ├── Advanced.md │ ├── README.md │ └── install_node_and_iot_explorer.md │ ├── .gitignore │ ├── 2b │ └── Readme.md │ ├── AzureFunction │ ├── AzureFunction.txt │ ├── README.md │ └── function.proj │ ├── AzureToolBar2.JPG │ ├── BlobStorage │ └── README.MD │ ├── Cleanup │ └── README.md │ ├── IoTHOL-LabParameters - old.xlsx │ ├── IoTHOL-LabParameters.xlsx │ ├── NodeExample.js │ ├── OptionalLabs │ └── IoTHubCreation.md │ ├── PowerBIYourDataset.PNG │ ├── Prep │ ├── Images │ │ ├── ConfirmInstall.jpg │ │ ├── EnableSSH.jpg │ │ ├── Interface.jpg │ │ ├── NOOBS_Install.jpg │ │ ├── SelectSSH.jpg │ │ └── SenseHat.jpg │ └── README.md │ ├── PythonSDK │ └── README.MD │ ├── README-back.md │ ├── README.md │ ├── SenseHat_IoTHub_Http.py │ ├── SenseHat_IoTHub_Http_C2D_LED.py │ ├── SenseHat_IoTHub_Http_Lab.py │ ├── SenseHat_IoTHub_Http_Lab_Key.py │ ├── StreamAnalytics │ └── README.md │ ├── images │ ├── ASANewInput.jpg │ ├── ASAQuery.jpg │ ├── ASAQueryBlob.jpg │ ├── AddNewCustomDevice.jpg │ ├── AppService1.jpg │ ├── AppService2.jpg │ ├── AzureNewButton.jpg │ ├── AzureNotification.jpg │ ├── AzureToolBar.JPG │ ├── BingMapsSearch.jpg │ ├── BlobIoTData.JPG │ ├── BlobIoTDataDownload.JPG │ ├── BlobStorage.JPG │ ├── BrowseToWebApp.jpg │ ├── ChangeVersion.jpg │ ├── ChangeVersion2.jpg │ ├── ChooseEventHub.jpg │ ├── CommandPrompt.jpg │ ├── ConnectionString.jpg │ ├── CreateAResource.JPG │ ├── CreateAResource.jpg │ ├── CreateBingMapsAPI.jpg │ ├── CreateBingMapsAPI2.jpg │ ├── CreateDevice.png │ ├── CreateEHTrigger.jpg │ ├── CreateFunction.jpg │ ├── CreateFunction1.jpg │ ├── CreateFunction2.jpg │ ├── CreateFunction3.jpg │ ├── CreateFunction4.jpg │ ├── CreateIoTHubBasics.PNG │ ├── CreateIoTHubBasics2.PNG │ ├── CreateIoTHubBasics3.PNG │ ├── CreatePowerBIReport.jpg │ ├── CreateReport.png │ ├── CreateSAS.jpg │ ├── CustomDeviceParams.jpg │ ├── CustomFunction.JPG │ ├── DeletePCS.jpg │ ├── DeviceExplorer-Connect.jpg │ ├── DeviceExplorer-ReceiveData.jpg │ ├── DeviceExplorer-ReceiveEvents.jpg │ ├── DeviceExplorer.JPG │ ├── EHCompatibleEP.jpg │ ├── EHConnectionString.jpg │ ├── EHTrigger.jpg │ ├── EHconnection.jpg │ ├── EHendpointValues.jpg │ ├── Fields.jpg │ ├── FunctionConfigConncetion.PNG │ ├── FunctionEHEndpoint.PNG │ ├── FunctionIOTHubFunctions.PNG │ ├── FunctionInPortal.PNG │ ├── FunctionIoTHubEventHub.PNG │ ├── FunctionIoTHubNewConncetion.PNG │ ├── FunctionMoreTemplates.PNG │ ├── FunctionNewFunction.PNG │ ├── FunctionUploadProj.PNG │ ├── FunctionsConnectionString.jpg │ ├── FunctionsV2AddFunctionFile.PNG │ ├── FunctionsV2GetStarted.PNG │ ├── FunctionsV2MoreTemplates.PNG │ ├── FunctionsV2RunFunction.PNG │ ├── FunctionsV2SaveProj.PNG │ ├── FunctionsV2ViewFiles.PNG │ ├── IoTHubConnectionString.jpg │ ├── IoTHubExplorerGet.JPG │ ├── IoTHubExplorerLogin.JPG │ ├── IoTHubExplorerMonitor.JPG │ ├── IoTHubExplorerSend.JPG │ ├── IoTHubKeys1.jpg │ ├── IoTHubKeys2.jpg │ ├── IoTHubParams.JPG │ ├── IoTHubTrigger.jpg │ ├── IotHubConnection.jpg │ ├── ListFiles.jpg │ ├── MonitorDevice.PNG │ ├── NewFunction.jpg │ ├── NewFunction1.jpg │ ├── NewRMPCS.png │ ├── NewStorageAccount.jpg │ ├── NewStorageAccount1.jpg │ ├── Notifications.JPG │ ├── OpenSettingsInWebApp.jpg │ ├── OpenWebApp.jpg │ ├── Pin.jpg │ ├── PowerBIAddStreamingDataset.PNG │ ├── PowerBILab.jpg │ ├── PowerBINameDashboard.jpg │ ├── PowerBINewDashboard.PNG │ ├── PowerBINewTile.PNG │ ├── PowerBIRealTimeData.PNG │ ├── PowerBITileConfig.PNG │ ├── PowerBITileDetails.PNG │ ├── PowerBIYourDataset.PNG │ ├── ProvisioningState.jpg │ ├── ProvisioningState2.jpg │ ├── PuTTY.jpg │ ├── QueryKey1.jpg │ ├── QueryKey2.jpg │ ├── RMDashboard.jpg │ ├── RMDashboardwArrow.jpg │ ├── RMPCS.jpg │ ├── RMPCS2.jpg │ ├── RMSignIn.jpg │ ├── RemoteMonitoringTryNow.PNG │ ├── ResourceGroupForIoTHub.JPG │ ├── SABlobOutput.jpg │ ├── Select.jpg │ ├── SelectASAOutputBlob.jpg │ ├── SelectLineChart.jpg │ ├── SendMsg-DvcExplorer.jpg │ ├── SenseMsgDisplay.jpg │ ├── SolutionReady.jpg │ ├── SolutionReady2.jpg │ ├── StopSimulatedDeviceData.jpg │ ├── StreamAnalyticsBlob.JPG │ ├── ValidAccelerators.jpg │ ├── Visualizations.jpg │ ├── addInput1.jpg │ ├── addOutput.jpg │ ├── addProject.jpg │ ├── authorizePBI.jpg │ ├── clickASA1.jpg │ ├── clickASA2.jpg │ ├── clickASABlob.jpg │ ├── consumerGroups.jpg │ ├── createNewFunction.jpg │ ├── enableVNC.jpg │ ├── eventHubTrigger.jpg │ ├── functionConnection.jpg │ ├── functionViews.jpg │ ├── functionsTicket.jpg │ ├── menu.jpg │ ├── newASA.jpg │ ├── newASA1.jpg │ ├── newASA3.jpg │ ├── newASA4.jpg │ ├── newDevice.jpg │ ├── newFunction1.jpg │ ├── pauseSimulatedDevices.jpg │ ├── permissions.jpg │ ├── powerBIOutput.jpg │ ├── powerBIOutput2.jpg │ ├── projectSave.jpg │ ├── reduceAppService.jpg │ ├── reduceIoTHub.jpg │ ├── reduceStorage.jpg │ ├── runC2D.jpg │ ├── runFunction.jpg │ ├── selectIoTHub.jpg │ ├── selectRMS.png │ ├── startASA.jpg │ ├── startASA2.jpg │ ├── twinTag1.jpg │ ├── twinTag2.jpg │ └── wifi.JPG │ └── sample_payload.json ├── LICENSE.txt ├── README.md └── SECURITY.md /HOL/IOTHubPiHackathon/.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /SenseHatEmulator_IoTHub_TM.py 6 | /cpfrompi.bat 7 | /cptopi.bat 8 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/1/README.md: -------------------------------------------------------------------------------- 1 | ## Hands on Lab - Initial Setup 2 | 3 | These steps will be performed in the morning before the workshop starts. You will need to walk through each of the following steps to make sure that you can connect your Raspberry Pi to the local WiFi as well as ensure the requisite tools are installed and enabled. 4 | 5 | 1. Turn on your Raspberry Pi and connect to Wifi. 6 | - Connect your Raspberry Pi to a monitor. 7 | - Click on the wifi icon in the top right. 8 |

9 | 10 |

11 | - Enter the correct wifi credentials 12 | 2. Retrieve the IP address. 13 | - Click on the command prompt 14 |

15 | 16 |

17 | - Retrieve the IP address with the following command: `ifconfig`
18 | Take note of the IP address and use the following [template](/HOL/IOTHubPiHackathon/IoTHOL-LabParameters.xlsx) to track the configuration details that you will collect over the course of the lab. 19 | 3. If you didn't enable SSH on your Raspberry Pi previously, follow the steps in the [Pre-lab Steps instructions](/HOL/IOTHubPiHackathon/Prep).

20 | 4. If using a laptop, connect to your Raspberry Pi using your laptop to verify the connection. 21 | - Open PuTTY. 22 | - Enter the IP address of your Raspberry Pi into the *Host Name (or IP address)* field. 23 |

24 | 25 |

26 | - If you get prompted to accept a security certificate, click "Yes". 27 | 5. Disconnect from the monitor. 28 | 29 | 30 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 31 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/2/README.md: -------------------------------------------------------------------------------- 1 | In the following section of the Hands on Lab, you will walk through the creation of a remote monitoring solution accelerator from the Azure IoT Solutions Accelerator microsite. 2 | The Remote Monitoring solution accelerator implements an end-to-end monitoring solution for multiple machines in remote locations. The solution combines key Azure services to provide a generic implementation of the business scenario. You can use the solution as a starting point for your own implementation and customize it to meet your own specific business requirements. It includes and by default will provision simulated devices such as trucks, chillers, elevators, engines and others. 3 | 4 | ## Create a Remote Monitoring Solution Accelerator 5 | 1. Setup your Azure IoT Suite remote monitoring solution accelerator. You will use this solution accelerator for the duration of the labs to help with visualization of the data and other IoT functions. 6 | - Go to the Microsoft IoT Solution Accelerators microsite [https://www.azureiotsolutions.com/](https://www.azureiotsolutions.com/). 7 | - Log in using your Azure subscription credentials. 8 | - Click on the "Remote Monitoring Solution" Accelerator. 9 | ![remote monitoring](/HOL/IOTHubPiHackathon/images/selectRMS.png) 10 | - Click on "Try Now" 11 | ![remote monitoring try now](/HOL/IOTHubPiHackathon/images/RemoteMonitoringTryNow.PNG) 12 | - Fill out the form to create a Remote monitoring solution 13 | - Enter a name for your remote monitoring solution eg. IoTHandsOnLab-VinnyH. Note that the solution name needs to be globally unique. Once you provide a unique name, a green checkmark will appear to indicate that the solution name is valid. 14 | - Choose the subscription that you will be using eg. Visual Studio Enterprise with MSDN 15 | - Select the closest region to deploy your remote monitoring solution eg. Canada Central 16 | - Choose the Deployment option you want - either C# or Java 17 | - Click "Create". The remote monitoring solution will get provisioned to your Azure subscription in approximately 25 minutes. 18 |

19 | 20 |

21 | - Take note of the list of resources that get provisioned as part of the process. At the time of writing this document, the following Azure services get created in the Azure subscription that you specified (and therefore will incur some cost): 22 | - 1 Azure Active Directory application 23 | - 1 Virtual Machine (Standard D1 V2 (1 core, 3.5 GB memory)) 24 | - 1 IoT Hub (S1 - Basic tier) 25 | - 1 Cosmos DB Account (Standard) 26 | - 1 Storage account (Standard-GRS) 27 | - 1 Web Application 28 | - 1 Azure Maps account (Standard) 29 | - 1 Azure Stream Analytics (3 streaming units) 30 | 31 | - While the remote monitoring solution is being provisioned, you can see the provisioning state and logging information by clicking on the solution 32 |

33 | 34 |

35 | - Once the solution is fully created, it will appear in your list of provisioned solutions showing the "Ready" indicator with a green checkmark or your provisiong status page will show a . It will take about 25 minutes to provision so while you wait for that, feel free to go for a coffee or click on the "Azure activity log" to see the logs that are written during the provisioning process. 36 | 37 | When the provisioning is complete, you will see one of the two following screens: 38 |

39 | 40 |

41 |
42 | OR 43 |
44 |

45 | 46 |

47 | 48 | ## Obtain Your IoT Hub Primary Key Connection String 49 | 50 | 1. Open the [Azure Portal](https://portal.azure.com/) tab and navigate to your IoT Hub service that you deployed as part of the remote monitoring solution 51 | - Click the *resource group* icon -> click the name of your remote monitoring solution -> click the IoT Hub service that was created when you provisioned the remote monitoring solution. 52 |

53 | 54 |

55 | 2. Obtain the "Connection string - primary key" for your IoT Hub.
56 | This is the shared access key that you will use to connect your device to the IoT Hub. Note that since we are using the iothubowner policy, we will be using the policy that provides the device with all permissions - registryWrite, ServiceConnect and DeviceConnect. We do this to simplify the labs but in practice, you should only give your services access to the appropriate permissions. For example, if you are connecting a backend service that will be used to write to the IoT Hub register, you should only grant that particular service the "registryWrite" permission. Details on the permissions are available [here](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security#iot-hub-permissions). 57 | Also, note that this is the primary key used by back end services to connect to the IoT Hub. Later in the labs, you will also be using a connection string that is used for individual devices to connect to IoT Hub. Make sure to note the difference. 58 | - Click on the "Shared access policies". 59 | - Click on the "iothubowner" policy. 60 | - Copy the primary key connection string. Take note of the primary key connection string as you will use it later. To make things easier to capture, you can use the following template to capture all the required variables that you will use throughout this lab: [IoT HOL - Lab Parameters.xlsx](/HOL/IOTHubPiHackathon/IoTHOL-LabParameters.xlsx) 61 |

62 | 63 |

64 | 65 | ## Create Consumer Groups 66 | Consumer groups are a key element in Azure event ingestion services that allow consuming applications with a separate view of the event stream. Each consuming application can use the groups to read the streaming data independently at their own pace and with their own offet. For this section of the lab, you will create two new consumer groups that will be used by Azure Stream Analytics as well as the Azure CLI command tool to monitor IoT Hub events. You will create these in advance but won't use them until later in this lab. 67 | 1. Under the "Messaging" subsection, select "Endpoints" 68 | 2. Click on the "Events" endpoint 69 | 3. In the blade that appears on the right, add the following consumer groups. If multiple people are connecting to the same IoT Hub, append your initials to each of the consumer group names so that each person gets their own consumer groups. 70 | - "monitor" 71 | - "asa" 72 | 4. Click save in the top left hand corner of the blade. 73 |

74 | 75 |

76 | 77 | ## Create Your Device in the Remote Monitoring Solution Accelerator 78 | 1. Go back to the Azure IoT Solution Accelerators microsite tab. Click the "Launch" button on the newly provisioned remote monitoring solution. This will open up a new browser tab to your remote monitoring solution dashboard. 79 |

80 | 81 |

82 | 2. If the following permissions page showsup, click "Accept". 83 |

84 | 85 |

86 | 3. Click the "Sign In" button and provide your corporate credentials if it's requested. 87 |

88 | 89 |

90 | 4. You will now have access to your created remote monitoring solution accelerator. Feel free to browse around and review the features available in the solution accelerator. More information on how to navigate and use the features of the remote monitoring solution accelerator are here: https://docs.microsoft.com/en-ca/azure/iot-accelerators/iot-accelerators-remote-monitoring-monitor 91 |

92 | 93 |

94 | 95 | 5. Create a new custom device within the IoT Solution Accelerator. 96 | - At the top left of the portal in the navigation bar, click the "Devices" button. 97 |

98 | 99 |

100 | - Click the '+ New Device' button in the top right corner 101 | - Under device type, select physical. The custom device that you will add is the physical Raspberry Pi. 102 |

103 | 104 |

105 | - Under Device ID, create a custom Device ID. Enter in a device ID eg. MyRaspberryPi. 106 | 107 | - Leave the Authentication Type as Symmetric Key.
108 | (Note: Communication between IoT devices and the IoT Hub can be secured using two methods. In these labs, we will use SAS based tokens but a higher level of security can be provided through the use of X.509 based certificates. See the following for best practices on securing your [IoT Architecture] (https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-security-deployment). 109 | 110 | - Select Auto Generate Keys under "Authentication Key". 111 | 112 | - Click "Apply". 113 |

114 | 115 |

116 | 117 | - Take note of your Device ID and Connection String, as you will need these later. Feel free to use the parameters template provided earlier. 118 | - Click "Close" 119 | 120 | - As a final step in this part of the lab, you will add a tag that will be used by the app backend to define a property on the device. This tag will be a high temperature limit that will serve as a high temperature threshold that will trigger a message to be sent to your to your physical device later in the lab. 121 | - Click the checkbox of the physical device you created. 122 | - Click the "Jobs" button. 123 |

124 | 125 |

126 | 127 | - Keep the "Tag" radio button selected under the "Select job" header. 128 | - Provide the job a name. eg. SetHighTemp 129 | - Click "+ Add Tag". 130 | 131 | - Add a new parameter "HighTemperatureLimit" under the "KEY" header. Set the value to 40 and make it of data type "Number". 132 | 133 | - Click " Apply ". 134 | 135 |

136 | 137 |

138 | -The job will be submitted and you should see a "job submitted successfully" message. This action will queue up a job in the IoT Hub job queue until the RaspberryPi device that you will setup later connects into the IoT Hub. 139 | 140 | Congratulations! You have successfully spun up your Solution Accelerator and created a new custom device that you will configure in the next section of the labs! 141 | 142 | [Next lab - 3 Connect your Raspberry Pi to IoT Hub](/HOL/IOTHubPiHackathon/3) 143 | 144 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 145 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/2b/Readme.md: -------------------------------------------------------------------------------- 1 | In the following section of the Hands on Lab, you will walk through provisioning an IoT Hub service from the Azure portal. 2 | 3 | ## Create an IoT Hub 4 | 1. Open the [Azure Portal](https://portal.azure.com/). 5 | 1. Click "Create a resource" in the top left of the portal. 6 |

7 | 8 |

9 | 1. Type "IoT Hub" in the search, and choose "IoT Hub" 10 | 1. Click on the "Create" button. 11 | 1. Enter the details for your Hub: 12 | 1. Subscription. Choose a subscription you have permissions to create services in. 13 | 1. Resource group. Choose "Create new", then enter a globally unique name for your resource group. eg. "TMResourceGroup" 14 | 1. Region. Choose a region for your IoT Hub. eg. "West US" 15 | 1. IoT Hub Name. A globally unique name for your IoT Hub. eg. my initials are "TM", so "TMIoTHub" 16 | 17 | ![iot hub basics](/HOL/IOTHubPiHackathon/images/CreateIoTHubBasics.PNG) 18 | 19 | 1. Click "Next: Size and scale >>" 20 | 1. Choose the pricing correct tier. You should be able to complete this lab with a "F1: Free tier" 21 | 22 | ![iot hub basics](/HOL/IOTHubPiHackathon/images/CreateIoTHubBasics2.PNG) 23 | 24 | 1. Choose "Review + create" 25 | 26 | ![iot hub basics](/HOL/IOTHubPiHackathon/images/CreateIoTHubBasics3.PNG) 27 | 28 | 1. Choose "Create" 29 | 30 | 1. Watch the notifications to see when your IoT Hub has been created. (should be less than a minute) 31 | 32 | ## Obtain Your IoT Hub Primary Key and Connection String 33 | 1. Open the [Azure Portal](https://portal.azure.com/) tab and navigate to your IoT Hub service that you provisioned above 34 | - Click the *resource group* icon -> click the name of the resource group you created above -> click the IoT Hub service 35 |

36 | 37 |

38 | 2. Obtain the "Connection string - primary key" for your IoT Hub.
39 | This is the shared access key that you will use to connect your device to the IoT Hub. The key provides the device with all permissions - registryWrite, ServiceConnect and DeviceConnect. Details on the permissions are available [here](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security#iot-hub-permissions) 40 | - Click on the "Shared access policies". 41 | - Click on the "iothubowner" policy. 42 | - Copy the primary key connection string. Take note of the primary key connection string for later. You can use the following template to capture all the required variables for this lab: [IoT HOL - Lab Parameters.xlsx](/HOL/IOTHubPiHackathon/IoTHOL-LabParameters.xlsx) 43 |

44 | 45 |

46 | 47 | ## Create Consumer Groups 48 | Consumer groups are a key element in Azure event ingestion services that allow consuming applications with a separate view of the event stream. Each consuming application can use the groups to read the streaming data independently at their own pace and with their own offet. These consumer groups will be created in advance but will be used later in this lab. 49 | 1. Under the "Settings" section, select "Built-in endpoints" 50 | 1. In the blade that appears on the right, add the following consumer groups. If mulitple people are using the same IoT Hub, append your initials to the consumer group name so that each user gets their own groups. 51 | - "monitor" 52 | - "asa" 53 |

54 | 55 |

56 | 57 | ## Create A Device 58 | 59 | Now we will configure a device in the IoT Hub for your Raspberry Pi. 60 | 1. Under "Explorers", choose "IoT Devices" 61 | 1. Click "+ Add" 62 | 1. Enter the parameters for your device: 63 | 1. Device ID. This is a name for your device. It needs to be unique in the IoT Hub. eg. TMDevice 64 | 1. Authentication Type. Choose "Symmetric Key" 65 | 1. Check "Auto Generate Keys" 66 | 1. Select "Enable" for "Connect Device to IoT Hub" 67 | 1. Do not set a parent Device. 68 | ![create device](/HOL/IOTHubPiHackathon/images/CreateDevice.png) 69 | 1. Click on Save 70 | 71 | Congratulations! You have successfully spun up an IoT Hub and created a new custom device that you will configure in the next section of the labs! 72 | 73 | [Next lab - 3 Connect your Raspberry Pi to IoT Hub](/HOL/IOTHubPiHackathon/3) 74 | 75 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 76 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/3/Advanced.md: -------------------------------------------------------------------------------- 1 | This tutorial will walk you through the steps to send messages via AMQP and MQTT. In the previous labs, we used HTTP/REST which is not ideal for IoT type scenarios as it will has high overhead, will have scale issues and generally isn't as fast. 2 | 3 | 1. Compiling requires more memory. Increase the swap space to 500 MB. 4 | - Edit this file: /etc/dphys-swapfile 5 | - Change swap file sile to 500. eg. CONF_SWAPSIZE=500 6 | - Stop the swapfile: /etc/init.d/dphys-swapfile stop 7 | - Start the swapfile: /etc/init.d/dphys-swapfile start 8 | 1. Clone the repository: git clone --recursive https://github.com/Azure/azure-iot-sdk-python.git 9 | 1. Compile by following these commands: 10 | 11 | - sudo apt-get update
12 | - sudo apt-get install -y git cmake build-essential curl libcurl4-openssl-dev libssl-dev uuid-dev
13 | - cmake --version
14 | - cd
15 | - cd azure-iot-sdk-python/build_all/linux
16 | - ./setup.sh
17 | - ./build.sh
18 | 19 | 1. Add connection string to the simple sample: 20 | 21 | - cd ../../device/samples
22 | - Edit iothub_client_sample.py, add connection string
23 | - python iothub_client_sample.py

24 | 25 | Reference: https://github.com/Azure/azure-iot-sdk-python 26 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/3/README.md: -------------------------------------------------------------------------------- 1 | ## Connect Your Raspberry Pi to the IoT Hub 2 | 3 | In this lab, you will configure your Raspberry Pi to connect to the IoT solution that you created earlier. You will create a small application (a python script) and run it on your Raspberry Pi to send a D2C (Device to Cloud) message to the IoT Hub and you will also modify the script so that the application can be used to receive a C2D (Cloud to Device) message. The C2D message that gets received will be displayed on the Sense HAT or the Sense HAT emulator LED display. The python script is a sample that will interact with the Sense HAT to collect telemetry data (temperature, humidity, pitch, yaw, roll) from the device. It will also contain code that will securely connect the Raspberry Pi to Azure IoT Hub and allow bidirectional communication to it. 4 | 5 | 1. Configure the Raspberry Pi to send messages to the IoT Hub. 6 | - Copy the [Python code](/HOL/IOTHubPiHackathon/SenseHat_IoTHub_Http_Lab_Key.py) from these lab instructions to a text editor (eg. Notepad) on your laptop or to the RaspberryPi text editor directly. Save the file as ```SenseHat_IoTHub_Http_Lab_Key.py```. 7 | - Alternatively, you can download the file directly to your Raspberry Pi using: ```git clone https://github.com/Microsoft/IIoT.git``` and edit the ```SenseHat_IoTHub_Http_Lab_Key.py``` using a text editor (eg. Nano) on your Raspberry Pi. 8 | - Comment/uncomment the *import* statements that correspond to whether you are using a Sense HAT or the Sense Hat emulator. 9 | Below the import statements, you will see: 10 | 11 | ``` from sense_hat import SenseHat #if using a physical SenseHat attached to Raspi```
12 | ``` #from sense_emu import SenseHat #if using a Sense HAT Emulator (Linux only) ``` 13 | 14 | - if you are using the physical Sense HAT, uncomment the *from sense_hat* statement and comment the *from sense_emu* statement. To comment a statement, use the '#' character in front of the text that you are trying to comment. To uncomment, remove the '#' character. 15 | - if using the Sense HAT emulator, comment the *from sense_hat* and uncomment the *from sense_emu* statement 16 | 17 | - Next, you will provide the information required to connect your device - the Raspberry Pi to your provisioned IoT Hub: 18 | - Update the file with the primary key connection string. Look for ```connectionString = ''``` and paste in the IoT Hub "Connection string - primary key" you noted earlier. (Azure Portal -> IoT Hub -> Shared access policies -> iothubowner -> Connection string-primary key).
19 | Note: you will be using the **IoT Hub** primary key connection string and not the device connection string. 20 | - Search for ```deviceId = ''``` and paste in the Device ID you created earlier. 21 | - If you are editing the file on a laptop and not on the Raspberrry PI, copy ```SenseHat_IoTHub_Http_Lab_Key.py``` to your Raspberry Pi using pscp (or some other secure client to copy files). 22 | - If you installed PuTTY using the default settings, the PuTTY environment variables should be set in your PATH already and you should be able to run psp from any path. Otherwise, the pscp executable will be in your PuTTY directory.
23 | 24 | Open up a command prompt on **your local machine/laptop** and enter the following command to copy the python script to your Raspberry Pi. If you didn't change the username/password on the raspberry pi, it should be ***pi/raspberry***
25 | 26 | `pscp SenseHat_IoTHub_Http_Lab_Key.py @:/<$path>/SenseHat_IoTHub_Http_Lab_Key.py` 27 | 28 | (replace the \ text with your Raspberry Pi Username. The default username on Raspbian is "pi")
29 | (replace \ with the Raspbery Pi's IP address)
30 | (for the \<$path\>, use */home/pi*)
31 | 32 | As an example, if your RaspberryPi has an IP of 192.168.1.1, the command you will run is: 33 | 'pscp SenseHat_IoTHub_Http_Lab_Key.py pi@192.168.1.1:/home/pi' 34 | 35 | - Log into the Raspberry Pi using PuTTY. 36 | - Verify that the file was transfered by listing the directory: `ls -l` 37 | 38 | ![ls -l](/HOL/IOTHubPiHackathon/images/ListFiles.jpg) 39 | 40 | 2. Now, lets send messages from the Raspberry Pi to the IoT Hub. 41 | - If you are using the Sense HAT Emulator, start it now (Open a VNC session to the Raspberry Pi: Start -> Programming -> Sense HAT emulator). The Python script will error out if the Emulator is not running. 42 | - Start sending messages by invoking the Python script on the Pi
43 | ``` 44 | pi@raspberrypi:~ $ python SenseHat_IoTHub_Http_Lab_Key.py 45 | ``` 46 | 47 | - Next use the az CLI to look at the messages coming into the IoT Hub. Click on the "Cloud Shell" button on the menu bar across the top of the [Azure Portal](http://portal.azure.com) in your browser. Enter the following command with your iot hub name and device id. If the system requires you to login, enter ```az login```. 48 | 49 | ![Cloud Shell](/HOL/IOTHubPiHackathon/images/AzureToolBar.JPG) 50 | 51 | ```bash 52 | # Will show messages coming in from your device. To see messages coming in from all devices, 53 | # remove the '--device-id' param. We are using the 'monitor' consumer group that we created earlier in this lab 54 | az iot hub monitor-events --hub-name --consumer-group monitor --device-id 55 | ``` 56 |
57 | <iot-hub-name>: name of the IoT Hub that was provisioned as part of the solution accelerator (hint: the hub name should be noted in the template spreadsheet. 58 | 59 | <device-id>: device ID for your Raspberry Pi. 60 |
61 | ![Monitor Device](/HOL/IOTHubPiHackathon/images/MonitorDevice.PNG) 62 | 63 | Note: If you didn't install the Azure IoT CLI extension previously, run the following command: 64 | ``` 65 | az extension add --name azure-cli-iot-ext 66 | ``` 67 | Here are some additional az CLI commands you can try 68 | 69 | ```bash 70 | # Show the details of a device 71 | az iot hub device-identity show --hub-name --device-id 72 | 73 | # List the devices in an IoT Hub 74 | az iot hub device-identity list --hub-name 75 | 76 | # Retrieve the connection string for an individual device. Why would it be better to use a connection string 77 | # for an individual device than one that works for all devices? 78 | az iot hub device-identity show-connection-string --hub-name --device-id 79 | ``` 80 | - To send a message to your Raspberry PI via the IoT Hub, enter the following: 81 | ``` 82 | az iot device c2d-message send --hub-name --device-id --data Hello 83 | ``` 84 | In this step, you are using the az CLI as a backend service to send a message to the IoT hub. IoT hub receives the message, queues it and sends the message down to the device using a C2D (Cloud-to-Device) command. In the Azure functions lab, you will be creating a script that will monitor telemetry values from the Raspberry Pi and any time that a value goes above the set threshold, the function will be used to send a message down to the Pi. 85 | 86 | - On your Sense HAT, you should see the message appear on the display. (If you are using the Sense HAT emulator, you will need to VNC to your Raspberry Pi and open the Sense HAT Emulator application: Menu -> Programming -> Sense HAT Emulator)
87 | If you didn't see the message on your LED display, double check that your Python script is still running. 88 | ![Sense HAT Message Display](/HOL/IOTHubPiHackathon/images/SenseMsgDisplay.jpg) 89 | 90 | 91 | Congratulations! You just connected your Raspberry Pi to the IoT hub and created an application which demonstrated the two-way messaging capabilities. 92 | 112 | 115 | 116 | Finished early? Try this [advanced tutorial](/HOL/IOTHubPiHackathon/3/Advanced.md) 117 | 118 | 119 | [Next lab - 4a Route Telemetry to PowerBI](/HOL/IOTHubPiHackathon/StreamAnalytics) 120 | OR 121 | [Next lab - 4b Route Telemetry to Blob Storage](/HOL/IOTHubPiHackathon/BlobStorage) 122 | 123 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 124 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/3/install_node_and_iot_explorer.md: -------------------------------------------------------------------------------- 1 | # Installing node 2 | 3 | We will leverage an open source application called "Node Version Manager" (NVM), which will allow you to install various versions of Node in differnt OS environments and be able to switch between Node versions. 4 | 5 | 1. Install node in your environment 6 | - go to https://github.com/creationix/nvm#installation and run the install script: 7 | ```curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash``` 8 | - You may need to refresh your .bashrc file environment: 9 | ```source ~/.bashrc``` 10 | 11 | 2. Now you can install a specific version of Node at anytime. At the time of writing this document, 8.11.1 is the latest stable Long Term Support (LTS) release. For example, to install Node 8.11.1 run the following command: 12 | ```nvm install 8.11.1``` 13 | - This will install Node 8.11.1 14 | - If this is your first time running ```nvm install``` it will make ```8.11.1``` your default Node version 15 | ```npm``` is automatically installed along with your desired version of ```node``` 16 | 17 | 3. Now you can install ```iothub-explorer``` globally for your OS 18 | ```npm install -g iothub-explorer``` 19 | 20 | You can now continue [Lab 3](README.md) and use iothub-explorer to view our incoming telemetry and send messages to our device via the IoT Hub. 21 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/AzureFunction/AzureFunction.txt: -------------------------------------------------------------------------------- 1 | #r "../bin/Microsoft.Azure.EventHubs.dll" 2 | #r "Newtonsoft.Json" 3 | 4 | using Microsoft.Azure.Devices; 5 | using Microsoft.Azure.Devices.Shared; 6 | using Newtonsoft.Json; 7 | using System; 8 | using System.Text; 9 | using Microsoft.Azure.EventHubs; 10 | 11 | public class RaspberryPi 12 | { 13 | public string DeviceId; 14 | public double Temperature; 15 | public double ExternalTemperature; 16 | public double Humidity; 17 | public double pitch; 18 | public double yaw; 19 | public double roll; 20 | } 21 | 22 | static ServiceClient serviceClient; 23 | 24 | static RegistryManager registryManager; 25 | 26 | // It is a better to store the connection string in the App Settings 27 | 28 | // for your function and retrieve it with Environment.GetEnvironmentVariable("") 29 | 30 | // The CONNECTION_STRING variable should be in the form: "HostName=handsonlab230c6.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=jXbEZiTfHOfG+rrlFw5CoM47I1TE1mpz/IgKyEu0K/A=" 31 | 32 | private const string CONNECTION_STRING = ""; 33 | 34 | 35 | public static async Task Run(EventData[] events, ILogger log) 36 | { 37 | var exceptions = new List(); 38 | 39 | // Initiate the services used to interact with the IoT Hub 40 | serviceClient = serviceClient ?? ServiceClient.CreateFromConnectionString(CONNECTION_STRING); 41 | registryManager = registryManager ?? RegistryManager.CreateFromConnectionString(CONNECTION_STRING); 42 | 43 | foreach (EventData eventData in events) 44 | { 45 | try 46 | { 47 | string messageBody = Encoding.UTF8.GetString(eventData.Body.Array, eventData.Body.Offset, eventData.Body.Count); 48 | 49 | // Replace these two lines with your processing logic. 50 | log.LogInformation($"C# Event Hub trigger function processed a message: {messageBody}"); 51 | await ProcessMessage(messageBody, log); 52 | } 53 | catch (Exception e) 54 | { 55 | // We need to keep processing the rest of the batch - capture this exception and continue. 56 | // Also, consider capturing details of the message that failed processing so it can be processed again later. 57 | exceptions.Add(e); 58 | } 59 | } 60 | 61 | // Once processing of the batch is complete, if any messages in the batch failed processing throw an exception so that there is a record of the failure. 62 | 63 | if (exceptions.Count > 1) 64 | throw new AggregateException(exceptions); 65 | 66 | if (exceptions.Count == 1) 67 | throw exceptions.Single(); 68 | } 69 | 70 | private async static Task ProcessMessage(string myIoTHubMessage, ILogger log) 71 | { 72 | //Retrieve IoT Hub Messages 73 | 74 | var raspberryPi = new RaspberryPi(); 75 | 76 | try 77 | { 78 | //(This line is what it’s all about. Take the Message that trigger this function and load it into our object by deserializing it.) 79 | raspberryPi = Newtonsoft.Json.JsonConvert.DeserializeObject(myIoTHubMessage); 80 | } 81 | catch (Exception ex) 82 | { 83 | log.LogInformation($"Error deserializing: {ex.Message}"); 84 | 85 | return; 86 | } 87 | 88 | // Retrieve the digital twin from the IoT Hub. 89 | 90 | Twin twin = await registryManager.GetTwinAsync(raspberryPi.DeviceId); 91 | 92 | if (twin != null) 93 | { 94 | log.LogInformation("Twin Properties:"); 95 | 96 | log.LogInformation(twin.Properties.Desired.ToJson()); 97 | 98 | log.LogInformation(twin.Properties.Reported.ToJson()); 99 | 100 | log.LogInformation(twin.Tags.ToJson()); 101 | 102 | } 103 | else 104 | { 105 | log.LogInformation("Twin not retrieved"); 106 | } 107 | 108 | double highTemperatureLimit = 40; 109 | 110 | if (twin.Tags.Contains("HighTemperatureLimit")) 111 | { 112 | highTemperatureLimit = twin.Tags["HighTemperatureLimit"]; 113 | } 114 | 115 | var temperatureStatus = "Normal"; 116 | 117 | if (twin.Tags.Contains("TemperatureStatus")) 118 | { 119 | temperatureStatus = twin.Tags["TemperatureStatus"]; 120 | } 121 | 122 | if (raspberryPi.Temperature >= highTemperatureLimit && temperatureStatus != "High") 123 | { 124 | log.LogInformation("Changing status to Hot"); 125 | 126 | await SendCloudToDeviceMessageAsync(raspberryPi.DeviceId, "High"); 127 | 128 | await AddTag(twin, "High"); 129 | } 130 | else if (raspberryPi.Temperature < highTemperatureLimit && temperatureStatus != "Normal") 131 | { 132 | log.LogInformation("Changing status to Normal"); 133 | 134 | await SendCloudToDeviceMessageAsync(raspberryPi.DeviceId, "Normal"); 135 | 136 | await AddTag(twin, "Normal"); 137 | } 138 | } 139 | 140 | /// 141 | /// Sends a message to the device via a method. If the device is not active an error occurs. 142 | /// 143 | /// The device identifier 144 | /// Text to send to the device 145 | /// 146 | private async static Task SendCloudToDeviceMessageAsync(string deviceId, string message) 147 | { 148 | var commandMessage = new Message(Encoding.ASCII.GetBytes(message)); 149 | 150 | await serviceClient.SendAsync(deviceId, commandMessage); 151 | } 152 | 153 | /// 154 | /// Updates the device registry "TemperatureStatus" tag 155 | /// 156 | /// The devices twin 157 | /// The new status 158 | /// 159 | 160 | public static async Task AddTag(Twin twin, string status) 161 | { 162 | string patch = 163 | @"{{ 164 | tags: {{ 165 | TemperatureStatus: ""{0}"" 166 | }} 167 | }}"; 168 | 169 | patch = string.Format(patch, status); 170 | 171 | await registryManager.UpdateTwinAsync(twin.DeviceId, patch, twin.ETag); 172 | } 173 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/AzureFunction/README.md: -------------------------------------------------------------------------------- 1 | ## Azure Functions Lab 2 | 3 | In this part of the lab, you will create an Azure function that will be used to programmatically send data back to the Raspberry Pi. The Azure function that you will create will be triggered by events that arrive at the IoT Hub. If the status of the Raspberry Pi is normal and the newly reported temperature goes above the set threshold, the status of Sense HAT will be set to high. If the status is at high and the temperature goes below the threshold, the status will be reset to normal. These state changes will be sent back to the Raspberry Pi through a Cloud to Device (C2D) message and the status message will be displayed on the Sense HAT LED display. 4 | Note that if your are using the Sense HAT emulator, the text that shows up across the emulated LED display may be faint and may show up quickly. Keep an eye on the LED display so you can see the message appear. 5 | 6 | ### Create a Function 7 | 8 | In the next part of this lab, you will be creating a C# Azure Function that will get triggered whenever the IoT hub service receives a new event. 9 | For ease of getting through the lab, we have provided the code that you will need to write the function. When triggered, the code in the function will compare the new event value to the set threshold. The threshold value is the tag parameter setting that you previously set to a value of 40. If the value is above or below, the function will send a cloud to device (C2D) message to the RaspberryPi. Note: To be technically correct, the function actually gets triggered when the event hub compatible endpoint within the IoT Hub service receives an event. IoT Hub service is built with the event hub service running under the covers. 10 | 1. Navigate to the Azure portal: https://portal.azure.com 11 | 2. Click the ‘+’ sign and type in “function app” 12 |

13 | 14 |

15 | 3. Click the “Create” button
16 |

17 | 18 |

19 | 20 | 4. Fill out the required values to create a function
21 | - Provide the function app a name (eg. functionC2DHoL) 22 | - Select your Azure subscription 23 | - Select your existing subscription that you are using for the hands on lab 24 | - Select "Windows" for the OS 25 | - For hosting plan, select “consumption plan” 26 | - For location, choose the closest data centre (eg. East US) 27 | - For Runtime stack, choose ".NET" 28 | - For storage, select “create new” and provide a name for the storage 29 | - You can leave Application Insights turned off 30 | - Click “Create”
31 |

32 | 33 |

34 | 5. Once the Function app is created, click the function (the function icon is the one in the shape of a lightning bolt) 35 | 6. Click the ‘+’ sign beside the “Functions” node in the hierarchy tree 36 |

37 | 38 |

39 | 7. Click on “In-Portal” then Continue. 40 |

41 | 42 |

43 | 8. Choose "More templates..." then click on "Finish and view templates". 44 |

45 | 46 |

47 | 9. Scroll down and choose the “Azure Event Hub trigger”. 48 |

49 | 50 |

51 | 10. Input all the values to create your new IoT Hub based function. 52 | - Enter a name for your new function in the “Name:” field. eg. MessageTriggerFunction 53 | - click "new" 54 |

55 | 56 |

57 | - In the _Connection_ pop-up, click the "IoT Hub" button and select the IoT Hub that you provisioned. The _Endpoint_ should be "Events (built-in endpoint)". Click "Select" 58 |

59 | 60 |

61 | - You should be brought back to the *New Function* blade and the *Event Hub connection* and *Event hub consumer group* (leave it at *$Default*) fields should be auto-filled. 62 | You will need to type in the *Event Hub name*. The name is a substring of the connection string (see highlighted substring in the screenshot). Paste this value into the *Event Hub name* field and click the "Create" button. 63 |

64 | 65 |

66 | 11. The template for your new Event Hub trigger is now created! 67 | 12. You will now configure the required libraries that will be needed for the new function created. 68 | - Expand the “Logs” view at the bottom of the page 69 | - Click on “View Files” 70 | 71 | ![Expand Function views](/HOL/IOTHubPiHackathon/images/FunctionsV2ViewFiles.PNG) 72 | 73 | - Click on “+ Add” under the "View files" tab. 74 | - Enter “function.proj”
75 | ![Add project file](/HOL/IOTHubPiHackathon/images/FunctionsV2AddFunctionFile.PNG) 76 | 77 | - Copy the text from [function.proj](/HOL/IOTHubPiHackathon/AzureFunction/function.proj) file in the github repo to the new json file you created. 78 | - Click "Save". 79 |

80 | 81 |

82 | 13. Now add the main source code that will used within the function 83 | - Copy the text from [Function.txt](/HOL/IOTHubPiHackathon/AzureFunction/AzureFunction.txt) in the github repo to the "run.csx" file. 84 | - In the run.csx file, find the CONNECTION_STRING variable and set the value to the IoT Hub Primary Key Connection String obtained in an earlier lab. 85 | - Click “Save and run” to run the function 86 | 87 |

88 | 89 |

90 | 91 | ## Trying it out 92 | 93 | You will now attempt to trigger the function and have the function send a message back to the Sense HAT. 94 | If you recall in lab 2, you created a tag parameter called tags.HighTemperatureLimit and set it to 40. This is the threshold that will determine when the status of the Sense HAT will change to Hot (if temperature is above the limit) or to Normal (when the temperature drops below the limit). When the status changes, the state (hot or normal) will appear on the Sense HAT display LEDs. 95 | 96 | 1. If your python script is no longer running on the Raspberry Pi, start it back up using the command ```python SenseHat_IoTHub_Http_Lab_Key.py``` 97 | 2. Try to get the temperature of the Sense HAT above the threshold value (if set to the instructed value, you should be trying to get the temperature above 40C) 98 | 99 | If you are having difficulties getting the temperature on your physical Sense HAT over the threshold, you can do one of the following: 100 | - Lower the threshold in the device twin for the RaspberryPi device. You can do this in the preconfigured solution portal (see steps in lab 2 to determine how to change the HighTemperatureLimit) 101 | - Update your Python script to use the Sense Hat emulator instead of the physical board. Using the Sense HAT emulator will allow you to virtually control the temperature (and other properties) 102 | 103 | [Back to Main HOL Instructions](../README.md) 104 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/AzureFunction/function.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/AzureToolBar2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/AzureToolBar2.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/BlobStorage/README.MD: -------------------------------------------------------------------------------- 1 | # Stream Analytics Lab - Send data to Blob Storage 2 | 3 | In this lab, we are going to create an Azure Stream Analytics job that will take the telemetry data from the Raspberry Pi and store it in Blob Storage. 4 | 5 | 6 | ## Stop the device simulators 7 | 8 | **This step is only relevant if you created the Remote Monitoring solution accelerator [(Lab 2a)](/HOL/IOTHubPiHackathon/2/README.md)**
9 | Perform this part of the module to populate Blob storage with only data coming from your physical Raspberry Pi and not the simluated devices provisioned as part of the solution accelerator. The following steps will stop the telemetry data flowing from the simulated devices to your IoT Hub. 10 | 11 | 1. Go to the web app that was provisioned as part of the Remote Monitoring solution accelerator. 12 | - Navigate to the [Azure portal](https://ms.portal.azure.com) 13 | - Click the resource group icon -> click the name of the group of your Remote Monitoring solution -> click the App Service that was created when you provisioned the solution acclerator. 14 | 15 |

16 | 17 |

18 | 19 | - Click 'Browse' to navigate to the web app. 20 | 21 |

22 | 23 |

24 | 25 | 2. You should be at the same device dashboard as when you initially launched the solution accelerator. 26 | - Click the 'Gear' icon in the upper right corner 27 | 28 |

29 | 30 |

31 | 32 | 3. Toggle the 'Simulation data' slider so that it reads 'Stopped'. This will stop all telemetry data and associated alerts from the simulated devices. 33 | 34 |

35 | 36 |

37 | 38 | ## Create Azure Stream Analytics (ASA) Job 39 | 40 | 1. Log into the [Azure portal](https://ms.portal.azure.com) 41 | 2. Add an Azure Stream Analytics (ASA) Job 42 | - Click on "+ Create a resource" 43 | 44 |

45 | 46 |

47 | 48 | - In the "Search the marketplace" blade, type in "Stream Analytics". Click on the "Stream Analytics job" option that shows up. 49 | 50 |

51 | 52 |

53 | 54 | 1. Click "Create" on this blade. 55 | 56 |

57 | 58 |

59 | 60 | 1. Enter a name for your job. eg. "HandsOnLab-BlobStorage" 61 | 1. Choose your subscription. Use the same subscription you used to provision everything else in this lab. 62 | 1. Choose a Resource Group. Use the existing Resource Group that was created previously. This will make it easier to delete all the resources when you are done with the lab. 63 | 1. Choose a Location. Try and choose the same location as where the rest of your solution has been provisioned. 64 | 1. Select "Cloud" for the Hosting Environment. With the IoT Edge gateway solution, you can now push ASA jobs down to the edge and have ASA jobs run locally on premise on your gateway solution. In these labs, we are going to use the cloud ASA job to filter out data streaming through IoT Hub and pass that data down to Blob Storage. 65 | 1. Leave the Streaming Units at 1. Streaming Units are the pool of computation resources available for the Stream Analytics job. 66 | 1. Click "Create". Feel free to click the "Pin to dashboard" check box. This will add the newly created ASA service to the main Azure portal dashboard. 67 | 68 |

69 | 70 |

71 | 72 | - Wait for the job to be created. You will see a notification banner that will pop up in the top right corner of the Azure portal to indicate the status of the job. This banner will disappear automatically. If you wish to see all the past notifications, click the bell icon. 73 | 74 |

75 | 76 |

77 | 78 | - Next, you will add an Input for the Stream Analytics job. 79 | 1. If you pinned the ASA service to the dashboard, you will see the ASA tile on the main Azure portal page. Click it. 80 | 81 |

82 | 83 |

84 | 85 | If not, click "Resource Groups" -> Your *resource group name* -> Your *ASA name* 86 | 87 |

88 | 89 |

90 | 91 | 1. Under the "Job Topology" category, click on "Inputs". 92 | 1. Click "+ Add stream input". 93 | 94 |

95 | 96 |

97 | 98 | 1. In the pop up menu that appears, select "IoT Hub". 99 | 100 |

101 | 102 |

103 | 104 | 1. In the "New Input" blade that appears, fill in the fields: 105 | - Input Alias: This is a free form text name for the input to the ASA job. eg. "IoTHub" 106 | - Choose "Select IoT Hub from your subscriptions". We will be connecting the ASA job to the IoT Hub you created and collecting streaming data from that existing IoT Hub 107 | - Subscription: Choose the name of your IoT Hub from your current subscription 108 | - IoT Hub: Choose the IoT Hub you have been using for the lab 109 | - Endpoint: Messaging 110 | - Shared Access Policy Name: iothubowner 111 | - Consumer Group: asa (we created this earlier) 112 | - Event Serialization Format: JSON 113 | - Encoding: UTF-8 114 | - Event Compression Type: None 115 | - Click "Save" and wait for the input to be created. 116 | 117 |

118 | 119 |

120 | 121 | - Next, create a Blob Storage account for the Stream Analytics job to stream data to. 122 | 1. Click on "+ Create a resource". 123 | 124 |

125 | 126 |

127 | 128 | 1. In the "Search the marketplace" blade, type in "storage account". Click on the "Storage account - blob, file, table, queue" option that shows up. Click "Create". 129 | 130 |

131 | 132 |

133 | 134 | 1. In the "Create storage account" blade enter the following. 135 | - Enter a name for your atorage account. this name must be unique across all existing storage account names in Azure. eg. "iotholstorageaccount" 136 | - Leave "Resource manager" as the Deployment model. 137 | - Leave "Storage (general purpose v1)" as the Account Kind. 138 | - Choose a Location. Try and choose the same location as where the rest of your IoT Hub has been provisioned. 139 | - Leave "Locally Redundant storage (LRS)" as the Replication. LRS still ensures that three copies of your data is stored in Azure. 140 | - Leave the default settings selected for Performance and Secure transfer required options. 141 | - Choose your subscription. Use the same subscription you used to provision your IoT Hub resource. 142 | - Choose an existing Resource Group. Use the one that contains your IoT Hub resource. 143 | - Leave "Virtual Networks" disabled. Enabling this will grant access to the storage account from only a specified virtual network and subnets. 144 | - Click "Create". 145 | 146 |

147 | 148 |

149 | 150 | 151 | - Now we need to add the Blob Storage as Output for the Stream analytics job. Navigate back to the Stream Analytics Job you created ("Resource Groups" -> *Your resource group name* -> *Your ASA name*). 152 | 1. In the Stream Analytics blade under the "Job Topology" category, click on "Outputs". 153 | 154 |

155 | 156 |

157 | 158 | 1. Click "+ Add" in the blade to the right. In the pop up menu that appears select "Blob storage". 159 | 160 |

161 | 162 |

163 | 164 | 1. Fill out the values in the "Blob storage" blade. 165 | - Enter in any free form text for the "Output alias". eg. "BlobStorage" 166 | - Choose "Select Blob storage from your subscriptions". We will be connecting the ASA job to the Blob Storage account that you just created. 167 | - Choose the subscription that you created your storage account in. 168 | - Choose the Storage account that you just created in the previous steps. 169 | - For "Container", select "Create new" and enter "iotdata" 170 | - In "Path pattern", enter "data/{date}/{time}" 171 | - Keep all the remaining options set to their default values. 172 | - Click "Save". 173 | 174 |

175 | 176 |

177 | 178 | - Next lets create an ASA Query. 179 | 1. In the Stream Analytics job blade, under the "Job Topology" category, click on "Query". The inline query editing tool will already have some stub code inserted. You will make some modifications to the query. 180 | 1. Enter the following query: (Note, if you named your Input and Output bindings something different then you will have to update the query parameters so that they correspond correctly) 181 | 182 | ``` 183 | SELECT 184 | * 185 | INTO 186 | [BlobStorage] 187 | FROM 188 | [IoTHub] 189 | ``` 190 | 191 | 1. Click "Save". 192 | 1. If you wish to run a test on your newly generated query, you will need to upload some sample data that the ASA Query tool will use to run the query. To generate a sample file, you can either manually generate your own file or get a sampling of data from the IoT Hub input. Click the elipses (...) beside the IoTHub input and click "Sample data from input" to start collecting data. Click the "Upload sample data from file" option once you have created a sample file and then run the query test by clicking the "Test" button. 193 | 194 |

195 | 196 |

197 | 198 | - Start the ASA Job 199 | 1. Click on "Overview". 200 | 1. Click "Start". 201 | 202 |

203 | 204 |

205 | 206 | 1. For the "Job output start time", click "Now". 207 | 1. Click "Start". 208 | 209 |

210 | 211 |

212 | 213 | 214 | ## View IoT blob data in the Azure Portal 215 | 216 | 1. Click "Resource Groups" -> Your *resource group name* -> Your *blob storage account name* (eg. "iotholstorageaccount") 217 | 218 |

219 | 220 |

221 | 222 | 1. Select "Browse blobs" 223 | 1. Select the container. eg. "iotdata" 224 | 1. Click down through the folder hierarchy. eg. "data" -> -> -> -> 225 | 1. Click on a file. 226 | 1. Select "Download". 227 | 228 |

229 | 230 |

231 | 232 | 1. Open the file with your favorite editor to view the IoT data 233 | 234 |

235 | 236 |

237 | 238 | Congratulations, you have streamed your data into blob storage! 239 | 240 | [Next lab - 5 Azure Functions](/HOL/IOTHubPiHackathon/AzureFunction) 241 | 242 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 243 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Cleanup/README.md: -------------------------------------------------------------------------------- 1 | At the end of the Hands on Labs, you should clean up your Azure account so that the resources provisioned do not continue to consume funds from your account. There are two options that we suggest you follow: 2 | 3 | ### Option 1 - Delete the Solution Accelerator Completely 4 | 5 | If you did not create a solution accelerator skip this step. 6 | 7 | 1. Remove any functions you created.
8 | - Click on "Function Apps" in the Azure portal https://ms.portal.azure.com/ 9 | - Click on the function that you created 10 | - Click on "Manage" 11 | - Click on the "Delete" button 12 | 13 | 1. Delete the Remote Monitoring Solution Accelerator completely if you are not planning to continue to work on the labs in your own time.
14 | - Best way to remove all the resources is through the www.azureiotsuite.com microsite 15 | - Navigate to www.azureiotsuite.com 16 | - Click the tile for your solution accelerator: 17 | 18 |

19 | 20 |

21 | - Once the blade that appears, click the "Delete solution" button 22 | 23 |

24 | 25 |

26 | 27 | ### Option 2 - Delete the Resource Group 28 | 29 | If you did not create the free IoT Hub skip this step. 30 | 31 | 1. Open the [Azure Portal](https://portal.azure.com/). 32 | 1. Select your resource group from the "Resource groups" blade. 33 | 1. Select your resource group. 34 | 1. Select "Delete resource group" 35 | 1. Enter the name of the resource group. Be sure not to delete any resource groups you did not create! 36 | 1. Click "Delete". 37 | 38 | 58 | 59 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/IoTHOL-LabParameters - old.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/IoTHOL-LabParameters - old.xlsx -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/IoTHOL-LabParameters.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/IoTHOL-LabParameters.xlsx -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/NodeExample.js: -------------------------------------------------------------------------------- 1 | 2 | var connectionString = 'HostName=Trak-IoT-Hub-Free.azure-devices.net;DeviceId=RaspberryPi;SharedAccessKey=Kj8PlWxtSYpeCCLfVcbLxaBgYHteCPRAi+9yrbn4Fo0='; 3 | // Example: HostName=.azure-devices.net;DeviceId=;SharedAccessKey= 4 | 5 | 6 | // use factory function from AMQP-specific package 7 | var clientFromConnectionString = require('azure-iot-device-amqp').clientFromConnectionString; 8 | 9 | // AMQP-specific factory function returns Client object from core package 10 | var client = clientFromConnectionString(connectionString); 11 | 12 | // use Message object from core package 13 | var Message = require('azure-iot-device').Message; 14 | 15 | var connectCallback = function (err) { 16 | if (err) { 17 | console.error('Could not connect: ' + err); 18 | } else { 19 | console.log('Client connected'); 20 | i = 0; 21 | var msg = ''; 22 | i = i + Math.random(); 23 | msg = new Message('{' + i + '}'); 24 | client.sendEvent(msg, function (err) { 25 | if (err) { 26 | console.log(err.toString()); 27 | } else { 28 | console.log('Message sent'); 29 | }; 30 | }); 31 | }; 32 | }; 33 | 34 | 35 | client.open(connectCallback); 36 | 37 | console.log('Waiting for send'); 38 | setTimeout(exitProcessing, 30000) 39 | 40 | 41 | function exitProcessing() 42 | { 43 | console.log('Process complete'); 44 | process.exit() 45 | } -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/OptionalLabs/IoTHubCreation.md: -------------------------------------------------------------------------------- 1 | 2 | -------- Steps using IoT Hub only ----- 3 | 4 | **Note: This tutorial is for Windows Users who have installed [Device Explorer](https://github.com/Azure/azure-iot-sdk-csharp/tree/master/tools/DeviceExplorer#download)** 5 | 6 | 1. Setup your Azure IoT Hub. 7 | 1. Go to the [Azure Portal](https://portal.azure.com). 8 | 1. Select the [IoT Hub Service](https://ms.portal.azure.com/#blade/HubsExtension/Resources/resourceType/Microsoft.Devices%2FIotHubs). 9 | 1. Click on "Add". 10 | 1. Enter the properties for your IoT Hub. 11 | 1. Enter a name for your hub. eg. TerrysFirstIoTHub 12 | 1. Choose the "Free" pricing tier. This will allow you up to 8,000 messages per day. 13 | 1. For the Free tier, the "IoT Hub units" will default to 1. 14 | 1. If you have more than 1 subscription, choose the one you wish to use. 15 | 1. Create a new Resource group for your hub. It can have the same name as the IoT Hub. 16 | 1. Select the "West US" Location. 17 | 1. Click the "Pin to dashboard" button. 18 | 1. Click the "Create" button. 19 | 1. Wait for the hub to be created. You will be notified in the "Notifications" section when it is complete. 20 | 21 |

22 | 23 |

24 | 25 | 1. Create (configure) your device in Azure IoT Hub. 26 | 1. Click on your new IoT Hub in the [Azure Portal](https://portal.azure.com) Dashboard. 27 | 1. Click on the "Shared access policies". 28 | 1. Click on the "iothubowner" policy. 29 | 1. Copy the primary key connection string. Save the primary key connection string for later. 30 | 31 |

32 | 33 |

34 | 35 | 1. Open Device Explorer 36 | 1. In the "Connection information" tab paste the primary key connection string into the "IoT Hub Connection String" text box. 37 | 1. Click on "Update". 38 | 1. Click on the "Management" tab. 39 | 1. In the "Actions" section, select "Create". 40 | 1. Enter a name for your device. Save the device name for later. 41 | 42 |

43 | 44 |

45 | 46 | 1. Click "Create". 47 | 48 | 1. Configure the Raspberry Pi to send messages to the IoT Hub. 49 | 1. Copy the [Python code](https://github.com/Microsoft/IIoT/blob/master/HOL/IOTHubPiHackathon/SenseHat_IoTHub_Http.py) from this HOL to a file. Save the file as ```SenseHat_IoTHub_Http.py``` and open it with a text editor such as Notepad. 50 | 1. Alternatively you can download the file directly to your Raspberry Pi using: ```git clone https://github.com/Microsoft/IIoT/HOL/IoTHubPiHackathon.git``` and edit the ```SenseHat_IoTHub_Http.py``` using a text editor such as Nano. 51 | 1. Update the file with the primary key connection string. Look for ```connectionString =``` and paste in the primary key connection string you copied earlier. Then look for ```deviceId =``` and paste in the Device Name you created earlier. 52 | 1. Copy ```SenseHat_IoTHub_Http.py``` to your Raspberry Pi using PuTTY. The pscp executable will be in your PuTTY directory.
53 | `pscp SenseHat_IoTHub_Http.py userid@server_name:/path/SenseHat_IoTHub_Http.py` 54 | 1. Log into the Raspberry Pi using PuTTY or another ssh client. 55 | 1. Verify that the file was transfered by listing the directory: `ls -l` 56 | 1. Start sending messages by invoking the script in Python 57 | ``` 58 | pi@raspberrypi:~ $ python SenseHat_IoTHub_Http.py 59 | ``` 60 | 61 | 1. On your laptop, open Device Explorer, click the Data tab, select your device from the Device ID list, and click Monitor. If you see messages arriving then - Congratulations, your Raspberry Pi is now sending data to Azure IoT Hub! 62 | 1. Referring to the [Sense Hat API](https://pythonhosted.org/sense-hat/api/), update the code to send more telemetry to IoT Hub from the Sense HAT. 63 | 1. Update the ```SenseHat_IoTHub_Http.py``` code to send multiple telemetry data points (e.g. Yaw, Pitch, Roll, or Temperature, Pressure, Humidity) in a single JSON-formatted message to IoT Hub. See [sample_payload.json](/HOL/IOTHubPiHackathon/sample_payload.json). 64 | - Solution source code: Authorized MSFT personnel only [SenseHat_IoTHub_Http_JSON.py](https://kevinhilscher.visualstudio.com/_git/IoT%20Hackathon?path=%2FSenseHat_IoTHub_Http_JSON.py&version=GBmaster&_a=contents). 65 | 1. Update ```SenseHat_IoTHub_Http.py``` to display the HTTP response code from the IoT Hub message onto the Sense HAT LED display. 66 | - Solution source code: Authorized MSFT personnel only [SenseHat_IoTHub_Http_JSON_LED.py](https://kevinhilscher.visualstudio.com/_git/IoT%20Hackathon?path=%2FSenseHat_IoTHub_Http_JSON%20_LED.py&version=GBmaster&_a=contents). 67 | 1. To send messages from IoT Hub back to your Raspberry Pi: 68 | 1. Copy the ```SenseHat_IoTHub_Http_C2D_LED.py``` file to your Raspberry Pi using pscp or download it directly using git clone. 69 | 1. Update the file with the primary key connection string. Look for ```connectionString =``` and paste in the primary key connection string you copied earlier. Then look for ```deviceId =``` and paste in the Device Name you created earlier. Save the file. 70 | 1. Run the file using ```pi@raspberrypi:~ $ python SenseHat_IoTHub_Http_C2D_LED.py``` 71 | 1. On your laptop, open Device Explorer, click the Messages to Device tab, select your device from the Device ID list, type in a message into the Message textbox and click Send. You should see the message appear on the Sense HAT LED display. 72 | 73 | 74 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 75 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/PowerBIYourDataset.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/PowerBIYourDataset.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Prep/Images/ConfirmInstall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/Prep/Images/ConfirmInstall.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Prep/Images/EnableSSH.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/Prep/Images/EnableSSH.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Prep/Images/Interface.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/Prep/Images/Interface.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Prep/Images/NOOBS_Install.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/Prep/Images/NOOBS_Install.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Prep/Images/SelectSSH.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/Prep/Images/SelectSSH.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Prep/Images/SenseHat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/Prep/Images/SenseHat.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/Prep/README.md: -------------------------------------------------------------------------------- 1 | ## Pre-workshop Setup (Must be completed in advance of the HOL) 2 | 3 | Please perform the following steps in advance of the Hands-on-labs otherwise you will spend a significant time during the workshop performing these steps. 4 | 5 | ### Raspberry Pi Setup 6 | 7 | You will need to walk through the following steps on your Raspberry Pi prior to the hands-on-lab.
8 | 9 | 1. Ensure your Raspberry Pi can boot [Raspian] (https://www.raspberrypi.org/downloads/) from the SD card. 10 | - Follow the instructions to install the operating system: [NOOBS] (https://www.raspberrypi.org/downloads/noobs/) 11 | - If you have a new microSD card that hasn't been formatted before, use [SDFormatter](https://www.sdcard.org/downloads/formatter_4/eula_windows/) to do a full format of the card. 12 | - Insert the microSD card into your Pi and connect the power supply. 13 | - Click to install Raspbian 14 |

15 | 16 |

17 | - Confirm the deletion of content on the SD card and the installation of the OS. 18 |

19 | 20 |

21 | 2. If you do not have the Sense HAT and will be using the Sense HAT Emulator, you will have to run through some extra steps to ensure that you access the Sense HAT Emulator graphically: 22 | - First, run through the steps to ensure it's installed. Verify by checking under 'Programming' in the Raspian GUI. 23 | 24 |

25 | 26 |

27 | 28 | - Next, make sure that VNC is enabled. We will be using VNC so that a physical monitor will not be required for the labs. 29 | - Select Menu -> Preferences -> Raspberry Pi Configuration -> Interfaces. 30 | 31 |

32 | 33 |

34 | 35 | - Ensure VNC is Enabled. 36 | 37 |

38 | 39 |

40 | 41 | 3. Enable SSH on the Raspberry Pi. You will be SSH-ing to the Raspberry Pi to modify and execute scripts. 42 | 43 | - In the menu, choose "Preferences", then "Raspberry Pi Configuration" 44 | - Enable SSH 45 | 46 | ### Laptop Setup (only required if using a laptop to emulate into the Raspberry Pi) 47 | 48 | The following steps will walk you through the installation of tools that you need to run on your laptop for this lab: 49 | 50 | 1. OPTIONAL if using a laptop to connect to the Raspberry Pi, download and install an SSH client like [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html). We will use PuTTY to SSH into the Raspberry Pi to perform various functions throughout the lab. 51 | 1. OPTIONAL if using a laptop and the Sense HAT Emulator (vs the physical device), you'll need to install a VNC viewer client on your laptop so that you can remotely view your Raspbian desktop. Download and install RealVNC from (https://www.realvnc.com/download/viewer/) 52 | 1. Ensure your Azure subscription login is working and you have sufficient permissions to create resources. 53 | 1. Ensure you have access to Powerbi.com. If you are able to log in then you should be okay. 54 | 1. Ensure that you can log into www.azureiotsolutions.com and can see the various Azure IoT solution Accelerators tiles as per below. If you get permission errors, you will need to ask your IT team to provide you with the right permissions or email your instructor for assistance. 55 |

56 | 57 |

58 | 1. During the labs, you will install the Azure IoT CLI in your Azure cloud shell on the Azure Portal. 59 | - Open the [Azure Portal](http://portal.azure.com) in your browser 60 | - click on the "Cloud Shell" button on the menu bar across the top 61 | 62 | ![Cloud Shell](../images/AzureToolBar.JPG) 63 | 64 | - install the azure iot cli extension with the following command 65 | 66 | ```bash 67 | az extension add --name azure-cli-iot-ext 68 | ``` 69 | Alternatively, if you use Azure often, then you can actually install Azure CLI on your laptop and then install the IoT CLI extension mentioned above. Instructions to install the Azure CLI are [here](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) 70 | 71 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 72 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/PythonSDK/README.MD: -------------------------------------------------------------------------------- 1 | 1. Update Swap file to 500 MB. See this document: http://raspberrypi.stackexchange.com/questions/70/how-to-set-up-swap-space 2 | 1. Documentation: [https://github.com/Azure/azure-iot-sdk-python](https://github.com/Azure/azure-iot-sdk-python) 3 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/README-back.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ## Steps (Performed by students during HOL) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ## Using the Python Device SDK 14 | IoT Hub also supports MQTT and AMQP protocols. These are generally more efficient and scale better than using the HTTP REST API. In order to use MQTT or AMQP with Python, you will need to download and compile the Python Device SDK on your Raspian operating system. 15 | 16 | The full instructions are [here] (https://github.com/Azure/azure-iot-sdk-python/blob/master/doc/python-devbox-setup.md) with some Python SDK examples [here] (https://github.com/Azure/azure-iot-sdk-python/tree/master/device/samples). 17 | 18 | In summary: 19 | - ```git clone --recursive https://github.com/Azure/azure-iot-sdk-python.git``` 20 | - ```cd azure-iot-sdk-python/build_all/linux``` 21 | - ```sudo ./setup.sh``` 22 | - ```sudo ./build.sh``` 23 | 24 | After a successful build, the ```iothub_client.so``` Python extension module is copied to the device/samples and service/samples folders. The iothub_client.so must be in the same folder as your IoT Hub client python script or in the common shared libraries folder such as ```/usr/local/lib``` or ```/usr/lib```. 25 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/README.md: -------------------------------------------------------------------------------- 1 | # IoT Hub Pi Hands on Lab (HoL) 2 | 3 | ## Overview 4 | This Hands on Lab (HOL) demonstrates connecting a Raspberry Pi running Raspian to [Azure IoT Hub] (https://azure.microsoft.com/en-us/services/iot-hub/) and sending telemetry to Azure IoT Hub from either: 5 | - a physical [Sense HAT](https://www.raspberrypi.org/products/sense-hat/) connected to the Raspberry Pi; or 6 | - a [Sense HAT Emulator](https://www.raspberrypi.org/blog/sense-hat-emulator/) installed on the Raspberry Pi. 7 | 8 | Completing this HOL will provide you with the basic skills needed to connect and securely send telemetry from a physical device (e.g. a field device or field gateway) to the Azure IoT Hub. This HOL does not demonstrate what can be done with the data after it arrives at the Azure IoT Hub. Having said that, you can do almost anything including complex event processing, stream processing, saving telemetry to blob storage or databases, analytics, training of Machine Learning models etc. 9 | 10 | ### Why Sense HAT? 11 | We didn't want you to mess around with breadboards, jumper cables, resistors etc. This just wastes time and adds nothing to the goal of connecting a sensor to Azure IoT Hub. The Sense HAT has all the necessary components installed on the circuit board, including a ready to use library, and a series of sensors to play with. 12 | 13 | ### Why HTTPS and REST? 14 | For simplicity and to avoid downloading/compiling SDKs during the HOL, we chose to send the Sense Hat telemetry to Azure IoT Hub using the [IoT Hub REST API](https://docs.microsoft.com/en-us/rest/api/iothub/) over HTTPS. Of course, you can use one of the many device SDKs available, which support sending messages over AMQP and MQTT. If you want to use the device SDKs, refer to the Using the .NET Device SDK section below. 15 | 16 | ## Lab Requirements 17 | 18 | It is expected that you will have a base understanding of the following: 19 | - Microsoft Azure (we will discuss the IoT specific aspects of Azure so are expecting attendees to understand Azure and the capabilities in a broader sense). 20 | - Basic system administration skills (eg. SSH, SCP, copying file, etc.) 21 | - Some development experience is beneficial but not required. 22 | 23 | ### HARDWARE 24 | You can order your hardware from a variety of online sites such as adafruit.com, amazon.com etc. Please order yours 3-4 weeks in advance of the HOL so it will arrive in time. 25 | - [Raspberry Pi 3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) or [Raspberry Pi Zero W](https://www.raspberrypi.org/products/raspberry-pi-zero-w/) with latest version of Raspian installed on the micro SD card. Using [NOOBS](https://www.raspberrypi.org/downloads/noobs/) works fine. **Note:** if you are using the **Raspberry Pi Zero W**, make sure you bring the mini-HDMI to HMDI adapter for connectivity to a monitor as well as a USB hub so that you can connect a keyboard and mouse to the Pi. (if you already have a Pi 2 Model B with USB Wi-Fi dongle, that will probably work as well) 26 | - OPTIONAL (for those who want to play with real hardware): [Sense HAT](https://www.raspberrypi.org/products/sense-hat/) 27 | If you don't want to use the physical Sense HAT, you can also use the [Sense HAT Emulator](https://www.raspberrypi.org/blog/sense-hat-emulator/) which comes with the Raspian O/S. You will use the sensors build into the Sense HAT to generate telemetry data as well as use the RGB LED matrix to display messages sent from your IoT solution. 28 | - OPTIONAL Laptop. A laptop can be used to edit files in user friendly editors before transferring the files to the Raspberry Pi. The lab can be completed using only a Raspberry Pi, but you will also need a monitor, mouse and keyboard. 29 | 30 | ### SOFTWARE 31 | - [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) or another SSH client. You will use PuTTY to SSH from your laptop into your Raspberry Pi 32 | - If you are using the Sense HAT Emulator (vs the physical device) and are emulating in from a laptop, you'll need to install VNC viewer on your laptop so that you can remotely view your Raspbian desktop. Download and install RealVNC from (https://www.realvnc.com/download/viewer/) 33 | - Install az command line interface (CLI) 34 | - Open the [Azure Portal](http://portal.azure.com) in your browser 35 | - click on the "Cloud Shell" button on the menu bar across the top 36 | 37 | ![Cloud Shell](images/AzureToolBar.JPG) 38 | 39 | - install the azure iot cli extension with the following command 40 | 41 | ```bash 42 | az extension add --name azure-cli-iot-ext 43 | ``` 44 | 45 | ### OTHERS 46 | - An Azure subscription with permissions to create Azure services. You can use a free Azure account, but you will not be able to complete all paths of the lab. The free account does not allow the creation of solution accelerators. OPTIONAL: A corporate Azure subscription. This is required if you plan to use a solution accelerator. You can use a corporate MSDN Azure subscription or a subscription from your company. 47 | - OPTIONAL A PowerBI account (same account as the corporate Azure account). 48 | - A basic understanding of Python and Linux. 49 | 50 | ## Pre-workshop Setup (Steps must be completed before the Hands On Lab Workshop) 51 | 52 | Follow the instructions [here](/HOL/IOTHubPiHackathon/Prep) before you arrive on-site for the hands-on-lab workshop. 53 | 54 | 55 | ## Hands on Workshop Steps 56 | 57 | The following subsections of the Hands on Labs are as follows: 58 | 59 | ### Morning 60 | 61 | * [1 - Hands on Lab Setup](/HOL/IOTHubPiHackathon/1) 62 | 63 | * 2 - Provision **ONE** of the following:
64 | * a) [A Remote Monitoring Solution Accelerator](/HOL/IOTHubPiHackathon/2)
65 | **OR**
66 | * b) [An IoT Hub](/HOL/IOTHubPiHackathon/2b)
67 | 68 | * [3 - Connect Raspberry Pi to Azure IoT](/HOL/IOTHubPiHackathon/3) 69 | 70 | ### Afternoon 71 | 72 | * 4 - Route your IoT data using Stream Analytics to one (or both) of the following:
73 | * a) [Power BI](/HOL/IOTHubPiHackathon/StreamAnalytics)
74 | **OR** 75 | * b) [Blob Storage](/HOL/IOTHubPiHackathon/BlobStorage) 76 | 77 | * [5 - Azure Functions](/HOL/IOTHubPiHackathon/AzureFunction) 78 | 79 | * [6 - Lab Clean-up](/HOL/IOTHubPiHackathon/Cleanup) 80 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/SenseHat_IoTHub_Http.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sample code demonstrating Sense HAT running on Raspian and Raspberry Pi 3 sending sensor data to Azure IoT Hub using Azure IoT Hub REST API. 3 | 4 | Azure IoT Hub REST API reference https://docs.microsoft.com/en-us/rest/api/iothub/ 5 | 6 | Sense HAT API reference https://pythonhosted.org/sense-hat/api/ 7 | 8 | Adapted from https://github.com/Azure-Samples/iot-hub-python-get-started 9 | """ 10 | 11 | import base64 12 | import hmac 13 | import hashlib 14 | import time 15 | import requests 16 | import urllib 17 | import time 18 | import sys 19 | 20 | #If using emulator, uncomment 'from sense_emu import SenseHat ' and comment out 'from sense_hat import SenseHat' 21 | #from sense_hat import SenseHat #if using a physical SenseHat attached to Raspi 22 | from sense_emu import SenseHat #if using a Sense HAT Emulator (Linux only) 23 | 24 | class IoTHub: 25 | 26 | API_VERSION = '2016-02-03' 27 | TOKEN_VALID_SECS = 10 28 | TOKEN_FORMAT = 'SharedAccessSignature sig=%s&se=%s&skn=%s&sr=%s' 29 | 30 | def __init__(self, connectionString=None): 31 | if connectionString != None: 32 | iotHost, keyName, keyValue = [sub[sub.index('=') + 1:] for sub in connectionString.split(";")] 33 | self.iotHost = iotHost 34 | self.keyName = keyName 35 | self.keyValue = keyValue 36 | 37 | def _buildExpiryOn(self): 38 | return '%d' % (time.time() + self.TOKEN_VALID_SECS) 39 | 40 | def _buildIoTHubSasToken(self, deviceId): 41 | resourceUri = '%s/devices/%s' % (self.iotHost, deviceId) 42 | targetUri = resourceUri.lower() 43 | expiryTime = self._buildExpiryOn() 44 | toSign = '%s\n%s' % (targetUri, expiryTime) 45 | key = base64.b64decode(self.keyValue.encode('utf-8')) 46 | 47 | if sys.version_info[0] < 3: 48 | signature = urllib.quote( 49 | base64.b64encode( 50 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 51 | ) 52 | ).replace('/', '%2F') 53 | else: 54 | signature = urllib.parse.quote( 55 | base64.b64encode( 56 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 57 | ) 58 | ).replace('/', '%2F') 59 | 60 | return self.TOKEN_FORMAT % (signature, expiryTime, self.keyName, targetUri) 61 | 62 | def registerDevice(self, deviceId): 63 | sasToken = self._buildIoTHubSasToken(deviceId) 64 | url = 'https://%s/devices/%s?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 65 | body = '{deviceId: "%s"}' % deviceId 66 | r = requests.put(url, headers={'Content-Type': 'application/json', 'Authorization': sasToken}, data=body) 67 | return r.text, r.status_code 68 | 69 | def sendD2CMsg(self, deviceId, message): 70 | sasToken = self._buildIoTHubSasToken(deviceId) 71 | url = 'https://%s/devices/%s/messages/events?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 72 | r = requests.post(url, headers={'Authorization': sasToken}, data=message) 73 | return r.text, r.status_code 74 | 75 | if __name__ == '__main__': 76 | 77 | #You can obtain the connection string from portal.azure.com -> IoT Hub -> -> Shared Access Policies 78 | #To send messages, ensure you use a shared access policy with at least 'device connect' permissions. 79 | #To register a new device, ensure you use a shared access policy with at least 'registry write' permissions. 80 | #The connection string will resemble: 81 | # 'HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=sdilhjlEDPvgcc1kIAW5bDlNQG6/Y7zJSoi6qSiNpcio=' 82 | connectionString = '' 83 | 84 | #This is the device name that will be registered in the IoT Hub. 85 | #If it is already registered, it will error and continue on. 86 | deviceId = 'Device100' 87 | 88 | iotHubConn = IoTHub(connectionString) 89 | sense = SenseHat() 90 | 91 | while True: 92 | 93 | try: 94 | #Uncomment this code if you want the device to self-register with IoT Hub. Otherwise use Device Explorer to register device. 95 | #print('Registering device... ' + deviceId) 96 | #print(iotHubConn.registerDevice(deviceId)) 97 | 98 | #Send current temperature from the Sense HAT temp sensor 99 | #Refer to Sense HAT API to send other Sense HAT sensor data https://pythonhosted.org/sense-hat/api/ 100 | message = str(sense.temp) 101 | print('Sending message... ' + message) 102 | print(iotHubConn.sendD2CMsg(deviceId, message)) 103 | time.sleep(5) # 5 second delay 104 | except OSError as e: 105 | print('Error: ' + str(e)) 106 | break 107 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/SenseHat_IoTHub_Http_C2D_LED.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sample code demonstrating Sense HAT running on Raspian and Raspberry Pi 3 receiving messages from Azure IoT Hub using Azure IoT Hub REST API. 3 | 4 | Azure IoT Hub REST API reference https://docs.microsoft.com/en-us/rest/api/iothub/ 5 | 6 | Sense HAT API reference https://pythonhosted.org/sense-hat/api/ 7 | 8 | Adapted from https://github.com/Azure-Samples/iot-hub-python-get-started 9 | """ 10 | 11 | import base64 12 | import hmac 13 | import hashlib 14 | import time 15 | import requests 16 | import urllib 17 | import time 18 | import sys 19 | import json 20 | 21 | #If using emulator, uncomment 'from sense_emu import SenseHat ' and comment out 'from sense_hat import SenseHat' 22 | from sense_hat import SenseHat #if using a physical SenseHat attached to Raspi 23 | #from sense_emu import SenseHat #if using a Sense HAT Emulator (Linux only) 24 | 25 | class IoTHub: 26 | 27 | API_VERSION = '2016-02-03' 28 | TOKEN_VALID_SECS = 10 29 | TOKEN_FORMAT = 'SharedAccessSignature sig=%s&se=%s&skn=%s&sr=%s' 30 | 31 | def __init__(self, connectionString=None): 32 | if connectionString != None: 33 | iotHost, keyName, keyValue = [sub[sub.index('=') + 1:] for sub in connectionString.split(";")] 34 | self.iotHost = iotHost 35 | self.keyName = keyName 36 | self.keyValue = keyValue 37 | 38 | def _buildExpiryOn(self): 39 | return '%d' % (time.time() + self.TOKEN_VALID_SECS) 40 | 41 | def _buildIoTHubSasToken(self, deviceId): 42 | resourceUri = '%s/devices/%s' % (self.iotHost, deviceId) 43 | targetUri = resourceUri.lower() 44 | expiryTime = self._buildExpiryOn() 45 | toSign = '%s\n%s' % (targetUri, expiryTime) 46 | key = base64.b64decode(self.keyValue.encode('utf-8')) 47 | 48 | if sys.version_info[0] < 3: 49 | signature = urllib.quote( 50 | base64.b64encode( 51 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 52 | ) 53 | ).replace('/', '%2F') 54 | else: 55 | signature = urllib.parse.quote( 56 | base64.b64encode( 57 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 58 | ) 59 | ).replace('/', '%2F') 60 | 61 | return self.TOKEN_FORMAT % (signature, expiryTime, self.keyName, targetUri) 62 | 63 | def registerDevice(self, deviceId): 64 | sasToken = self._buildIoTHubSasToken(deviceId) 65 | url = 'https://%s/devices/%s?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 66 | body = '{deviceId: "%s"}' % deviceId 67 | r = requests.put(url, headers={'Content-Type': 'application/json', 'Authorization': sasToken}, data=body) 68 | return r.text, r.status_code 69 | 70 | def receiveC2DMsg(self, deviceId): 71 | sasToken = self._buildIoTHubSasToken(deviceId) 72 | url = 'https://%s/devices/%s/messages/devicebound?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 73 | r = requests.get(url, headers={'Authorization': sasToken}) 74 | return r.text, r.status_code, r.headers 75 | 76 | def ackC2DMsg(self, deviceId, eTag): 77 | sasToken = self._buildIoTHubSasToken(deviceId) 78 | url = 'https://%s/devices/%s/messages/devicebound/%s?api-version=%s' % (self.iotHost, deviceId, eTag, self.API_VERSION) 79 | r = requests.delete(url, headers={'Authorization': sasToken}) 80 | return r.text, r.status_code, r.headers 81 | 82 | class telemetry : 83 | def __init__(self, pitch, yaw, roll): 84 | """Return a new object.""" 85 | self.pitch = pitch 86 | self.yaw = yaw 87 | self.roll = roll 88 | 89 | def toJSON(self): 90 | return json.dumps(self, default=lambda o: o.__dict__, 91 | sort_keys=True, indent=4) 92 | 93 | if __name__ == '__main__': 94 | 95 | #You can obtain the connection string from portal.azure.com -> IoT Hub -> -> Shared Access Policies 96 | #To send messages, ensure you use a shared access policy with at least 'device connect' permissions. 97 | #To register a new device, ensure you use a shared access policy with at least 'registry write' permissions. 98 | #The connection string will resemble: 99 | # 'HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=sdilhjlEDPvgcc1kIAW5bDlNQG6/Y7zJSoi6qSiNpcio=' 100 | connectionString = '' 101 | 102 | #This is the device name that will be registered in the IoT Hub. 103 | #If it is already registered, it will error and continue on. 104 | deviceId = '' 105 | 106 | iotHubConn = IoTHub(connectionString) 107 | sense = SenseHat() 108 | 109 | while True: 110 | 111 | try: 112 | #Uncomment this code if you want the device to self-register with IoT Hub. Otherwise use Device Explorer to register device. 113 | #print('Registering device... ' + deviceId) 114 | #print(iotHubConn.registerDevice(deviceId)) 115 | 116 | response = iotHubConn.receiveC2DMsg(deviceId) 117 | if response[1] == 200: 118 | print('Message from IoT Hub: %s' % (response[0])) 119 | etag = response[2]['ETag'] 120 | etag = etag.replace('"', '').strip() 121 | ackresponse = iotHubConn.ackC2DMsg(deviceId, etag) 122 | sense.show_message(str(response[0]), text_colour=[255, 0, 0]) 123 | else: 124 | print('No messages from IoT Hub') 125 | 126 | time.sleep(5) # 5 second delay 127 | 128 | except OSError as e: 129 | print('Error: ' + str(e)) 130 | break 131 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/SenseHat_IoTHub_Http_Lab.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sample code demonstrating Sense HAT running on Raspian and Raspberry Pi 3 receiving messages from Azure IoT Hub using Azure IoT Hub REST API. 3 | 4 | Azure IoT Hub REST API reference https://docs.microsoft.com/en-us/rest/api/iothub/ 5 | 6 | Sense HAT API reference https://pythonhosted.org/sense-hat/api/ 7 | 8 | Adapted from https://github.com/Azure-Samples/iot-hub-python-get-started 9 | """ 10 | 11 | import base64 12 | import hmac 13 | import hashlib 14 | import time 15 | import requests 16 | import urllib 17 | import time 18 | import sys 19 | import json 20 | 21 | #If using emulator, uncomment 'from sense_emu import SenseHat ' and comment out 'from sense_hat import SenseHat' 22 | from sense_hat import SenseHat #if using a physical SenseHat attached to Raspi 23 | #from sense_emu import SenseHat #if using a Sense HAT Emulator (Linux only) 24 | 25 | class IoTHub: 26 | 27 | API_VERSION = '2016-02-03' 28 | TOKEN_VALID_SECS = 10 29 | TOKEN_FORMAT = 'SharedAccessSignature sig=%s&se=%s&skn=%s&sr=%s' 30 | 31 | def __init__(self, connectionString=None): 32 | if connectionString != None: 33 | iotHost, keyName, keyValue = [sub[sub.index('=') + 1:] for sub in connectionString.split(";")] 34 | self.iotHost = iotHost 35 | self.keyName = keyName 36 | self.keyValue = keyValue 37 | 38 | def _buildExpiryOn(self): 39 | return '%d' % (time.time() + self.TOKEN_VALID_SECS) 40 | 41 | def _buildIoTHubSasToken(self, deviceId): 42 | resourceUri = '%s/devices/%s' % (self.iotHost, deviceId) 43 | targetUri = resourceUri.lower() 44 | expiryTime = self._buildExpiryOn() 45 | toSign = '%s\n%s' % (targetUri, expiryTime) 46 | key = base64.b64decode(self.keyValue.encode('utf-8')) 47 | 48 | if sys.version_info[0] < 3: 49 | signature = urllib.quote( 50 | base64.b64encode( 51 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 52 | ) 53 | ).replace('/', '%2F') 54 | else: 55 | signature = urllib.parse.quote( 56 | base64.b64encode( 57 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 58 | ) 59 | ).replace('/', '%2F') 60 | 61 | return self.TOKEN_FORMAT % (signature, expiryTime, self.keyName, targetUri) 62 | 63 | def registerDevice(self, deviceId): 64 | sasToken = self._buildIoTHubSasToken(deviceId) 65 | url = 'https://%s/devices/%s?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 66 | body = '{deviceId: "%s"}' % deviceId 67 | r = requests.put(url, headers={'Content-Type': 'application/json', 'Authorization': sasToken}, data=body) 68 | return r.text, r.status_code 69 | 70 | def receiveC2DMsg(self, deviceId): 71 | sasToken = self._buildIoTHubSasToken(deviceId) 72 | url = 'https://%s/devices/%s/messages/devicebound?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 73 | r = requests.get(url, headers={'Authorization': sasToken}) 74 | return r.text, r.status_code, r.headers 75 | 76 | def ackC2DMsg(self, deviceId, eTag): 77 | sasToken = self._buildIoTHubSasToken(deviceId) 78 | url = 'https://%s/devices/%s/messages/devicebound/%s?api-version=%s' % (self.iotHost, deviceId, eTag, self.API_VERSION) 79 | r = requests.delete(url, headers={'Authorization': sasToken}) 80 | return r.text, r.status_code, r.headers 81 | 82 | def sendD2CMsg(self, deviceId, message): 83 | sasToken = self._buildIoTHubSasToken(deviceId) 84 | url = 'https://%s/devices/%s/messages/events?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 85 | r = requests.post(url, headers={'Authorization': sasToken}, data=message) 86 | return r.text, r.status_code 87 | 88 | def toJSON(self): 89 | return json.dumps(self, default=lambda o: o.__dict__, 90 | sort_keys=True, indent=4) 91 | 92 | if __name__ == '__main__': 93 | 94 | #You can obtain the connection string from portal.azure.com -> IoT Hub -> -> Shared Access Policies 95 | #To send messages, ensure you use a shared access policy with at least 'device connect' permissions. 96 | #To register a new device, ensure you use a shared access policy with at least 'registry write' permissions. 97 | #The connection string will resemble: 98 | # 'HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=sdilhjlEDPvgcc1kIAW5bDlNQG6/Y7zJSoi6qSiNpcio=' 99 | connectionString = '' 100 | 101 | #This is the device name that will be registered in the IoT Hub. 102 | #If it is already registered, it will error and continue on. 103 | deviceId = '' 104 | 105 | iotHubConn = IoTHub(connectionString) 106 | #d2cMsgSender = D2CMsgSender(connectionString) 107 | sense = SenseHat() 108 | 109 | while True: 110 | 111 | try: 112 | #Uncomment this code if you want the device to self-register with IoT Hub. Otherwise use Device Explorer to register device. 113 | #print('Registering device... ' + deviceId) 114 | #print(iotHubConn.registerDevice(deviceId)) 115 | 116 | response = iotHubConn.receiveC2DMsg(deviceId) 117 | if response[1] == 200: 118 | print('Message from IoT Hub: %s' % (response[0])) 119 | etag = response[2]['ETag'] 120 | etag = etag.replace('"', '').strip() 121 | ackresponse = iotHubConn.ackC2DMsg(deviceId, etag) 122 | 123 | if str(response[0]) == "High": 124 | sense.show_message(str(response[0]), text_colour=[255, 0, 0]) 125 | else: 126 | sense.show_message(str(response[0]), text_colour=[29, 131, 72]) 127 | else: 128 | print('No messages from IoT Hub') 129 | 130 | message = str(sense.temp) 131 | print('Sending message... ' + message) 132 | print(iotHubConn.sendD2CMsg(deviceId, message)) 133 | 134 | time.sleep(5) # 5 second delay 135 | 136 | except OSError as e: 137 | print('Error: ' + str(e)) 138 | break 139 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/SenseHat_IoTHub_Http_Lab_Key.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sample code demonstrating Sense HAT running on Raspian and Raspberry Pi 3 receiving messages from Azure IoT Hub using Azure IoT Hub REST API. 3 | Azure IoT Hub REST API reference https://docs.microsoft.com/en-us/rest/api/iothub/ 4 | Sense HAT API reference https://pythonhosted.org/sense-hat/api/ 5 | Adapted from https://github.com/Azure-Samples/iot-hub-python-get-started 6 | """ 7 | 8 | import base64 9 | import hmac 10 | import hashlib 11 | import time 12 | import requests 13 | import urllib 14 | import time 15 | import sys 16 | import json 17 | 18 | #If using emulator, uncomment 'from sense_emu import SenseHat ' and comment out 'from sense_hat import SenseHat' 19 | from sense_hat import SenseHat #if using a physical SenseHat attached to Raspi 20 | #from sense_emu import SenseHat #if using a Sense HAT Emulator (Linux only) 21 | 22 | class IoTHub: 23 | 24 | API_VERSION = '2016-02-03' 25 | TOKEN_VALID_SECS = 10 26 | TOKEN_FORMAT = 'SharedAccessSignature sig=%s&se=%s&skn=%s&sr=%s' 27 | 28 | def __init__(self, connectionString=None): 29 | if connectionString != None: 30 | iotHost, keyName, keyValue = [sub[sub.index('=') + 1:] for sub in connectionString.split(";")] 31 | self.iotHost = iotHost 32 | self.keyName = keyName 33 | self.keyValue = keyValue 34 | 35 | def _buildExpiryOn(self): 36 | return '%d' % (time.time() + self.TOKEN_VALID_SECS) 37 | 38 | def _buildIoTHubSasToken(self, deviceId): 39 | resourceUri = '%s/devices/%s' % (self.iotHost, deviceId) 40 | targetUri = resourceUri.lower() 41 | expiryTime = self._buildExpiryOn() 42 | toSign = '%s\n%s' % (targetUri, expiryTime) 43 | key = base64.b64decode(self.keyValue.encode('utf-8')) 44 | 45 | if sys.version_info[0] < 3: 46 | signature = urllib.quote( 47 | base64.b64encode( 48 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 49 | ) 50 | ).replace('/', '%2F') 51 | else: 52 | signature = urllib.parse.quote( 53 | base64.b64encode( 54 | hmac.HMAC(key, toSign.encode('utf-8'), hashlib.sha256).digest() 55 | ) 56 | ).replace('/', '%2F') 57 | 58 | return self.TOKEN_FORMAT % (signature, expiryTime, self.keyName, targetUri) 59 | 60 | def registerDevice(self, deviceId): 61 | sasToken = self._buildIoTHubSasToken(deviceId) 62 | url = 'https://%s/devices/%s?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 63 | body = '{deviceId: "%s"}' % deviceId 64 | r = requests.put(url, headers={'Content-Type': 'application/json', 'Authorization': sasToken}, data=body) 65 | return r.text, r.status_code 66 | 67 | def receiveC2DMsg(self, deviceId): 68 | sasToken = self._buildIoTHubSasToken(deviceId) 69 | url = 'https://%s/devices/%s/messages/devicebound?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 70 | r = requests.get(url, headers={'Authorization': sasToken}) 71 | return r.text, r.status_code, r.headers 72 | 73 | def ackC2DMsg(self, deviceId, eTag): 74 | sasToken = self._buildIoTHubSasToken(deviceId) 75 | url = 'https://%s/devices/%s/messages/devicebound/%s?api-version=%s' % (self.iotHost, deviceId, eTag, self.API_VERSION) 76 | r = requests.delete(url, headers={'Authorization': sasToken}) 77 | return r.text, r.status_code, r.headers 78 | 79 | def sendD2CMsg(self, deviceId, message): 80 | sasToken = self._buildIoTHubSasToken(deviceId) 81 | url = 'https://%s/devices/%s/messages/events?api-version=%s' % (self.iotHost, deviceId, self.API_VERSION) 82 | r = requests.post(url, headers={'Authorization': sasToken}, data=message) 83 | return r.text, r.status_code 84 | 85 | class telemetry : 86 | def __init__(self, pitch, yaw, roll, temp, humidity): 87 | """Return a new object.""" 88 | self.DeviceId = deviceId 89 | self.pitch = pitch 90 | self.yaw = yaw 91 | self.roll = roll 92 | self.Temperature = float(temp) 93 | self.ExternalTemperature = 0 94 | self.Humidity = float(humidity) 95 | 96 | def toJSON(self): 97 | return json.dumps(self, default=lambda o: o.__dict__, 98 | sort_keys=True, indent=4) 99 | 100 | if __name__ == '__main__': 101 | 102 | #You can obtain the connection string from portal.azure.com -> IoT Hub -> -> Shared Access Policies 103 | #To send messages, ensure you use a shared access policy with at least 'device connect' permissions. 104 | #To register a new device, ensure you use a shared access policy with at least 'registry write' permissions. 105 | #The connection string will resemble: 106 | # 'HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=sdilhjlEDPvgcc1kIAW5bDlNQG6/Y7zJSoi6qSiNpcio=' 107 | connectionString = '' 108 | 109 | #This is the device name that will be registered in the IoT Hub. 110 | #If it is already registered, it will error and continue on. 111 | deviceId = '' 112 | 113 | iotHubConn = IoTHub(connectionString) 114 | #d2cMsgSender = D2CMsgSender(connectionString) 115 | sense = SenseHat() 116 | 117 | while True: 118 | 119 | try: 120 | #Uncomment this code if you want the device to self-register with IoT Hub. Otherwise use Device Explorer to register device. 121 | #print('Registering device... ' + deviceId) 122 | #print(iotHubConn.registerDevice(deviceId)) 123 | 124 | response = iotHubConn.receiveC2DMsg(deviceId) 125 | if response[1] == 200: 126 | print('Message from IoT Hub: %s' % (response[0])) 127 | etag = response[2]['ETag'] 128 | etag = etag.replace('"', '').strip() 129 | ackresponse = iotHubConn.ackC2DMsg(deviceId, etag) 130 | 131 | if str(response[0]) == "High": 132 | sense.show_message(str(response[0]), text_colour=[255, 0, 0]) 133 | else: 134 | sense.show_message(str(response[0]), text_colour=[29, 131, 72]) 135 | else: 136 | print('No messages from IoT Hub') 137 | 138 | orientation = sense.get_orientation_degrees() 139 | temp = str(sense.temp) 140 | humidity = str(sense.humidity) 141 | jsonMessage = telemetry("{pitch}".format(**orientation),"{yaw}".format(**orientation),"{roll}".format(**orientation),temp=temp, humidity=humidity) 142 | print(jsonMessage.toJSON()) 143 | response = iotHubConn.sendD2CMsg(deviceId, jsonMessage.toJSON()) 144 | print(response[1]) 145 | 146 | time.sleep(5) # 5 second delay 147 | 148 | except OSError as e: 149 | print('Error: ' + str(e)) 150 | break 151 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/StreamAnalytics/README.md: -------------------------------------------------------------------------------- 1 | # Stream Analytics Lab - Send data to Power BI 2 | 3 | Prerequisites: Power BI account 4 | 5 | In this lab, we are going to create an Azure Stream Analytics job that will take the telemetry data that is flowing through IoT Hub from the Raspberry Pi and feed it to PowerBI as the output. From PowerBI, we will use the user friendly interface to drag and drop values onto a BI canvas and create some simple reports so that we can visualize the data coming into Azure from our device. 6 | 7 | ## Optional: Stop the device simulators 8 | 9 | **This step is only relevant if you created the Remote Monitoring Solution Accelerator [(Lab 2a)](/HOL/IOTHubPiHackathon/2/README.md)**
10 | Perform this part of the module if you wish to populate your PowerBI report with only data coming from your physical Raspberry Pi and not the simulated devices provisioned as part of the solution accelerator. The following steps will stop the telemetry data flowing from the simulated devices to your IoT Hub. 11 | 12 | 1. Go to the web app that was provisioned as part of the Remote Monitoring solution accelerator. 13 | - Navigate to the [Azure portal](https://ms.portal.azure.com) 14 | - Click the resource group icon -> click the name of the group of your Remote Monitoring solution -> click the App Service that was created when you provisioned the solution. 15 | 16 |

17 | 18 |

19 | 20 | - Click 'Browse' to navigate to the web app. 21 | 22 |

23 | 24 |

25 | 26 | 2. You should be at the same device dashboard as when you initially launched the preconfigured solution. 27 | - Click the 'Gear' icon in the upper right corner 28 | 29 |

30 | 31 |

32 | 33 | 3. Toggle the 'Simulation data' slider so that it reads 'Stopped'. This will stop all telemetry data and associated alerts from the simulated devices. 34 | 35 |

36 | 37 |

38 | 39 | ## Create Azure Stream Analytics (ASA) Job 40 | 41 | 1. Log into the [Azure portal](https://ms.portal.azure.com) 42 | 2. Add an Azure Stream Analytics (ASA) Job 43 | - Click on "+ Create a resource" 44 | 45 |

46 | 47 |

48 | 49 | - In the "Search the marketplace" box, type in "Stream Analytics". Click on the "Stream Analytics job" option that shows up. 50 | 51 |

52 | 53 |

54 | 55 | 1. Click on the "Stream Analytics job" that shows up in the results. Click "Create". 56 | 57 |

58 | 59 |

60 | 61 | 1. Enter a name for your job. eg. "HandsOnLab-PowerBI" 62 | 1. Choose your subscription. Use the same subscription you used to provision everything else in this lab. 63 | 1. Choose a Resource Group. Use the existing Resource Group that was created previously. This will make it easier to delete all the resources when you are done with the lab. 64 | 1. Choose a Location. Try and choose the same location as where the rest of your solution has been provisioned. 65 | 1. Select "Cloud" for the Hosting Environment. With the IoT Edge gateway solution, you can now push ASA jobs down to the edge and have ASA jobs run locally on premise on your gateway solution. In these labs, we are going to use the cloud ASA job to filter out data streaming through IoT Hub and pass that data down to PowerBI. 66 | 1. Leave the Streaming Units at 1. Streaming Units are the pool of computation resources available for the Stream Analytics job. 67 | 1. Click "Create". Feel free to click the "Pin to dashboard" check box. This will add the newly created ASA service to the main Azure portal dashboard. 68 | 69 |

70 | 71 |

72 | 73 | - Wait for the job to be created. You will see a notification banner that will pop up in the top right corner of the Azure portal to indicate the status of the job. This banner will disappear automatically. If you wish to see all the past notifications, click the bell icon. 74 | 75 |

76 | 77 |

78 | 79 | - Next, you will add an Input for the Stream Analytics job. 80 | - Click on "Go to Resource", or 81 | - If you pinned the ASA service to the dashboard, you will see the ASA tile on the main Azure portal page. Click it. 82 | 83 |

84 | 85 |

86 | 87 | If not, click "Resource Groups" -> Your *resource group name* -> Your *ASA name* 88 | 89 |

90 | 91 |

92 | 93 | - Under the "Job Topology" category, click on "Inputs". 94 | - Click "+ Add Stream input". 95 | 96 |

97 | 98 |

99 | 100 | - In the pop up menu that appears, select "IoT Hub" 101 |

102 | 103 |

104 | 105 | - In the "New Input" blade that appears, fill in the fields: 106 | - Input Alias: This is a free form text name for the input to the ASA job. eg. "IoTHub" 107 | - Choose "Select IoT Hub from your subscriptions". We will be connecting the ASA job to the IoT Hub you created and collecting streaming data from that existing IoT Hub 108 | - Subscription: Choose the name of your IoT Hub from your current subscription 109 | - IoT Hub: Choose the IoT Hub you have been using for the lab 110 | - Endpoint: Messaging 111 | - Shared Access Policy Name: iothubowner 112 | - Consumer Group: asa (we created this earlier) 113 | - Event Serialization Format: JSON 114 | - Encoding: UTF-8 115 | - Event Compression Type: None 116 | - Click "Save" and wait for the input to be created. 117 |

118 | 119 |

120 | 121 | - Next, add an Output for the Stream Analytics job. 122 | 1. Under the "Job Topology" category, click on "Outputs". 123 | 124 |

125 | 126 |

127 | 128 | 1. Click "+ Add" in the blade to the right and select "PowerBI" 129 | 1. Fill out the values in the "New Output" blade. 130 | - Enter in any free form text for the "Output alias". eg. "PowerBI" 131 | - Click the "Authorize" button to make the connection to your PowerBI account. In the pop-up window that appears, enter in your PowerBI username and password. 132 | 133 |

134 | 135 |

136 | 137 | - A new window will open requiring credentials to authorize the connection to PowerBI. Enter your credentials and click "Sign in". 138 |

139 | 140 |

141 | 142 | - Once you enter in the correct credentials, the "Group Workspace" drop down field should populate. Choose the workspace that you want the ASA streaming data to be stored. eg. "My workspace" 143 | - Enter a Dataset name. A dataset is a collection of data tables. eg. Raspberry Pi Dataset 144 | - Enter a Table Name. eg. Raspberry Pi Data Table 145 | - Click "Save" 146 |

147 | 148 |

149 | 150 | - Wait for the input and output to be created. Check the Notifications in the portal for a successful connection test. 151 | 152 | - Create an ASA Query. 153 | - Under the "Job Topology" category, click on "Query". The inline query editing tool will already have some stub code inserted. You will make some modifications to the query. 154 | - Enter a query like the following: (Note, if you named your Input and Output bindings something different then you will have to update the query parameters to correspond correctly) 155 | ``` 156 | SELECT 157 | * 158 | INTO 159 | [PowerBI] 160 | FROM 161 | [IoTHub] 162 | ``` 163 | - Click "Save". 164 | - If you wish to run a test on your newly generated query, you will need to upload some sample data that the ASA Query tool will use to run the query. To generate a sample file, you can either manually generate your own file or get a sampling of data from the IoT Hub input. Click the elipses (...) beside the IoTHub input and click "Sample data from input" to start collecting data. Click the "Upload sample data from file" option once you have created a sample file and then run the query test by clicking the "Test" button. 165 | 166 |

167 | 168 |

169 | 170 | - Start the ASA Job 171 | 1. Click on "Overview" 172 | 1. Click the "Start" button 173 | 174 |

175 | 176 |

177 | 178 | 1. For the "Job output start time", click "Now" 179 | 1. Click "Start" 180 | 181 |

182 | 183 |

184 | 185 | ## View Telemetry data in Power BI 186 | 1. Open Power BI in a web browser - https://powerbi.microsoft.com 187 | 1. Sign in. 188 | 1. Go to the bottom of the bar on the left. Expand "My Workspace" and select "Datasets" to see the dataset you configured in Azure Stream Analytics (eg. Raspberry Pi Dataset). If you don't see the dataset that you created in the list, it's likely that no data has been streamed into your ASA job yet. Make sure that your ASA job has started and that there's input and output events showing up in your monitoring graph. Ask an instructor for assistance if you have any issues with this. 189 | 190 |

191 | 192 |

193 | 194 | 1. Click on "My Workspace". Click on the "Dashboards" tab, and select "+ Create" from the top right corner. Choose "Dashboard" 195 | 196 | ![New Dashboard](/HOL/IOTHubPiHackathon/images/PowerBINewDashboard.PNG) 197 | 198 | 1. Give the dashboard a name. eg. "Lab Dashboard" 199 | 200 | ![New Dashboard](/HOL/IOTHubPiHackathon/images/PowerBINameDashboard.jpg) 201 | 202 | 1. Click on "Add tile" and select "REAL-TIME DATA". Select "Next". 203 | 204 | ![New Tile](/HOL/IOTHubPiHackathon/images/PowerBINewTile.PNG) 205 | 206 | 1. Click on the dataset you created under "YOUR DATASETS". Select "Next". 207 | 208 | ![Select Dataset](/HOL/IOTHubPiHackathon/images/PowerBIYourDataset.PNG) 209 | 210 | 1. Under "Visualization Type", select "Line chart". Under "Axis", select "EventEnqueuedUtcTime". Under "Values" select "Temperature". Select an appropriate time window. eg. 1-5 minutes. Select "Next". 211 | 212 | ![Configure Tile](/HOL/IOTHubPiHackathon/images/PowerBITileConfig.PNG) 213 | 214 | 1. Give your tile a title. eg. "Real-time Raspberry Pi temperature". Select "Apply". 215 | 216 | ![Tile Details](/HOL/IOTHubPiHackathon/images/PowerBITileDetails.PNG) 217 | 218 | 1. Ignore the phone configuration by clicking on the "X" to close the window. 219 | 220 | 1. You are now viewing your Raspberry Pi temperature data in (near) real time. 221 | 222 | ![Real Time Data](/HOL/IOTHubPiHackathon/images/PowerBIRealTimeData.PNG) 223 | 224 | [Next lab - 5 Azure Functions](/HOL/IOTHubPiHackathon/AzureFunction) 225 | 226 | [Back to Main HOL Instructions](/HOL/IOTHubPiHackathon/README.md) 227 | -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ASANewInput.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ASANewInput.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ASAQuery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ASAQuery.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ASAQueryBlob.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ASAQueryBlob.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/AddNewCustomDevice.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/AddNewCustomDevice.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/AppService1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/AppService1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/AppService2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/AppService2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/AzureNewButton.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/AzureNewButton.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/AzureNotification.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/AzureNotification.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/AzureToolBar.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/AzureToolBar.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/BingMapsSearch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/BingMapsSearch.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/BlobIoTData.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/BlobIoTData.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/BlobIoTDataDownload.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/BlobIoTDataDownload.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/BlobStorage.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/BlobStorage.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/BrowseToWebApp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/BrowseToWebApp.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ChangeVersion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ChangeVersion.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ChangeVersion2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ChangeVersion2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ChooseEventHub.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ChooseEventHub.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CommandPrompt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CommandPrompt.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ConnectionString.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ConnectionString.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateAResource.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateAResource.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateAResource.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateAResource.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateBingMapsAPI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateBingMapsAPI.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateBingMapsAPI2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateBingMapsAPI2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateDevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateDevice.png -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateEHTrigger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateEHTrigger.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateFunction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateFunction.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateFunction1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateFunction1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateFunction2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateFunction2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateFunction3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateFunction3.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateFunction4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateFunction4.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateIoTHubBasics.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateIoTHubBasics.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateIoTHubBasics2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateIoTHubBasics2.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateIoTHubBasics3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateIoTHubBasics3.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreatePowerBIReport.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreatePowerBIReport.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateReport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateReport.png -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CreateSAS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CreateSAS.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CustomDeviceParams.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CustomDeviceParams.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/CustomFunction.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/CustomFunction.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/DeletePCS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/DeletePCS.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/DeviceExplorer-Connect.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/DeviceExplorer-Connect.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/DeviceExplorer-ReceiveData.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/DeviceExplorer-ReceiveData.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/DeviceExplorer-ReceiveEvents.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/DeviceExplorer-ReceiveEvents.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/DeviceExplorer.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/DeviceExplorer.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/EHCompatibleEP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/EHCompatibleEP.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/EHConnectionString.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/EHConnectionString.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/EHTrigger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/EHTrigger.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/EHconnection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/EHconnection.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/EHendpointValues.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/EHendpointValues.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/Fields.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/Fields.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionConfigConncetion.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionConfigConncetion.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionEHEndpoint.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionEHEndpoint.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionIOTHubFunctions.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionIOTHubFunctions.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionInPortal.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionInPortal.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionIoTHubEventHub.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionIoTHubEventHub.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionIoTHubNewConncetion.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionIoTHubNewConncetion.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionMoreTemplates.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionMoreTemplates.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionNewFunction.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionNewFunction.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionUploadProj.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionUploadProj.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionsConnectionString.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionsConnectionString.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionsV2AddFunctionFile.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionsV2AddFunctionFile.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionsV2GetStarted.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionsV2GetStarted.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionsV2MoreTemplates.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionsV2MoreTemplates.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionsV2RunFunction.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionsV2RunFunction.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionsV2SaveProj.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionsV2SaveProj.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/FunctionsV2ViewFiles.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/FunctionsV2ViewFiles.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubConnectionString.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubConnectionString.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubExplorerGet.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubExplorerGet.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubExplorerLogin.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubExplorerLogin.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubExplorerMonitor.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubExplorerMonitor.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubExplorerSend.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubExplorerSend.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubKeys1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubKeys1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubKeys2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubKeys2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubParams.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubParams.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IoTHubTrigger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IoTHubTrigger.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/IotHubConnection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/IotHubConnection.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ListFiles.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ListFiles.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/MonitorDevice.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/MonitorDevice.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/NewFunction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/NewFunction.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/NewFunction1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/NewFunction1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/NewRMPCS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/NewRMPCS.png -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/NewStorageAccount.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/NewStorageAccount.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/NewStorageAccount1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/NewStorageAccount1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/Notifications.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/Notifications.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/OpenSettingsInWebApp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/OpenSettingsInWebApp.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/OpenWebApp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/OpenWebApp.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/Pin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/Pin.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBIAddStreamingDataset.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBIAddStreamingDataset.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBILab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBILab.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBINameDashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBINameDashboard.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBINewDashboard.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBINewDashboard.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBINewTile.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBINewTile.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBIRealTimeData.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBIRealTimeData.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBITileConfig.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBITileConfig.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBITileDetails.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBITileDetails.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PowerBIYourDataset.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PowerBIYourDataset.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ProvisioningState.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ProvisioningState.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ProvisioningState2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ProvisioningState2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/PuTTY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/PuTTY.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/QueryKey1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/QueryKey1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/QueryKey2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/QueryKey2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/RMDashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/RMDashboard.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/RMDashboardwArrow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/RMDashboardwArrow.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/RMPCS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/RMPCS.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/RMPCS2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/RMPCS2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/RMSignIn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/RMSignIn.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/RemoteMonitoringTryNow.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/RemoteMonitoringTryNow.PNG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ResourceGroupForIoTHub.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ResourceGroupForIoTHub.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/SABlobOutput.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/SABlobOutput.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/Select.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/Select.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/SelectASAOutputBlob.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/SelectASAOutputBlob.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/SelectLineChart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/SelectLineChart.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/SendMsg-DvcExplorer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/SendMsg-DvcExplorer.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/SenseMsgDisplay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/SenseMsgDisplay.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/SolutionReady.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/SolutionReady.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/SolutionReady2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/SolutionReady2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/StopSimulatedDeviceData.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/StopSimulatedDeviceData.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/StreamAnalyticsBlob.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/StreamAnalyticsBlob.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/ValidAccelerators.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/ValidAccelerators.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/Visualizations.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/Visualizations.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/addInput1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/addInput1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/addOutput.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/addOutput.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/addProject.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/addProject.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/authorizePBI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/authorizePBI.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/clickASA1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/clickASA1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/clickASA2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/clickASA2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/clickASABlob.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/clickASABlob.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/consumerGroups.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/consumerGroups.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/createNewFunction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/createNewFunction.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/enableVNC.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/enableVNC.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/eventHubTrigger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/eventHubTrigger.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/functionConnection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/functionConnection.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/functionViews.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/functionViews.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/functionsTicket.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/functionsTicket.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/menu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/menu.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/newASA.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/newASA.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/newASA1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/newASA1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/newASA3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/newASA3.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/newASA4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/newASA4.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/newDevice.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/newDevice.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/newFunction1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/newFunction1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/pauseSimulatedDevices.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/pauseSimulatedDevices.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/permissions.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/permissions.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/powerBIOutput.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/powerBIOutput.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/powerBIOutput2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/powerBIOutput2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/projectSave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/projectSave.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/reduceAppService.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/reduceAppService.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/reduceIoTHub.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/reduceIoTHub.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/reduceStorage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/reduceStorage.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/runC2D.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/runC2D.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/runFunction.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/runFunction.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/selectIoTHub.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/selectIoTHub.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/selectRMS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/selectRMS.png -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/startASA.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/startASA.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/startASA2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/startASA2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/twinTag1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/twinTag1.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/twinTag2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/twinTag2.jpg -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/images/wifi.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/IIoT/77be90e9dba0dd0b0d3b947fd55dff9181552d99/HOL/IOTHubPiHackathon/images/wifi.JPG -------------------------------------------------------------------------------- /HOL/IOTHubPiHackathon/sample_payload.json: -------------------------------------------------------------------------------- 1 | { 2 | "DeviceId": "RaspberryPi", 3 | "ExternalTemperature": 0, 4 | "Humidity": 7.42866516113, 5 | "Temperature": 37.8324356079, 6 | "pitch": "2.14371527549", 7 | "roll": "301.881776918", 8 | "yaw": "160.873863408" 9 | } 10 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2016 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the “Software”), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IIoT 2 | Industrial IoT Samples, Solutions and Documentation 3 | 4 | ## License 5 | This project is licensed under the [MIT License](LICENSE.txt) 6 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | --------------------------------------------------------------------------------