Home

Awesome

#NOTE! This repository will no longer be maintained as the nRF5 SDK for Eddystone is now part of nRF5 SDK version 13.0.0.

The project is found in the folder examples/ble_peripheral/ble_app_eddystone

Note that this version only supports nRF52 support.

Experimental support for nRF51 is found in nRF5 SDK Version 12.2.0 A future 12.x release will add production quality support for nRF51 for Eddystone.

nRF5 SDK for Eddystone™

This is an example implementation of the Eddystone GATT Configuration Service for nRF52. Support for nRF51 is scheduled for a future release. The application is intended to be used together with the open source nRF Beacon for Eddystone Android App. It is recommended to read the official specification for Eddystone, an open beacon format from Google to get a thorough understanding. Go to Quick start if you want to experiment right away.

<img src="https://github.com/google/eddystone/blob/master/branding/assets/png/EddyStone_final-01.png" alt="Eddystone logo" width="300px" align="middle">

Table of contents

Release note

Introduction

The new Eddystone GATT Configuration Service enables simple configuration of beacons. The user can configure the beacon to broadcast all Eddystone frame types:

Currently the firmware has five available slots and each slot can be configured to any of the unique frame types. From the source code it is possible to increase or decrease the number of available slots.

In addition to the new Eddystone GATT Configuration Service there are also two new frame types aimed at secure use cases.

The new frame types are Eddystone-EID and Eddystone-eTLM. EID, or Ephemeral Identifier, is a secure version of UID. eTLM, or encrypted TLM, is a secure telemetry format and provides information on the health of a beacon.

Eddystone-EID and Eddystone-eTLM protect against spoofing, replay attacks and malicious asset tracking - which are known beacon vulnerabilities.

Spoofing

Impersonating Eddystone-EIDs is difficult since the advertising data is encrypted and regularly updated.

Replay Attacks

By randomizing and never sending the Unlock Key in clear text it is difficult to perform replay attacks with the new Eddystone GATT Configuration Service. The beacon creates a random challenge token every time a user tries to unlock it. The user then encrypts the Lock Key with the challenge token and sends the result to the beacon. The result will be different for every unlock and replay attacks are therefore impossible.

Malicious Asset Tracking

Eddystone-EIDs randomize the device ID of the beacon as well as the encrypted advertising data. Since there are no constant values to track it will be difficult if not impossible to track the location of a single beacon over any significant time period.

IMPORTANT In order to have all the security benefits of Eddystone-EID and Eddystone-eTLM refrain from configuring other non-secure frame types while broadcasting these secure frame types

Supported characteristics

The application supports all functionality of the Eddystone GATT Configuration Service except the advanced optional characteristics as displayed in the table below. The advanced characteristics will be implemented in a future release.

CharacteristicNameStatus
1Broadcast Capabilities:white_check_mark:
2Active Slot:white_check_mark:
3Advertising Interval:white_check_mark:
4Radio Tx Power:white_check_mark:
5Advertised Tx Power (advanced)
6Lock State:white_check_mark:
7Unlock:white_check_mark:
8Public ECDH Key:white_check_mark:
9EID Identity Key:white_check_mark:
10Read/Write ADV Slot:white_check_mark:
11Factory Reset (advanced)
12Remain Connectable (advanced)

Prerequisites

Software

The application might work with other versions of the SDK/Keil but some modification of the source code is likely required on your part. For a quick start on using Embedded Studio with nRF5 devices see: https://devzone.nordicsemi.com/blogs/845/segger-embedded-studio-cross-platform-ide-w-no-cod/.

Hardware

Known issues

How to install

Quick start

This is the recommended approach if you just want to get started quickly without building the project yourself.

Compile from source

git clone https://github.com/NordicPlayground/nrf5-sdk-for-eddystone.git
Some_parent_folder
        nRF5_SDK_11.0.0_89a8197 (would be here if you ran download_sdk_setup.sh)
        nrf5-sdk-for-eddystone
                                bsp
                                hex
                                include
                                project
                              **sdk_components
                              **sdk_external
                                setup_scripts
                                source
                                     ble_services
                                   **crypto_libs
                                     modules
                                .gitignore
                                licenses.txt
                                README.md

Keil

nrf5-sdk-for-eddystone\project\pca10040_s132\arm5_no_packs
sdk_components\softdevice\s132\hex\s132_nrf52_2.0.0_softdevice.hex

The Softdevice can be flashed in with Nordic's nRFgo Studio tool. For instructions on how to use nRFgo Studio, follow the tutorial here under the Preparing the Development Kit section.

SEGGER Embedded Studio

nrf5-sdk-for-eddystone\project\pca10040_s132\embedded_studio
#define PACKED(TYPE) __packed TYPE // This should be line 87.

with this:

#if defined(__CC_ARM)
    #define PACKED(TYPE) __packed TYPE
#elif defined(__ICCARM__)
    #define PACKED(TYPE) __packed TYPE
#else
    #define PACKED(TYPE) TYPE __attribute__((packed))
#endif

Debugging

How to use

After flashing the firmware to a nRF52 DK it will automatically start broadcasting a Eddystone-URL pointing to http://www.nordicsemi.com, with LED 1 blinking. In order to configure the beacon to broadcast a different URL or a different frame type it is necessary to put the DK in configuration mode by pressing Button 1 on the DK so it starts advertising in "Connectable Mode". After that, it can be connected to nRF Beacon for Eddystone app, which allows the writing of the Lock Key to the Unlock Characteristic.

Please note that after pressing Button 1, the DK will only broadcast in "Connectable Mode" for 1 minute. After which, you must press Button 1 again if you did not manage to connect in time with the App.

LED Indications:
LED No.LED StateBeacon State
LED 1BlinkingAdvertising
LED 2OnConnected to Central
LED 3OnAdvertising in Connectable Mode

Detailed instructions on how to use the App is available in the nRF Beacon for Eddystone GitHub repository.

How it works

Modules

The firmware is mainly broken up in several modules that each handle specific functionalities required by the Eddystone specification.

Flash blocks arrangement
Block No.Data TypeCorresponding Structure
0Slot Configurationeddystone_flash_slot_config_t
1,2,3...Slot Configurationeddystone_flash_slot_config_t
APP_MAX_ADV_SLOTS - 1Slot Configurationeddystone_flash_slot_config_t
APP_MAX_ADV_SLOTSPrivate ECDH Key32 byte array
APP_MAX_ADV_SLOTS + 1Public ECDH Key32 byte array
APP_MAX_ADV_SLOTS + 2Lock Key16 byte array
APP_MAX_ADV_SLOTS + 3Flash Flagseddystone_flash_flags_t

User Configs

Inside project\pca10040_s132\config you can find debug_config.h and eddystone_app_config.h which are useful for changing the debug and application behaviour respectively. Read the comments in those files for details.

Issues and support

This example application is provided as a firmware foundation for beacon providers or for users simply wanting to experiment with Eddystone. It is not part of the official nRF5 SDK and support is therefore limited. Expect limited follow-up of issues.

Third-party crypto libraries

The example application uses algorithms from the following third-party cryptographic libraries.

Library | Algorithm | License ---:|---:|---|--- uWeave | AES-128-ECB | Unlicense Cifra | AES-EAX | Creative Commons 0 1.0 Cifra | ECDH 25519 | Creative Commons 0 1.0 RFC6234 | HMAC-SHA256 | Simplified BSD License

About

This application has been developed by the application team at Nordic Semiconductor as a demonstration of the Eddystone GATT Configuration Service. It has not necessarily been thoroughly tested, so there might be unknown issues. It is hence provided as-is, without any warranty. However, in the hope that it still may be useful also for others than the ones we initially wrote it for, we've chosen to distribute it here on GitHub. The application is built to be used with the official nRF5 SDK, that can be downloaded from http://developer.nordicsemi.com/.

Licenses

The nRF5 SDK for Eddystone licensing is split between the portion of the source code that originates from Nordic Semiconductor ASA and the portion that originates from third-parties.

Note: The crypto_libs folder is not included in this repository but is created by running the setup script.