Skip to content
This repository was archived by the owner on Jan 14, 2020. It is now read-only.

Latest commit

 

History

History
70 lines (50 loc) · 3.36 KB

Readme.md

File metadata and controls

70 lines (50 loc) · 3.36 KB

Door Monitor

Steps to start

  1. Setup development environment by following Get Started
  2. Open VS Code
  3. Press F1 or Ctrl + Shift + P - IoT Workbench: Examples and select DoorMonitor

Deploy SendGrid service in Azure

  1. click the Deploy to Azure button below and deploy SendGrid Service.

    Deploy to Azure

  2. After the deployment succeeds, click the resource and then click the Manage button. You are taken to your SendGrid page, and need to verify your email address.

  3. On the SendGrid page, click Settings > API Keys > Create API Key. Input the API Key Name and click Create & View.

  4. Copy the API key.

Creating the Azure Logic App

  1. Open the Azure Portal

  2. Select the + or Create a resource button and under Enterprise Integration choose Logic App

  3. Give it a Name, Resource Group, and Region (any will do) and click Create

  4. After the logic app is created, open it

  5. The designer should automatically load - if not click the Edit button

  6. Select the When an HTTP request is received trigger

  7. Click New Step to add a step to the workflow and Add an action

  8. Search for the key word of Send email action.

    NOTE: You are more than welcome to use any action you want to perform on an IoT event

  9. Select the SendGrid - Send email(V2) action and provide the detailed information of the email.

  10. Authenticate this logic app by using the SendGrid API key you created before..

  11. Click the Save button to save this serverless workflow.

  12. Click the When a HTTP request is received card to open and reveal the URL generated after saving. Copy that URL.

Provision Azure Services

  1. Press F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench:Cloud and click Azure Provision
  2. Select a subscription.
  3. Select or choose a resource group.
  4. Select or create an IoT Hub.
  5. Wait for the deployment.
  6. Select or create an IoT Hub device. Please take a note of the device name.
  7. Create Function App.
  8. Wait for the deployment.

Deploy Function App

  1. Open shakeshake\run.csx and modify the following line with the URL you created in the previous step.
var response = await client.PostAsync("https://prod-1....", httpContent);
  1. ress F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench: Cloud and click Azure Deploy.
  2. Wait for function app code uploading.

Configure IoT Hub Device Connection String in DevKit

  1. Connect your DevKit to your machine.
  2. Press F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench: Device and click config-device-connection.
  3. Hold button A on DevKit, then press rest button, and then release button A to enter config mode.
  4. Wait for connection string configuration to complete.

Upload Arduino Code to DevKit

  1. Connect your DevKit to your machine.
  2. Press F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench:Device and click Device Upload.
  3. Wait for arduino code uploading.