# DIY Google's "Physical Web" UriBeacons with the Bluefruit LE Friend

## Getting Started

![](https://cdn-learn.adafruit.com/assets/assets/000/021/387/medium800/adafruit_products_uribeacon-large.png?1416861632)

Google has an interesting initiative called the [Physical Web](https://github.com/google/physical-web), which aims to enable any device to broadcast a specific URI (e.g. website) that users can detect with their cellphone/tablet and navigate to. &nbsp;The aim is to provide a standard, light-weight 'window' into any networked device.

The concept is similar to Apple's iBeacon, in that a specially formatted Bluetooth Low Energy (BLE) advertising packet is sent out from a radio to anyone in the radio range, and a listening app on the mobile phone that can pick the packets up and alert users. To demo, we'll be using the official Physical Web apps available for [Android](https://play.google.com/store/apps/details?id=physical_web.org.physicalweb)&nbsp;and [iOS](https://itunes.apple.com/us/app/physical-web/id927653608?mt=8).

Instead of advertising 128-bit UUIDs like iBeacon, Google defines an (open!) standard they call [UriBeacon](https://github.com/google/uribeacon)&nbsp;which advertises URIs, typically a shortened web address.

The primary use case is enabling any device to advertise a web-address where users can interact with the object, or where further information about the device can be found.

A vending machine might redirect you to a payment system, for example, or a sensor node might redirect you to the web interface where the sensor data and it's history can be searched and navigated.

# How Does it Work?

[The Bluefruit LE Friend from Adafruit already include everything you need to advertise as UriBeacon nodes.](https://www.adafruit.com/product/2267)

You simply need to tell the BLE Friend what URI you want it to advertise. To do that, we'll create a specially formatted advertising packet that contains your short (or shortened) URI, and tell the Bluefruit LE Friend to advertise with that packet instead of the default data.

The full [UriBeacon advertising packet specs](https://github.com/google/uribeacon/tree/master/specification#uribeacon-advertising-data)&nbsp;are available online in the UriBeacon Github repo:

![](https://cdn-learn.adafruit.com/assets/assets/000/021/381/medium800/adafruit_products_Screen_Shot_2014-11-24_at_20.29.44.png?1416857451)

To make life easier for you, though, we've made a convenient JavaScript UriBeacon generator that will take a URI and convert it into an advertising data payload that can be entered into the Bluefruit LE Friend via the&nbsp;**[AT+GAPSETADVDATA](../../../../introducing-adafruit-ble-bluetooth-low-energy-friend/ble-gap#at-plus-gapsetadvdata)**[command](../../../../introducing-adafruit-ble-bluetooth-low-energy-friend/ble-gap#at-plus-gapsetadvdata).

# UriBeacon Packet Generator

Simply enter your URI into the textbox below and click the generator button:

* * *

* * *
* * *

Make sure you start with [http://](http://learn.adafruit.com)or other valid URI prefixes! For example, here's the output for "http://www.adafruit.com"

![](https://cdn-learn.adafruit.com/assets/assets/000/021/401/medium800/adafruit_products_uri.png?1416866080)

# Configuring your Bluefruit LE Friend

Once you have the advertising packet generated with the above tool, insert your Bluefruit LE Friend into your USB port, put it in '[Command Mode](../../../../introducing-adafruit-ble-bluetooth-low-energy-friend/command-mode)', open up your favorite [terminal software](../../../../introducing-adafruit-ble-bluetooth-low-energy-friend/terminal-settings), and enter the AT+GAPSETADVDATA command with the UriBeacon payload.

For example, if we used&nbsp; **http://www.adafruit.com** as our URI, we would enter the following command:

Info: 

```
AT+GAPSETADVDATA=03-03-D8-FE-0F-16-D8-FE-00-00-00-61-64-61-66-72-75-69-74-07
```

This should generate an 'OK' response if everything went OK, and you can reset your device to get a clean start with the following command:

```
ATZ
```

# Detecting the UriBeacon Packets

To detect the UriBeacon advertising packets, simply open up the Physical Web application on your BLE-enabled Android or iOS device.

You will see a scanning icon similar to the image below (Android app):

![](https://cdn-learn.adafruit.com/assets/assets/000/021/383/medium800/adafruit_products_UriBeacon.jpg?1416858168)

Once a node is detected, you'll see the advertised URI (which should be expanded if you used a popular shortening service like bit.ly to stay within the size constraints of BLE advertising packets, which must be 27 bytes or smaller):

![](https://cdn-learn.adafruit.com/assets/assets/000/021/385/medium800/adafruit_products_UriBeacon2.jpg?1416858299)

# Clearing UriBeacon Data

The AT+GAPSETADVDATA command will store the values you supply in non-volatile memory, and they will be used as soon as the device powers up.

To clear the data and reset your Bluefruit LE Beacon to normal operating mode, simply enter the following command in Command Mode:

```
AT+FACTORYRESET
```


## Featured Products

### Bluefruit LE Friend - Bluetooth® Low Energy 4.0 - nRF5182

[Bluefruit LE Friend - Bluetooth® Low Energy 4.0 - nRF5182](https://www.adafruit.com/product/2267)
The Bluefruit LE Friend is your new Bluetooth® Low Energy BFF! This USB-to-Bluetooth® Low Energy board makes it easy to get your computer talking to your&nbsp;Bluetooth® Low Energy-enabled phone or tablet using a standard serial/UART connection.

In its simplest form, it works...

In Stock
[Buy Now](https://www.adafruit.com/product/2267)
[Related Guides to the Product](https://learn.adafruit.com/products/2267/guides)

## Related Guides

- [Bluefruit LE Python Library](https://learn.adafruit.com/bluefruit-le-python-library.md)
- [Reverse Engineering a Bluetooth Low Energy Light Bulb](https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb.md)
- [Bluefruit LE Connect for iOS and Android](https://learn.adafruit.com/bluefruit-le-connect.md)
- [Introducing the Adafruit Bluefruit LE Friend](https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend.md)
- [Adafruit LSM6DS3TR-C 6-DoF Accel + Gyro IMU](https://learn.adafruit.com/adafruit-lsm6ds3tr-c-6-dof-accel-gyro-imu.md)
- [Adafruit 1-Wire Thermocouple Amplifier - MAX31850K](https://learn.adafruit.com/adafruit-1-wire-thermocouple-amplifier-max31850k.md)
- [Adafruit Simple Soil Moisture Sensor](https://learn.adafruit.com/adafruit-simple-soil-moisture-sensor.md)
- [Adafruit DPI Display Kippah](https://learn.adafruit.com/adafruit-dpi-display-kippah-ttl-tft.md)
- [Expressive Pixels for Adafruit Matrix Portal](https://learn.adafruit.com/expressive-pixels-for-matrix-portal.md)
- [Adafruit SHT31-D Temperature & Humidity Sensor Breakout](https://learn.adafruit.com/adafruit-sht31-d-temperature-and-humidity-sensor-breakout.md)
- [NeoPixel Manicure](https://learn.adafruit.com/neopixel-manicure.md)
- [Pi Hole Ad Detection Display with PiTFT](https://learn.adafruit.com/pi-hole-ad-pitft-tft-detection-display.md)
- [Adafruit BMP580, BMP581, and BMP585 - Temperature and Pressure Sensor](https://learn.adafruit.com/adafruit-bmp580-bmp581-and-bmp585-temperature-and-pressure-sensor.md)
- [Adafruit TRRS Jack Breakout Board](https://learn.adafruit.com/trrs-jack-breakout.md)
- [Adafruit AirLift - ESP32 WiFi Co-Processor Breakout](https://learn.adafruit.com/adafruit-airlift-breakout.md)
