►
Description
The open source, cross-platform design of .NET Core opens up all kinds of new possibilities for .NET developers. This talk teaches the attendee how to install the .NET Core runtime on the ultimate IoT platform, Raspberry Pi and unlock the potential of IoT devices for .NET developers!
A
A
But
the
content
was
so
good
and
I
would
talk
it
with
cam.
So
for
our
next
speaker
was
right
here
say:
hey,
say:
hi
cam,
hey
everybody,
so
we
were
like
talking
behind
the
scenes
like
well.
Let
me
go
I'll
do
Miguel
stuff
and
then
we'll
come
back
and
go
about
it.
But
anyway,
now
we've
got
cam.
I'm
hearing
down
and
calm
talking
about
half
your
raspberry.
Have
your
pie,
I!
Need
it
too.
Let's
talk
about
that
camp.
A
C
So
before
we
start
hey
Miguel,
if
you're
watching
man
I'm
so
sorry,
I
had
to
cut
you
off,
I
was
really
digging
your
talk.
So
one
of
the
most
exciting
features
of
dotnet
core
is
its
cross-platform
compatibility.
So
this
applies
not
just
the
server
and
desktop
environments,
but
also
to
IOT
devices.
Raspberry
pi
is
arguably
the
ultimate
IOT
platform
because
it
packs
a
very
broad
range
of
functionality
into
a
credit
card
size
device,
that's
affordable
for
students,
hobbyists
and
professionals.
C
What
we're
gonna
cover
is
we're
gonna
talk
about
the
basics
where's
my
slide
there.
It
is
so
we're
going
to
talk
about
developing,
deploying
and
debugging
dotnet
core
code
on
the
Raspberry
Pi.
There's
a
lot
less
that
goes
into
it.
Then
you
would
think
this
is
actually
gonna
seem
kind
of
100
level
stuff.
Then
we're
gonna
talk
about
GPIO
GPIO
stands
for
general
purpose,
input
and
output.
It
refers
to
this
header
here
on
the
motherboard.
It's
a
collection
of
pins
that
we
can
use
for
all
kinds
of
input
and
output
purposes.
C
What
we're
going
to
use
it
for
today
are
some
pretty
simple
demonstrations:
we're
going
to
control
an
LED
and
we're
going
to
control
a
reversible
motor,
we're
going
to
turn
a
motor
on
and
we're
going
to
be
able
to
make
it
go
forward
or
backward,
and
then,
after
we
played
with
the
GPIO
pins
a
little
bit
we're
gonna.
Take
it
a
step
further
and
use
our
IOT
device
on
the
internet,
we're
going
to
integrate
a
few
components
with
some
cloud
services.
C
C
D
C
Yeah
we're
using
yeah
so
we're
using
the
three
B,
but
the
demos
that
I
have
out
on
github
and
I'll
share
that
link
in
a
little
bit
should
work
on
should
work
on
the
two.
The
three
the
freebie
I,
don't
know
about.
The
zero
I
haven't
tried
it
on
the
zero,
but
I'd
be
I'd,
be
interested
in
hearing
what
what
what
your
experience
is
with
that
awesome.
C
So
sure
so,
I'm
gonna
jump
right
into
a
demo.
I'm
gonna
show
you
how
easy
it
is
to
get
dotnet
code
running
on
the
Raspberry
Pi.
Now
I'm
not
gonna,
go
through.
You
know
where
to
get
the
Raspberry
Pi
and
the
operating
system
and
all
that
it's
out
there
on
the
internet.
It's
easy
to
find
we're.
Gonna
start
where
I've
got
a
Raspberry
Pi
device
sitting
here
on
my
desk,
it's
connected
to
my
network
and
it's
running
the
raspbian
OS
with
SSH
and
abled.
So
all
we
need
to
do
is
write
some
code.
C
Asp.Net
core
web
application
and
I'm
gonna
call
it
PI
demo
I
already
have
a
PI
demo
folder
how
about
PI
demo
2,
that's
creative.
C
C
All
right,
so
that's
it's
working,
that's
fine!
Now
we
need
to
get
it
on
to
the
Raspberry
Pi
well
to
get
it
on
the
Raspberry
Pi
I
need
to
package
it
up
as
a
deployment.
First,
there
are
two
ways
we
can
do
deployments
in
dotnet
core,
there's
a
framework
dependent
deployment
that
expects
the
framework
to
be
installed
on
the
operating
system
or
there's
a
self-contained
deployment
that
has
all
the
dependencies,
along
with
the
executable
I'm
going
to
go
with
the
self-contained
deployment.
So
I
don't
have
to
worry
about
getting
the
dotnet
framework.
C
Now
I
could
package
that
we
are
in
PI
demo.
2
I
could
publish
that
rather
dotnet
publish
are
for
to
make
it
a
self-contained
deployment
targeting
Linux
arm
and
that
that
will
work
that
that
will
do
exactly
what
I
want
it
to.
But
since
I
use
a
Visual
Studio
to
build
the
application,
it
seems
to
me,
like
I,
should
probably
use
Visual
Studio
to
at
least
publish
it
before
I
before
I
FTP
it
out
to
the
device.
So,
let's
take
a
look
at
how
to
do
that.
C
Really
quick,
just
like
publishing
to
Azure
we're
going
to
right
click
on
the
project
and
go
down
to
publish
but
I'm,
going
to
publish
to
a
folder
I'm
going
to
put
this
folder
I'm
gonna
put
it
in
the
root
I'm
just
going
to
call
it
a
PI
demo
pub
and
then
we're
going
to
set
a
few
Advanced
Options
I'm
gonna
go
with
the
debug
configuration
because
I'm
gonna
be
showing
you
debugging
here
in
a
minute
target
framework.
Is
that
is
net
core
app
one
deployment
mode
is
not
going
to
be
framework
dependent.
C
It's
going
to
be
self-contained
and
target
run
time
when
you'll
notice,
Linux
arm
isn't
in
the
list.
That's
okay,
I
gotcha,
we're
gonna
pick
Linux
x64
save
the
profile
and
create
it
I'm
going
to
go
ahead
and
rename
it
just
so.
I
I
know
what
the
file
name
for
the
profile
is:
we're
gonna,
rename
it
a
PI
profile.
C
Now,
before
I
click
publish
I'm
going
to
come
over
here
to
the
by
properties
node
under
the
project
and
there's
a
folder
for
published
profiles.
If
we
look
in
there
there's
my
PI
profile-
and
this
is
the
profile
and
there's
the
Linux
x64
runtime
identifier,
I'm-
going
to
change
that
to
Linux
arm,
save
it
and
now
I
can
come
back
over
here
then
I
can
click
publish
and
it's
going
to
do
its
thing.
C
D
A
C
You
know
I,
don't
know
of
all
the
deployments
I've
done
it
does
seem
to
grow
if
I'm
doing
asp.net
versus
say
a
console.
So
I'm
inclined
to
say
yes,
but
to
be
honest,
I
haven't
looked
that
closely:
I
I.
It
is
a
bigger
transfer
from
asp.net,
so
I'm
inclined
to
say
yes
and
I'm,
hoping
that
somebody
has
a
more
definitive
answer.
Gotcha.
A
C
Well,
I
wouldn't
assume,
there's
any
type
of
a
performance
difference.
It's
the
same.
It's
the
same
binaries
that
are
being
read
in
at
runtime,
it's
just
whether
they're
located
in
the
same
directory,
as
has
the
the
assembly
or
whether,
whether
they're
off
somewhere
in
like
a
global.
You
know
like
in
a
path,
location,
somewhere,
perfect.
A
C
Right
well,
I
see
another
question
just
popped
up
who
wants
to
know
which
of
us
is
running
on
the
Raspberry
Pi
and
that
is
I'm
running
the
latest
version
of
raspbian
Linux,
so
yeah,
so
we're
gonna
grab
this
publish
location.
Where
was
it?
Where
did
I
call
I
probably
need
to
refresh
locally
there?
It
is
PI
demo
pub
and
I'm
going
to
connect
to
my
raspberry
pi
over
SFTP
and
FileZilla.
Filezilla
is
an
open
source
file.
Transfer
client
I
actually
have
a
profile
already
set
up.
Sftp
uses
the
same
username
and
credentials
as
SSH.
C
So
when
you
set
up
your
PI
and
you
go
into
the
configuration
tool
to
turn
on
like
Wi-Fi
and
things,
you'll
also
want
to
turn
on
the
SSH
service.
Let's
make
a
little
location,
so
you
see
we're
in
our
home
directory
for
the
PI
user.
I'm
gonna
make
a
location
to
store
that
will
just
call
it
PI
demo,
actually
PI
demo.
C
Those
are
also
what
we
would
expect
to
see
in
a
razor
app,
but
we
also
have
this
file
right
here.
This
file
that
has
no
extension,
PI
demo,
no
extension,
that's
actually
the
executable
file,
that's
actually
what
we're
going
to
run
in
Linux,
there's,
probably
a
term
for
that
I'm,
really
more
of
a
windows
guy
anyway.
So
I.
If
there's
a
terminology
terminology
there
that
I'm
not
aware
of
I'd
love.
C
C
Should
be
able
to
run
it
right?
Well,
not
so
fast,
here's,
let
me
go
ahead
and
type
in
the
command.
Pi
demo
permission
denied
if
you're
not
familiar
with
Linux
Linux
has
a
mechanism
whereby
we
don't
just
run
any
file
willy-nilly.
We
have
to
give
files
permission
to
run
the
way
we
do.
That
is
the
chmod
command,
so
I'm
going
to
give
it
permissions.
C
All
right,
it's
running
now,
I
can't
look
at
the
website
yet,
though,
because
we're
running
as
a
as
a
Kestrel
applicant
whoops
wrong
wrong
zoom
it
we're
running
as
a
Kestrel
application
and
Kestrel
by
default.
If
you
don't
tell
it
otherwise
is
only
listening
on
the
loopback
adapter
localhost
port
5000.
So
we
can
change
that
right.
You
can
change
it
in
code.
C
We
can
go
to
you,
know
the
the
programs
dot
CS
and
come
in
here
and
when
we're
creating
our
web
host,
we
can
add
a
dot
use,
URLs
right,
for
example,
but
what
we
can
also
do
is
just
at
the
command
line
when
a
ctrl
C
to
end
the
program
and
I'm
going
to
run
it
again.
But
this
time
I'm
going
to
pass
in
a
switch
URLs,
HTTP,
HTTP
colon,
slash,
slash
star,
so
every
adapter
port
5,000.
C
C
C
There
we
go
and
we're
going
to
go
to
debug
and
attach
to
process
and
in
the
connection
type,
when
you
come
in
here,
it's
usually
gonna
say
default.
It's
going
to
list
all
your
local
processes,
but
we're
going
to
select
SSH
in
the
connection
target
is
going
to
be
your
username
at
the
network.
Address
and.
C
C
I'm
looking
at
the
while,
it's
attaching
I'm
looking
at
the
chat,
yeah
I
do
have
like
a
foot
tall,
Deadpool
characters
standing
here
on
my
desk
by
the
way,
all
right.
So
it's
running,
let's
set
a
breakpoint
real,
quick
I'm
gonna
go
into
the
razor
page
and
when
I
set
a
breakpoint
where
it
drops
out
of
the
on
get
method.
So
in
theory
we
should
be
able
to
come
back
over
here
to
our
browser,
refresh
the
page
and
hit
the
breakpoint.
C
C
You
notice
it
hits
the
breakpoint
much
quicker
that
time.
So
that's
how
we
debug
in
Visual
Studio.
You
can
debug
in
Visual
Studio
code
too,
but
there's
a
little
bit
more
involved.
There's
a
dependency
that
you
have
to
install
on
the
PI
and
I've
got
a
link
to
a
walkthrough
to
that
on
the
github
page.
For
this
talk,
I'll
be
sharing
that
URL
later
alright.
C
So
that's
pretty
much
all
we
need
to
do
to
get
an
asp.net
core
app
running
now.
I
want
to
talk
about
some
of
the
device,
specific
features
of
of
the
Raspberry
Pi,
specifically
GPIO.
Right
now,
before
we
start
talking
about
GPIO,
we
have
to
talk
a
little
bit
about
just
a
tiny
bit
about
Electrical
Engineering.
Now
let
me
preface
this
I
am
NOT
an
electrical
engineer.
There
are
probably
plenty
of
you
in
the
audience
who
have
way
more
experience
in
electrical
engineering
than
I.
C
So
the
hello
world
app
when
it
comes
to
GPIO,
is
blinking
an
LED
to
do
that.
I'm
using
a
few
devices
here
that
I
want
to
make
you
familiar
with
the
first
one.
Is
this
little
blue
thing
right
here
on
my
device?
It's
black
on
one
I,
think
it's
green
on
another
one,
but
it's
it's
called
a
cobbler
or
a
breakout
board.
The
idea
behind
this
cobbler
or
breakout
board
is
that
I
can
hook
on
the
Raspberry
Pi
itself.
C
A
ribbon
cable
that
connects
the
GPIO
header
to
the
header
on
this
cobbler
and
then
plug
the
cobbler
into
a
breadboard
which
makes
it
easy
to
connect
wires
to
these
various
pins
on
the
Raspberry
Pi
and
have
a
visual
representation
of
what
I'm
connecting
to
now
the
breadboard
itself.
If
you've
never
used
a
breadboard
and
breadboards
were
new
to
me
until
recently,
the
breadboard
itself
is
a
device.
That's
used
for
prototyping
circuits
without
doing
any
soldering,
which
is
really
handy
for
me,
because
I'm
awful
at
soldering.
C
And
what
this
allows
us
to
do,
like
I
said,
is
to
plug
our
cobbler
into
the
breadboard
and
then
use
jumper,
wires
and
kind
of
play
operator.
You
remember
the
old
cartoons
where
the
operators
would
plug
in
the
the
plugs
into
the
switchboard,
and
it's
kind
of
like
that
again
I'm
not
going
to
go
into
the
circuit
or
why
the
LED
works
or
why
there's
a
resistor
there
or
anything
like
that.
But
what's
important
is
to
know
that
to
turn
on
the
LED
I
need
to
turn
on
GPIO
17.
C
That's
pin,
17
I,
just
arbitrarily
picked,
pin
17,
there's
no
reason
to
pick
it
over
any
other.
One
I
just
arbitrarily
picked
that
one
and
it
feeds
power
to
this
rail
down
here
on
the
bottom,
which
feeds
power
to
the
resistor
which
feeds
power
to
the
LED,
which
is
connected.
The
cathode
the
out,
pin
on
the
LED
is
connected
to
this
row
right
here,
which
goes
back
to
the
ground
pin
on
the
header.
C
So
that's
the
circuit
now
before
I
show
you
the
code.
That's
going
to
run
this
circuit
I
need
to
show
you
a
feature
of
the
raspbian
operating
system,
that's
fundamental
to
how
the
code
works.
So,
let's
drop
out
of
the
slide
here
and
I'm
gonna
go
back
over
to
my
shell
and
what
I
want
to
show.
You
is
a
virtual
file
system,
location
on
the
raspbian
operating
system,
so
this
slash
class,
slash
GPIO
and
what
this
file
system
location
allows
us
to
do.
Is
it
allows
us
to
control
our
GPIO
pins
directly
through
the
shell?
C
Let
me
let
me
demonstrate
so.
If
I
look
at
the
contents
of
this
directory,
we
have
a
few
different
locations,
we
locations
and
export
and
export,
and
we
have
three
representing
GPIO
chips.
We're
just
concerned
with
export
and
unexplored
at
this
moment
now
to
open,
pin
17
I'm,
going
to
write
the
text
17
and
I'm
going
to
pipe
it
to
that
export
location.
C
So
if
we
change
our
directory
to
GPIO
17
and
look
at
the
contents,
we
have
a
few
other
locations
and
what
we're
concerned
with
here
are
direction
and
value.
So
whenever
we
open
a
pin,
we
need
to
set
a
direction.
We
need
to
tell
the
device
whether
to
it's
whether
to
generate
current
or
expect
current
coming
in
to
the
pin
like
a
ground
pin
the
way
we
do.
That
is
we
write
again.
C
We
just
write
a
text
value
and
in
this
case
out,
we
want
the
pendant
generator
current
echo
out
to
direction
alright,
so
Direction
is
out
and
then
we
can
turn
on
the
LED
turn
it
off
and
on
by
writing,
1
or
0
to
the
value
location.
To
show
you
an
actual
breadboard
with
the
LED
I've
got
a
low
camera
rig
here.
I
actually
had
to
do
a
little
bit
of
a
Rube
Goldberg
contract'
contraption,
where
I'm
remoting
into
another
machine
driving
the
camera,
because
Skype
does
not
like
this
camera,
and
you
can
see
that
this.
C
This
circuit
is
exactly
the
same
as
it
was
on.
The
schematic.
I
showed
you
a
second
ago:
I
mean
I've,
got
it
plugged
into
pin
17
the
blue
wire
right
now
to
the
wire
color.
I
really
wanted
to
make
it.
So
you
could
reconstruct
this
at
home
without
too
much
effort,
so
so
yeah.
We
should
be
able
to
just
write,
1/2
the
value
and
it
should
be
able
to
should
turn
the
LED
on.
Let's,
let's
try
it
echo
1/2
value.
C
So
we're
opening
the
pin
then
later
on
we're
setting
the
direction
and
then
we're
setting
a
default
value
right.
So
we
have
an
optional
parameter
on
the
constructor
that
that
sets
a
default
value
of
pin
valued
low
wait-wait-wait
low.
What's
that
mean
we
talked
1
&
0
well
in
in
in
GPIO
terms.
High
is
one
low.
Is
zero
I?
Don't
know
why
all
right!
This
goes
back
to
me,
saying
I'm,
not
an
electrical
engineer.
I'm
sure
somebody
in
the
audience
can
probably
tell
us
why.
C
But,
but
that's
that's
the
terminology,
so
that's
what
I
went
with
the
other
thing
that
this
class
does
is
in
the
event
that
we
set
pen
Direction
in,
in
other
words,
we're
expecting
current,
so
we're
gonna
watch
to
see
if
the
circuit
is
broken.
I
kick
off
a
task,
asynchronous
tasks
that
I
call
pin
watcher
just
actually
polls
the
value,
every
10,
milliseconds
and
fires
off
an
event.
If,
if
the
value
changes
to
either
high
or
low,
why
am
I
polling
there?
C
Why
didn't
I
use
like
a
filesystemwatcher,
well
I
tried
using
the
filesystemwatcher,
and
it
doesn't
like
that
virtual
file
system
thing
so
I
had
to
use
kind
of
this
hacky
clootie
method.
There
is
an
API
out
there
that
will
do
it
kind
of
the
right
way
directly
in
memory,
but
it's
not
quite
baked
yet
and
we'll
get
to
that.
C
So
my
hello
world
led
program.
Where
was
the
code
for
that
there?
It
is
all
it
does
when
we
run
the
code.
Is
it's
going
to
new
up
my
GPIO
pin
class
with
pin
17
Direction
out
and
we're
gonna
loop
five
times
we're
gonna
turn
it
on
wait.
A
second
turn.
It
off
wait
a
second!
That's
all
we're
gonna
do
now:
GPIO
pin
it
implements
I
disposable,
because
I
made
it
I
wrote
it
in
such
a
way
that
it
is
considerate
and
closes
the
pins
that
it
opens.
C
C
And
sure
enough,
it
works
alright.
So
on
one
hand
that's
pretty
cool.
We
can
control
an
LED
through
hardware
that
you
know
kind
of
like
low
level
on
the
metal
hardware,
but
on
another
level
big
deal,
we
turned
on
an
LED
right,
well,
that
little
piece
of
functionality
being
able
to
open
and
close
a
pin,
open
and
close
a
circuit
like
that
gives
opens
up
a
whole
world
of
possibilities
for
us.
Let
me
illustrate.
C
The
next
demo
I'm
going
to
show
you
is
this
circuit
now
I
realize
this
circuit
looks
kind
of
nasty.
He
has
lots
of
wires
and
relays,
and
things
like
that.
It's
really
not
that
bad
I'm
actually
switching
out
my
breadboards,
while
I'm
talking
so
I've
got
to
relay
modules
attached
to
attached
to
my
breadboard,
and
what
we
need
to
take
away
from
this
is
that
the
first
relay
module
the
one
on
the
top
there.
It's
only
using
one
of
its
two
relays,
because
these
are
dual
relay
modules.
C
It's
connected
to,
pin,
21
and
all
it
does
is
open
and
close.
The
circuit
turn
this
motor
on
and
off.
That's
all
it
does
now
the
other
one.
The
the
second
relay
module
has
two
relays
on
it
and
we
are
actually
using
both
of
those.
But
what
I
want
to
point
out
is
that
they
are
both
hooked
up
to
the
same
pin.
In
fact,
let's
zoom
in
a
little
bit
there
you
can
see
those
are
both
hooked
up
to
pin
27
both
of
them.
Now.
Why
would
I
do
that?
C
Well,
the
reason
I
did
that
is
because
I
wired
this
circuit
in
such
a
way
that,
when
these
two
relays
on
the
second
relay
module
are
turned
off
power
flows,
one
way
through
the
circuit
and
then
when
we
have
turned
them
both
on.
At
the
same
time,
we
use
a
different
set
of
wires
and
power
flows.
The
other
way
reversing
the
polarity
of
the
motor
okay.
C
C
Really
quick
this
again,
this
breadboard
is
exactly
what's
on
the
schematic.
I
showed
you
right
down
to
the
wire
color
I
paid
a
lot
of
attention
to
detail.
I
3d
printed
a
little
bushing
to
hold
my
motor,
so
we
can
make
it
more
visible
for
you
and
I
put
a
little
spinner
on
the
on
the
shaft.
So
when
the
motors
spinning,
you
have
a
visual
representation
of
it,
so
let's
take
a
look
at
the
dotnet
code
that
goes
along
with
that
real
quick
before
we
run
it.
C
This
is
the
motor
project
in
the
demo
solution,
we'll
start
with
the
motor
class.
The
motor
class
is
actually
really
simple
when
we
knew
it
up.
We
pass
in
in
the
constructor
a
power
pin
number
and
a
polarity
pin
number,
and
we
knew
up
those
GPIO
pins
and
notice.
We
set
a
default
value
of
pin
value
hi.
Why
on
earth?
Would
we
do
that?
Well,
it
has
to
do
with
the
way
the
relays
are
expecting
current
from
the
device.
C
It
turns
out
that
my
relay
modules
expect
pin
value
high
to
be
on
and
pin
value
low
to
be
off.
It's
just
how
the
how
the
relay
modules
were
designed
so
I'm,
just
rolling
with
it.
So
when
we
call
on
we
set,
pin
value
to
low
turns
the
motor
on
when
we
call
off,
we
set
high,
turns
motor
off
and
then
I
just
arbitrarily
chose
high
and
low
for
forward
and
reverse
the
program
code
that
launches
that
motor
class
I
just
made
a
little
command-line
interpreter
right.
C
C
C
C
So
that's
a
practical
application
beyond
just
turning
a
light
on
and
off.
We
can
actually
turn
like
physical
things
on
and
off
motors.
You
could
connect
relays
to
lamps
to
you
these
relays
actually
support
up
to
15
amps
on
a
110
volt
circuit,
so
you
could
control
your
your
your
your
household
lighting
with
one
of
these,
if
you
were
so
inclined
alright,
so
we've
put
the
things
in
Internet
of
Things.
C
We've
been
looking
at
the
GPIO
pins,
but
this
is
all
everything
we've
done
so
far
has
been
constrained
locally
to
my
Raspberry
Pi
right
here
on
my
desk.
What
I
want
to
do
now
is
I
want
to
show
you
a
few
projects
that
I
did
to
give
you
some
ideas
of
things
that
you
can
do
with
this
using
some
services
out
in
the
cloud
and
to
start
I'm
gonna
dive
right
in
with
that
door.
Alert
sensor,
I
told
you
about
now.
Let
me
switch
out.
My
breadboards
bear
with
me
for
a
few
seconds.
A
A
C
Appreciate
that
alright,
so
what
I'm
gonna
show
you
now
is
we're
actually
gonna
use,
pin
direction
in
right,
we're
gonna,
Mott
we're
going
to
watch
a
circuit
to
see
if
it
gets,
you
know
see
if
it's
opened
or
closed
and
what
I'm
using
are
these
little
magnetic
this
little
magnetic
Reed
switch.
So
the
whole
idea
behind
a
reed
switch
is
when
the
magnet
is
present.
The
switch
is
closed.
So
the
circuit
is
connected
and
when
the
magnet
is
not
present,
the
switch
is
open.
C
So
the
circuit
is
disconnected
and
let
me
zoom
in
a
little
bit
here
so
I
can
show
you.
You
can't
really
make
out
the
text
on
the
breadboard,
but
the
blue
wire
is
three
volt
power
and
that's
going
to
the
read,
switch
and
then
pin
twenty
right.
There
is
that's
going
to
be
in
that's
going
to
be
what's
watching
to
see
if
the
power
is
coming
into
the
pin
or
not
and
firing
off
events
in
our
code.
C
C
So
I'm
gonna
skip
right
down
here
to
main
and
all
I'm
doing
is
I'm
mooing
up
that
pin
on
port
20
direction
in
and
I'm
wiring
up
a
couple
of
events,
contacts
which
high
in
contacts
which
low.
If
we
go
look
at
those
two
events,
they
both
do
practically
the
same
thing.
They
pass
a
message
off
to
a
method
called
post
status
and
what
post
status
does?
Is
it
kicks
off
an
asynchronous
tasks
that
serializes
a
message
and
if
you're
wondering
what
that,
what
the
what
that
looks
like
there's
not
much
to
it.
C
It's
just
a
single
property
on
that
class.
It
serializes
that
message
to
JSON
and
it
posts
it
to
an
azure
logic.
App
now
I
chose
an
azure
logic
app
for
this
because
they
are
dead,
simple
to
set
up.
We
can
go
look
at
it
real
quick.
This
is
the
logic
app
it
has.
It
has
a
single
trigger
and
a
single
action.
C
The
trigger
is
just
an
HTTP
web
hook,
so
you
saw
back
in
back
in
the
code,
I'm
I'm
posting
to
a
HTTP
location
and
there's
the
the
schema
for
the
message
that
Matt
matches
the
class
in
my
in
my
project
and
then
what
it
does
with
that
message.
There's
a
billion
different
connectors
that
we
can
choose
from
in
in
logic.
Apps
I
chose
slack
in
this
case,
just
because
it
would
be
easy
to
show
here
on
the
screen
share,
but
you
could
use
something
like
Twilio.
You
could
log
it
in
an
Excel
spreadsheet.
C
If
you
want
to
know
who
came
and
left
your
office
all
day,
you
could
set
that
up
and
I'm
not
who,
but
what
time
people
came
and
left
and
I
have
one
the
doors
open
you
could
you
could
rig
up
a
home
systems?
You
could
do
stuff
like
that
and
make
it
go
to
your
phone,
go
wherever
that's
kind
of
kind
of
the
magic
of
something
like
logic
apps.
C
C
C
Okay,
now,
for
my
final
demonstration
of
cloud
integrations
that
we
can
do
I
want
to
actually
use
Cortana
to
drive
like
I
said:
I
have
an
array
of
LEDs
that
I
want
to
be
able
to
instruct
Cortana
to
turn
these
LEDs
on
and
off.
There's
a
problem
with
this,
however,
and
I've
got
a
slide
to
illustrate
that
the
problem
is
that
the
way
this
is
going
to
work
is
I'm
actually
going
to
do
this
with
the
Cortana
integration
on
IFFT.
If
this
than
that,
it's
a
it's
a
service,
it's
a
lot
like
logic,
apps!
C
It's
it's
a
lot
simpler
though
it
has
a
single
trigger
and
a
single
action.
If
a
happens,
then
B
and
Cortana
actually
has
some
actions
out
there
that
are
pretty
robust.
That
are
really
easy
to
use.
I'm
going
to
show
you
that
here
in
a
second,
so
my
thought
was
well,
we
could
trigger
Cortana.
We
could
invoke
Cortana
dotnet
Bhatt
is
gonna.
Help
me
with
that.
C
If
I
can
there,
we
go
we're
gonna
invoke
Cortana
and
that's
gonna
set
off
the
trigger
in
IFFT
right
and
then,
if
could
maybe
fire
off
a
web
hook
to
hit
a
web
api
on
my
Raspberry
Pi
right
I
mean
that
seems
to
make
sense.
The
problem
is
we're
here
in
my
home
office,
we're
behind
my
firewall.
I
could
open
a
port
on
my
firewall,
but
I'm
not
gonna.
C
Do
that
and
what,
if
I,
was
in
a
location
where
I
couldn't
open
a
port
on
my
firewall,
so
there
traffic's
not
gonna,
get
through
and
that's
not
going
to
work.
So
we
have
to
come
up
with
another
solution.
So
the
way
what
this
is
going
to
work
is
we're
going
to
use
a
couple.
Other
services
we're
gonna,
use
an
azure
logic
app
and
an
azure
service
bus
message
queue
and
the
way
it's
gonna
go
is
when
we
first
start
the
application.
C
It's
going
to
make
an
outbound
connection
from
behind
my
firewall
to
the
message:
queue
where
it's
gonna
watch
the
queue
and
it's
going
to
wait
for
new
messages.
Then,
at
some
future
time
we
can
invoke
Cortana,
which
will
fire
off
the
trigger
on.
If
this
than
that,
which
will
send
a
we
use
a
web
hook
and
post
the
post
that
web
hook
on
another
Azure
logic
app,
which
that
logic
app
will
in
turn,
create
a
service
bus
message
and
put
it
on
the
queue
where
it's
immediately
picked
up
and
acted
on
by
our
application.
C
C
Close
that
so,
let's
start
with
the
service
bus
queue,
there's
actually
nothing
to
the
service
bus
queue.
I
already
have
a
service
bus,
namespace,
I
created,
there's
no
I
I
just
took
all
the
defaults
and
then
there's
two
queues
I
put
in
there.
I
had
one
for
another
demo
that
I'm
not
that
I
I
am
NOT
going
to
be
doing
and
I
have
this
one
here
called
Cortana.
There's
all
default.
I
made
no
changes
whatsoever,
just
a
file
new.
Basically
now
the
logic
app.
Let's
check
out
that
logic,
app.
C
That
logic,
app
again,
is
pretty
simple.
It's
pretty
much
the
same
as
the
other
one.
We've
got
a
web
hook
here
right
with
a
simple
schema:
that's
expecting
a
single
property
called
color
and
the
action
that
that
logic
app
is
going
to
take.
Is
it's
going
to
send
a
message
to
a
service
bus
queue
named
Cortana
and
I've
already
done
all
the
wiring
up
and
it
walks
you
through
it
the
first
time
you
you
set
it
up?
C
C
C
So
what
we
do
is
we
open
up
these
three
pins
and
then
we
connect
to
the
service
bus
queue
and
we
watch
it.
We
register
some
handlers
to
handle
the
handle
the
messages
as
they're
posted
and
then
we,
we
just
say:
okay,
we're
waiting
for
kirtanam.
Now
the
handlers
are
actually
pretty
simple,
they're,
very
similar
to
the
to
the
door
watcher
app.
Actually,
the
same
kind
of
thing
where
all
we're
doing
is
we're.
C
Looking
at
that
message
right
and
we're
looking
we're
doing
when
we
get
down
to
the
process
color
text,
it
has
to
go
through
several
levels
of
of
process
messages
and
handlers
and
so
forth,
but
when
it
gets
down
to
process
color
text
we're
just
looking
if
it's
red,
we
turn
on
the
red
light.
If
it's
yellow,
we
turn
on
the
yellow.
If
it's
green,
we
turn
on
the
green
again.
C
You're
gonna
say
okay,
but
why
is
this
pin
value
low
and
not
pin
value
high
I'm
gonna
explain
that
in
just
a
second,
this
one's
actually
pretty
easy
to
understand
for
me
anyway,
and
then,
if,
if
it's
not
red,
yellow
or
green
we're
gonna
blink,
all
the
LEDs
is
kind
of
an
error
state
to
say
hey
this:
isn't
this
isn't
a
color?
You
asked
for
purple
and
we
don't
have
purple.
C
C
We're
going
to
say
a
phrase
with
text:
what
do
you
want
to
say
I'm
going
to
say
turn
on
the,
and
then
you
see
it
says
down
here
that
says
down
here
that
the
dollar
sign
is
the
token
for
the
for
the
text
ingredient.
They
call
it
so
the
text
that
we
want
to
pass
on
to
the
to
our
action,
so
we're
gonna,
say
turn
on
the
dollar
sign
light.
Also
just
add
dollar
sign
light.
Please
is
another
option
and
what
do
I
want
Cortana
to
say
in
response?
How
about?
We
have
her
say
sure.
C
So
there's
our
trigger
yeah
I,
see
out
in
the
chat
they're
asking
where's
the
device
integration
this
this
is.
This
is
poor
man's
Cortana
integration
you're!
Absolutely
right.
We
can.
We
could
write
Cortana
code
to
live
on
a
PI
device
using
the
Windows
IOT,
but
this
is
more
I'm
going
to
use
some
some
integrations
from
my
desktop
here
to
automate
stuff
like
in
my
house
or
office
or
whatever
so
the
trigger
was
Cortana,
and
then
that
is
going
to
be
a
in
this
case.
Another
webhook.
C
C
C
There
we
go
now,
I
told
you
that
the
reason
that
there's
a
very
easy
to
understand,
reason
why
we're
using
low,
instead
of
high
to
turn
on
these
LEDs
and
that
that
reason
is
the
what's
the
hotkey
for
a
line.
So
the
3.3
volt
wire
here
is
going
to
this
rail,
which
is
providing
power
to
all
these
resistors,
which
are
in
turn
providing
power
to
the
LEDs.
And
then
the
cathodes
from
the
LEDs
are
connected
to
their
respective
ports.
Since
the
cathodes,
the
outputs
from
the
LEDs
are
connected
to
the
ports.
C
The
ports
are
going
to
be
blocking
the
connection
when
they're
high
and
when
they're
set
to
one
but
they're
going
to
be
allowing
the
connection
when
they're
set
to
zero.
So
that's
why
low
is
going
to
turn
them
on
and
high
is
going
to
turn
them
off.
You'll
notice,
also
the
red
and
the
yellow
happen
to
be
glowing
a
little
and
I
think
the
green
is
to
is
just
not
coming
through
on
the
camera.
That's
because
we
haven't
opened
the
pins
and
there's
just
a
little
bit
of
background
voltage
flowing
across
the
pins.
C
C
C
Well,
I,
don't
know
how
the
I
don't
know
how
good
the
frame
rate
on
the
frame
rate
on
skype
is,
but
you
should
have
seen
all
the
lights
blinking
in
quick
succession
to
show
that
we
don't
have
a
purple
light.
One
more
thing:
I
want
to
try:
hey
cortana,
a
cortana.
Oh
she
heard
me
say:
hey
Cortana
twice.
C
C
For
those
of
you,
young
uns,
that
was
a
joke
about
the
police.
They
were
a
really
cool
band
in
the
80s
and
you
should
go
check
them
out
on
Spotify
alright.
So
that
is
it
for
our
integration,
demos,
which
leaves
us
one
more
point
of
discussion,
and
that
point
of
discussion
is
what
now
well
I
encourage
you
to
go
check
out
my
github
at
that
address
right
there
github.com
slash
camp,
so
/
/
have
your
pie.
There
you'll
find
my
notes
with
everything
you
need
to
know.
C
I've
got
links
to
where
you
can
get
the
operating
systems
and
some
some
advice
about
which
devices
to
buy
and
and
which
components
to
buy,
to
build.
These
I've
got
all
my
schematics
all
my
demos,
including
some
demos
that
I
didn't
use,
and
all
these
slides
I'll
also
put
a
link
to
this
talk
on
that
github.
So
you
can
refer
to
it
in
the
future.
C
The
other
thing
I
wanted
to
talk
about
is
you
should
go.
Take
a
look
at
system,
dot
devices
that
GPIO.
That
is
a
package
that
is
currently
in
pre-release.
It
is
targeted
for
dotnet
core
3.
Oh,
it
is
very
early
in
development
and
the
API
surface
is
very
likely
to
change
before
release.
It's
designed
for
all
kinds
of
IOT
platforms
that
use
GPIO,
Raspberry,
Pi
included,
and
it's
kind
of
an
easy
one
to
feature
because
it's
so
ubiquitous.
C
There's
a
few
there's
actually
a
reason
why
I
didn't
use
system
dot
devices
that
GPIO
it
mostly
works,
but
the
demo
that
I
had
where
we
were
watching
the
read
sensor.
It
locked
up
my
Raspberry
Pi,
pretty
consistently
every
time,
I
demoed
it
so
I
ended
up
not
using
it,
but
it
is
like
I,
said
early
pre-release,
and
it
doesn't
use
that
kind
of
hacky
mechanism
that
I
used
in
the
file
system.
It
does
support
pulse
width,
modulator
pulse
width,
modulation.
C
Finally,
the
team
has
asked
me
to
point
out
to
you
guys
that
they're
looking
for
contributors,
if
you're,
if
this
is
something
that
you're
really
interested
in-
and
this
is
in
your
wheelhouse
by
all
means-
go
check
out
their
github
and
and
send
them
a
few
pull
requests.
So
with
that
I'd
like
to
see
if
we
have
any
other
questions.
A
B
C
If
there
aren't
any
more
questions,
I
just
want
to
say
I
hope
everyone
found
this
informative
and
enjoyable
and
I
really
hope.
You
found
yourself
inspired
with
some
ideas
to
go
implement
in
your
own
Raspberry
Pi
projects.
You
can
again
check
out
my
github
check
out
my
Twitter.
You
can
always
hit
me
up
and
I'll,
try
to
help
you
out
and
and
do
check
out
the
system,
dot
devices
GPIO
project,
because
that
is
going
to
be
the
official
dotnet
course
support
in
the
future.
Nice.