Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BLE beacons, Eddystone and Physical Web: an int...

BLE beacons, Eddystone and Physical Web: an introduction

Bluetooth Low Energy (BLE) beacons is an emerging technology. First introduced in 2013, with iBeacon launch from Apple, BLE beacons technology immediately raised a large interest in the mobile community, recently freshened with the Google introduction of Eddystone format and Physical Web project.
A BLE beacon is a wireless device that periodically broadcast a Bluetooth Low Energy advertising packet, that is received by a smartphone and used to determine the position with respect to the beacon itself. This allows to provide “context-aware” information to the mobile user, opening up the possibility to connect the online (virtual) world with the offline (real) physical world. It is clear that BLE beacons are considered one of the anabling technology for the Internet of Things (IoT).
In this talk, we will provide a review on this technology, starting from a general introduction on how a BLE beacon works and interacts with smartphones. Then, focus will be given on Eddystone beacon specifications from Google, analyzing different advertising formats and their potential applications. Finally, the talk will address Physical Web project, a novel approach, developed and introduced by Google and based on open-source Eddystone-URL BLE beacon format, to enable interaction on-demand between a mobile device and a smart device (a parking meter, an electronic kiosk, a bus stop, …)

droidcon Italy

May 17, 2016
Tweet

More Decks by droidcon Italy

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 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)
  4. 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.
  5. • 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
  6. 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.
  7. 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
  8. GAP = Generic Access Profile GATT = Generic ATTribute Profile

    Generic BLE connection BlueUp Srls, 2016, All right reserved GATT Client GATT Server
  9. Android Bluetooth LE API BlueUp Srls, 2016, All right reserved

    Class: BluetoothLeScanner Method: 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
  10. Android Bluetooth LE API BlueUp Srls, 2016, All right reserved

    Class: BluetoothDevice Method: 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
  11. Android Bluetooth LE API BlueUp Srls, 2016, All right reserved

    GATT Client (App) GATT Server Class: BluetoothGatt Method: discoverServices() Discovers services offered by a remote device as well as their characteristics and descriptors.
  12. Beacon Smartphone BLE Beacon BlueUp Srls, 2016, All right reserved

    BLE-beacon technology uses only a portion of the Bluetooth LE protocol: Broadcast advertising
  13. 2011 2012 2013 2014 2015 2016 BLE Beacons Timeline iPhone

    4S First 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
  14. 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
  15. FL = Field Length FT = Field Type fl =

    LE and BR/EDR flag Mnf. data = manufacturer data 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
  16. Far (< 30/35 m) Near (< 2/3 m) Unknown Immediate

    (< 0.2 m) Proximity BlueUp Srls, 2016, All right reserved
  17. 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
  18. 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 model RSSI = RSSI 0 -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
  19. 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
  20. FL = Field Length FT = Field Type fl =

    LE and BR/EDR flag CL = Complete list of service UUID SD = Service Data E-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
  21. 12 13 14-23 24-29 30 31 FT RD Namespace ID

    Instance ID RFU 00 FL = 0x17 (23) FT = Frame Type RD = 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
  22. 12 13 14 15 + FT RD US Encoded URL

    01 FL = variable, depends on URL length FT = Frame Type RD = 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
  23. FL = 0x11 (17) FT = Frame Type Ver. =

    TLM-frame version (currently 0x00) VBATT = battery voltage (mV) – 2 bytes TEMP = beacon temperature (°C) – 2 bytes ADV_CNT = advertising packet counter from power-up (units) – 4 bytes SEC_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
  24. UID vs URL BlueUp Srls, 2016, All right reserved UID

    URL ID ID http://example.com http://example.com http://example.com http://example.com
  25. 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.
  26. 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.
  27. 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
  28. 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.
  29. 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 embbeded 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.
  30. 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/)
  31. 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
  32. BlueUp Srls, 2016, All right reserved • Android API for

    Blueooth Low Energy http://developer.android.com/guide/topics/connectivity/blue tooth-le.html • Open-source Android library for iBeacon https://github.com/AltBeacon/android-beacon-library • Eddystone Beacons Google Developer site https://developers.google.com/beacons/ • Open-source Eddystone library https://github.com/google/eddystone • The Physical Web project library https://github.com/google/physical-web • Web Bluetooth https://developers.google.com/web/updates/2015/07/intera ct-with-ble-devices-on-the-web Resources
  33. BlueUp Srls, 2016, All right reserved • Alessio Cucini BlueUp

    Srls, Managing Director E-mail: [email protected] • Samuele Forconi BlueUp Srls, SW Development Manager E-mail: [email protected] Contacts