mozilla / connected-devices-experiments

INACTIVE - http://mzl.la/ghe-archive - A place to publish experiments and investigations from the Connected Devices team
10 stars 6 forks source link

Eddystone Beacons #32

Closed sfoster closed 2 months ago

sfoster commented 8 years ago

Project Information

Name of Project

Eddystone Beacons

Summary

A number of beacon vendors have emerged and support for Google's Eddystone protocol is growing. Eddystone is the BLE-based beacon protocol that allows broadcast of a URL. For the Magnet project we want to understand some of the parameters including:

Google hosts a page listing the manufacturers & vendors whose devices they have evaluated and confirmed support Eddystone: https://developers.google.com/beacons/eddystone#full_support_for_eddystone Some are OEMs like Nordic Semiconductor, others are bundling beacons with cloud services, enterprise support etc. This project will focus on those vendors which offer Eddystone beacons for purchase and evaluation today.

sfoster commented 8 years ago

Accent Systems

Beacon Inside

Eddystone beacons for pre-order only

Blesh

BlueBite

BlueCats

Bluvision

Estimote

Gimbal

Nordic Semiconductor

Radius Networks

sfoster commented 8 years ago

Range & Power Notes

In trying to understand minimum and maximum range, I went looking at the datasheet for one of the chips widely used for the BLE beacons: http://cache.nxp.com/files/32bit/doc/data_sheet/MKW40Z160.pdf?pspll=1

This indicates "Programmable Transmitter Output Power: -18 dBm to +5 dBm". However, what this means in practice isn't clear as an implementation may or may not expose this for configuration, and it may not allow the full range. In theory it should be possible to dial down the minimum beacon range to say 1cm. There is more information about the max range as the BLE spec calls for comparable range to Bluetooth Classic, and max range is one of the key parameters manufacturers list for each product. We should expect a theoretical maximum of 100m, and a real-world maximum of about 50m.

Transmit power is one of the main factors that determines battery life and power usage of a beacon: more power = more range = shorter battery life. Some beacons have a provision for mains power - via a wall wart or USB adapter, others are powered by sealed/built-in LiPo batteries, or replaceable AA or coin cells. Estimates for battery life range from 12mo to 9 years. Expected use and the ease of maintenance will be factors in which product to chose. For an event or short-lived installation, the sealed units may be fine. For a more permanent installation, it will be necessary to replace batteries periodically. I don't yet know if the battery status for a given beacon can be determined remotely.

sfoster commented 8 years ago

Reco Beacon

Signal 360

Swirl

Zebra

arcturus commented 8 years ago

Determining beacon battery status in theory is part of the Eddystone protocol. Eddystone provides a telemetry package where vendors can provide this (called Eddystone TLM)

sfoster commented 8 years ago

I received a kit of 3 USB-powered beacons from Accent Systems (iBKS-USB) and 3 of the button cell (CR2477 Lithium Cell) iBKS-105 beacons. Both are put into "configuration mode" by resetting (unplug/re-plug or remove/replace the battery.) They revert to their normal configured mode after 30 seconds. Accent publish an android app (also I think an iOS app) for configuring them, this appears to be a simple app that lists and allows editing for each of the GATT attributes. There is some short explanation of possible values and what they might mean in the app, and more in the technical docs To be honest, this is not a user-friendly experience. Clearly the assumption is that some installer or IT specialist is going to be configuring the beacons. As this is GATT, any similar app should work, and perhaps some are better than others. Google's Physical Web app does allow editing of the URL field, but not the other parameters.

I plugged in the USB-powered device via a USB power monitor, which shows voltage and current draw. But even at full power it does not register on a milliamp scale. I can see if I can run it through my multimeter to try and get a measurement, but clearly power requirements are low. In the battery powered unit, the CR2477 is a chunky cell. It has a nominal capacity of 1000mAh @ 3V which puts it in the ballpark of 2 AAA cells. Apart from transmit power, the other key parameter is the advertising interval. With these beacons, this defaults to 0.95s, with a configurable range of 0.1 - 10s

I got the following rough range estimates:

Tx Power Value Range
-30dBm 0 0.5m
-20dBm 1 3m
-16dBm 2 15m
-12dBm 3 40m
-8dBm 4 35m
-4dBm 5 45m
0dBm 6 60m
+4dBm 7 80+m

These numbers were obtained with clear line of sight to the beacon, with the beacon facing me and my Sony Z3C running Google's Physical Web app. I faced the beacon and held the phone in front of me at a natural angle - say 45deg. I logged the approximate distance threshold when the beacon registered in the app as I approached it.

There are a lot of significant variables here that will have an impact on real-world use experience. Tilting the phone changes the range. The 45deg angle seems about optimum - for this phone at least. I imagine this varies based on the position and type of antenna built into the phone. This beacon (and probably most) is quite strongly directional. Placing it face up (i.e. perpendicular to me) reduced its range by as much as 50%. In one rotation it was particularly bad - I assume this was the coin cell interfering with the internal antenna. Also, simply having my lovely assistant turn away from me while holding the antenna - i.e placing her body in between my phone and the beacon - reduced the range down to around 30% of the distance measured with no obstruction.

All this makes me suspect beacon owners will be likely to crank up the transmission power to a high value to ensure it is picked up despite obstacles and interference. Which means that when you happen to have clear line of sight, the "nearby" beacon could be 50m or more away!

One more note: The iBKS app shows a RSSI value for each beacon in dBm units. I tried and failed to correlate this to the results I was getting with the Physical Web app. I'm not sure if this was due to latency or what. Nearer beacons had a higher RSSI value than those further away, but I wasn't able to pin down a value that represented "nearby". Perhaps this is a heuristic that averages values over time?

It would be interesting to know if beacon vendors have guidelines for their placement. For example, based on what I've described, it might be sensible to install them above head height.

I would suggest other people conduct the same kind of measurements, using different beacons, different phones/BLE devices, in differing environments. The relative humidity on a given day may be a factor. Perhaps enclosed spaces have different characteristics? Some building materials are more opaque to these frequencies than others. It is very clear that the gulf between product specs and datasheets vs real-world experience is large enough that user stories involving beacons, design decisions and possibly strategy in general should be informed by direct measurement and in-person experience of the target use cases and circumstances.

lime124 commented 8 years ago

Hey sam - in your experience so far, are there any that are super simple for someone to set up and get running? I'm thinking of the local coffee shop owner who just wants to broadcast today's special out into the world.

sfoster commented 8 years ago

The Accent Systems beacons I tried can be put in "configure" mode to change the URL (and other attributes) by power cycling them. That could be a pain if you needed to do it every day. Better to point the URL at a page that you update rather than update the beacon every time. However, some beacons may make this easier than others. The USB-power beacon are easier to power cycle as you just disconnect the power source rather than opening up the case.

Really though, any beacon that supports GATT configuration should be pretty easy to set up. The variables affecting ease of setup then are all in the app itself, vs. the beacon. For example, the Google Physical Web app lets you easily edit the URL and if that's all you need to do, its a far better UX than the clunky iBKS app. There are many of these apps though: each manufacture produces one, some vendors are creating their own, and there are 3rd parties making their own as well.

lime124 commented 8 years ago

Got that helps clarify things as I'm still catching up on how you set one of these up. Thanks :)

sfoster commented 8 years ago

I just captured a short video showing the process for configuring these beacons As I've mentioned, provided the beacon supports the GATT (Generic Attribute Profile) service, the user should have a range of choices in how they configure their beacon. As BLE is widespread on smart phones, typically a iOS or Android app is used as shown here. The video shows the initial defaults this particular product ships with, and how to change them to broadcast the Eddystone URL, at a given transmission power.

sfoster commented 8 years ago

Regarding the URL itself, this is a max of 18 bytes. Some common prefixes like http://www, https:// etc have single-byte representations, so its slightly more than appears at first glance. That said, in practice almost all URLs will need to be shortened using a service like bit.ly or goo.gl or another service. The advantage of using a shortener/redirect service like this is that is easy to both update what page that resolves to after deploying the beacon.

The shortener/redirect service is an obvious point for data collection. Not coincidentally, many beacon vendors and services provide their own service which allows them to collect logs on beacon usage. It can also be a good value-add though, giving customers a UI to manage beacons and monitor usage in bulk. I expect we'll see lock-in and customer confusion in this area as beacon vendors are not in a hurry to point out the options people have for configuring and managing beacons, where for the most part a beacon is a beacon is a beacon.