SlideShare a Scribd company logo
Getting 
Started 
with 
iBeacons
Get 
started 
by 
building.
Getting 
Started 
with 
iBeacons 
›What 
they 
are 
›How 
they 
talk 
›How 
to 
work 
with 
them 
›What 
this 
means 
for 
designing 
things
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
Getting 
Started 
with 
iBeacons: 
Estimotes
! 
It’s 
not 
just 
about 
the 
beacons 
! 
It’s 
about 
the 
devices 
that 
sense 
and 
communicate 
with 
them 
too
Going 
Beyond 
the 
Phone
Going 
Beyond 
the 
Phone
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
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
1 
2 
3 
4 
5 
var 
noble 
= 
require('noble') 
noble.on('discover', 
function(per){ 
console.log(per.advertisement.localName+' 
'+per.uuid) 
}) 
noble.startScanning()
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
var 
noble 
= 
require('noble') 
noble.on('discover', 
function(per){ 
console.log(per.advertisement.localName+' 
'+per.uuid) 
per.on('connect', 
function(){ 
per.on('servicesDiscover', 
function(sers){ 
sers.forEach(function(ser){ 
if(ser.name) 
console.log(' 
'+ser.name) 
}) 
}) 
per.discoverServices() 
}) 
per.connect() 
}) 
noble.startScanning()
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
var 
noble 
= 
require('noble') 
noble.on('discover', 
function(per){ 
console.log(per.advertisement.localName+' 
'+per.uuid) 
per.on('connect', 
function(){ 
per.on('servicesDiscover', 
function(sers){ 
sers.forEach(function(ser){ 
if(ser.name) 
console.log(' 
'+ser.name) 
ser.on('characteristicsDiscover', 
function(chs){ 
chs.forEach(function(ch){ 
if(ch.name) 
console.log(' 
'+ch.name) 
}) 
}) 
ser.discoverCharacteristics() 
}) 
}) 
per.discoverServices() 
}) 
per.connect() 
}) 
noble.startScanning()
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
var 
noble 
= 
require('noble') 
noble.on('discover', 
function(per){ 
console.log(per.advertisement.localName+' 
'+per.uuid) 
per.on('connect', 
function(){ 
per.on('servicesDiscover', 
function(sers){ 
sers.forEach(function(ser){ 
if(ser.name) 
console.log(' 
'+ser.name) 
ser.on('characteristicsDiscover', 
function(chs){ 
chs.forEach(function(ch){ 
if(ch.name) 
console.log(' 
‘+ch.name) 
ch.on('descriptorsDiscover', 
function(descs){ 
descs.forEach(function(desc){ 
if(desc.name) 
console.log(' 
'+desc.name) 
}) 
}) 
ch.discoverDescriptors() 
}) 
}) 
ser.discoverCharacteristics() 
}) 
}) 
per.discoverServices() 
}) 
per.connect() 
}) 
noble.startScanning()
Callbacks
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
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)
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)
$ 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
$ 
! 
! 
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
$ 
! 
! 
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...
$ 
$ 
! 
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...
$ 
! 
! 
Running 
Our 
Program 
node 
index1.js 
! 
scanning... 
estimote 
5404e4f46332620002f4 
...
Having 
Our 
Thing 
Talk 
to 
Us 
› Adafruit 
Blue&White 
16x2 
LCD+Keypad 
Kit
! 
This 
is 
still 
all 
text 
! 
Things 
are 
interesting 
because 
they 
can 
talk 
in 
other 
ways 
too
Having 
Our 
Thing 
“Talk” 
to 
Us 
› ThingM 
blink(1) 
mk2 
USB 
RGB 
LED
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()
Dependency 
Injection
1 
2 
3 
4 
5 
6 
Dependency 
Injection 
exports.Detector 
= 
function(options, 
injected){ 
this.options 
= 
options 
this.noble 
= 
injected.noble 
this.noble.on('discover', 
this.discover.bind(this)) 
... 
}
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
var 
Dependency 
Injection 
expect 
= 
require('expect.js'), 
sinon 
= 
require('sinon'), 
Detector 
= 
require('../lib/detector').Detector 
! 
describe('new 
Detector()', 
function(){ 
it('calls 
noble#on', 
function(){ 
var 
noble 
= 
{on: 
sinon.spy()} 
var 
detector 
= 
new 
Detector({}, 
{noble: 
noble}) 
expect(noble.on.called).to.be.ok() 
}) 
})
! 
This 
is 
still 
an 
extension 
of 
my 
computer 
! 
Things 
are 
interesting 
because 
they 
can 
live 
on 
their 
own 
too
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
1 
2 
3 
4 
5 
6 
7 
8 
Setup 
Script 
#! 
/bin/sh 
! 
sudo 
npm 
install 
forever 
-­‐g 
sudo 
rm 
-­‐rf 
/usr/local/ibeacon-­‐detector 
sudo 
ln 
-­‐s 
`readlink 
-­‐m 
.` 
/usr/local 
sudo 
rm 
-­‐rf 
/etc/init.d/ibeacon-­‐detector 
sudo 
cp 
ibeacon-­‐detector 
/etc/init.d/ibeacon-­‐detector 
sudo 
update-­‐rc.d 
ibeacon-­‐detector 
defaults
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
Process 
Launcher 
# 
/etc/init.d/ibeacon-­‐detector 
! 
### 
BEGIN 
INIT 
INFO 
# 
Provides: 
ibeacon-­‐detector 
# 
Required-­‐Start: 
$all 
# 
X-­‐UnitedLinux-­‐Should-­‐Start: 
# 
Required-­‐Stop: 
$all 
# 
X-­‐UnitedLinux-­‐Should-­‐Stop: 
# 
User: 
root 
# 
Default-­‐Start: 
2 
3 
4 
5 
# 
Default-­‐Stop: 
0 
1 
6 
# 
Short-­‐Description: 
iBeacon 
Detector 
autostart 
# 
Description: 
iBeacon 
Detector 
autostart... 
### 
END 
INIT 
INFO
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
case 
"$1" 
in 
start) 
Process 
Launcher 
/usr/local/bin/hciconfig 
hci0 
up 
/usr/local/bin/forever 
start… 
;; 
stop) 
/usr/local/bin/forever 
stopall 
;; 
*) 
echo 
"Usage: 
/ibeacon-­‐detector 
{start|stop}" 
exit 
1 
;; 
esac 
exit 
0
Process 
Monitor 
$ /usr/local/bin/forever 
start 
 
-­‐al 
/var/log/forever.log 
 
-­‐o 
/var/log/ibeacon-­‐detector.log 
 
-­‐e 
/var/log/ibeacon-­‐detector-­‐error.log 
 
—sourceDir=/usr/local/ibeacon-­‐detector 
index.js
System 
Utilities
Learn 
by 
building?
Observations 
• Things 
can 
both 
produce 
and 
consume 
context 
• Things 
can 
communicate 
in 
new 
and 
different 
ways 
• Things 
can 
exist 
autonomously
Advice 
• Think 
in 
callbacks 
• Program 
with 
dependency 
injection 
(and 
mocked 
interfaces) 
• Get 
familiar 
with 
relevant 
system 
utilities 
(and 
help 
others 
to 
as 
well)
Code: 
Thanks! 
github.com/dluxemburg/ibeacon-­‐detector 
GitHub: 
dluxemburg 
Twitter: 
@dluxemburg

More Related Content

What's hot

playaround workshop 2010 - internet of the real things
playaround workshop 2010 - internet of the real thingsplayaround workshop 2010 - internet of the real things
playaround workshop 2010 - internet of the real things
playaround.cc
 
Scratch pcduino
Scratch pcduinoScratch pcduino
Scratch pcduino
Jingfeng Liu
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating language
jgrahamc
 
Arduino and the real time web
Arduino and the real time webArduino and the real time web
Arduino and the real time web
Andrew Fisher
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual
Vivek Kumar Sinha
 
IT6712 lab manual
IT6712 lab manualIT6712 lab manual
IT6712 lab manual
Madhu Amarnath
 
DomCode 2015 - Abusing phones to make the internet of things
DomCode 2015 - Abusing phones to make the internet of thingsDomCode 2015 - Abusing phones to make the internet of things
DomCode 2015 - Abusing phones to make the internet of things
Jan Jongboom
 
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2
TechWell
 
"Elixir of Life" - Dev In Santos
"Elixir of Life" - Dev In Santos"Elixir of Life" - Dev In Santos
"Elixir of Life" - Dev In Santos
Fabio Akita
 
Arduino1.0 RC
Arduino1.0 RCArduino1.0 RC
Arduino1.0 RC
馬 萬圳
 
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1
TechWell
 
Network security mannual (2)
Network security mannual (2)Network security mannual (2)
Network security mannual (2)
Vivek Kumar Sinha
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
Jingfeng Liu
 
Home Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google AssistantHome Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google Assistant
Nilhcem
 
Ieee 1149.1-2013-tutorial-ijtag
Ieee 1149.1-2013-tutorial-ijtagIeee 1149.1-2013-tutorial-ijtag
Ieee 1149.1-2013-tutorial-ijtag
Venkateshwar Motamarri
 
Using Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansUsing Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate Reptilians
Nilhcem
 
Maker Movement
Maker MovementMaker Movement
Maker Movement
Jingfeng Liu
 
Interacting with Intel Edison
Interacting with Intel EdisonInteracting with Intel Edison
Interacting with Intel Edison
FITC
 
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet LabsThe Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
Puppet
 
QConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações WebQConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações Web
Fabio Akita
 

What's hot (20)

playaround workshop 2010 - internet of the real things
playaround workshop 2010 - internet of the real thingsplayaround workshop 2010 - internet of the real things
playaround workshop 2010 - internet of the real things
 
Scratch pcduino
Scratch pcduinoScratch pcduino
Scratch pcduino
 
Lua: the world's most infuriating language
Lua: the world's most infuriating languageLua: the world's most infuriating language
Lua: the world's most infuriating language
 
Arduino and the real time web
Arduino and the real time webArduino and the real time web
Arduino and the real time web
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual
 
IT6712 lab manual
IT6712 lab manualIT6712 lab manual
IT6712 lab manual
 
DomCode 2015 - Abusing phones to make the internet of things
DomCode 2015 - Abusing phones to make the internet of thingsDomCode 2015 - Abusing phones to make the internet of things
DomCode 2015 - Abusing phones to make the internet of things
 
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 2
 
"Elixir of Life" - Dev In Santos
"Elixir of Life" - Dev In Santos"Elixir of Life" - Dev In Santos
"Elixir of Life" - Dev In Santos
 
Arduino1.0 RC
Arduino1.0 RCArduino1.0 RC
Arduino1.0 RC
 
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1
Intel® Curie™ Open Developer Kit (ODK): A Primer—Part 1
 
Network security mannual (2)
Network security mannual (2)Network security mannual (2)
Network security mannual (2)
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 
Home Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google AssistantHome Automation with Android Things and the Google Assistant
Home Automation with Android Things and the Google Assistant
 
Ieee 1149.1-2013-tutorial-ijtag
Ieee 1149.1-2013-tutorial-ijtagIeee 1149.1-2013-tutorial-ijtag
Ieee 1149.1-2013-tutorial-ijtag
 
Using Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansUsing Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate Reptilians
 
Maker Movement
Maker MovementMaker Movement
Maker Movement
 
Interacting with Intel Edison
Interacting with Intel EdisonInteracting with Intel Edison
Interacting with Intel Edison
 
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet LabsThe Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs
 
QConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações WebQConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações Web
 

Viewers also liked

Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
Eduardo Pelegri-Llopart
 
iBeacon™ FAQ White Paper
iBeacon™ FAQ White PaperiBeacon™ FAQ White Paper
iBeacon™ FAQ White Paper
Red Fox Insights
 
Evolve 2014 iBeacons and Contextual Location Awareness in iOS and Android apps
Evolve 2014 iBeacons and Contextual Location Awareness in iOS and Android appsEvolve 2014 iBeacons and Contextual Location Awareness in iOS and Android apps
Evolve 2014 iBeacons and Contextual Location Awareness in iOS and Android apps
James Montemagno
 
ibeacons
ibeaconsibeacons
ibeacons
Chaitanya Ram
 
Indoor location in mobile applications using iBeacons
Indoor location in mobile applications using iBeaconsIndoor location in mobile applications using iBeacons
Indoor location in mobile applications using iBeacons
Simon Guest
 
Brand You : Personal Branding
Brand You : Personal BrandingBrand You : Personal Branding
Brand You : Personal Branding
Studio Science
 
Grow with HubSpot - Sydney - June 2016
Grow with HubSpot - Sydney - June 2016Grow with HubSpot - Sydney - June 2016
Grow with HubSpot - Sydney - June 2016
Ryan Bonnici
 
In-Store Marketing via Micro-Location: Beacon
In-Store Marketing via Micro-Location: BeaconIn-Store Marketing via Micro-Location: Beacon
In-Store Marketing via Micro-Location: Beacon
DigitasLBi Paris
 
Preparing to fail
Preparing to failPreparing to fail
Preparing to fail
aweyenberg
 
Culture Code: Creating A Lovable Company
Culture Code: Creating A Lovable CompanyCulture Code: Creating A Lovable Company
Culture Code: Creating A Lovable Company
HubSpot
 

Viewers also liked (10)

Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
 
iBeacon™ FAQ White Paper
iBeacon™ FAQ White PaperiBeacon™ FAQ White Paper
iBeacon™ FAQ White Paper
 
Evolve 2014 iBeacons and Contextual Location Awareness in iOS and Android apps
Evolve 2014 iBeacons and Contextual Location Awareness in iOS and Android appsEvolve 2014 iBeacons and Contextual Location Awareness in iOS and Android apps
Evolve 2014 iBeacons and Contextual Location Awareness in iOS and Android apps
 
ibeacons
ibeaconsibeacons
ibeacons
 
Indoor location in mobile applications using iBeacons
Indoor location in mobile applications using iBeaconsIndoor location in mobile applications using iBeacons
Indoor location in mobile applications using iBeacons
 
Brand You : Personal Branding
Brand You : Personal BrandingBrand You : Personal Branding
Brand You : Personal Branding
 
Grow with HubSpot - Sydney - June 2016
Grow with HubSpot - Sydney - June 2016Grow with HubSpot - Sydney - June 2016
Grow with HubSpot - Sydney - June 2016
 
In-Store Marketing via Micro-Location: Beacon
In-Store Marketing via Micro-Location: BeaconIn-Store Marketing via Micro-Location: Beacon
In-Store Marketing via Micro-Location: Beacon
 
Preparing to fail
Preparing to failPreparing to fail
Preparing to fail
 
Culture Code: Creating A Lovable Company
Culture Code: Creating A Lovable CompanyCulture Code: Creating A Lovable Company
Culture Code: Creating A Lovable Company
 

Similar to Getting Started with iBeacons (Designers of Things 2014)

Exploring the Internet of Things Using Ruby
Exploring the Internet of Things Using RubyExploring the Internet of Things Using Ruby
Exploring the Internet of Things Using Ruby
Mike Hagedorn
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
Ronny
 
From printed circuit boards to exploits
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploits
virtualabs
 
Fun with Ruby and Cocoa
Fun with Ruby and CocoaFun with Ruby and Cocoa
Fun with Ruby and Cocoa
Patrick Huesler
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIO
Kris Findlay
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
Logicaltrust pl
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
Yury Chemerkin
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Romain Dorgueil
 
Simple ETL in python 3.5+ with Bonobo, Romain Dorgueil
Simple ETL in python 3.5+ with Bonobo, Romain DorgueilSimple ETL in python 3.5+ with Bonobo, Romain Dorgueil
Simple ETL in python 3.5+ with Bonobo, Romain Dorgueil
Pôle Systematic Paris-Region
 
Parrot Drones Hijacking
Parrot Drones HijackingParrot Drones Hijacking
Parrot Drones Hijacking
Priyanka Aash
 
R-House (LSRC)
R-House (LSRC)R-House (LSRC)
R-House (LSRC)
Fernand Galiana
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
Susan Potter
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POE
Thiago Rondon
 
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionDEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
Felipe Prado
 
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Mike Qin
 
Fixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data PatternsFixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data Patterns
Martin Jackson
 
[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)
Evgeny Kaziak
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
Hafez Kamal
 
Ransomware for fun and non-profit
Ransomware for fun and non-profitRansomware for fun and non-profit
Ransomware for fun and non-profit
Youness Zougar
 
Intro to the raspberry pi board
Intro to the raspberry pi boardIntro to the raspberry pi board
Intro to the raspberry pi board
Thierry Gayet
 

Similar to Getting Started with iBeacons (Designers of Things 2014) (20)

Exploring the Internet of Things Using Ruby
Exploring the Internet of Things Using RubyExploring the Internet of Things Using Ruby
Exploring the Internet of Things Using Ruby
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
From printed circuit boards to exploits
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploits
 
Fun with Ruby and Cocoa
Fun with Ruby and CocoaFun with Ruby and Cocoa
Fun with Ruby and Cocoa
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIO
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
 
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017Simple ETL in python 3.5+ with Bonobo - PyParis 2017
Simple ETL in python 3.5+ with Bonobo - PyParis 2017
 
Simple ETL in python 3.5+ with Bonobo, Romain Dorgueil
Simple ETL in python 3.5+ with Bonobo, Romain DorgueilSimple ETL in python 3.5+ with Bonobo, Romain Dorgueil
Simple ETL in python 3.5+ with Bonobo, Romain Dorgueil
 
Parrot Drones Hijacking
Parrot Drones HijackingParrot Drones Hijacking
Parrot Drones Hijacking
 
R-House (LSRC)
R-House (LSRC)R-House (LSRC)
R-House (LSRC)
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POE
 
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destructionDEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
DEF CON 27 - PATRICK WARDLE - harnessing weapons of Mac destruction
 
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
Blockchain Software for Hardware: The Canaan AvalonMiner Open Source Embedded...
 
Fixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data PatternsFixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data Patterns
 
[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)[JAM 1.2] Design & Multitasking (Andrew Solovey)
[JAM 1.2] Design & Multitasking (Andrew Solovey)
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
 
Ransomware for fun and non-profit
Ransomware for fun and non-profitRansomware for fun and non-profit
Ransomware for fun and non-profit
 
Intro to the raspberry pi board
Intro to the raspberry pi boardIntro to the raspberry pi board
Intro to the raspberry pi board
 

Recently uploaded

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 

Recently uploaded (20)

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 

Getting Started with iBeacons (Designers of Things 2014)

  • 2. Get started by building.
  • 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
  • 5. Getting Started with iBeacons: Estimotes
  • 6. ! It’s not just about the beacons ! It’s about the devices that sense and communicate with them too
  • 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
  • 11. 1 2 3 4 5 var noble = require('noble') noble.on('discover', function(per){ console.log(per.advertisement.localName+' '+per.uuid) }) noble.startScanning()
  • 12. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 var noble = require('noble') noble.on('discover', function(per){ console.log(per.advertisement.localName+' '+per.uuid) per.on('connect', function(){ per.on('servicesDiscover', function(sers){ sers.forEach(function(ser){ if(ser.name) console.log(' '+ser.name) }) }) per.discoverServices() }) per.connect() }) noble.startScanning()
  • 13. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 var noble = require('noble') noble.on('discover', function(per){ console.log(per.advertisement.localName+' '+per.uuid) per.on('connect', function(){ per.on('servicesDiscover', function(sers){ sers.forEach(function(ser){ if(ser.name) console.log(' '+ser.name) ser.on('characteristicsDiscover', function(chs){ chs.forEach(function(ch){ if(ch.name) console.log(' '+ch.name) }) }) ser.discoverCharacteristics() }) }) per.discoverServices() }) per.connect() }) noble.startScanning()
  • 14. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 var noble = require('noble') noble.on('discover', function(per){ console.log(per.advertisement.localName+' '+per.uuid) per.on('connect', function(){ per.on('servicesDiscover', function(sers){ sers.forEach(function(ser){ if(ser.name) console.log(' '+ser.name) ser.on('characteristicsDiscover', function(chs){ chs.forEach(function(ch){ if(ch.name) console.log(' ‘+ch.name) ch.on('descriptorsDiscover', function(descs){ descs.forEach(function(desc){ if(desc.name) console.log(' '+desc.name) }) }) ch.discoverDescriptors() }) }) ser.discoverCharacteristics() }) }) per.discoverServices() }) per.connect() }) noble.startScanning()
  • 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...
  • 23. $ ! ! Running Our Program node index1.js ! scanning... estimote 5404e4f46332620002f4 ...
  • 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()
  • 29. 1 2 3 4 5 6 Dependency Injection exports.Detector = function(options, injected){ this.options = options this.noble = injected.noble this.noble.on('discover', this.discover.bind(this)) ... }
  • 30. 1 2 3 4 5 6 7 8 9 10 11 var Dependency Injection expect = require('expect.js'), sinon = require('sinon'), Detector = require('../lib/detector').Detector ! describe('new Detector()', function(){ it('calls noble#on', function(){ var noble = {on: sinon.spy()} var detector = new Detector({}, {noble: noble}) expect(noble.on.called).to.be.ok() }) })
  • 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
  • 33. 1 2 3 4 5 6 7 8 Setup Script #! /bin/sh ! sudo npm install forever -­‐g sudo rm -­‐rf /usr/local/ibeacon-­‐detector sudo ln -­‐s `readlink -­‐m .` /usr/local sudo rm -­‐rf /etc/init.d/ibeacon-­‐detector sudo cp ibeacon-­‐detector /etc/init.d/ibeacon-­‐detector sudo update-­‐rc.d ibeacon-­‐detector defaults
  • 34. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Process Launcher # /etc/init.d/ibeacon-­‐detector ! ### BEGIN INIT INFO # Provides: ibeacon-­‐detector # Required-­‐Start: $all # X-­‐UnitedLinux-­‐Should-­‐Start: # Required-­‐Stop: $all # X-­‐UnitedLinux-­‐Should-­‐Stop: # User: root # Default-­‐Start: 2 3 4 5 # Default-­‐Stop: 0 1 6 # Short-­‐Description: iBeacon Detector autostart # Description: iBeacon Detector autostart... ### END INIT INFO
  • 35. 15 16 17 18 19 20 21 22 23 24 25 26 27 28 case "$1" in start) Process Launcher /usr/local/bin/hciconfig hci0 up /usr/local/bin/forever start… ;; stop) /usr/local/bin/forever stopall ;; *) echo "Usage: /ibeacon-­‐detector {start|stop}" exit 1 ;; esac exit 0
  • 36. Process Monitor $ /usr/local/bin/forever start -­‐al /var/log/forever.log -­‐o /var/log/ibeacon-­‐detector.log -­‐e /var/log/ibeacon-­‐detector-­‐error.log —sourceDir=/usr/local/ibeacon-­‐detector index.js
  • 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)
  • 41. Code: Thanks! github.com/dluxemburg/ibeacon-­‐detector GitHub: dluxemburg Twitter: @dluxemburg