Micro-Location with Beacons

53
Microlocation with Beacons : Navigating the way with Mobility, Big Data, and the Cloud

Transcript of Micro-Location with Beacons

Page 1: Micro-Location with Beacons

Micro-­‐location  with  Beacons  :  

Navigating  the  way  with  Mobility,  Big  Data,  and  the  Cloud

Page 2: Micro-Location with Beacons

About  Me

• Bill  Klos  • Sr.  Architect  w/Centric  Consulting  (12  years)  • National  Lead  for  Cloud  Computing  • Foci:  Cloud,  mobility,  IoT  architectures,  &  any  randomly  arcane  technologies  no  one  under  40  has  heard  of.  

• Languages  of  Choice:  Go,  Ruby,  and  TBD  for  2015  • [email protected]  • @williamklos

Page 3: Micro-Location with Beacons

www.centricconsulting.com

$82 million 2013 revenue

1999 year founded

500+ employees

10 •  Cleveland • Columbus •  Indianapolis •  Louisville

• Miami •  St.  Louis   •  Tampa locations

2 •  Energy  &  Utilities  •  Oracle  

national practices

1 bold vision that spans 100 years

Our culture is built on our passion for our work  and driven by our values. • We work to understand your needs and

act as a true partner. • We selectively hire people who have a track

record of delivering exceptional results. • We value hard work and temper that work

with humility, respect  and collaboration. • We are committed to making a positive

difference in the communities we serve. • We are unconventional, loyal, smart  and fun.

We strive to manage a work-life balance that makes us better professionals and better people.

•  Boston    •  Chicago      •  Cincinnati-­‐     Dayton

You’ve  found  your  most  reliable  partner.  We’re  a  business  consulting  and  technology  solutions  company  that’s  been  around  for  14  years  and  we’re  building  a  company  that  will  be  here  for  100  more.

3July 2014

Page 4: Micro-Location with Beacons

Agenda

• A  common  scenario  • What  are  beacons?  • How  do  beacons  work?  • What  should  I  do  about  beacons?  • Which  industries  will  beacons  affect?  • Development  considerations  • A  typical  beacon  influenced  architecture  • Code  samples

Page 5: Micro-Location with Beacons

Imagine  this…

On  your  way  to  work  one  morning,  you  walk  by  your  favorite  coffee  shop.    As  you  walk  by,  you  notice  a  sign  in  the  window  with  the  day’s  specials:    

$1  off  Lattes  today!  

That’s  nice,  but  maybe  Latte  isn’t  your  favorite…  

Page 6: Micro-Location with Beacons

Now  imagine  this…

Same  scenario,  but  as  you  approach  the  coffee  shop  (let’s  say  100  feet  away),  your  phone  suddenly  notifies  you  with  the  following  message:  

“Good  Morning,  Bill.    Your  favorite  Grande,  Soy,  Chai  Tea,  No  Water,  Extra  Hot  is  only  a  few  steps  away.    Stop  in  and  we’ll  take  $1  off  your  total!”  

This  is  a  much  more  direct,  targeted,  and  context-­‐aware  approach!

Page 7: Micro-Location with Beacons

What  changed?

Three  key  things  have  changed:  

1. The  customer  has  the  coffee  shop’s  mobile  app  on  his/her  phone  2. The  coffee  shop  has  installed  a  few  beacons  around  the  store  3. The  coffee  shop  understands  the  power  of  “the  Cloud”  and  “Big  Data”  

Huge  implications  for  CUSTOMER  SERVICE,  REVENUE  GENERATION,  and  OPERATIONAL  EFFICIENCY

Page 8: Micro-Location with Beacons
Page 9: Micro-Location with Beacons

What  are  beacons?

Beacons are • Small • Battery-powered • Transmitters • Bluetooth Low Energy • Compatible with most newer phones

• Apple iPhone and iPad iOS 7+ • Android 4.0+ • Windows Phone 8+

• Micro-location • A few inches to ~150 feet

• Low • Cost • Profile • Maintenance

• Part of the Internet of Things (IoT) • RFID and NFC replacements?

Page 10: Micro-Location with Beacons

– They  are  typically  dumb.    Zero  smarts.  • i.e.  They  are  not  tracking  you.  

– Vendors  may  jazz  them  up  for  differentiation.  • Different  form  factors,  battery  life,  extra  security,  custom  APIs  or  payloads.

10

What  are  beacons?  (cont.)

Page 11: Micro-Location with Beacons

Do  Beacons  replace  GPS?

NO

• GPS is for MACRO-location • Miles and Kilometers

• Beacons are for MICRO-location • Inches, Feet and Meters

• GPS is great for OUTDOOR use, terrible for INDOOR use

• Beacons work both INDOORS and OUTDOORS

• GPS requires satellites, VERY EXPENSIVE to deploy new ones

• Beacons cost about $5-$10

The best solutions use BOTH

Page 12: Micro-Location with Beacons

How  do  beacons  work?• At  the  heart  of  any  solution  that  deals  with  micro-­‐location  are  the  beacons  that  broadcast  their  position.    

Beacons  provide  a  different  service  than  does  GPS.    A  GPS  signal  is  reliable  in  most  outdoor  situations  in  the  10-­‐15  foot  range  but  is  very  unreliable  indoors.    Beacons,  using  a  Bluetooth  LE  signal  can  be  accurate  to  within  a  few  inches  to  a  a  few  feet.    Using  the  triangulation  of  multiple  beacons  within  range  of  each  other,  more  precise  locations  can  be  calculated.  

Distances  &  Usage  

The  context  of  a  beacon  can  change  based  on  its  distance.    While  essentially  all  tasks  can  be  performed  at  all  distances,  some  tasks  have  more  practicality  than  others.  

-­‐ Immediate  (within  a  foot)  

-­‐ Near  (Up  to  8  feet)  

-­‐ Far  (Up  to  150  feet)

Page 13: Micro-Location with Beacons

Ping.

Page 14: Micro-Location with Beacons

• Immediate  (<  1ft)  – Purchases,  Security  Access,  Marking  Progress  

• Near  (<  8  ft)  – Throwing  Offers,  Information  on  Nearby  Sites  

• Far  (>  8  ft)  – Turn-­‐by-­‐Turn  Directions,  “Barker”  Ads,  Broadcast  Alerts

14

Uses

Page 15: Micro-Location with Beacons

The  convergence  of  beacons,  mobile  apps  and  cloud  services  has  all  the  makings  of  a  paradigm  shift.    Here  are  some  of  the  areas  that  WILL  BE  AFFECTED:  

• Cloud  

• Big  Data  

• Marketing  

• Security

What  should  I  do  about  Beacons?

Page 16: Micro-Location with Beacons

• Always  Connected  • Real-­‐Time  Updates  • Dynamic  Content  • Personalized  Content  • Scalability  • Redundancy

Implications  -­‐  Cloud

Page 17: Micro-Location with Beacons

• 10%  of  the  VALUE  of  a  Beacon  solution  is  the  APP,  the  other  90%  is  the  DATA  • Data  aggregated  will  enable  faster  decision-­‐making  • Predictive  trends  modeling  • Sales  forecasting  • Discovery  of  hidden  relationships  between  seemingly  independent  factors  

Implications  –  Big  Data

Page 18: Micro-Location with Beacons

• Direct  • Context-­‐aware  • Targeted  • Micro-­‐location  (Proximity)  • Driven  by  Analytics  

Implications  -­‐  Marketing

Page 19: Micro-Location with Beacons

• Beacons  are  UNSECURE  and  that’s  OK  • Beacon  payload  contains  NO  SENSITIVE  DATA  • SITA  and  other  Beacon  Portals  • Cloud  and  App  security  is  IMPERATIVE

Implications  -­‐  Security

Page 20: Micro-Location with Beacons

Which  Industries  will  Beacons  affect?

Although  the  pace  of  adoption  may  vary,  many  industries  such  as  Retail,  Healthcare  and  Travel  &  Transportation  will  be  most  affected  by  beacons  and  indoor  location  awareness.  

Retail         Healthcare  

Travel  &  Transportation     Sports  &  Entertainment  Venues  

Self-­‐Guided  Tours     Home  automation  

Geo-­‐fencing       Banking  

Education  

Page 21: Micro-Location with Beacons

Retail

1. Proximity  Marketing  – Enticing  Window  Shoppers  – Matching  Demographics    

2. Entering  the  Store  – Offer  a  coupon  for  check-­‐out  

3. Gathering  Information  

– Targeted  offers  – Product  information  

4. Contactless  Payment  – Automatically  charge  the  

customer’s  credit  card  for  items  purchased

Page 22: Micro-Location with Beacons

Healthcare

1. Turn-­‐by-­‐Turn  Directions  

– GPS  doesn’t  work  indoors  – Hospitals  are  large,  unfamiliar  

buildings  2. Asset  Tracking  

– Durable  Medical  Equipment  (DME)  

– Wheelchairs  to  MRIs  

3. Patient  Records  – Integrate  with  EHR/EMR  – Doctor/Nurse  rounds

Page 23: Micro-Location with Beacons

Travel  &  Tourism

1. Guest  Experience  – Self-­‐Service  – Turn-­‐by-­‐Turn  Directions    

2. Revenue  Generation  – Proximity  Alerts  – Unused  Capacity  

3. Operational  Efficiency  

– Know  where  guests  are  – Deploy  resources  

4. Analytics  – Guests  prefer  the  Spa  on  

Saturday  – The  pool  gets  crowded  on  

Sunday  afternoon

Page 24: Micro-Location with Beacons

Other  Industries

1. Sports  and  Entertaining  Venues  • MLB:  At  Bat  (20  stadiums  so  far…)  • NFL  :  Miami  Dolphins  at  Sun  Life  Stadium  in  2013  • NBA:  Orlando  Magic    

2. Self-­‐Guided  Tours  • Museums  • Zoos  • Art  Galleries  • Parks  

3. Home  Automation  • Turning  lights  ON/OFF  • Locking/Opening  doors  as  your  leave/return  • Temperature  control  

4. Banking  • Branch  customer  service  • ATM  location  

5. Education  • Taking  attendance  

6. Geo-­‐fencing  • Making  sure  something  (someone)  is  where  it  should  be

Page 25: Micro-Location with Beacons

Beacon Payload• UUID

• Usually the same across a manufacturer, can be set.

• Major #

• Used to help group beacons. Can be set.

• Minor #

• Used to address a specific beacon. Can be set.

• That’s it!

Page 26: Micro-Location with Beacons

Reading Beacons

• The monitoring device (phone, tablet, or some custom equipment) estimates proximity based on the power of the signal from the beacon.

• If multiple beacons can be seen simultaneously, then this process is repeated for each.

• Local rules (or cloud rules) will dictate what action should be taken based on the final proximity calculations.

Page 27: Micro-Location with Beacons

Two Ways of Working w/Beacons

Page 28: Micro-Location with Beacons

Active Monitoring• Application is Distributed, Individual Users

• Application Moves, Beacons are Stationary

• Application Moves, Beacons can Move

• Uses

• Turn-by-Turn Directions

• Actuations

• Offer Presentment

Page 29: Micro-Location with Beacons

Passive Monitoring• Application is Central, Shared

• Beacons Move, Application is Stationary

• Scanning for Roving UUIDs

• Uses

• Tracking Equipment Coming/Going

• Monitoring Traffic/Movement Patterns

Page 30: Micro-Location with Beacons

In either case, an application of some sort is required to make

use of the signal.

Page 31: Micro-Location with Beacons

Overall Architecture of a Beacon Application

Page 32: Micro-Location with Beacons

Beacon

Beacon

Beacon

Beacon

Beacon

Application API Queue

Queue

Queue

Queue

Queue

Data Store

ManagementApplicationData Store

Page 33: Micro-Location with Beacons

Information ProgressionProducersData Acquisition/Collection

Data Acquisition

Generate API Logs

Process Cloud Data

Process Data Locally

Generate Sub

Transactions

Generate API Errors

Submit Data to Cloud API

Execute Long Jobs

Generate System Tasks

Consumers

Deplete Beacon Queue

Deplete Log Queue

Deplete Error Queue

Deplete Secondary

Queue

Deplete Long Job Queue

Deplete System Queue

Analysis Presentation

TBD TBD

Page 34: Micro-Location with Beacons

Responsibilities of the Mobile Piece

Page 35: Micro-Location with Beacons

• Provide the interface for the user.

• Download master data for caching. This includes the beacon & location correlations. Sync data as necessary. A constant connection should not be required.

• Keep track of data that doesn’t need to and/or shouldn’t live in the cloud. PII for example, account information, etc.

• React to beacon signals immediately, especially those in immediate proximity or when throwing coupons.

• Do local calculations to turn-by-turn directions.

Page 36: Micro-Location with Beacons

What Data is Captured Locally?

Page 37: Micro-Location with Beacons

• Beacon & Environmental Data

• Lat/Long

• Visible Beacon Array

• Beacon UUID, Major, Minor, Signal Strength

• App Specific Data

• User ID

• Demographics & Preferences

Page 38: Micro-Location with Beacons

Notice What Isn’t In the Beacon Data?

Page 39: Micro-Location with Beacons

• SSN

• Current and past arrest warrants.

• Where you “were” last night.

• All the credit card charges from that place you weren’t at last night.

• Your phone records.

• Your school records, especially the black marks on them from the 8th grade.

• Your medical records.

• Your old LP records - except for the White Album.

Page 40: Micro-Location with Beacons

What Data is Stored Locally on the Mobile Device?

Page 41: Micro-Location with Beacons

• Locations (including hours of operation)

• Beacon Definitions

• Coupon Definitions

• Group Assignments

• Turn-by-Turn Route Edges and Path Weights

• Generated Transactions

• For store and forward needs.

Page 42: Micro-Location with Beacons

How Often is Data Captured?

Page 43: Micro-Location with Beacons

• Polling frequency by the application can affect battery life.

• Goal is to determine a material change of status, and only report that.

• How quickly is the target moving?

• Is there anything of note potentially around the target?

• Who is making the processing decisions? App? Cloud?

• If the cloud, will the information be relevant by the time it’s processed?

Page 44: Micro-Location with Beacons

What Data is Sent to the Cloud?

Page 45: Micro-Location with Beacons

• Potentially…

• Everything captured by the application, and…

• Everything enriched by the application (context)

Page 46: Micro-Location with Beacons

Therefore, *I*, as the cloud developer knows…

Page 47: Micro-Location with Beacons

• SSN

• Current and past arrest warrants.

• Where you “were” last night.

• All the credit card charges from that place you weren’t at last night.

• Your phone records.

• Your school records, especially the black marks on them from the 8th grade.

• Your medical records.

• Your old LP records - except for the White Album.

Page 48: Micro-Location with Beacons

Apple  iOS  Frameworks  and  Key  Classes

• iBeacon  supported  via  CoreLocation  Framework  

• Key  classes  • CLLocationManager  /  CLLocationManagerDelegate  • CLRegion  • CLBeaconRegion  • CLBeacon  • CLProximity  

• Key  methods  in  CLLocationManagerDelegate  • didRangeBeacons  • didStartMonitoringForRegion  • didEnterRegion  • didExitRegion

Page 49: Micro-Location with Beacons

Apple  iOS  Code  Sample

-­‐(void)locationManager:(CLLocationManager  *)manager  didRangeBeacons:(NSArray  *)beacons  inRegion:(CLBeaconRegion  *)region  {          for  (CLBeacon  *  beacon  in  beacons)  {     if  (beacon.proximity  ==  CLProximityImmediate)  {       //  you’re  right  on  top  of  me!       UIAlertView  *alert=  [[UIAlertView  alloc]             initWithTitle:@”Alert"  message:           [NSString  stringWithFormat:             @"You  are  standing  on  beacon  %@”,           beacon.  proximityUUID]  delegate:self           cancelButtonTitle:@"OK”  otherButtonTitles:nil];                         [alert  show];       }     }  }

Page 50: Micro-Location with Beacons

Google  Android  Frameworks  and  Key  Classes

• No  iBeacon  support!  • Lots  of  Bluetooth  Low  Energy  (BLE)  support  • Create  a  separate  service  for  (background)  scanning  

• Key  classes  • android.bluetooth.BluetoothAdapter  /  LeScanCallback  • android.bluetooth.BluetoothDevice  • android.bluetooth.BluetoothManager  • android.bluetooth.BluetoothGatt  /  BluetoothGattCallback  • android.bluetooth.BluetoothGattService  

• Key  methods  in  BluetoothAdapter.LeScanCallback  • onLeScan

Page 51: Micro-Location with Beacons

Google  Android  Code  Sample

public  void  onLeScan(final  BluetoothDevice  device,  int  rssi,  byte[]  scanRecord)  {     long  msb,  lsb,  iBeaconID;     UUID  uuid;     int  major,  minor;     byte    txPower;     ByteBuffer  bufferScanRecord;     //  Extract  the  advertisement  payload.     bufferScanRecord  =  ByteBuffer.wrap(scanRecord);     bufferScanRecord.position(1);     iBeaconID  =  (bufferScanRecord.getLong()  &  0x00FFFFFFFFFFFFFFL);     bufferScanRecord.position(9);     msb  =  bufferScanRecord.getLong();     lsb  =  bufferScanRecord.getLong();     //  Extract  iBeacon  fields     uuid  =  new  UUID(msb,  lsb);     major  =  bufferScanRecord.getShort()  &  0x00FFFF;     minor  =  bufferScanRecord.getShort()  &  0x00FFFF;     txPower  =  bufferScanRecord.get();  }

Page 52: Micro-Location with Beacons

Deployment  Checklist

• Building  the  App  • Features  • Platform(s)  • AppStore(s)  • Custom  Integration  

• Site  visit  • Site  mapping  • Beacon  placement  • Beacon  classification/

configuration  • Data  Analytics  

• What  data  to  collect  • What  and  When  to  push  

proximity  alerts  • Which  user  preferences  to  

store

• Testing  • Multiple  Devices  • Pilot?  

• Training  • Document  new  processes  

• Go  live  • Place  all  configured  beacons  • Test  all  beacons  are  active  and  

discoverable  • Confirm  all  features  of  the  app  

• Ongoing  maintenance  /  Retirement  

• Lost,  stolen,  damaged  beacons  • App  updates