SlideShare une entreprise Scribd logo
1  sur  56
FieldGateways
ProtocolAdapters
OSSProject
CloudGateway
EventHub->IoTHub
Hot Path Analytics
Azure Stream Analytics, Azure Storm
Cold / Batch Analytics & Visualizations
Azure HDInsight, AzureML, Power BI,
Azure Data Factory
Hot Path Business Logic
PaaS V2 & Actor Framework
EnterpriseProcessConnections
BizTalkServices,NotificationHubs
Devices
Linux,Android,iOS,RTOS,Windows
Device
Connectivity
Analytics &
Operationalized Insights
Business
Connectivity
FieldGateways
ProtocolAdapters
OSSProject
CloudGateway
IoTHub
Hot Path Analytics
Azure Stream Analytics, Azure Storm
Cold / Batch Analytics & Visualizations
Azure HDInsight, AzureML, Power BI,
Azure Data Factory
Hot Path Business Logic
PaaS V2 & Actor Framework
EnterpriseProcessConnections
BizTalkServices,NotificationHubs
Devices
Linux,Android,iOS,RTOS,Windows
Device
Connectivity
Analytics &
Operationalized Insights
Business
Connectivity
MCU + MPUMCU (e.g. ATMega) MPU
Micro-controller (MCU) MCU + MPU MPU
Example
Arduino Pro Mini Arduino Uno Arduino Yún Particle Photon Raspberry Pi 2
MinnowBorad
MAX
Micro-
controller
ATmega328 ATmega328 ATmega32u4 -- -- --
Micro-
processor
-- -- Atheros AR9331 ARM Cortex-M3 ARM Cortex-A7 Intel Atom E38xx
GPU No No No No Yes Integrated
Wi-Fi SoC No No Yes Yes No No
Linux No No Yes No Yes Yes
Windows 10
IoT
No No No No Yes Yes
Preparing your development environment
Photon.ThingLabs.io/00/
(v 4.0 is not compatible with this lab)
If you have a 64-bit OS, be sure to install the
64-bit version of Node.js
The fundamentals of maker development kits
Azure IoT
Azure IoT
SETUP
Push & Hold to set to
Listen mode
D7
Digital pin with
onbaod LED
RESET
Push to reboot
Azure IoTParticle Cloud
The ‘Hello, World!’ of devices
Photon.ThingLabs.io/01/
Tweet with @ThingLabsIO and #HelloIoT
"name" "IoT-Labs"
"version" "0.1.0"
"private"
"description" ”Building Things with Node.js and Johnny-Five"
"main" ”lab01.js"
"author" "YOUR NAME HERE"
"license" "MIT"
"dependencies"
"johnny-five" "^0.8.104”
"particle-io" "^0.10.1”
// lab01.js
var "johnny-five"
var "particle-io"
// Set up the access credentials for Particle and Azure
var 'YOUR PARTICLE ACCESS TOKEN HERE'
var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE'
// Define the pin that is connected to the LED
var
// Create a Johnny Five board instance to represent your Particle Photon.
// ‘Board ‘is simply an abstraction of the physical hardware,
// whether it is a Photon, Arduino, Raspberry Pi or other boards.
var new
new
// The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
"ready" function
"Board connected..."
// Set the pin you connected to the LED to OUTPUT mode
this
// Create a loop to "flash/blink/strobe" the LED once per second
var
this function
this
In this lab you will read input from an analog sensor using a voltage divider.
Photon.ThingLabs.io/02/
Tweet with @ThingLabsIO and #ilikedark
A voltage divider splits input
voltage input amongst two or
more components.
The resisted voltage indicates the
value.
Brighter light == Less resistance;
// lab02.js
var "johnny-five"
var "particle-io"
// Set up the access credentials for Particle and Azure
var 'YOUR PARTICLE ACCESS TOKEN HERE'
var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE'
// Define the pin you will use to read the residual voltage
// coming from the photoresistor
var
// Create a Johnny Five board instance to represent your Particle Photon.
// ‘Board ‘is simply an abstraction of the physical hardware, whether
// it is a Photon, Arduino, Raspberry Pi or other boards.
var new
new
// The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
"ready" function
"Board connected..."
// Read the residual voltage coming from the photoresistor
this function
// Multiple the value by 3.3V / 1024, which the the
// value range of the photoresistor
In this lab you will use analog input to control digital output.
Photon.ThingLabs.io/03/
Tweet with @ThingLabsIO and #NightLight
// lab03.js
var "johnny-five"
var "particle-io"
// Set up the access credentials for Particle and Azure
var 'YOUR PARTICLE ACCESS TOKEN HERE'
var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE'
// Define the pin that is connected to the LED
var “D0"
// Define the pin you will use to read the residual voltage
// coming from the photoresistor
var "A0"
// Create a Johnny Five board instance to represent your Particle Photon. ‘Board ‘is
simply an abstraction of
// the physical hardware, whether it is a Photon, Arduino, Raspberry Pi or other boards.
var new
new
// The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
"ready" function
"Board connected..."
// Set the pin you connected to the LED to OUTPUT mode
this
// Create a new 'photoresistor' hardware instance.
new
// Analog pin 0
// TODO: Handle the photoresistor data events
// Replace ‘TODO: Handle the photoresistor data events’ with the following:
// Define the callback function for the photoresistor reading.
// The freq value used when the photoresistor was defined
// determines how often this is invoked.
// Scale the sensor's data from 0-1023 to 0-255.
"data" function
// Multiple the value by 3.3V / 1024, which the the
// value range of the photoresistor
this
// Set the brigthness of the LED
this
The fundamentals of connecting Things to the Cloud
In this lab you will gather telemetry and send it to the cloud.
Azure.ThingLabs.io/02/
Tweet with @ThingLabsIO and #Telemetry
{
"name": "IoT-Labs",
"version": "0.1.0",
"private": true,
"description": "Sample app that connects a device to Azure using Node.js",
"main": "weather.js",
"author": "YOUR NAME HERE",
"license": "MIT",
"dependencies": {
"johnny-five": "^0.8.104",
"particle-io": "^0.10.1” ,
"j5-sparkfun-weather-shield": "^0.2.0",
"azure-iot-device": "^1.0.0-preview.3”
}
}
// weather.js
var five = require ("johnny-five");
var device = require("azure-iot-device");
var Weather = require("j5-sparkfun-weather-shield")(five);
var Particle = require("particle-io");
// Set up the access credentials for Particle and Azure
var token = 'YOUR PARTICLE ACCESS TOKEN HERE';
var deviceId = 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE';
var location = 'THE LOCATION OF THE PARTICLE PHOTON DEVICE';
var connectionString = 'YOUR IOT HUB DEVICE-SPECIFIC CONNECTION STRING HERE';
// Create a Johnny Five board instance to represent your Particle Photon.
// Board is simply an abstraction of the physical hardware, whether it is
// a Photon, Arduino, Raspberry Pi or other boards.
var board = new five.Board({
io: new Particle({
token: token,
deviceId: deviceId
})
});
// Create an Azure IoT client that will manage the connection to your IoT Hub
// The client is created in the context of an Azure IoT device, which is why
// you use a device-specific connection string.
var client = new device.Client(connectionString, new device.Https());
// The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
board.on("ready", function() {
console.log("Board connected...");
// The SparkFun Weather Shield for the Particle Photon has two sensors on the I2C bus –
// a humidity sensor (HTU21D) which can provide both humidity and temperature, and a
// barometer (MPL3115A2) which can provide both barometric pressure and humidity.
// Controllers for these are wrapped in the convenient ‘Weather’ plug-in class:
var weather = new Weather({
variant: "PHOTON",
freq: 1000,
elevation: 100 // Put your current elevation (in feet) here
})
// Don’t close the board.on() function yet
// The weather.on("data", callback) function invokes the anonymous callback function
// whenever the data from the sensor changes (no faster than every 25ms). The anonymous
// function is scoped to the object (e.g. this == the instance of Weather class object).
weather.on(“data" , function () {
// Create an Azure IoT Message
var payload = JSON.stringify({
deviceId: deviceId,
location: location,
// celsius & fahrenheit are averages taken from both sensors on the shield
celsius: this.celsius,
fahrenheit: this.fahrenheit,
relativeHumidity: this.relativeHumidity,
pressure: this.pressure,
feet: this.feet,
meters: this.meters
});
// Don’t close the weather.on() or board.on() functions yet
// Create the message based on the payload JSON
var message = new device.Message(payload);
// For debugging purposes, write out the message payload to the console
console.log("Sending message: " + message.getData());
// Send the message to Azure IoT Hub
// printResultsFor() is a function you will write next
client.sendEvent(message, printResultFor('send'));
}); // Close the weather.on() function
}); // Close the board.on() function
In this lab you will create visualizations of IoT data.
Azure.ThingLabs.io/03/
Tweet with @ThingLabsIO and #IoTBI
SELECT
MAX(fahrenheit) MaxTempF,
MIN(fahrenheit) MinTempF,
AVG(fahrenheit) AvgTempF,
MAX(celsius) MaxTempC,
MIN(celsius) MinTempC,
AVG(celsius) AvgTempC,
MAX(relativeHumidity) MaxHumidity,
MIN(relativeHumidity) MinHumidity,
AVG(relativeHumidity) AvgHumidity,
location,
deviceId,
System.Timestamp AS Timestamp
INTO
[TemperatureBI]
FROM
[DeviceInputStream]
GROUP BY
TumblingWindow (second, 1), deviceId, location
Tweet with @ThingLabsIO and #ThatWasAwesome

Contenu connexe

Tendances

Sun Spot Talk
Sun Spot TalkSun Spot Talk
Sun Spot Talkvittalp88
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsSander van der Burg
 
Event driven-automation and workflows
Event driven-automation and workflowsEvent driven-automation and workflows
Event driven-automation and workflowsDmitri Zimine
 
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive servicesBirdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive servicesJohn Staveley
 
Mistral and StackStorm
Mistral and StackStormMistral and StackStorm
Mistral and StackStormDmitri Zimine
 
Virus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing GatekeeperVirus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing GatekeeperSynack
 
Gatekeeper Exposed
Gatekeeper ExposedGatekeeper Exposed
Gatekeeper ExposedSynack
 
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade ServerlessKatyShimizu
 
Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...nimak
 
Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019Moses Schwartz
 
Raspberry pi and Azure
Raspberry pi and AzureRaspberry pi and Azure
Raspberry pi and AzureFaisal Mehmood
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT Meetup
 

Tendances (13)

Sun Spot Talk
Sun Spot TalkSun Spot Talk
Sun Spot Talk
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented Systems
 
Event driven-automation and workflows
Event driven-automation and workflowsEvent driven-automation and workflows
Event driven-automation and workflows
 
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive servicesBirdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
 
Mistral and StackStorm
Mistral and StackStormMistral and StackStorm
Mistral and StackStorm
 
Join FIWARE Lab
Join FIWARE LabJoin FIWARE Lab
Join FIWARE Lab
 
Virus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing GatekeeperVirus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing Gatekeeper
 
Gatekeeper Exposed
Gatekeeper ExposedGatekeeper Exposed
Gatekeeper Exposed
 
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
 
Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...
 
Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019
 
Raspberry pi and Azure
Raspberry pi and AzureRaspberry pi and Azure
Raspberry pi and Azure
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
 

Similaire à ThingLabs IoT Workshop

Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Amarjeetsingh Thakur
 
IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2John Staveley
 
Report for weather pi
Report for weather piReport for weather pi
Report for weather piAsutosh Hota
 
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & RulesAmazon Web Services
 
Webshield internet of things
Webshield internet of thingsWebshield internet of things
Webshield internet of thingsRaghav Shetty
 
Introducing the Sun SPOTs
Introducing the Sun SPOTsIntroducing the Sun SPOTs
Introducing the Sun SPOTsStefano Sanna
 
Scripting Things - Creating the Internet of Things with Perl
Scripting Things - Creating the Internet of Things with PerlScripting Things - Creating the Internet of Things with Perl
Scripting Things - Creating the Internet of Things with PerlHans Scharler
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection systemAashiq Ahamed N
 
Ardunio + MySQL = direct database connections.
Ardunio + MySQL = direct database connections.  Ardunio + MySQL = direct database connections.
Ardunio + MySQL = direct database connections. Walter W. Leutwyler
 
How To Electrocute Yourself using the Internet
How To Electrocute Yourself using the InternetHow To Electrocute Yourself using the Internet
How To Electrocute Yourself using the InternetAlexander Roche
 
Programming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineProgramming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineAmazon Web Services
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Codemotion
 
Fire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS FirewallsFire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS FirewallsPriyanka Aash
 
Controlling robots using javascript
Controlling robots using javascriptControlling robots using javascript
Controlling robots using javascriptSudar Muthu
 
Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2FIWARE
 
FIWARE Training: Connecting to Legacy Systems, IoT and other Systems
FIWARE Training: Connecting to Legacy Systems, IoT and other SystemsFIWARE Training: Connecting to Legacy Systems, IoT and other Systems
FIWARE Training: Connecting to Legacy Systems, IoT and other SystemsFIWARE
 
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)Amazon Web Services Korea
 
Microsoft's view of the Internet of Things (IoT) by Imran Shafqat
Microsoft's view of the Internet of Things (IoT) by Imran ShafqatMicrosoft's view of the Internet of Things (IoT) by Imran Shafqat
Microsoft's view of the Internet of Things (IoT) by Imran ShafqatAllied Consultants
 

Similaire à ThingLabs IoT Workshop (20)

Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)Introduction to Things board (An Open Source IoT Cloud Platform)
Introduction to Things board (An Open Source IoT Cloud Platform)
 
IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2IoT on Raspberry PI v1.2
IoT on Raspberry PI v1.2
 
Report for weather pi
Report for weather piReport for weather pi
Report for weather pi
 
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
(MBL312) NEW! AWS IoT: Programming a Physical World w/ Shadows & Rules
 
SRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoTSRV408 Deep Dive on AWS IoT
SRV408 Deep Dive on AWS IoT
 
Webshield internet of things
Webshield internet of thingsWebshield internet of things
Webshield internet of things
 
Introducing the Sun SPOTs
Introducing the Sun SPOTsIntroducing the Sun SPOTs
Introducing the Sun SPOTs
 
Scripting Things - Creating the Internet of Things with Perl
Scripting Things - Creating the Internet of Things with PerlScripting Things - Creating the Internet of Things with Perl
Scripting Things - Creating the Internet of Things with Perl
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection system
 
Ardunio + MySQL = direct database connections.
Ardunio + MySQL = direct database connections.  Ardunio + MySQL = direct database connections.
Ardunio + MySQL = direct database connections.
 
How To Electrocute Yourself using the Internet
How To Electrocute Yourself using the InternetHow To Electrocute Yourself using the Internet
How To Electrocute Yourself using the Internet
 
Book
BookBook
Book
 
Programming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules EngineProgramming the Physical World with Device Shadows and Rules Engine
Programming the Physical World with Device Shadows and Rules Engine
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Fire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS FirewallsFire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS Firewalls
 
Controlling robots using javascript
Controlling robots using javascriptControlling robots using javascript
Controlling robots using javascript
 
Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2Fiware IoT_IDAS_intro_ul20_v2
Fiware IoT_IDAS_intro_ul20_v2
 
FIWARE Training: Connecting to Legacy Systems, IoT and other Systems
FIWARE Training: Connecting to Legacy Systems, IoT and other SystemsFIWARE Training: Connecting to Legacy Systems, IoT and other Systems
FIWARE Training: Connecting to Legacy Systems, IoT and other Systems
 
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
AWS IoT 핸즈온 워크샵 - 실습 3. AWS IoT Thing Shadow (김무현 솔루션즈 아키텍트)
 
Microsoft's view of the Internet of Things (IoT) by Imran Shafqat
Microsoft's view of the Internet of Things (IoT) by Imran ShafqatMicrosoft's view of the Internet of Things (IoT) by Imran Shafqat
Microsoft's view of the Internet of Things (IoT) by Imran Shafqat
 

Dernier

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Dernier (20)

Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

ThingLabs IoT Workshop

  • 1.
  • 2.
  • 3.
  • 4. FieldGateways ProtocolAdapters OSSProject CloudGateway EventHub->IoTHub Hot Path Analytics Azure Stream Analytics, Azure Storm Cold / Batch Analytics & Visualizations Azure HDInsight, AzureML, Power BI, Azure Data Factory Hot Path Business Logic PaaS V2 & Actor Framework EnterpriseProcessConnections BizTalkServices,NotificationHubs Devices Linux,Android,iOS,RTOS,Windows Device Connectivity Analytics & Operationalized Insights Business Connectivity
  • 5. FieldGateways ProtocolAdapters OSSProject CloudGateway IoTHub Hot Path Analytics Azure Stream Analytics, Azure Storm Cold / Batch Analytics & Visualizations Azure HDInsight, AzureML, Power BI, Azure Data Factory Hot Path Business Logic PaaS V2 & Actor Framework EnterpriseProcessConnections BizTalkServices,NotificationHubs Devices Linux,Android,iOS,RTOS,Windows Device Connectivity Analytics & Operationalized Insights Business Connectivity
  • 6. MCU + MPUMCU (e.g. ATMega) MPU Micro-controller (MCU) MCU + MPU MPU Example Arduino Pro Mini Arduino Uno Arduino Yún Particle Photon Raspberry Pi 2 MinnowBorad MAX Micro- controller ATmega328 ATmega328 ATmega32u4 -- -- -- Micro- processor -- -- Atheros AR9331 ARM Cortex-M3 ARM Cortex-A7 Intel Atom E38xx GPU No No No No Yes Integrated Wi-Fi SoC No No Yes Yes No No Linux No No Yes No Yes Yes Windows 10 IoT No No No No Yes Yes
  • 7.
  • 8. Preparing your development environment Photon.ThingLabs.io/00/
  • 9. (v 4.0 is not compatible with this lab) If you have a 64-bit OS, be sure to install the 64-bit version of Node.js
  • 10.
  • 11.
  • 12. The fundamentals of maker development kits
  • 15.
  • 16. SETUP Push & Hold to set to Listen mode D7 Digital pin with onbaod LED RESET Push to reboot
  • 18.
  • 19.
  • 20. The ‘Hello, World!’ of devices Photon.ThingLabs.io/01/ Tweet with @ThingLabsIO and #HelloIoT
  • 21.
  • 22.
  • 23. "name" "IoT-Labs" "version" "0.1.0" "private" "description" ”Building Things with Node.js and Johnny-Five" "main" ”lab01.js" "author" "YOUR NAME HERE" "license" "MIT" "dependencies" "johnny-five" "^0.8.104” "particle-io" "^0.10.1”
  • 24.
  • 25.
  • 26. // lab01.js var "johnny-five" var "particle-io" // Set up the access credentials for Particle and Azure var 'YOUR PARTICLE ACCESS TOKEN HERE' var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE' // Define the pin that is connected to the LED var // Create a Johnny Five board instance to represent your Particle Photon. // ‘Board ‘is simply an abstraction of the physical hardware, // whether it is a Photon, Arduino, Raspberry Pi or other boards. var new new
  • 27. // The board.on() executes the anonymous function when the // board reports back that it is initialized and ready. "ready" function "Board connected..." // Set the pin you connected to the LED to OUTPUT mode this // Create a loop to "flash/blink/strobe" the LED once per second var this function this
  • 28. In this lab you will read input from an analog sensor using a voltage divider. Photon.ThingLabs.io/02/ Tweet with @ThingLabsIO and #ilikedark
  • 29. A voltage divider splits input voltage input amongst two or more components. The resisted voltage indicates the value. Brighter light == Less resistance;
  • 30.
  • 31. // lab02.js var "johnny-five" var "particle-io" // Set up the access credentials for Particle and Azure var 'YOUR PARTICLE ACCESS TOKEN HERE' var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE' // Define the pin you will use to read the residual voltage // coming from the photoresistor var // Create a Johnny Five board instance to represent your Particle Photon. // ‘Board ‘is simply an abstraction of the physical hardware, whether // it is a Photon, Arduino, Raspberry Pi or other boards. var new new
  • 32. // The board.on() executes the anonymous function when the // board reports back that it is initialized and ready. "ready" function "Board connected..." // Read the residual voltage coming from the photoresistor this function // Multiple the value by 3.3V / 1024, which the the // value range of the photoresistor
  • 33. In this lab you will use analog input to control digital output. Photon.ThingLabs.io/03/ Tweet with @ThingLabsIO and #NightLight
  • 34.
  • 35.
  • 36. // lab03.js var "johnny-five" var "particle-io" // Set up the access credentials for Particle and Azure var 'YOUR PARTICLE ACCESS TOKEN HERE' var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE' // Define the pin that is connected to the LED var “D0" // Define the pin you will use to read the residual voltage // coming from the photoresistor var "A0" // Create a Johnny Five board instance to represent your Particle Photon. ‘Board ‘is simply an abstraction of // the physical hardware, whether it is a Photon, Arduino, Raspberry Pi or other boards. var new new
  • 37. // The board.on() executes the anonymous function when the // board reports back that it is initialized and ready. "ready" function "Board connected..." // Set the pin you connected to the LED to OUTPUT mode this // Create a new 'photoresistor' hardware instance. new // Analog pin 0 // TODO: Handle the photoresistor data events
  • 38. // Replace ‘TODO: Handle the photoresistor data events’ with the following: // Define the callback function for the photoresistor reading. // The freq value used when the photoresistor was defined // determines how often this is invoked. // Scale the sensor's data from 0-1023 to 0-255. "data" function // Multiple the value by 3.3V / 1024, which the the // value range of the photoresistor this // Set the brigthness of the LED this
  • 39. The fundamentals of connecting Things to the Cloud
  • 40.
  • 41.
  • 42. In this lab you will gather telemetry and send it to the cloud. Azure.ThingLabs.io/02/ Tweet with @ThingLabsIO and #Telemetry
  • 43. { "name": "IoT-Labs", "version": "0.1.0", "private": true, "description": "Sample app that connects a device to Azure using Node.js", "main": "weather.js", "author": "YOUR NAME HERE", "license": "MIT", "dependencies": { "johnny-five": "^0.8.104", "particle-io": "^0.10.1” , "j5-sparkfun-weather-shield": "^0.2.0", "azure-iot-device": "^1.0.0-preview.3” } }
  • 44. // weather.js var five = require ("johnny-five"); var device = require("azure-iot-device"); var Weather = require("j5-sparkfun-weather-shield")(five); var Particle = require("particle-io"); // Set up the access credentials for Particle and Azure var token = 'YOUR PARTICLE ACCESS TOKEN HERE'; var deviceId = 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE'; var location = 'THE LOCATION OF THE PARTICLE PHOTON DEVICE'; var connectionString = 'YOUR IOT HUB DEVICE-SPECIFIC CONNECTION STRING HERE';
  • 45. // Create a Johnny Five board instance to represent your Particle Photon. // Board is simply an abstraction of the physical hardware, whether it is // a Photon, Arduino, Raspberry Pi or other boards. var board = new five.Board({ io: new Particle({ token: token, deviceId: deviceId }) }); // Create an Azure IoT client that will manage the connection to your IoT Hub // The client is created in the context of an Azure IoT device, which is why // you use a device-specific connection string. var client = new device.Client(connectionString, new device.Https());
  • 46. // The board.on() executes the anonymous function when the // board reports back that it is initialized and ready. board.on("ready", function() { console.log("Board connected..."); // The SparkFun Weather Shield for the Particle Photon has two sensors on the I2C bus – // a humidity sensor (HTU21D) which can provide both humidity and temperature, and a // barometer (MPL3115A2) which can provide both barometric pressure and humidity. // Controllers for these are wrapped in the convenient ‘Weather’ plug-in class: var weather = new Weather({ variant: "PHOTON", freq: 1000, elevation: 100 // Put your current elevation (in feet) here }) // Don’t close the board.on() function yet
  • 47. // The weather.on("data", callback) function invokes the anonymous callback function // whenever the data from the sensor changes (no faster than every 25ms). The anonymous // function is scoped to the object (e.g. this == the instance of Weather class object). weather.on(“data" , function () { // Create an Azure IoT Message var payload = JSON.stringify({ deviceId: deviceId, location: location, // celsius & fahrenheit are averages taken from both sensors on the shield celsius: this.celsius, fahrenheit: this.fahrenheit, relativeHumidity: this.relativeHumidity, pressure: this.pressure, feet: this.feet, meters: this.meters }); // Don’t close the weather.on() or board.on() functions yet
  • 48. // Create the message based on the payload JSON var message = new device.Message(payload); // For debugging purposes, write out the message payload to the console console.log("Sending message: " + message.getData()); // Send the message to Azure IoT Hub // printResultsFor() is a function you will write next client.sendEvent(message, printResultFor('send')); }); // Close the weather.on() function }); // Close the board.on() function
  • 49. In this lab you will create visualizations of IoT data. Azure.ThingLabs.io/03/ Tweet with @ThingLabsIO and #IoTBI
  • 50.
  • 51.
  • 52.
  • 53. SELECT MAX(fahrenheit) MaxTempF, MIN(fahrenheit) MinTempF, AVG(fahrenheit) AvgTempF, MAX(celsius) MaxTempC, MIN(celsius) MinTempC, AVG(celsius) AvgTempC, MAX(relativeHumidity) MaxHumidity, MIN(relativeHumidity) MinHumidity, AVG(relativeHumidity) AvgHumidity, location, deviceId, System.Timestamp AS Timestamp INTO [TemperatureBI] FROM [DeviceInputStream] GROUP BY TumblingWindow (second, 1), deviceId, location
  • 54.
  • 55.
  • 56. Tweet with @ThingLabsIO and #ThatWasAwesome