SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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 thingsplayaround.cc
 
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 languagejgrahamc
 
Arduino and the real time web
Arduino and the real time webArduino and the real time web
Arduino and the real time webAndrew Fisher
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual Vivek Kumar Sinha
 
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 thingsJan 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 2TechWell
 
"Elixir of Life" - Dev In Santos
"Elixir of Life" - Dev In Santos"Elixir of Life" - Dev In Santos
"Elixir of Life" - Dev In SantosFabio Akita
 
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 1TechWell
 
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 pcDuino3BJingfeng 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 AssistantNilhcem
 
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 ReptiliansNilhcem
 
Interacting with Intel Edison
Interacting with Intel EdisonInteracting with Intel Edison
Interacting with Intel EdisonFITC
 
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 LabsPuppet
 
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 WebFabio Akita
 

Was ist angesagt? (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
 

Andere mochten auch

iBeacon™ FAQ White Paper
iBeacon™ FAQ White PaperiBeacon™ FAQ White Paper
iBeacon™ FAQ White PaperRed 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 appsJames Montemagno
 
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 iBeaconsSimon Guest
 
Brand You : Personal Branding
Brand You : Personal BrandingBrand You : Personal Branding
Brand You : Personal BrandingStudio Science
 
Grow with HubSpot - Sydney - June 2016
Grow with HubSpot - Sydney - June 2016Grow with HubSpot - Sydney - June 2016
Grow with HubSpot - Sydney - June 2016Ryan 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: BeaconDigitasLBi Paris
 
Preparing to fail
Preparing to failPreparing to fail
Preparing to failaweyenberg
 
Culture Code: Creating A Lovable Company
Culture Code: Creating A Lovable CompanyCulture Code: Creating A Lovable Company
Culture Code: Creating A Lovable CompanyHubSpot
 

Andere mochten auch (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
 

Ähnlich wie 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 RubyMike 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 exploitsvirtualabs
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOKris Findlay
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - RoutersLogicaltrust 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… routersYury Chemerkin
 
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 DorgueilPôle Systematic Paris-Region
 
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 2017Romain Dorgueil
 
Parrot Drones Hijacking
Parrot Drones HijackingParrot Drones Hijacking
Parrot Drones HijackingPriyanka Aash
 
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 2016Susan Potter
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEThiago 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 destructionFelipe 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 PatternsMartin 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-profitYouness Zougar
 
Intro to the raspberry pi board
Intro to the raspberry pi boardIntro to the raspberry pi board
Intro to the raspberry pi boardThierry Gayet
 

Ähnlich wie 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, 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
 
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
 
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
 

Kürzlich hochgeladen

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

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