Pass the bacon

I've been working for the past few weeks with iBeacons to implement an app for automagic checkins and location detection, and have been quite impressed with their capabilities. Our team was lucky enough to score some Estimotes, and have been putting together an app for mobile and web using Angular and Ionic.

So what the heck is an iBeacon?

Essentially, an iBeacon is a Low Energy Bluetooth transmitter that continually broadcasts a set signal at a regular interval. This broadcast is one-way, meaning that iBeacons only transmit information - they never listen for signals coming back at them.

In most cases, these signals are comprised of very simple information - namely, information about the beacon. Our Estimotes broadcast something like this:

major: 5026,
minor: 4,
uuid: 'B9XXXF30-F5F8-4XXE-AFF9-2XXX6B57FXXX',
identifier: 'Estimote Blue One',

Beacons all have these properties:

  • UUID: An string that identifies the hardware of the beacon. These need not be unique for multiple beacons (and in fact often are not, in the case of our Estimotes)

  • Major ID: A numerical identifier for the general area / region that the beacons correspond to. These you'd usually configure for your environment.

  • Minor ID: A number that represents this specific beacon as a subset of the Major ID's defined area. You'll want to configure these as well.

  • Identifier: A string that makes it easy for you to figure out what beacon you're talking about. This can be artitrary - name it "My froot loop" if it pleases you.

Literally what iBeacons do is to simple broadcast the above information over and over until their batteries run out.

So, that might sound a little boring. After all, they're only doing one thing.
Why the heck is that useful?

Listen up

It's not the broadcasting but the listening to that broadcast that makes this work.

First, a mobile device can easily tell if it's in range of a beacon by listening for the signals that beacon is continuously broadcasting. So it's easy to tell that you've arrived at a specific location by just checking for that specific signal.

Additionally, by measuring the signal strength, the same mobile device can also say how far it is away from the beacon in question.

Now apply this

Where this becomes really cool is that by listening for a signal from a specific beacon, you can determine if you've come into proximity of that beacon.

Imagine you have a retail store, and a mobile app that you use to offer your customers deals and show them your catalog. What if you want to offer some of these features specifically when your customer is IN your store? How could you display today's special deal to them when they arrive?

With an iBeacon, this is easy. Simply have your app listen for proximity to a beacon you've configured to work with the app, and voila! You now can trigger any behavior you want when people arrive in range of your store.

But wait, there's more...

That's with one beacon. If you want more detail, add more!

Say you'd like to know where a customer is within your shop, to show them details about the shoe section or the sundries department. By placing multiple beacons around your space, you can follow one of two strategies to enable this:

  • Simply use beacons to delinate areas in your store. Whatever you are in range of any given beacon (ie, area), show information for that area.

  • Alternately, and this is really cool, if you get 3 or more beacons working in tandem in one space, you can use the data from all of them together to triangulate your customer's position in the store! You can track their movements and position, and display relevant content for their area. Check out Estimote's demo...

Now this might all sound a tad Orwellian, but never fear - any app using this functionality MUST ask for permission from the user.

How do I start?

If you're a developer looking to get started using these technologies, I highly suggest you check out the Estimote site. Granted, they're one vendor among many but they make it pretty easy to get going.

On the software side, if you're writing apps to take advantage of iBeacons, check out Apple's CoreLocation documentation for iOS. I'll be writing a future post about some of the specifics of this, so stay tuned. If you're developing for Android, check out Estimote's SDK for some cross platform fun.

Another alternative, and one that we're currently in the process of exploring, is using the Cordova iBeacon Plugin by Peter Metz. This allows you to utilize iBeacon region detection and ranging in your Ionic/Cordova/PhoneGap application, is cross platform, and seems pretty solid so far.

Happy ranging!

Tags

javascript , iBeacons , bluetooth , ionic , hardware , cordova , ios , corelocation

About the author
comments powered by Disqus