IoT Workshop

Joanna Lamch

IoT Workshop

IoT solutions on Azure

Excersises

I:๐ŸŒธ Create IoT Hub

  1. Go to Azure Portal
  2. Create IoT Hub
    • preferable S1 tier
    • 1 unit
    • 4 partitions
  3. Create device
    • IoT Devices -> New
    • with symetric key
  4. Go to your device and open connection strings, we will need it later
    • IoT Devices -> your device -> Primary Connection String

I:๐ŸŒธ VS Code for IoT Hub

  1. In VS Code call Command Palette and call Azure: Sign in
  2. In Explorer at the bottom go to Azure IoT Hub
    • select More actionsโ€ฆ
    • Select IoT Hub
  3. Select Devices
    • select your device
    • Start monitoring build-in endpoints
    • observe messages in Output window

I:๐ŸŒธ VS Code Simulate device

  1. Select Devices
    • select your device
    • Send D2C Messages
    • set your text and send
  2. While sending look into Output windows

II:๐Ÿฅ€ Arduino create project

  1. Create new project
    • Shift + Ctrl + P => Command Palette
    • Azure IoT Device Workbench: Create Project
    • choose project name
    • close all instances of VS Code
    • open again ale wait about minute

II:๐Ÿฅ€ Arduino fun

  1. Go to documentation and choose what you want to code

III:๐Ÿ’ฎ IoT DevKit

  1. Update firmware
  2. Set WIFI connection - Access Point mode
    • => Hold B, press Reset - still holding B just press and release Reset still holding B, release B
  3. Connect to you DevKit access point
  4. Configure WIFI at 192.168.0.1
  5. See sensors reading => Press B

IV:๐ŸŒน Getting started

  1. Upload getting started program Solution link
  2. Configure getting started
    • => Hold B, press Reset - still holding B just press and release Reset still holding B,
    • => release B
  3. Connect to you DevKit access point
  4. Configure at 192.168.0.1
    • set WIFI
    • set connection string from recent demo
    • restart device

IV:๐ŸŒน Getting started - Cold Path

  1. Go to Azure portal
    • go to Message routing
    • Add
    • on Add Route page Add endpoint, storage
    • fill name, choose frequency, choose JSON and pick container
    • create or choose storage account and container
  2. Check storage
    • body is encripted with Base64

V:๐ŸŒบ Hot Path

VI:๐ŸŒต IoT Central

  1. Create your own IoT Central application on Solution page
  2. Upload MXChipa current release
  3. Add new device
    • Devices > + > Real
    • set Device Name

VI:๐ŸŒต IoT Central - configure device

  1. Open your device configuration
    • Devices > your device
    • Connect in right upper corner - leave it open
  2. Configure device
    • restart device
    • press A and B right after restart at the same time
    • connect to access point
    • open 192.168.0.1 and set all needed informations from point 2 and device display
    • reboot device

VII:๐ŸŒป Stream Analytics to Storage Account

  1. Create new container in existing Storage Account
  2. Create Stream Analytics Job
  3. Configure Stream Analytics Job
    • set Storage Account as output
    • set IoT Hub as input
    • write Query - choose what you want to save
    • start job

VII:๐ŸŒป Stream Analytics to SQL

  1. Create SQL Database
    • create new database without any tables
  2. Create new SQL to Stream Analytic integration
    • go to SQL Database
    • in integration create new Stream Analytic Job
    • set IoT Hub as input
    • create satisfying query
    • run test Query to create Sql schema
    • run job

VII:๐ŸŒป Stream Analytics multiple queries

  1. Combine both jobs quesies in one job
    • add needed inputs
    • put needed queries
  2. Add new query for max value for temperature
    • use MAX(value)
    • use tumbling or sliding window