Android O Bluetooth 5 Device API Observations

Last March we took a closer look at Bluetooth 5 and concluded there are tradeoffs between long range, high speed, legacy (today’s) phone compatibility and efficient battery.

We are starting to see corresponding development APIs appear for devices that will detect Bluetooth 5 beacons. Android (O) has a new setPreferredPhy call that allows apps to choose the PHY modes mentioned in our previous article.

As expected, high speed and long range are mutually exclusive and if you want to remain compatible with older (current) beacons then you can’t have the high speed or long range. Long range and high speed are only supported if the hardware supports it which means old (current) smartphones won’t get Bluetooth 5 support through a software upgrade.

The availability of the Android API raises new questions. Our understanding is that PHY is a low level thing and that the Bluetooth hardware can only work in one PHY mode at a time. If so, what if an app changes the PHY? Does this switch for all apps? What are implications? For example, what if one app, for example an existing app, needs to use older beacons in compatibility mode while another app wants to use Bluetooth 5 long range beacons? Maybe we are wrong and the underlying Bluetooth 5 firmware somehow multi-tasks PHY modes? Finally, how does the app know the device is Bluetooth 5 capable? It remains to be seen how the fragmentation of capability and behaviour is going to be workable on a typical app. Will most apps end up defaulting to compatibility mode, the long range and high speed only being used for special cases (devices)? In any case, we can see it’s likely that Bluetooth 5 is going to complicate beacon app development.

28/6 UPDATE: In response to this post, Martin Woolley of the Bluetooth SIG answered all our questions! Hardware, hence Android O, can have several PHY modes active at the same time provided the underlying device supports this.

The Use of Beacons in Smart Cities

There’s a recent paper by Gonzalo Cerruela García, Irene Luque Ruiz, and Miguel Ángel Gómez-Nieto of the University of Córdoba, Spain on State of the Art, Trends and Future of Bluetooth Low Energy, Near Field Communication and Visible Light Communication in the Development of Smart Cities (pdf)

The paper explains how technologies (NFC, BLE, VLC) will be important for the Internet of Things in smart cities and how they will need to be connected via LoRaWAN, Sigfox, Weightless, LTE, and 5G. With regard to Bluetooth LE they say:

Another challenge for the attention of BLE technology is the limited range problem; the range is directly dependent on Broadcasting Signal Power. An increase in signal power makes BLE devices less energy-efficient. Moreover it is necessary to improve accuracy in determining proximity to a BLE device.

The range problem will become less of an issue once Bluetooth 5 devices become available.

Bluetooth 5 Beacon Implementation Tradeoffs

We previously wrote about Bluetooth 5 and beacons. Now that more technical articles are available, we have been looking deeper into Bluetooth 5 and and how it might affect beacons, particularly in terms of compatibility and battery life.

Bluetooth 5 achieves a greater range without necessarily using more battery power. How? There’s an informative article by Martin Woolley that explains how range is more to do with how far the radio signal reaches and is still intelligible as opposed to how far the signal reaches. With current Bluetooth 4, the signal is actually going further than the working range but there’s noise in the signal such that the data can’t be reliably read. Bluetooth 5 (optionally) adds extra information to the data to allow error correction to be performed. This allows the data to be intelligible at a longer range. There are various PHY ‘modes’ that Bluetooth 5 can use with different capabilities:

LE 1M is what we have at the moment and will provide backward compatibility. The new LE Coded modes add error correction at the expense of a lower data rate. The LE 2M provides twice the data rate but actually less range than with Bluetooth 4. It can be seen that the ‘headline’ of Bluetooth x4 range and x2 speed are mutually exclusive. Bluetooth 5 is better than Bluetooth 4 but you can’t have everything. Bluetooth implementations will need to choose whether range, or speed is important. As beacons transmit very little data and speed of that data isn’t that important, we expect new beacons to use the coded PHY modes.

However, what about compatibility? If beacons need to remain backward compatible with current Bluetooth 4 phones then they will need to transmit LE 1M. There will be a tradeoff between long range needs and compatibility with today’s phones. Some beacons might do timeslicing between long range Coded and LE 1M advertising with a consequent significant degradation of battery life.

Another aspect that will affect battery use is that Bluetooth 5 allows a maximum transmit power +20dBm rather than +10dBm as at present. However, as now, higher output power will be under user (initial configuration) control.

In terms of using the new, larger Bluetooth advertising data size, this will need the iBeacon and Eddystone specifications to evolve. This is reliant on work by Apple and Google. Larger data sizes imply longer transmission time, about x2 to x8 the current transmission time. Most current beacons transmit for about 1ms (1 millisecond) every 100ms to 1000ms. New beacons will transmit between 2ms and 8ms again every 100ms to 1000ms. The transmission time has a direct, almost linear, affect on battery use.

[As an aside, if a beacon uses use LE 2M, without the longer range, then the transmission time will be cut by about a half. As most beacons are expected to support the longer range, in most cases there’s going to be a corresponding increase in battery use.]

It can be seen that for ‘Beacons 2.0’, compromises will have to be made. There are tradeoffs between long range, high speed, legacy (today’s) phone compatibility and efficient battery use that mean no beacon will have all these desirable attributes. There’s likely to be an even larger range of beacons and/or configuration parameters that tradeoff range, speed, compatibility and battery life. This is likely to complicate evaluation and rollouts.

Bluetooth 5 and Beacons

We have been receiving enquiries about Bluetooth 5 and how it affects beacons. Some people have even asked “where are the Bluetooth 5 beacons?”

In terms of beacons, Bluetooth 5 provides:

  • x4 the range
  • x2 the speed
  • increase broadcast advertising message size x 800%

The greater range will benefit most new beacon implementations but there are already some Bluetooth 4 ultra long range beacons with output power amplifiers that boost the Bluetooth 4 range from the typical 50m to 300m.

The speed increase probably won’t be noticed as it’s the discovery/connection time rather than the ‘bits per second’ that’s usually the determining factor for the few beacon users who connect to beacons.

Additionally, there’s also deeper access into the physical host controller interface so that the speed and range can be configured to adjust for different scenarios but it remains to be seen if this will be used in beacon implementations.

The most significant change for beacons is the larger advertising data size. This means the beacon can more easily transmit sensor, telemetry or new types of data. It will potentially also allow Eddystone-URL to do away with the need for URL shorteners but, even if this happens, some applications might still use them for other reasons such as easily being able to redirect the URL to elsewhere.

For those of you wanting Bluetooth 5 now, you will need to wait. While there’s already SoC chips, such as the nRF52840, that support Bluetooth 5, other things such as the iBeacon/Eddystone specs need to catch up to (possibly) use the new advertising data size. Also, (new) phones will need to catch up to support Bluetooth 5. After that, Android and iOS will probably need updated OS Bluetooth APIs. Only once the ecosystem is in place will the majority of beacon manufacturers see it’s worth it to release new Bluetooth 5 beacons.

All this isn’t going to happen overnight. When it does, we might end up with a fragmented and more-complicated ecosystem where older Bluetooth 4 phones won’t be able to take advantage of the newer features of the Bluetooth 5 beacons.