URI-Beacons are handy when there is a need to advertise a small amount of information (usually a URL) to any nearby device. They’re really easy to set up: the code is fully available on the mbed website, so all you’ll need to do is tell the beacon what to broadcast. The canonical source for this example lives at https://github.com/ARMmbed/mbed-os-example-ble/tree/master/BLE_URIBeacon

URI-Beacons are handy when there is a need to advertise a small amount of information (usually a URL) to any nearby device. They’re really easy to set up: the code is fully available on the mbed website, so all you’ll need to do is tell the beacon what to broadcast.

Technical details are better presented here, which happens to be the mbed-classic equivalent of this example. Please also refer to Google's URIBeacon project.

What You’ll Need

To get this going, you’ll need:

- To see URIBeacons get the *Physical Web* app installed on your phone:

- Android version

- iOS version

- One of the BLE platforms listed in the README.md of this repository, for example a Nordic DK board.

Build Instructions

Building with mbed CLI

If you'd like to use mbed CLI to build this, then you should refer to the main readme. The instructions here relate to using the developer.mbed.org Online Compiler

In order to build this example in the mbed Online Compiler, first import the example using the ‘Import’ button on the right hand side.

Next, select a platform to build for. This must either be a platform that supports BLE, for example the NRF51-DK, or one of the following:

List of platforms supporting Bluetooth Low Energy

Or you must also add a piece of hardware and the supporting library that includes a Bluetooth Low Energy driver for that hardware, for example the K64F or NUCLEO_F401RE with the X-NUCLEO-IDB05A1

Once you have selected your platform, compile the example and drag and drop the resulting binary onto your board.

For general instructions on using the mbed Online Compiler, please see the mbed Handbook

Checking for Success

  • Build the application and install it on your board as explained in the building instructions.
  • Open the *Physical Web* application on your phone. It will start to search for nearby beacons.

https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-URIBeacon/raw-file/45a261c84d32/img/app_start.png

figure 1 Start of the *Physical Web* application version 0.1.856 on Android

  • When the beacon starts up, the Configuration Service runs for 60 seconds. During this time it is possible to change the URL advertised by the beacon. It is also important to note that during these 60 seconds, your device will not advertise any URL.

https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-URIBeacon/raw-file/45a261c84d32/img/open_configuration.png

figure 2 How to open the beacon configuration view using the *Physical Web* application version 0.1.856 on Android

  • Edit the URL advertised by your beacon.

https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-URIBeacon/raw-file/45a261c84d32/img/edit_url.png

figure 3 How to edit the URL advertised by your beacon using the *Physical Web* application version 0.1.856 on Android

  • Save the URL which will be advertised by your beacon.

https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-URIBeacon/raw-file/45a261c84d32/img/save_url.png

figure 4 How to save your beacon configuration and start advertising URL using the *Physical Web* application version 0.1.856 on Android.

  • Find your device; it should advertise the URL you have set.

https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-URIBeacon/raw-file/45a261c84d32/img/result.png

figure 5 Display of URL advertised by your beacon using the *Physical Web* application version 0.1.856 on Android.

Please note that the URIBeacon spec requires the URIBeacon app to remain in config mode for the first 60 seconds before switching to being a beacon. So if you're using a physical-web app, you'll only see the beacon after this period; if you're using one of the generic apps for BLE scanning, you should see a configurable beacon being advertised for the first 60 seconds.

You'll find links on Google's project page to client apps to test URIBeacon. Here's a link that should get you an Android App; please browse to `uribeacon-sample-release.apk`. But you should begin with the links to android apps mentioned above.

Revisions of mbed-os.lib

Revision Date Message Actions
20:aba6206ee5d9 2017-03-01 Merge pull request #55 from adbridge/master File  Diff  Annotate
18:e292204f819e 2017-02-15 Merge pull request #52 from 0xc0170/master File  Diff  Annotate
17:0259d4cbf61d 2017-02-02 Merge pull request #48 from adbridge/master File  Diff  Annotate
16:6db5e046f08e 2017-01-26 Merge pull request #46 from adbridge/master File  Diff  Annotate
15:c4119c999c55 2016-12-15 Update mbed-os revision to mbed-os 5.3.0. File  Diff  Annotate
14:5fba994c8d03 2016-12-15 Merge pull request #42 from ARMmbed/mbed-os-5.3.0-rc3 File  Diff  Annotate
13:dd14588c15c0 2016-10-28 Updating mbed-os to mbed-os-5.2.1 File  Diff  Annotate
12:752cd4a9d62c 2016-10-24 Updating mbed-os to mbed-os-5.2.0 File  Diff  Annotate
11:23f03970d2cd 2016-10-24 Merge pull request #32 from ARMmbed/oob File  Diff  Annotate
10:7f6985ae3125 2016-10-05 Updating mbed-os to mbed-os-5.1.5 File  Diff  Annotate
9:2d1e8269fdd2 2016-09-16 Updating mbed-os to mbed-os-5.1.4 File  Diff  Annotate
8:2f7803a56519 2016-08-20 Updating mbed-os to mbed-os-5.1.2 File  Diff  Annotate
7:d23b732ddbdf 2016-08-19 Updating mbed-os to mbed-os-5.1.1 File  Diff  Annotate
6:157de62e6d44 2016-08-05 Updating mbed-os to mbed-os-5.1.0 File  Diff  Annotate
4:5306e53c67d8 2016-08-03 Updating mbed-os to mbed-os-5.1.0-rc5 File  Diff  Annotate
3:5d8b42cc1a27 2016-07-30 Updating mbed-os to mbed-os-5.1.0-rc4 File  Diff  Annotate
2:e075005e17d0 2016-07-28 Merge branch 'master' of https://github.com/ARMmbed/mbed-os-example-ble File  Diff  Annotate
1:7b3d36c9808f 2016-07-28 Sync with mbed-os-5.1.0-rc3 File  Diff  Annotate
0:45a261c84d32 2016-07-26 Update example at tag mbed-os-5.0.1-rc1 File  Diff  Annotate