ble beacons, eddystone and physical web: an … beacons, eddystone and physical web: an introduction...
TRANSCRIPT
BLE beacons, Eddystone and Physical Web: an introduction
Alessio Cucini, Samuele ForconiBlueUp Srls
BlueUp Srls, 2016, All right reserved
Contents● The origin of (radio) beacons
● Bluetooth 4.0 and Bluetooth Low Energy
● Bluetooth LE protocol
● Android Bluetooth LE API
● Bluetooth LE beacons
● iBeacon
● Eddystone
● Google Beacon API
● Physical Web
● Web Bluetooth
What is a (radio) beacon?
A radio beacon is a transmitter at a known location, which transmits a continuous or
periodic radio signal with limited information content (for example its identification or location), on a specified radio frequency.
Occasionally the beacon function is combined with some other transmission, like telemetry
data or meteorological information.
(source: Wikipedia)
BlueUp Srls, 2016, All right reserved
BlueUp Srls, 2016, All right reserved
Beacons and mobile
Radio beacons are a well known and estabilished technology (especially in aviation, navigation).
A few events renewed the interest:● Bluetooth Low Energy
(or Smart) included in Bluetooth 4.0 specifications
● Support of Bluetooth 4.0 in smartphones and mobile OS (iOS, Android, Windows, Blackberry)
● Launch of iBeacon (Apple)
BlueUp Srls, 2016, All right reserved
Bluetooth 4.0
Starting from Version 4.0 of Bluetooth Core Specification, a new extension has been included, called Bluetooth Low Energy (BLE), also known as Bluetooth Smart.
Bluetooth Low Energy is a power- and application-friendly version of Bluetooth, especially built for the Internet of Things (IoT).
Bluetooth Smart was originally introduced under the name Wibree by Nokia in 2006.
BlueUp Srls, 2016, All right reserved
The Bluetooth 4.0 Ecosystem
(Source: Bluetooth SIG)
● Non-negligible energy consumption
● Long discovering and pairing time
● Medium complexity● Limited visibility and
discovery● Stream-oriented
BlueUp Srls, 2016, All right reserved
Vs.
● Low consumption (“low energy”)
● Short connection and comunication time
● Low complexity● Asymmetric architecture
● Simple, cheap, battery-powered peripheral
● Complex central ● Message-oriented
BlueUp Srls, 2016, All right reserved
BLE Roles
GAP (Generic Access Profile) controls connections and advertising in Bluetooth: determines how two devices can (or can't) interact with each other.
GAP defines various roles for devices. Two key concepts are:
● Peripheral devices are small, low power, resource contrained devices that advertise to connect to a much more powerful central device.
● Central devices are usually (but not necessarily) a mobile phone or tablet with far more processing power and memory.
BlueUp Srls, 2016, All right reserved
BLE Services and Characteristics
GATT (Generic ATTribute profile) defines how two BLE devices transfer data back and forth using concepts called Services and Characteristics:● Services are logic entities, and
contain specific chunks of data called characteristics;
● Characteristics incapsulate a single data point
Services and Char's are identified by 16-bit or 128-bit UUID's
GAP = Generic Access ProfileGATT = Generic ATTribute Profile
Generic BLE connection
BlueUp Srls, 2016, All right reserved
GATT Client GATT Server
Android Bluetooth LE API
BlueUp Srls, 2016, All right reserved
Class: BluetoothLeScannerMethod: startScan (List<ScanFilter> filters, ScanSettings settings, ScanCallback callback)
A ScanFilter allows clients to restrict scan results to only those that are of interest to them:● Service UUIDs which identify the GATT services running on the device● Name of remote Bluetooth LE device● MAC address of the remote device.● Service data which is the data associated with a service.● Manufacturer specific data which is the data associated with a
particular manufacturer.
GATT Client (App) GATT Server
Android Bluetooth LE API
BlueUp Srls, 2016, All right reserved
Class: BluetoothDeviceMethod: connectGatt (Context context, boolean autoConnect, BluetoothGattCallback callback)
Connect to GATT Server hosted by this device. The callback is used to deliver results to Caller, such as connection status as well as any further GATT client operations.
GATT Client (App) GATT Server
Android Bluetooth LE API
BlueUp Srls, 2016, All right reserved
GATT Client (App) GATT Server
Class: BluetoothGattMethod: discoverServices()Discovers services offered by a remote device as well as their characteristics and descriptors.
BeaconSmartphone
BLE Beacon
BlueUp Srls, 2016, All right reserved
BLE-beacon technology uses only a portion of the Bluetooth LE protocol:
Broadcast advertising
2011 2012 2013 2014 2015 2016
BLE Beacons Timeline
iPhone 4SFirst smartphone with Bluetooth 4.0 support
Android 4.3 supports Bluetooth 4.0
Apple launches iBeacon technology
Google launches Eddystone specifications
Physical Web support on Google Chrome ver. 49 for
Android
BlueUp Srls, 2016, All right reserved
iBeacon technology (May 2013) defines advertising packet format.
iBeacon advertising packet includes an unique numeric identifier of the beacon, coded by three numbers (proximity-UUID, major number, minor number)
Specifications requires also:
● Advertising interval equal to 100msec
● Non-connectable advertising packet
iBeacon technology
BlueUp Srls, 2016, All right reserved
FL = Field LengthFT = Field Typefl = LE and BR/EDR flagMnf. data = manufacturer data (fixed)
Proximity UUID = unique identifier of proximity region (16 bytes)M = major number (2 bytes)m = minor number (2 bytes)R = RSSI (Received Signal Strength Indicator) at 1mt [used to estimate proximity (immediate, near, far, unknown) and accuracy]
1 2 3 4 5 6-9 10-25 26-27 28-29 30
FL FT fl FL FT Mnf. data Proximity UUID M m R
02 01 04 1A FF 4C 00 02 15
Fixed
iBeacon Advertising Packet
BlueUp Srls, 2016, All right reserved
Far (< 30/35 m)
Near (< 2/3 m)
Unknown
Immediate (< 0.2 m)
Proximity
BlueUp Srls, 2016, All right reserved
Definition (Apple CoreLocation Framework): “Indicates the one sigma horizontal accuracy in meters. Use this property to differentiate between beacons with the same proximity value. Do not use it to identify a precise location for the beacon. Accuracy values may fluctuate due to RF interference.A negative value in this property signifies that the actual accuracy could not be determined.”
Accuracy is associated to a probability to be within a certain distance from the beacon. It is NOT a distance.
BlueUp Srls, 2016, All right reserved
Accuracy
Reflections, diffractions, absorptions, ect., impact on radio signal propagation
BlueUp Srls, 2016, All right reserved
Ranging with RSSI
0 2 4 6 8 10 12 14 16 18 20
-100
-90
-80
-70
-60
-50
-40
-30
-20
-10
Distance (m)
RSSI (dBm)
Log-distance path-loss modelRSSI = RSSI0 -10 n log10(d/d
0) + Xg
n = 1.7 (in-building LOS)
n = 2 (free space)
n = 5 (in-building NLOS)
Two-ray model
normal random variable with zero mean and standard deviation in dB
First-release Eddystone specifications (July 2015) defines 3 advertising packet formats:● Eddystone-UID: similar to iBeacon (opaque unique
identifier), but with a different ID structure● Eddystone-URL: transmit an URL (Uniform Resource
Locator) in compact form● Eddystone-TLM: telemetry data (internal status) of
the beacon (battery voltage, temperature, counters)
This three packet formats share the first 11 bytes of the advertising packet
Eddystone specifications
BlueUp Srls, 2016, All right reserved
FL = Field LengthFT = Field Typefl = LE and BR/EDR flagCL = Complete list of service UUIDSD = Service DataE-UUID = Eddystone UUID (0xFEAA)
1 2 3 4 5 6-7 8 9 10 11
FL FT fl FL CL E-UUID FL SD E-UUID
02 01 06 03 03 AA FE 0xnn 0x16 AA FE
1 … 11 12 … max (31)
02 … FE depends on frame type
Eddystone Advertising Packet
BlueUp Srls, 2016, All right reserved
12 13 14-23 24-29 30 31
FT RD Namespace ID Instance ID RFU
00
FL = 0x17 (23)FT = Frame TypeRD = Ranging Data (RSSI at 0mt; = RSSI at 1mt + 41dB)Namespace ID, identifies a set of beacons (10 bytes)Instance ID, identifies a certain beacon within NID (6 bytes)RFU = Reserved for Future Use
Eddystone-UID
BlueUp Srls, 2016, All right reserved
12 13 14 15 +
FT RD US Encoded URL
01
FL = variable, depends on URL lengthFT = Frame TypeRD = Ranging Data (RSSI at 0mt)US = URL Scheme prefix (0x00 = http://www.; 0x01 = https://www.; 0x02 = http://; 0x03 = https://.Encoded URL = up to 17 bytes (usually compact URL)
Eddystone-URL
BlueUp Srls, 2016, All right reserved
FL = 0x11 (17)FT = Frame TypeVer. = TLM-frame version (currently 0x00)VBATT = battery voltage (mV) – 2 bytesTEMP = beacon temperature (°C) – 2 bytesADV_CNT = advertising packet counter from power-up (units) – 4 bytesSEC_CNT = time counter from power-up (0.1sec) – 4 bytes
12 13 14-15 16-17 18-21 22-25
FT Ver. VBATT TEMP ADV_CNT SEC_CNT
02 00
Eddystone-TLM
BlueUp Srls, 2016, All right reserved
UID vs URL
BlueUp Srls, 2016, All right reserved
UID
URL
ID
ID http://example.com
http://example.com
http://example.comhttp://example.com
Google Beacon API
BlueUp Srls, 2016, All right reserved
(Source: Google Inc.)
Proximity Beacon API / 1
BlueUp Srls, 2016, All right reserved
The Proximity Beacon API is a cloud service that allows you to manage data associated with your BLE beacon fleet using a REST interface.
You can associate data with registered beacons as attachments. Attachments are arbitrary blobs of data that are served back as messages to your Android and iOS apps through the Nearby Messages API. You can update attachments remotely, eliminating the need to physically visit each beacon.
Proximity Beacon API / 2
BlueUp Srls, 2016, All right reserved
You can monitor the health of your beacons (battery level, internal temperature, ...) through the Proximity Beacon API's diagnostic endpoint (based on Eddystone-TLM)
Also, when registering beacons with the Proximity Beacon API, the following fields are used as a signal by the Places API:● Latitude and longitude coordinates.● Indoor floor level.● Place ID.
Physical Web
BlueUp Srls, 2016, All right reserved
The Physical Web is a project whose aim is to connect everyday physical objects to the web.
This involves creating an open ecosystem where smart devices can broadcast URLs into the area around them.
Any nearby display such as a smartphone or a tablet can then see these URLs and offer them up to the user. It mirrors the basic behavior we have today with a search engine.
The backbone of Physical Web is Eddystone-URL format
Physical Web
BlueUp Srls, 2016, All right reserved
● The user requests a list of what's nearby.
● A ranked list of URLs is shown.
● The user picks one.● The URL is opened in a full
screen browser window.
Physical Web
BlueUp Srls, 2016, All right reserved
With Physical Web you do not need an app to receive nearby objects URL's. A browser with embedded BLE beacon-scanning support is sufficient.
Starting from Rel. 49.x, Google Chrome supports Physical Web (still some bugs to be fixed!)
HTTPS is required
Note: Opera browser supports Physical Web, too.
Web Bluetooth
BlueUp Srls, 2016, All right reserved
Web Bluetooth is a specification for Bluetooth API to allow websites to communicate with BLE devices, using the Generic Attribute Profile (GATT), in a secure and privacy-preserving way.
A website, running in the Central role, can connect to remote GATT Servers over a BLE connection.
You can interact with a BLE-enabled device from a website with a browser (no app required)
(Source: https://www.w3.org/community/web-bluetooth/)
Live Demo
BlueUp Srls, 2016, All right reserved
Very simple demo: toggling a led on a BLE-enabled device, using Web Bluetooth API.
We use:● a browser● a HTTPS site ● a BLE connection
NO Internet connection is required on the BLE-enabled device side
BlueUp Srls, 2016, All right reserved
● Android API for Blueooth Low Energyhttp://developer.android.com/guide/topics/connectivity/bluetooth-le.html
● Open-source Android library for iBeaconhttps://github.com/AltBeacon/android-beacon-library
● Eddystone Beacons Google Developer sitehttps://developers.google.com/beacons/
● Open-source Eddystone libraryhttps://github.com/google/eddystone
● The Physical Web project libraryhttps://github.com/google/physical-web
● Web Bluetooth https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web
Resources
BlueUp Srls, 2016, All right reserved
● Alessio CuciniBlueUp Srls, Managing DirectorE-mail: [email protected]
● Samuele ForconiBlueUp Srls, SW Development ManagerE-mail: [email protected]
Contacts