SlideShare a Scribd company logo
1 of 81
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Microsoft Azure IoT Hubs
with Raspberry Pi and
Node.js
PETE GALLAGHER
PJGCREATIONS.CO.UK
06/02/2018
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
About Me
Pete Gallagher
@PJGCreations
www.PJGCreations.co.uk
Pete@PJGCreations.co.uk
• IT Consultant
• Decades of Desktop, Web & Embedded
Software experience
• Gadget Addict
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What we’re going to be doing…
Basic understanding of IoT
The Hardware you’ll need
The Software you’ll need
GPIO and a description of the Circuit
Building Our Circuit
Connecting to the Raspberry pi
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What we’re going to be doing…
Some coding
Introduction to Azure’s IoT Offering
Lots more coding
Message Routing and Azure Logic Apps
Other cool IoT Tech from Particle and MX Chip
Q&A
Closing…
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What is IoT?
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Connected Cow
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
 Oestrus only lasts between 12-18 hours….
 Only once per 21 days
 Normally occurs between 10pm and 8am
 Traditionally detected by visual monitoring
 70% Conception Rate
 Only 55% probability of correctly identifying oestrus
 Pregnancy Rate of 39%
The Connected Cow
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Connected Cow
“To identify a cow in heat, you need to
spend at least 20-30 minutes in the stables
per day, four to five times a day”
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Connected Cow
“How can this be improved with
technology?”
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Connected Cow
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Connected Cow
12th
1am
12th
9am
12th
5pm
13th
7am
13th
9am
13th
5pm
STEPS
16 hours later
Start of Oestrus Optimum for Artificial Insemination
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Connected Cow
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Hardware you’ll need…
Raspberry Pi B+
Upwards with
Node.js 4.0+
Some
Components
A BreadBoard Some Wires
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
The Software you’ll need…
Visual Studio
Code
An SSH Client A Web Browser An Azure
Subscription
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
> _
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
http://bit.ly/nottsdevvscodeVisual Studio Code
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
http://bit.ly/nottsdevputtyAn SSH Client
Any!A Web Browser
http://bit.ly/nottsdevfreeazureAn Azure Subscription
The Software you’ll need…
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Let’s Get Started…
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
GPIO and the Circuit
LET’S GET HANDS ON
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Raspberry Pi GPIO
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Raspberry Pi GPIO
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Our Circuit and Parts
Part Qty
Breadboard 1
Red LED 1
Green LED 1
220Ω Resistor 2
Push Button 1
BME280 1
Jumper Wires 11
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 1
The Raspberry Pi
 This is the heart of our circuit
and will be controlling how all of
the electronics work as well as
running our code.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 2
Grab a Breadboard
 This is what we’ll be using to
connect all of our components
together
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
 Insert the Red LED with it’s
shortest leg to the outside of the
breadboard, and it’s longest leg
to the hole next to it.
 Don’t worry about making it
look the same!
 LED’s have a polarity and only
work one way round.
Step 3
Add the Red LED
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 4
Connect LED Ground
 Add a Purple Wire from the Red
LED short Leg to Pin 9 (Ground /
0v) .
 This is one side of the circuit to
light the Red LED.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
 Connect a resistor between the
Red LED Long Leg hole and the
adjacent hole.
 This limits the current to the
LED, preventing the Pi Pin from
burning out.
Step 5
Add a 220Ω Resistor
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 6
Connect Red LED
 Connect an Orange Wire to the
hole on the empty side of the
Red LED Resistor to Pin 10
(Wiring Pi Pin 16)
 This is the control to turn our
Red LED On and Off
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 7
Add Green LED
 Insert the Green LED with it’s
shortest leg to the outside of the
breadboard
 It’s the same column as the Red
LED
 Insert it’s longest leg into the
hole next to the Red LED
Resistor.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 8
Add a 220Ω Resistor
 Connect a resistor between the
Green LED Long Leg hole and
the adjacent hole.
 This limits the current to the
LED, preventing the Pi Pin from
burning out.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 9
Connect Green LED
 Connect a Grey Wire to the hole
on the empty side of the Green
LED Resistor to Pin 11 (Wiring Pi
Pin 0)
 This is the Control to turn our
Green LED On and Off
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 10
Add a Button
 Connect the Button between the
two sides of the Breadboard
 It will only fit in one orientation!
 Don’t force it!
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 11
Add Button Control
 Connect a White Wire from the
Right Hand Button Leg Hole to
Pin 26 (Wiring Pi Pin 11)
 This is one side of our Button
Circuit, and how we’re going to
sense if the Button has been
pressed.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 12
Add Button Ground
 Connect a Black wire from the
Left Hand Button Leg Hole to
Pin 25 (Ground / 0v)
 This is the other side of our
Button Circuit.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 13
Add the BME280
 This is our Temperature /
Humidity / Pressure Sensor
 Insert the BME with the body
overlapping the gap, and the
pins in the bottom half of the
breadboard.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 14
Add BME280 Power
 Connect a Red Wire from the left
most BME280 Pin Hole to Pin 1
(3v)
 This supplies the power for the
Sensor.
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 15
Add BME280 Ground
 Connect a Brown Wire from the
Pin Hole to the right of the Red
Wire to Pin 6 (Ground / 0V)
 This is our 0v and part of the
power to the BME280
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 16
Add BME280 Clock
 Connect a Yellow Wire from the
Pin Hole to the right of the
Brown Wire to Pin 23 (Wiring Pin
14 / SCLK)
 This is the clock for the SPI
(Serial Peripheral Interface)
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 17
Add BME280 Serial In
 Connect a Grey Wire from the
Pin Hole to the right of the
Yellow Wire to Pin 19 (Wiring Pi
Pin 12 / MOSI)
 This is the Serial Data from the
BME280 to the Raspberry Pi
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 18
Add BME Chip Enable
 Connect a Green Wire from the
Pin Hole to the right of the Grey
Wire to Pin 24 (Wiring Pi Pin 10 /
CE0)
 This allows the Raspberry Pi to
Enable the BME280 in case there
are multiple SPI devices
connected
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Step 19
Add BME280 Serial Out
 Connect a Blue Wire from the far
right Pin Hole to the right of the
Yellow Wire to Pin 21 (Wiring Pi
Pin 13 / MISO)
 This is the Serial Data from the
Raspberry Pi to the BME280
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Connecting to the Raspberry Pi
LETS GET TOGETHER
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
If you’re using a Mac…
 Connect your Network cable from the Pi to your Mac
 Enable Internet Sharing by going to System Preferences -> Sharing
 Select “Internet Sharing” on the left
 In “Share your connection from:”, select your Wifi connection
 In “To computers using:” select “Thunderbolt Ethernet” & “Thunderbolt Bridge“ Connections
 Click Start On Sharing when Selecting both.
 Open System Preferences -> Network and Select “Thunderbolt Ethernet”
 From “Configure IPv4:”, select “DHCP” if not already selected
 You should see “Status:” says “Connected” at the top, and below DHCP YOUR “IP Address”
 Go to “Applications -> Utilities -> Terminal”
 Enter “ifconfig” and look for the Connection starting “Bridge”
 Look for the line starting “inet” and find the IP Address. e.g. 192.168.3.1
 Pi will be next IP Address in sequence. e.g. 192.168.3.2
 Enter SSH pi@192.168.3.2
 Accept the certificate it required
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Flashing Our LED’s
TIME FOR SOME CODING!
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
git reset --hard origin/master
git checkout 01_flash_leds
Flashing our LED’s
If you want to cheat…
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Using the Config File
WE DON’T LIKE NUMBERS
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Using the Config File
If you want to cheat…
git checkout 03_use_config
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Adding a Button
FLASHING IN A LOOP IS BORING
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Adding a Button
If you want to cheat…
git checkout 04_add_button
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What is the Azure IoT Hub
HUH?
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What is the Azure IoT Hub?
 Provides Device to Cloud and Cloud to Device Messaging using a variety
of protocols including AMQP, MQTT, HTTP etc
 Based on Event Hubs… But allows for 2 way communications.
 Allows for MILLIONS of simultaneous connections.
 Stores a Registry of each IoT Device
 Provides “Device Twin” functionality for Desired and Actual Properties
 Device libraries available in a host of languages including .NET, JavaScript,
Node.js etc
 Sits on the Edge of the Cloud between the IoT Devices and the full Azure
Stack
 Connects to Service Bus, Event Hubs, Blob Storage, Ai etc etc
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
R
E
S
O
U
R
C
E
S
F
I
E
L
D
IoT and Azure
I
O
T
H
U
BIoT Hub
AZURE
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What does it cost?
Edition Price Per Unit
(Per Month)
Max Number of
Devices
Total Number of
Messages
(Per Day Per Unit)
Message
Meter Size
Free Free 500 8,000 0.5KB
S1 £37.27 Unlimited 400,000 4KB
S2 £372.66 Unlimited 6,000,000 4KB
S3 £3,726.55 Unlimited 300,000,000 4KB
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
A Real World Example…
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Creating and Connecting to an Azure
IoT Hub
LET’S GET CONNECTED
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Configuring and Connecting to an
Azure IoT Hub
If you want to cheat…
git checkout 05_connect_to_iot_hub
You need to create you security.json
{ "SharedAccessKey": "your.access.key" }
Then modify your config.json
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Configuring and Connecting to an
Azure IoT Hub
You’ll also need…
Azure IoT Device Explorer Twin
http://bit.ly/nottsdevdevexplorer
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Sending a Message to the IoT Hub
HELLO FROM THE OTHER SIDE
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Sending a Message to the IoT Hub
If you want to cheat…
git checkout 06_send_iot_hub_msg
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Sending a Message to the IoT Hub…
Using a Button
WE’RE IN CONTROL
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Sending a Message to the IoT Hub…
Using a Button
If you want to cheat…
git checkout 07_send_msg_on_button
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Using a VS Code extension in place of
the Device Explorer (or Node!)
ALL TOGETHER NOW…
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Receive Cloud to Device Messages
ARE YOU LISTENING TO ME?
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Receive Cloud to Device Messages
If you want to cheat…
git checkout 08_receive_msg
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Invoke a Method on the Device
DO WHAT I TELL YOU TO DO!
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Invoke a Method on the Device
If you want to cheat…
git checkout 09_invoke_method
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Add in the Temperature Sensor
IS IT HOT IN HERE?
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Add in the Temperature Sensor
If you want to cheat…
git checkout 10_add_BME
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Routing Messages & the Service Bus
SAT NAV ENGAGED
THIS WAY
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
R
E
S
O
U
R
C
E
S
F
I
E
L
D
IoT and Azure
IoT plays nicely with Azure…
I
O
T
H
U
B
IoT Hub
Routes
Service bus
Queue
Topics
Relay
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Add in the Temperature Sensor
If you want to cheat…
git checkout 11_add_routes
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Logic Apps
SPOCK WOULD BE HAPPY
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
R
E
S
O
U
R
C
E
S
F
I
E
L
D
IoT and Azure
IoT plays REALLY nicely with Azure…
I
O
T
H
U
B
IoT Hub
Routes
Service bus
Queue
Topics
Relay
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What are Logic Apps?
 Provides a Graphical Interface to Hook together a bunch of Apps, Services,
Workflows and functions.
 No code required!
 REALLY cheap - £0.000019 per execution!
 Can hook together an almost unlimited combination of items to perform
just about any Workflow
 For example
 Twitter Timeline Sentiment Analysis - Populate Power Bi Dashboard to help
improve customer service
 Order Approval – Route order types to the correct people
 Monitor feedback forms and email the correct people
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Links
Website: https://www.pjgcreations.co.uk
Twitter: @PJGCreations
Email: Pete@PJGCreations.co.uk
Slides (To Follow): http://bit.ly/nottsdeviothubslides
Getting Started: http://bit.ly/nottsdeviotinitialsetup
Code: http://bit.ly/NottsDevIoTHubCode
Video (To Follow): http://bit.lynottsdeviothubvideo
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Resources
Azure Dev Guide: http://bit.ly/NottsDevAzureDevGuide
IoT Hub Learning Path: http://bit.ly/nottsdeviothublearning
Azure IoT Hub Pricing: http://bit.ly/NottsDevIoTHubPricing
More Detailed Pricing: http://bit.ly/NottsDevIoTHubPricingDetail
IoT Hub with Arm Templates: http://bit.ly/nottsdevarmtemplates
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Resources
IoT Hub with Azure Cli: http://bit.ly/nottsdevazurecli
Iot Hub with Powershell: http://bit.ly/nottsdevpowershell
Azure Logic Apps: http://bit.ly/nottsdevpowershell
Microsoft IoT Homepage: https://dev.windows.com/en-us/iot
Some Cool IoT Projects: https://www.hackster.io/windowsiot/
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Tools
IoT Hub Explorer (Node): http://bit.ly/nottsdeviothubexplorer
npm install –g iothub-explorer
iothub-explorer
Device Explorer (Windows): http://bit.ly/nottsdevdevexplorer
Device Discovery (Node): http://bit.ly/nottsdevdevicediscovery
npm install –g device-discovery-cli
devdisco list –eth
IoT Hub Diagnostics Tool: http://bit.ly/nottsdevdiagnostics
npm install –g iothub-diagnostics
iothub-diagnostics <IoTHub Connection String>
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
More Tools
IoT Extensions for VS Code: http://bit.ly/nottsdeviottoolkit
Device Explorer (Windows): http://bit.ly/nottsdevdevexplorer
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Further Viewing
The Connected Cow: http://bit.ly/nottsdevconnectedcow
http://bit.ly/nottsdevconnectedcowfd
MVA Introduction to IoT: http://bit.ly/nottsdevmvaiot
Azure Friday Azure IoT Hub: http://bit.ly/nottsdevazurefriday
Azure IoT Deep Dive: http://bit.ly/nottsdevazuredeepdive
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
Questions?
Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
What could possibly go
wrong?

More Related Content

Similar to Azure IoT Hubs with Raspberry Pi and Node.js

Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...Peter Gallagher
 
Getting started with IoT with only your laptop - August 2018
Getting started with IoT with only your laptop - August 2018Getting started with IoT with only your laptop - August 2018
Getting started with IoT with only your laptop - August 2018Peter Gallagher
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...Peter Gallagher
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...Peter Gallagher
 
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptxBuilding a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptxPeter Gallagher
 
Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...
Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...
Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...Peter Gallagher
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptxBuilding a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptxPeter Gallagher
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...Peter Gallagher
 
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRBuilding a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRPeter Gallagher
 
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020Peter Gallagher
 
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021Peter Gallagher
 
Getting started with IoT with only your laptop - March 2020 - Dot Net Sheff
Getting started with IoT with only your laptop - March 2020 - Dot Net SheffGetting started with IoT with only your laptop - March 2020 - Dot Net Sheff
Getting started with IoT with only your laptop - March 2020 - Dot Net SheffPeter Gallagher
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalRBuilding a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalRPeter Gallagher
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...Peter Gallagher
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...Peter Gallagher
 
Getting started with IoT with only your Laptop (Lightning Talk) - October 201...
Getting started with IoT with only your Laptop (Lightning Talk) - October 201...Getting started with IoT with only your Laptop (Lightning Talk) - October 201...
Getting started with IoT with only your Laptop (Lightning Talk) - October 201...Peter Gallagher
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...Peter Gallagher
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET Stoke
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET StokeBuilding a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET Stoke
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET StokePeter Gallagher
 
Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...
Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...
Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...Peter Gallagher
 
Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...
Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...
Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...Peter Gallagher
 

Similar to Azure IoT Hubs with Raspberry Pi and Node.js (20)

Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Dot NET Pe...
 
Getting started with IoT with only your laptop - August 2018
Getting started with IoT with only your laptop - August 2018Getting started with IoT with only your laptop - August 2018
Getting started with IoT with only your laptop - August 2018
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - NDC Melbou...
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR - Yorkshire ...
 
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptxBuilding a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6 Blazor and SignalR.pptx
 
Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...
Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...
Getting started with IoT with only your Laptop (GIF Version) - Derby Dot Net ...
 
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptxBuilding a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
Building a Raspberry Pi Robot with Dot NET 6, Blazor and SignalR.pptx
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - HackSoc -...
 
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRBuilding a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
 
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - DDD 2020
 
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021
 
Getting started with IoT with only your laptop - March 2020 - Dot Net Sheff
Getting started with IoT with only your laptop - March 2020 - Dot Net SheffGetting started with IoT with only your laptop - March 2020 - Dot Net Sheff
Getting started with IoT with only your laptop - March 2020 - Dot Net Sheff
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalRBuilding a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - .NET Sout...
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - Bradford ...
 
Getting started with IoT with only your Laptop (Lightning Talk) - October 201...
Getting started with IoT with only your Laptop (Lightning Talk) - October 201...Getting started with IoT with only your Laptop (Lightning Talk) - October 201...
Getting started with IoT with only your Laptop (Lightning Talk) - October 201...
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - CSharp Co...
 
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET Stoke
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET StokeBuilding a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET Stoke
Building a Raspberry Pi Robot Arm with .NET 5, Blazor and SignalR - dotNET Stoke
 
Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...
Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...
Getting started with IoT with only your laptop and Workshop - May 2019 - Tech...
 
Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...
Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...
Azure IoT Hubs with Raspberry Pi and Node.js - DDD 14 Microsoft - Reading - 1...
 

More from Peter Gallagher

Supercharging your Data with Azure AI Search and Azure OpenAI
Supercharging your Data with Azure AI Search and Azure OpenAISupercharging your Data with Azure AI Search and Azure OpenAI
Supercharging your Data with Azure AI Search and Azure OpenAIPeter Gallagher
 
Experience Raspberry Pi 5 - October 2023
Experience Raspberry Pi 5 - October 2023Experience Raspberry Pi 5 - October 2023
Experience Raspberry Pi 5 - October 2023Peter Gallagher
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...Peter Gallagher
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Peter Gallagher
 
Azure Percept Home Automation - Hacksoc 2022
Azure Percept Home Automation - Hacksoc 2022Azure Percept Home Automation - Hacksoc 2022
Azure Percept Home Automation - Hacksoc 2022Peter Gallagher
 
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Peter Gallagher
 
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Peter Gallagher
 
Config and Deployments as Code with Octopus Deploy
Config and Deployments as Code with Octopus DeployConfig and Deployments as Code with Octopus Deploy
Config and Deployments as Code with Octopus DeployPeter Gallagher
 
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22Peter Gallagher
 
Azure Percept Home Automation - Festive Tech Calendar 2021 - 01-12-21
Azure Percept Home Automation  - Festive Tech Calendar 2021 - 01-12-21Azure Percept Home Automation  - Festive Tech Calendar 2021 - 01-12-21
Azure Percept Home Automation - Festive Tech Calendar 2021 - 01-12-21Peter Gallagher
 
IoT with only your Laptop - Build Stuff 2021
IoT with only your Laptop - Build Stuff 2021IoT with only your Laptop - Build Stuff 2021
IoT with only your Laptop - Build Stuff 2021Peter Gallagher
 
Azure Percept Home Automation - .NET Liverpool - 28-10-21
Azure Percept Home Automation  - .NET Liverpool - 28-10-21Azure Percept Home Automation  - .NET Liverpool - 28-10-21
Azure Percept Home Automation - .NET Liverpool - 28-10-21Peter Gallagher
 
Azure Percept Home Automation - .NET Docs Show - 20-09-21
Azure Percept Home Automation  - .NET Docs Show - 20-09-21Azure Percept Home Automation  - .NET Docs Show - 20-09-21
Azure Percept Home Automation - .NET Docs Show - 20-09-21Peter Gallagher
 
IoT with only your laptop - Microsoft Garage - January 2021
IoT with only your laptop - Microsoft Garage - January 2021IoT with only your laptop - Microsoft Garage - January 2021
IoT with only your laptop - Microsoft Garage - January 2021Peter Gallagher
 
IoT isn't just for Christmas
IoT isn't just for ChristmasIoT isn't just for Christmas
IoT isn't just for ChristmasPeter Gallagher
 

More from Peter Gallagher (15)

Supercharging your Data with Azure AI Search and Azure OpenAI
Supercharging your Data with Azure AI Search and Azure OpenAISupercharging your Data with Azure AI Search and Azure OpenAI
Supercharging your Data with Azure AI Search and Azure OpenAI
 
Experience Raspberry Pi 5 - October 2023
Experience Raspberry Pi 5 - October 2023Experience Raspberry Pi 5 - October 2023
Experience Raspberry Pi 5 - October 2023
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - Slides Onl...
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
 
Azure Percept Home Automation - Hacksoc 2022
Azure Percept Home Automation - Hacksoc 2022Azure Percept Home Automation - Hacksoc 2022
Azure Percept Home Automation - Hacksoc 2022
 
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
 
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
Deploying Web Apps using Config and Infrastructure as Code with Octopus Deplo...
 
Config and Deployments as Code with Octopus Deploy
Config and Deployments as Code with Octopus DeployConfig and Deployments as Code with Octopus Deploy
Config and Deployments as Code with Octopus Deploy
 
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
Azure Percept Home Automation - Microsoft Reactor London - 28-05-22
 
Azure Percept Home Automation - Festive Tech Calendar 2021 - 01-12-21
Azure Percept Home Automation  - Festive Tech Calendar 2021 - 01-12-21Azure Percept Home Automation  - Festive Tech Calendar 2021 - 01-12-21
Azure Percept Home Automation - Festive Tech Calendar 2021 - 01-12-21
 
IoT with only your Laptop - Build Stuff 2021
IoT with only your Laptop - Build Stuff 2021IoT with only your Laptop - Build Stuff 2021
IoT with only your Laptop - Build Stuff 2021
 
Azure Percept Home Automation - .NET Liverpool - 28-10-21
Azure Percept Home Automation  - .NET Liverpool - 28-10-21Azure Percept Home Automation  - .NET Liverpool - 28-10-21
Azure Percept Home Automation - .NET Liverpool - 28-10-21
 
Azure Percept Home Automation - .NET Docs Show - 20-09-21
Azure Percept Home Automation  - .NET Docs Show - 20-09-21Azure Percept Home Automation  - .NET Docs Show - 20-09-21
Azure Percept Home Automation - .NET Docs Show - 20-09-21
 
IoT with only your laptop - Microsoft Garage - January 2021
IoT with only your laptop - Microsoft Garage - January 2021IoT with only your laptop - Microsoft Garage - January 2021
IoT with only your laptop - Microsoft Garage - January 2021
 
IoT isn't just for Christmas
IoT isn't just for ChristmasIoT isn't just for Christmas
IoT isn't just for Christmas
 

Recently uploaded

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Recently uploaded (20)

MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 

Azure IoT Hubs with Raspberry Pi and Node.js

  • 1. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Microsoft Azure IoT Hubs with Raspberry Pi and Node.js PETE GALLAGHER PJGCREATIONS.CO.UK 06/02/2018
  • 2. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 About Me Pete Gallagher @PJGCreations www.PJGCreations.co.uk Pete@PJGCreations.co.uk • IT Consultant • Decades of Desktop, Web & Embedded Software experience • Gadget Addict
  • 3. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What we’re going to be doing… Basic understanding of IoT The Hardware you’ll need The Software you’ll need GPIO and a description of the Circuit Building Our Circuit Connecting to the Raspberry pi
  • 4. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What we’re going to be doing… Some coding Introduction to Azure’s IoT Offering Lots more coding Message Routing and Azure Logic Apps Other cool IoT Tech from Particle and MX Chip Q&A Closing…
  • 5. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What is IoT?
  • 6. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Connected Cow
  • 7. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018  Oestrus only lasts between 12-18 hours….  Only once per 21 days  Normally occurs between 10pm and 8am  Traditionally detected by visual monitoring  70% Conception Rate  Only 55% probability of correctly identifying oestrus  Pregnancy Rate of 39% The Connected Cow
  • 8. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Connected Cow “To identify a cow in heat, you need to spend at least 20-30 minutes in the stables per day, four to five times a day”
  • 9. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Connected Cow “How can this be improved with technology?”
  • 10. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Connected Cow
  • 11. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Connected Cow 12th 1am 12th 9am 12th 5pm 13th 7am 13th 9am 13th 5pm STEPS 16 hours later Start of Oestrus Optimum for Artificial Insemination
  • 12. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Connected Cow
  • 13. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Hardware you’ll need… Raspberry Pi B+ Upwards with Node.js 4.0+ Some Components A BreadBoard Some Wires Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
  • 14. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 The Software you’ll need… Visual Studio Code An SSH Client A Web Browser An Azure Subscription Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 > _
  • 15. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 http://bit.ly/nottsdevvscodeVisual Studio Code Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 http://bit.ly/nottsdevputtyAn SSH Client Any!A Web Browser http://bit.ly/nottsdevfreeazureAn Azure Subscription The Software you’ll need…
  • 16. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Let’s Get Started…
  • 17. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 GPIO and the Circuit LET’S GET HANDS ON
  • 18. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Raspberry Pi GPIO
  • 19. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Raspberry Pi GPIO
  • 20. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Our Circuit and Parts Part Qty Breadboard 1 Red LED 1 Green LED 1 220Ω Resistor 2 Push Button 1 BME280 1 Jumper Wires 11
  • 21. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 1 The Raspberry Pi  This is the heart of our circuit and will be controlling how all of the electronics work as well as running our code.
  • 22. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 2 Grab a Breadboard  This is what we’ll be using to connect all of our components together
  • 23. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018  Insert the Red LED with it’s shortest leg to the outside of the breadboard, and it’s longest leg to the hole next to it.  Don’t worry about making it look the same!  LED’s have a polarity and only work one way round. Step 3 Add the Red LED
  • 24. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 4 Connect LED Ground  Add a Purple Wire from the Red LED short Leg to Pin 9 (Ground / 0v) .  This is one side of the circuit to light the Red LED.
  • 25. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018  Connect a resistor between the Red LED Long Leg hole and the adjacent hole.  This limits the current to the LED, preventing the Pi Pin from burning out. Step 5 Add a 220Ω Resistor
  • 26. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 6 Connect Red LED  Connect an Orange Wire to the hole on the empty side of the Red LED Resistor to Pin 10 (Wiring Pi Pin 16)  This is the control to turn our Red LED On and Off
  • 27. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 7 Add Green LED  Insert the Green LED with it’s shortest leg to the outside of the breadboard  It’s the same column as the Red LED  Insert it’s longest leg into the hole next to the Red LED Resistor.
  • 28. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 8 Add a 220Ω Resistor  Connect a resistor between the Green LED Long Leg hole and the adjacent hole.  This limits the current to the LED, preventing the Pi Pin from burning out.
  • 29. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 9 Connect Green LED  Connect a Grey Wire to the hole on the empty side of the Green LED Resistor to Pin 11 (Wiring Pi Pin 0)  This is the Control to turn our Green LED On and Off
  • 30. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 10 Add a Button  Connect the Button between the two sides of the Breadboard  It will only fit in one orientation!  Don’t force it!
  • 31. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 11 Add Button Control  Connect a White Wire from the Right Hand Button Leg Hole to Pin 26 (Wiring Pi Pin 11)  This is one side of our Button Circuit, and how we’re going to sense if the Button has been pressed.
  • 32. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 12 Add Button Ground  Connect a Black wire from the Left Hand Button Leg Hole to Pin 25 (Ground / 0v)  This is the other side of our Button Circuit.
  • 33. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 13 Add the BME280  This is our Temperature / Humidity / Pressure Sensor  Insert the BME with the body overlapping the gap, and the pins in the bottom half of the breadboard.
  • 34. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 14 Add BME280 Power  Connect a Red Wire from the left most BME280 Pin Hole to Pin 1 (3v)  This supplies the power for the Sensor.
  • 35. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 15 Add BME280 Ground  Connect a Brown Wire from the Pin Hole to the right of the Red Wire to Pin 6 (Ground / 0V)  This is our 0v and part of the power to the BME280
  • 36. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 16 Add BME280 Clock  Connect a Yellow Wire from the Pin Hole to the right of the Brown Wire to Pin 23 (Wiring Pin 14 / SCLK)  This is the clock for the SPI (Serial Peripheral Interface)
  • 37. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 17 Add BME280 Serial In  Connect a Grey Wire from the Pin Hole to the right of the Yellow Wire to Pin 19 (Wiring Pi Pin 12 / MOSI)  This is the Serial Data from the BME280 to the Raspberry Pi
  • 38. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 18 Add BME Chip Enable  Connect a Green Wire from the Pin Hole to the right of the Grey Wire to Pin 24 (Wiring Pi Pin 10 / CE0)  This allows the Raspberry Pi to Enable the BME280 in case there are multiple SPI devices connected
  • 39. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Step 19 Add BME280 Serial Out  Connect a Blue Wire from the far right Pin Hole to the right of the Yellow Wire to Pin 21 (Wiring Pi Pin 13 / MISO)  This is the Serial Data from the Raspberry Pi to the BME280
  • 40. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Connecting to the Raspberry Pi LETS GET TOGETHER
  • 41. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 If you’re using a Mac…  Connect your Network cable from the Pi to your Mac  Enable Internet Sharing by going to System Preferences -> Sharing  Select “Internet Sharing” on the left  In “Share your connection from:”, select your Wifi connection  In “To computers using:” select “Thunderbolt Ethernet” & “Thunderbolt Bridge“ Connections  Click Start On Sharing when Selecting both.  Open System Preferences -> Network and Select “Thunderbolt Ethernet”  From “Configure IPv4:”, select “DHCP” if not already selected  You should see “Status:” says “Connected” at the top, and below DHCP YOUR “IP Address”  Go to “Applications -> Utilities -> Terminal”  Enter “ifconfig” and look for the Connection starting “Bridge”  Look for the line starting “inet” and find the IP Address. e.g. 192.168.3.1  Pi will be next IP Address in sequence. e.g. 192.168.3.2  Enter SSH pi@192.168.3.2  Accept the certificate it required
  • 42. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Flashing Our LED’s TIME FOR SOME CODING!
  • 43. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 git reset --hard origin/master git checkout 01_flash_leds Flashing our LED’s If you want to cheat…
  • 44. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Using the Config File WE DON’T LIKE NUMBERS
  • 45. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Using the Config File If you want to cheat… git checkout 03_use_config
  • 46. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Adding a Button FLASHING IN A LOOP IS BORING
  • 47. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Adding a Button If you want to cheat… git checkout 04_add_button
  • 48. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What is the Azure IoT Hub HUH?
  • 49. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What is the Azure IoT Hub?  Provides Device to Cloud and Cloud to Device Messaging using a variety of protocols including AMQP, MQTT, HTTP etc  Based on Event Hubs… But allows for 2 way communications.  Allows for MILLIONS of simultaneous connections.  Stores a Registry of each IoT Device  Provides “Device Twin” functionality for Desired and Actual Properties  Device libraries available in a host of languages including .NET, JavaScript, Node.js etc  Sits on the Edge of the Cloud between the IoT Devices and the full Azure Stack  Connects to Service Bus, Event Hubs, Blob Storage, Ai etc etc
  • 50. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 R E S O U R C E S F I E L D IoT and Azure I O T H U BIoT Hub AZURE
  • 51. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What does it cost? Edition Price Per Unit (Per Month) Max Number of Devices Total Number of Messages (Per Day Per Unit) Message Meter Size Free Free 500 8,000 0.5KB S1 £37.27 Unlimited 400,000 4KB S2 £372.66 Unlimited 6,000,000 4KB S3 £3,726.55 Unlimited 300,000,000 4KB
  • 52. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 A Real World Example…
  • 53. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Creating and Connecting to an Azure IoT Hub LET’S GET CONNECTED
  • 54. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Configuring and Connecting to an Azure IoT Hub If you want to cheat… git checkout 05_connect_to_iot_hub You need to create you security.json { "SharedAccessKey": "your.access.key" } Then modify your config.json
  • 55. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Configuring and Connecting to an Azure IoT Hub You’ll also need… Azure IoT Device Explorer Twin http://bit.ly/nottsdevdevexplorer
  • 56. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Sending a Message to the IoT Hub HELLO FROM THE OTHER SIDE
  • 57. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Sending a Message to the IoT Hub If you want to cheat… git checkout 06_send_iot_hub_msg
  • 58. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Sending a Message to the IoT Hub… Using a Button WE’RE IN CONTROL
  • 59. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Sending a Message to the IoT Hub… Using a Button If you want to cheat… git checkout 07_send_msg_on_button
  • 60. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Using a VS Code extension in place of the Device Explorer (or Node!) ALL TOGETHER NOW…
  • 61. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Receive Cloud to Device Messages ARE YOU LISTENING TO ME?
  • 62. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Receive Cloud to Device Messages If you want to cheat… git checkout 08_receive_msg
  • 63. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Invoke a Method on the Device DO WHAT I TELL YOU TO DO!
  • 64. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Invoke a Method on the Device If you want to cheat… git checkout 09_invoke_method
  • 65. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Add in the Temperature Sensor IS IT HOT IN HERE?
  • 66. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Add in the Temperature Sensor If you want to cheat… git checkout 10_add_BME
  • 67. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Routing Messages & the Service Bus SAT NAV ENGAGED THIS WAY
  • 68. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 R E S O U R C E S F I E L D IoT and Azure IoT plays nicely with Azure… I O T H U B IoT Hub Routes Service bus Queue Topics Relay
  • 69. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018
  • 70. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Add in the Temperature Sensor If you want to cheat… git checkout 11_add_routes
  • 71. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Logic Apps SPOCK WOULD BE HAPPY
  • 72. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 R E S O U R C E S F I E L D IoT and Azure IoT plays REALLY nicely with Azure… I O T H U B IoT Hub Routes Service bus Queue Topics Relay
  • 73. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What are Logic Apps?  Provides a Graphical Interface to Hook together a bunch of Apps, Services, Workflows and functions.  No code required!  REALLY cheap - £0.000019 per execution!  Can hook together an almost unlimited combination of items to perform just about any Workflow  For example  Twitter Timeline Sentiment Analysis - Populate Power Bi Dashboard to help improve customer service  Order Approval – Route order types to the correct people  Monitor feedback forms and email the correct people
  • 74. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Links Website: https://www.pjgcreations.co.uk Twitter: @PJGCreations Email: Pete@PJGCreations.co.uk Slides (To Follow): http://bit.ly/nottsdeviothubslides Getting Started: http://bit.ly/nottsdeviotinitialsetup Code: http://bit.ly/NottsDevIoTHubCode Video (To Follow): http://bit.lynottsdeviothubvideo
  • 75. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Resources Azure Dev Guide: http://bit.ly/NottsDevAzureDevGuide IoT Hub Learning Path: http://bit.ly/nottsdeviothublearning Azure IoT Hub Pricing: http://bit.ly/NottsDevIoTHubPricing More Detailed Pricing: http://bit.ly/NottsDevIoTHubPricingDetail IoT Hub with Arm Templates: http://bit.ly/nottsdevarmtemplates
  • 76. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Resources IoT Hub with Azure Cli: http://bit.ly/nottsdevazurecli Iot Hub with Powershell: http://bit.ly/nottsdevpowershell Azure Logic Apps: http://bit.ly/nottsdevpowershell Microsoft IoT Homepage: https://dev.windows.com/en-us/iot Some Cool IoT Projects: https://www.hackster.io/windowsiot/
  • 77. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Tools IoT Hub Explorer (Node): http://bit.ly/nottsdeviothubexplorer npm install –g iothub-explorer iothub-explorer Device Explorer (Windows): http://bit.ly/nottsdevdevexplorer Device Discovery (Node): http://bit.ly/nottsdevdevicediscovery npm install –g device-discovery-cli devdisco list –eth IoT Hub Diagnostics Tool: http://bit.ly/nottsdevdiagnostics npm install –g iothub-diagnostics iothub-diagnostics <IoTHub Connection String>
  • 78. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 More Tools IoT Extensions for VS Code: http://bit.ly/nottsdeviottoolkit Device Explorer (Windows): http://bit.ly/nottsdevdevexplorer
  • 79. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Further Viewing The Connected Cow: http://bit.ly/nottsdevconnectedcow http://bit.ly/nottsdevconnectedcowfd MVA Introduction to IoT: http://bit.ly/nottsdevmvaiot Azure Friday Azure IoT Hub: http://bit.ly/nottsdevazurefriday Azure IoT Deep Dive: http://bit.ly/nottsdevazuredeepdive
  • 80. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 Questions?
  • 81. Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018Raspberry Pi + Azure IoT Hubs + Node.js – Pete Gallagher – PJG Creations - 2018 What could possibly go wrong?