micro-location with beacons
TRANSCRIPT
Micro-‐location with Beacons :
Navigating the way with Mobility, Big Data, and the Cloud
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
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
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
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…
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!
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
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?
– 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.)
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
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)
Ping.
• 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
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?
• Always Connected • Real-‐Time Updates • Dynamic Content • Personalized Content • Scalability • Redundancy
Implications -‐ Cloud
• 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
• Direct • Context-‐aware • Targeted • Micro-‐location (Proximity) • Driven by Analytics
Implications -‐ Marketing
• 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
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
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
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
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
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
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!
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.
Two Ways of Working w/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
Passive Monitoring• Application is Central, Shared
• Beacons Move, Application is Stationary
• Scanning for Roving UUIDs
• Uses
• Tracking Equipment Coming/Going
• Monitoring Traffic/Movement Patterns
In either case, an application of some sort is required to make
use of the signal.
Overall Architecture of a Beacon Application
Beacon
Beacon
Beacon
Beacon
Beacon
Application API Queue
Queue
Queue
Queue
Queue
Data Store
ManagementApplicationData Store
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
Responsibilities of the Mobile Piece
• 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.
What Data is Captured Locally?
• Beacon & Environmental Data
• Lat/Long
• Visible Beacon Array
• Beacon UUID, Major, Minor, Signal Strength
• App Specific Data
• User ID
• Demographics & Preferences
Notice What Isn’t In the Beacon Data?
• 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.
What Data is Stored Locally on the Mobile Device?
• 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.
How Often is Data Captured?
• 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?
What Data is Sent to the Cloud?
• Potentially…
• Everything captured by the application, and…
• Everything enriched by the application (context)
Therefore, *I*, as the cloud developer knows…
• 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.
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
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]; } } }
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
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(); }
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