What is Bluetooth Smart and Bluetooth LE?
Bluetooth Low Energy (Bluetooth LE) is also known as Bluetooth Smart. It is designed to provide Bluetooth based functionality without draining the battery power of your device.
Bluetooth LE is part of Bluetooth 4.0 specification. You can download the specification from Bluetooth.org. You would find three kinds of bluetooth devices. One is based on Classic Bluetooth; not supporting the low energy specification. The other are Bluetooth Smart Ready; which support both classic and low energy specifications. The last are Bluetooth Smart devices; which only support 4.0 specification.
Bluetooth LE use the same spectrum as classic Bluetooth i.e. 2.4 GHz – 2.4835 GHz.
There are two central roles of Bluetooth LE devices. They are central and peripheral roles. In peripheral role, they can send advertisement broadcast messages for their presence. These messages can be picked up by another LE device in central mode. They can then connect with peripheral and request the GATT services supported by the device in peripheral role.
Each Bluetooth LE device can support a list of services. The details of these services can be discovered from the devices in the form of GATT (Generic ATTribute) profiles. You can display those services in an app to be displaoyed to the user. These services give the details of what the device is able to do.
iBeacons and Bluetooth LE
iBeacons implement the low energy part of Bluetooth 4.0 specification. They are Bluetooth LE devices in peripheral mode. They just support advertisement. You can’t really connect to an iBeacon. The presence of an iBeacon assumes proximity to a particular thing or place. It is your app’s responsibility to use the presence of an iBeacon into something useful for your customers.
There are a number of iBeacon providers. Just make sure that they have a configuration app for your device, otherswise, you might end up with a hardware but couldn’t just configure that. The app should also be compatible with the OS version you are running. Android is great in telling you the details of compatibility. You can also look at the details for indoor / outdoor usage. The plastic might be burned in the sun.
The most popular iBeacons are definitely Estimote iBeacons. They are cute little stone like structures which stick themselves to surfaces.
Estimote are generally powered with a battery. So they can be placed at the places of your choice without ever needing an power outlet. But for your testing, you might not want to buy a lot of batteries. The iBeacons from radius network look perfect. Just hook them with your USB power adapter and they would be providing all the necessary advertisements you need for testing your app. Radius network also provides beacon tags.
Technically, we can turn any device supporting Bluetooth 4.0 specification into an iBeacon. All it needs is to run it in peripheral mode with the same intervals. Please remember that this is not possible for a windows machine to turn into an ibeacon yet (discussed below in detail). Android has added support for peripheral mode starting with Lollipop (5.0 – API 21). Apple devices support running in peripheral mode but some recent changes in Yosemite OSX have caused some issues with the existing beacon app for Mac. There are a number of iOS apps available with this functionality (using Core Location API). Just remember that in order to transmit these advertisement, the app has to be in front-most with the screen turned-on and device unlocked.
iBeacon Advertisement Packet
An iBeacon has to advertise itself for the receivers. The receivers can use this advertisement to determine which iBeacon they are closed to. The configurable portion of an iBeacon advertisement packet consists of three parts. They are UUID, major and minor numbers.
- UUID (Universally Unique IDentifier): This is a 128 bit value. iOS allows scanning for iBeacon with particular UUID. As an example, a store chain owner can keep the same UUID for all iBeacons for his stores. He can also assign a unique ID for all iBeacons in a particular store.
- Major Number: This is a 16 bit value. Major and minor numbers are provided to uniquely identify a beacon within your device. If you are a store owner, you can use major number to identify the unique section.
- Minor Number: This is also a 16 bit value. A developer can use this to further identify a beacon. For the example of the store, you can use it to identify a particular aisle within the same section.
Frequency of iBeacon Advertisement
Since an iBeacon has to broadcast advertisement to announce its presence, the question is how often these announcements are transmitted. Advertising too often would drain the battery of the hardware, similarly, far apart advertisements would not be useful for most of the applications. So there has to be a balance between these two. The specification has a fixed value for the interval. This is 100ms i.e. the device would transmit advertisement packets after every 100 ms. This is not configurable.
iBeacon provides two functions. They are monitoring and ranging. Monitoring is the task of getting notified when an iBeacon receiver enters or exits an iBeacon region. Ranging provides the details how close we are to a particular iBeacon.
In an organization using iBeacon proximity technology, there would be a number of iBeacons installed in the facility. Their coverage area might also overlap. As an app provider, we need to determine which iBeacon is closest to show some features to the users, hence ranging. The proximity information is not part of advertising packet but it is determined by a receiving device based on the strength of the signal. The API provides this information as RSSI (Received Signal Strength Indication)
An iBeacon needs to be configured before it is deployed. There are various apps to configure iBeacons. Generally, iBeacon hardware provider provide the configuration tool as well. This allows the developers to assign the values in the advertising packet of an individual iBeacon.
iPhone and Bluetooth LE
iBeacons is really an Apple’s baby. There were a lot of talks when apple didn’t add support for NFC. They have been working on iBeacons all this time to come up with iBeacon technology. With iBeacons they don’t seem to add support for it anymore. Apple introduced the support for Bluetooth LE in iOS 7. Starting with iOS 7.1, monitoring can be used to launch an app which is not running. Apple has the best support for iBeacons, plus the iOS version of apps from hardware iBeacon providers are a lot better than their android counterpart.
Android and iBeacons
Android added support for Bluetooth LE in Android 4.3 in central role, which allows an android device to scan and receive advertisements sent by iBeacon trasmitters. The peripheral mode is announced for Anrdoid Lollipop, so it is part of Android 5.0 API (API Level – 21). In peripheral mode, an android device can be emulated as an iBeacon transmitter.
There is a special issue with Anroid BLE around some beacon hardwares specially Qualcomm’s Gimbal beacons. They have a security feature, which changes the MAC address of the hardware every 0.8 seconds. Android Bluetooth service can hold MAC addresses close to 1,990. After that it crashes. After that number is reached, as soon as you get close to a bluetooth device, it sees a new MAC address and just crashes. The only solution is to turn off the bluetooth or factory reset the hardware. Apparently Radius Network has a solution to this problem. You can download the app on your android.
Microsoft & iBeacon
Microsoft introduced support for Bluetooth LE with Win 8.1. Your app needs to have permissions, so you add it in package.appmanifest file [blog post].
Although there is support for pairing up with a Bluetooth LE device, an app cannot scan for iBeacons. OS can only scan for connectable Bluetooth devices providing GATT services and pair with them. So we need to wait until Windows 10 is out in the market. It should be expected some time in 2015. Stay tight!