iBeacon is a system for device-to-device communication based on Bluetooth Low Energy. Applications running on phones, computers, or other types of device can detect and respond to the presence of nearby iBeacons. This technology opens the doors for new and creative interactions between networked objects like wearables and the surrounding environment. In this session we'll explore the potential of iBeacons by building an iBeacon detection device from scratch and using it to interact with a set of iBeacon nodes from Estimote.
See code examples and demo application on GitHub here: https://github.com/dluxemburg/ibeacon-detector
3. Getting
Started
with
iBeacons
›What
they
are
›How
they
talk
›How
to
work
with
them
›What
this
means
for
designing
things
4. Getting
Started
with
iBeacons
› Transmitters
that
notify
devices
of
their
presence
› They
can
notify
about
other
things
too
› Enabling
technology:
Bluetooth
Low
Energy
› iBeacon,
AltBeacon,
maybe
more
to
come
› Lots
of
creative
potential:
› Context-‐aware
applications
› High-‐fidelity
positioning
(“Indoor
GPS”)
› “Smart”
(or
at
least
identifiable)
objects
9. Going
Beyond
the
Phone
› Is
there
a
future
for
single-‐purpose
devices?
› Of
course,
that’s
why
we’re
here
› At
a
minimum,
there’s
a
“movement”
worth
of
people
who
seem
to
think
there’s
room
to
make
new
things
› Robots,
drones,
toys,
appliances,
tools,
personal
trackers…
› It
doesn’t
matter—it’s
still
a
great
way
to
learn
and
explore
10. Application
Platform:
Node.js
!
!
“Node.js®
is
a
platform
built
on
Chrome's
JavaScript
runtime
for
easily
building
fast,
scalable
network
applications.
Node.js
uses
an
event-‐driven,
non-‐blocking
I/O
model
that
makes
it
lightweight
and
efficient,
perfect
for
data-‐
intensive
real-‐time
applications
that
run
across
distributed
devices.”
—nodejs.org
16. Callbacks
› Programming
for
iBeacons,
or
any
similar
technology,
is
inherently
asynchronous
› Programs
respond
to
changes
in
the
environment
› It’s
the
appropriate
mental
model—set
up
handlers
for
particular
scenarios
› The
structure
of
programs
have
lessons
to
teach
beyond
their
technical
details
17. Callbacks
in
Plain
Language
› Peripheral
broadcasts
advertisement
› Central
receives
advertisement,
discovers
services
› Peripheral
reports
services
› Central
discovers
characteristics
› Peripheral
reports
characteristics
› Central
reads
value
› Central
discovers
descriptors
› Peripheral
reports
descriptors
› Central
reads
value(s)
18. Talking
to
Our
Thing
› Finding
the
Raspberry
Pi
(nmap)
› Lists
the
local
IPs
of
available
devices
› Connecting
to
the
Raspberry
pi
(ssh)
› Creates
a
secure
tunnel
for
controlling
another
computer
› Turning
on
Bluetooth
(hciconfig)
› Enable
connections
through
the
Bluetooth
USB
dongle
› Running
our
program
(node)
19. $ nmap
Finding
the
Raspberry
Pi
-‐sn
10.0.1.0/24
Starting
Nmap
6.46
(
http://nmap.org
)...
...at
2014-‐09-‐05
17:38
EDT
Nmap
scan
report
for
10.0.1.1
Host
is
up
(0.0026s
latency).
Nmap
scan
report
for
10.0.1.3
Host
is
up
(0.047s
latency).
Nmap
scan
report
for
10.0.1.18
Host
is
up
(0.00011s
latency).
Nmap
scan
report
for
10.0.1.24
Host
is
up
(0.0058s
latency).
Nmap
done:
256
IP
addresses
(4
hosts
up)...
...scanned
in
3.08
seconds
20. $
!
!
Connecting
to
the
Raspberry
Pi
ssh
pi@10.0.1.24
!
pi@10.0.1.24's
password:
!
Linux
raspberrypi
3.10.25+
#622...
...
Last
login:
Mon
Jun
30
00:12:34
2014
from
10.0.1.18
21. $
!
!
Turning
on
Bluetooth
sudo
hciconfig
!
hci0:
Type:
BR/EDR
Bus:
USB
BD
Address:
00:1B:DC:06:5D:2A...
DOWN
RX
bytes:1150
acl:0
sco:0
events:58...
TX
bytes:788
acl:0
sco:0
commands:57...
22. $
$
!
Turning
on
Bluetooth
sudo
hciconfig
hci0
up
sudo
hciconfig
!
hci0:
Type:
BR/EDR
Bus:
USB
BD
Address:
00:1B:DC:06:5D:2A...
UP
RUNNING
RX
bytes:1703
acl:0
sco:0
events:86...
TX
bytes:1182
acl:0
sco:0
commands:85...
24. Having
Our
Thing
Talk
to
Us
› Adafruit
Blue&White
16x2
LCD+Keypad
Kit
25. !
This
is
still
all
text
!
Things
are
interesting
because
they
can
talk
in
other
ways
too
26. Having
Our
Thing
“Talk”
to
Us
› ThingM
blink(1)
mk2
USB
RGB
LED
27. 1
2
3
4
5
6
7
8
9
10
11
var
Having
Our
Thing
“Talk”
to
Us
detector
=
new
Detector({},{noble:
noble})
var
blinker
=
new
Blinker({},{blink1:
new
Blink1()})
var
display
=
new
Display()
!
var
app
=
require('./lib/app').create({},{
detector:
detector,
display:
display,
blinker:
blinker
})
!
app.run()
31. !
This
is
still
an
extension
of
my
computer
!
Things
are
interesting
because
they
can
live
on
their
own
too
32. Having
Our
Thing
Do
Its
Own
Thing
› Setup
script
(bash/shell)
› Ensures
environment
is
properly
configured
› Process
launcher
(init.d)
› Kicks
off
application
and
process
monitoring
› Process
monitor
(forever)
› Keeps
application
running
if
something
goes
wrong
39. Observations
• Things
can
both
produce
and
consume
context
• Things
can
communicate
in
new
and
different
ways
• Things
can
exist
autonomously
40. Advice
• Think
in
callbacks
• Program
with
dependency
injection
(and
mocked
interfaces)
• Get
familiar
with
relevant
system
utilities
(and
help
others
to
as
well)