In this blog post, we will teach you everything you need to know about beacons. What are they? In what way can you use them? Are there different brands? Any important things you should know about the hardware and software? Additionally, you will learn how to register beacons with Matchmore! Read this post and you will become a beacon ninja!
What is a beacon?
Beacons are wireless devices that help indoor and outdoor positioning. Since 2013, they are becoming more and more common and are now supported by the two dominant mobile operating systems, namely Android and iOS.
Beacons are wireless devices that continuously broadcast an advertising packet over Bluetooth. This advertising packet is composed of letters and numbers describing the beacons; in addition, other informations like manufacturer data or received signal strength indication (RSSI) are available. Other devices can receive the packet, thus helping to estimate their proximity to the transmitting beacon. All those informations help developers to implement indoor location, although beacons can be used outside as well.
Beacons use the Bluetooth Low Energy (BLE) technology to transmit data over short distances. The design of BLE is intended to provide low energy consumption, thus allowing the beacon’s battery to last longer than the original Bluetooth technology. The battery duration of BLE goes between 2 to 3 years .
Different protocols and brands
The iBeacon is the standard defined by Apple . There is also other beacons standard like Eddystone by Google  or AltBeacons by Kontakt.io . Basically, the content of the advertising packet could vary slightly from one standard to another, but the communication protocol (Bluetooth) remains the same. As a consequence, most beacons on the market support at least the Eddystone standard and the iBeacon standard.
Difference between Eddystone and iBeacon
In the end-user's perspective, there is nothing really compelling to discuss about. The little difference, that appears between the two standards, does not create a big significance. The distinction that does exist between them, is rather visible on their functionalities.
As noted, both protocols work with iOS and Android devices. There is no issue of incompatibility involved with beacon transmissions to Android and iOS smart devices. So, from the perspective of end-users, developers don't need to be worried about the difference in Eddystone and iBeacon. Matchmore supports all beacons conform to Eddystone and Apple's standard, iBeacon.
How does it work ?
An advertising packet is the message that beacons transmit continuously to announce their presence to nearby devices. The advertising packet could be slightly different depending on the beacon standards. Generally, advertising packets contain at least a universally unique identifier (UUID), major and minor. For example, Eddystone’s advertising packet can contain URL and also telemetry data like what temperature the Eddystone’s beacon is detecting. But in the end, all of them transmit the basic information which are:
- A UUID is a 16 bytes, usually represented as a string.
- A Major is a 2 bytes number from 1 to 65,535.
- A Minor, same as major.
- Received signal strength indication (RSSI) indicating the signal strength on meter from the device. Keep in mind that it is more an estimation than an exact distance.
One could use the UUID to distinguish beacons in one’s network, from all other beacons in networks outside of his control. Major and minor could be considered as a supplement layer to identify beacons with greater accuracy than using the UUID alone. Note that a beacon only transmits the advertising packet, no descriptive information are carried by a beacon. If one wants to deploy beacons for commercial use, it requires an external source to provide descriptive informations associated to the beacons.
The beacon's detection in Android devices is different from iOS devices. Mobile applications have different states, when the app is running in foreground both iOS and Android's detection are smooth and nice. While running app in background mode stays smooth for iOS developers, this is not the case for Android developers.
On Android, you don’t have the same low level of integration offered by iOS; if you want to implement a complex feature involving beacons, you have to dig harder with the Bluetooth APIs, or use another library. Fortunately, there are some very good and mature libraries to handle monitoring and ranging on Android.
This difference is very much felt at the introduction of the new version of Android 8.0 (Oreo). With Oreo, you are not allowed to run long background tasks anymore. Since running beacons is very interesting in background mode, this creates an important Android limitation to be aware of.
With this limitation, Google have restricted application's features running in background to raise and help the battery life. It means that your beacon scanner may not run effectively as you'd like in background.
If you are developing with beacons on Android, keep in mind that foreground monitoring is reliable and you will get 100% of the beacons detection. On the other hand, background monitoring can be used but you may miss some beacons some time to time.
Smartphones and beacons
Smartphones interact with beacons in two different ways, ranging and monitoring.
Ranging is used to determine approximate distance to a device generating iBeacon’s conform advertisements. Applications ranging beacons are able to locate themselves based on advertising packets. Only applications that are currently alive on foreground or background can range beacons.
The smartphone refreshes the list of detected beacons every second. All informations about the detected beacons are available, UUID, major, minor and relative proximity between detecting smartphone and detected beacon. About relative proximity, iBeacon standard rely on four constants to describe the distance between them and the detecting devices. Relative proximity to an iBeacon are categorized as:
- Immediate - the detecting device is virtually touching the beacon, distance between detecting device and beacon is defined to be between: 0 meter ≤ d < 0.5 meter.
- Near - when detecting device is virtually in the same room, distance between detecting device and beacon is defined to be between: 0.5 meter ≤ d < 3 meters.
- Far - the detecting device can hear the beacon but is pretty far, distance between detecting device and beacon is defined to be between: 3 meters ≤ d < 50 meters.
- Unknown - the detecting device cannot determine the RSSI, we define the distance between detecting device and beacon to be between: 50 meters ≤ d < 200 meters.
When one is particularly interested in knowing if users enter or leave a specific area, this is called geofencing. Monitoring beacons is very similar to geofencing. The device is constantly monitoring, therefore even if the application is killed, or application is not in foreground or background mode, monitoring never stops.
Whenever the device enters or exits a defined region, the application is launched or reactivated and generates appropriate events in relation to the crossed region. In the beacons' case, a region of boundaries is defined by the detection of Bluetooth beacons advertising packet. When one wants to monitor with beacons, one has to define which beacons are included in a region.
- One beacon defines a region: – a beacon triples (UUID, major and minor).
- Subset of beacons define a region: – UUID and major, – only the UUID.
For example, imagine two beacons having equal UUID but different major and minor attributes. If an application monitors a beacon region by using only this UUID, the region boundaries are defined by the two beacons advertising packet. In other words, the application will generate appropriate events for the defined region no matter which one of the two beacons' advertising packet it detects. Important to know is that the application can not differentiate which one of the two beacon was detected.
On the other hand, if you monitor a beacon region by using all values of an iBeacon; The triples (UUID, major and minor). The region boundaries are defined by your uniquely beacon which is broadcasting those triples attributes. Note, nothing stops developers from setting two or more beacons with the exact same triples attributes.
Apple limits applications to 20 monitored regions, but we can easily pass this limit by using a single UUID to monitor a subset for multiple beacons. An application monitoring a region with only the UUID, no major, no minor provided, cannot access other attributes from advertising packet. The application knows only that it detected a beacon broadcasting the UUID defined for this region. If one wants to know more informations about beacons, one has to use ranging. Monitoring is only used for enter/exit events.
Final comments and additional blog posts
If you enjoyed this blog post, you will like our other blog posts about beacons as well:
: ibeaconinsider, (2017) What is ibeacon? a guide to beacons. (Online) Available at: http://www. ibeacon.com/what-is-ibeacon-a-guide-to-beacons/ (Accessed on 11-06-2018).
: Apple, (06 2014) Getting started with ibeacon. (Online) Available at: https://developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf (Accessed on 04-06-2018).
: Estimote, (2017) What is eddystone? (Online) Available at: http://developer.estimote.com/eddystone/ (Accessed on 04-06-2018).
: kontakt.io, (2017) What is a beacon? (Online) Available at: https://kontakt.io/beacon-basics/what-is-a-beacon/(Accessed on 11-06-2018).