Elevate: an iBeacon experience made by Touchwonders

32
An iBeacon experience made by Touchwonders Elevate Fabio Milano

Transcript of Elevate: an iBeacon experience made by Touchwonders

Page 1: Elevate: an iBeacon experience made by Touchwonders

An iBeacon experience made by Touchwonders

Elevate

Fabio Milano

Page 2: Elevate: an iBeacon experience made by Touchwonders

ElevateThe challenges

Page 3: Elevate: an iBeacon experience made by Touchwonders

iOS SDK and iBeacons

Page 4: Elevate: an iBeacon experience made by Touchwonders

Monitoring and rangingHow iOS listens to a beacon signal

BEACON REGION

Page 5: Elevate: an iBeacon experience made by Touchwonders

Broadcast signalWhat an iBeacon transmits

Data(up to 31 bytes)

UUID Major Minor Measured Power

Page 6: Elevate: an iBeacon experience made by Touchwonders

An iBeacon “object”Get your app ready for some iBeacons

CLBeaconRegion *beacon = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:elem[@"UUID"]] major:[elem[@"major"] integerValue] minor:[elem[@"minor"] integerValue] identifier:elem[@"identifier"]];

@interface CLBeacon : NSObject <NSCopying, NSSecureCoding>

@property (readonly, nonatomic, strong) NSUUID *proximityUUID;

@property (readonly, nonatomic, strong) NSNumber *major;

@property (readonly, nonatomic, strong) NSNumber *minor;

@property (readonly, nonatomic) CLProximity proximity;

@property (readonly, nonatomic) CLLocationAccuracy accuracy;

@property (readonly, nonatomic) NSInteger rssi;

@end

Page 7: Elevate: an iBeacon experience made by Touchwonders

- (void)startLookupForBeacon:(CLBeaconRegion *)beaconRegion { // Start monitoring [self.locationManager startMonitoringForRegion:beaconRegion]; } [...]

// Receive region cross-boarding events - (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region { CLBeaconRegion *beaconRegion = [self.rangedBeacons objectForKey:region.identifier]; switch (state) { case CLRegionStateInside: { NSLog(@"locationManager didDetermineState INSIDE for %@", beaconRegion.identifier); [self.locationManager startRangingBeaconsInRegion:beaconRegion]; [self scheduleEnterNotification:beaconRegion]; if (self.delegate) { [self.delegate didEnterRegion]; } } break; case CLRegionStateOutside: { NSLog(@"locationManager didDetermineState OUTSIDE for %@", beaconRegion.identifier); [self scheduleExitNotification:beaconRegion]; [self.locationManager stopRangingBeaconsInRegion:beaconRegion]; if (self.delegate) { [self.delegate didExitRegion]; } } break; default: break; } }

Page 8: Elevate: an iBeacon experience made by Touchwonders

- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region

{ if ([beacons count] > 0) { for (CLBeacon *beacon in beacons) { NSLog(@“RSSI: %d", beacon.rssi); NSLog(@"Accuracy: %f", beacon.accuracy); NSLog(@"Proximity: %d", beacon.proximity]); NSLog(@“----------------");

if (self.delegate) { [self.delegate didReceiveSignal:beacon.rssi accuracy:beacon.accuracy proximity:beacon.proximity]; } } } }

Page 9: Elevate: an iBeacon experience made by Touchwonders

ElevateThe challenges

Positioning Responsiveness Accuracy

Page 10: Elevate: an iBeacon experience made by Touchwonders

PositioningWhere should I drill ?

Page 11: Elevate: an iBeacon experience made by Touchwonders

Floor’s “template”Location

Page 12: Elevate: an iBeacon experience made by Touchwonders

Define beacon regionWhispering loudly

BEACON REGION

PROXIMITY FIELD

Page 13: Elevate: an iBeacon experience made by Touchwonders

Out restroom’s doorCollected data

RSS

I

-100

-80

-60

-40

-20

0

Seconds1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

iBeacon signal Upper bound Lower bound

Page 14: Elevate: an iBeacon experience made by Touchwonders

Find your beaconGimbal S20

95mmx102mmx24mm

Page 15: Elevate: an iBeacon experience made by Touchwonders

Find your beaconGimbal S20

battery life of approximately 1-3 years

Page 16: Elevate: an iBeacon experience made by Touchwonders

Find your beaconGimbal S20

configurable omni-directional or directional antenna

Page 17: Elevate: an iBeacon experience made by Touchwonders

Directional brodcast signalGimbal S20

Page 18: Elevate: an iBeacon experience made by Touchwonders

ResponsivenessCaffeine mode

Monitoring and

rangingStart background task End background task

Collect data for threshold mechanism

Page 19: Elevate: an iBeacon experience made by Touchwonders

ResponsivenessCaffeine mode

Start background task End background taskCollect data for threshold mechanism

Page 20: Elevate: an iBeacon experience made by Touchwonders

PrecisionDistance between an iBeacon and an iDevice

Page 21: Elevate: an iBeacon experience made by Touchwonders

CLProximityiBeacon proximity

Immediate

Near

Far

Unknown

Page 22: Elevate: an iBeacon experience made by Touchwonders

CLProximityWhere is the decimal system ?

“RSSI and proximity estimate are not one-to-one. The proximity estimate is a heavily filtered value intended to capture typical user behaviour and use cases. The other values are available for developers who are willing to spend time experimenting and curating a specific user experience.”

- Apple documentation

Page 23: Elevate: an iBeacon experience made by Touchwonders

CLLocationAccuracy… close but not enough

/* * accuracy * * Discussion: * Represents an one sigma horizontal accuracy in meters where the measuring device's location is * referenced at the beaconing device. * Do not use it to identify a precise location for the beacon. * This value is heavily subject to variations in an RF environment.

* A negative accuracy value indicates the proximity is unknown. * */ @property (readonly, nonatomic) CLLocationAccuracy accuracy;

Page 24: Elevate: an iBeacon experience made by Touchwonders

Estimate iBeacon distance..because we really want it

Moving Average Method Power law model

Page 25: Elevate: an iBeacon experience made by Touchwonders

Power law modelRelation between RSSI and iBeacon’s distance

RSSI = −(10 * n)log10(d) − A

Texas Instruments - Chipcon CC2420

Page 26: Elevate: an iBeacon experience made by Touchwonders

Power law modelRelation between RSSI and iBeacon’s distance

RSSI = −(10 * n)log10(d) − A

Page 27: Elevate: an iBeacon experience made by Touchwonders

Power law modelRelation between RSSI and iBeacon’s distance

RSSI = −(10 * n)log10(d) − A

Page 28: Elevate: an iBeacon experience made by Touchwonders

Power law modelRelation between RSSI and iBeacon’s distance

RSSI = −(10 * n)log10(d) − A

Page 29: Elevate: an iBeacon experience made by Touchwonders

Power law and iBeaconRelation between RSSI and iBeacon’s distance

RSSI = −(10 * n)log10(d) − A

Page 30: Elevate: an iBeacon experience made by Touchwonders

Power law and iBeaconRelation between RSSI and iBeacon’s distance

RSSI = −(10 * n)log10(d) − A

x = (−10)log10(d)

Page 31: Elevate: an iBeacon experience made by Touchwonders

Power law and iBeaconRelation between RSSI and iBeacon’s distance

RSSI = −(10 * n)log10(d) − A

x = (−10)log10(d)

n = (RSSI + A) / x

Page 32: Elevate: an iBeacon experience made by Touchwonders