The Beacon Advertiser use case focuses on broadcasting Bluetooth Low Energy (BLE) advertisements from a device to communicate specific data or trigger actions in other devices, such as smartphones or BLE-enabled receivers.
BLE beacons are low-energy hardware transmitters that broadcast short-range wireless packets at regular intervals using Bluetooth Low Energy (BLE) technology. These packets typically contain unique identifiers and can also include additional data payloads. BLE beacons are widely used for proximity detection and location-based services, enabling devices to recognize when they are near a specific beacon and respond accordingly. |
In this use case, a BLE-capable device acts as a BLE beacon, broadcasting its presence and custom data using advertising packets that can be picked up by other devices configured to scan for them. These advertisements can include information relevant to specific applications, enabling a variety of use cases, such as:
-
Retail marketing: Broadcasting promotional offers or store information to nearby smartphones.
-
Public information: Disseminating schedules, updates, or alerts in public places like transit stations or airports.
-
Telemetry and data broadcasting: Sending sensor data, device status, or other custom information to nearby receivers for monitoring or analysis.
Communication model
The Beacon Advertiser use case employs a non-connection-oriented communication model. Similar to the Beacon Scanner use case, this model operates without requiring a direct connection between the broadcasting BLE device and the scanning devices. Instead, the broadcasting device periodically transmits advertising packets containing custom data, which can be read by any BLE-capable device within range.
Key characteristics:
-
Connection requirement: No direct connection is needed between the device that advertises data and the devices scanning for BLE advertisements.
-
Data transmission: Unidirectional; the BLE device broadcasts advertisements, and other devices such as smartphones can passively receive them.
-
Advantages: Enables widespread and continuous data dissemination with minimal power usage and without the overhead of connection management.
XBee Beacon Advertise demo
The XBee Beacon Advertise demo developed by Digi demonstrates how XBee 3 BLU devices can be configured to broadcast BLE advertisements. This demo showcases the device’s ability to act as a BLE beacon, advertising custom data that can be received by other BLE devices such as smartphones or specialized receivers.
The XBee Beacon Advertise demo involves an XBee 3 BLU device configured with specific settings (applied using the Quick Setup feature of XBee Studio) and the XBee Mobile application running on a smartphone.
-
The XBee 3 BLU device runs a MicroPython application that configures it to broadcast custom BLE advertisements. These packets include the Bluetooth address of the device and temperature and humidity reads from the I2C sensor of the XBIB-C development board.
-
A smartphone running the XBee Mobile app scans for the beacons. When it enters the range of the BLE beacons, it obtains data from the advertised packets and displays the information, including the temperature and humidity values, in a card format.
The XBee Mobile app includes a new built-in feature called Get Started that centralizes the smartphone functionality for the different demos of the XBee 3 BLU use cases. Since mobile development can be a complex part of the implementation process, Digi provides sample interfaces in this section of the app so you can test the demos.
This setup simulates a real-world scenario where a broadcasting device sends out data that can be picked up by receivers, enabling applications such as location-based notifications, proximity marketing, or automated responses in smart environments.
Requirements
The XBee Beacon Advertise demo requires the following components and software:
-
1 XBee 3 BLU device.
-
1 XBIB-C development board.
-
1 U.FL antenna.
-
1 test cable.
-
A computer with the XBee Studio application installed.
-
You can download it here.
-
-
A smartphone (iOS or Android) with the XBee Mobile application installed. You can download it from:
-
Android: Google Play.
-
iOS: Apple Store.
-
You can scan the following QR to download the application from the corresponding market:
-
Set up the hardware
Before testing the demo, ensure the hardware is set up correctly:
-
XBIB-C development board requires a slight modification to enable the XBee 3 BLU device to access the I2C sensor:
-
Connect one end of the test cable to pin 24 of the Breakout connector within the XBIB-C development board and the other end to pin 36:
-
-
Attach the XBee 3 BLU device to the XBee socket of the XBIB-C development board.
-
In case your device requires an antenna, connect the antenna to the antenna connector of the XBee 3 BLU device:
-
Align the U.FL antenna with the U.FL female counterpart on the device. Then, press down until you hear a click.
-
-
Connect the XBIB-C development board to your computer using the USB cable.
-
Verify the RSSI (orange LED) is solid.
Apply the XBee Beacon Advertise Quick Setup
Follow these steps to apply the XBee Beacon Advertise Quick Setup to your XBee 3 BLU device:
-
Open XBee Studio and wait for your XBee 3 BLU device to be automatically discovered.
-
Access the Quick Setup wizard from the left navigation menu (lightning icon, second option in the list). The wizard page displays.
-
Select the XBee Beacon Advertise Quick Setup from the list of available quick setups.
-
Click Start. The tab associated with the selected quick setup displays.
The interactive help may appear if this is the first time you are executing a quick setup. In that case, uncheck the Always show interactive help option and then click anywhere in the screen to close the interactive help. -
The Quick Setup tab displays two controls: a list of devices and a role box titled Advertising device. Drag and drop the XBee 3 BLU device from the list to the Advertising device role box.
-
Click Next to continue. The Summary page displays.
-
Verify that your XBee 3 BLU device will be configured as Advertising device and click Next to continue. The Flash page appears.
-
The Flash page displays a table with the configuration progress for the XBee 3 BLU device selected in the Quick Setup. When the device is fully configured, the Test page displays.
-
Click Evaluate to start testing the Quick Setup. The XBee 3 BLU device resets and the MicroPython Terminal tab for the XBee 3 BLU device displays.
The Test page contains a set of instructions to evaluate the Quick Setup, you can skip them as they are explained in this documentation too.
Test the XBee Beacon Advertise demo
Once the Quick Setup is applied to the XBee 3 BLU device, you can test the BLE broadcasting functionality:
-
The MicroPython Terminal tab for the XBee 3 BLU device in XBee Studio displays the packet being broadcasted by the device periodically:
- Advertising new XBIB-C beacon frame: 0201060608584249424314ffdb0200003c84fffefab32ba05ae141c0085242 - Name: XBIBC - Address: 003c84fffefab32b - Temperature: 28.17 C - Humidity: 52.51 % HR
-
Start the XBee Mobile application on your smartphone. The Home page of the application displays.
-
Tap the Get Started option. The list of Get Started options displays.
-
Select the XBee Beacon Advertise option. The XBee Beacon Advertise demo overview page displays.
-
Tap the Start scanning option from the second step. The XBee Beacon Advertise demo page displays.
-
When the XBee Mobile app finds the custom BLE beacon (XBee 3 BLU device), it prints information about the advertised data in card format. Information includes:
-
Name of the BLE beacon device
-
Bluetooth address
-
RSSI value
-
Temperature value from the I2C sensor of the XBIB-C development board
-
Humidity value from the I2C sensor of the XBIB-C development board
-
Raw advertisement payload
Data is refreshed constantly.
-
-
Recap
In this chapter you have successfully configured an XBee 3 BLU device to behave as a custom beacon advertiser, demonstrating how BLE devices can broadcast custom data. This capability is crucial for applications that require the dissemination of information over short distances.
Key achievements
As part of this guide, you have:
-
Configured your XBee 3 BLU device to act as a beacon, broadcasting custom BLE advertisements.
-
Created custom beacon frames containing device information and sensor data from the XBIB-C development board.
-
Broadcast these frames to be detected by other BLE-enabled devices.
-
Scanned the custom beacon frames and extracted information from them with the XBee Mobile application.
Demo components review
Here is a brief explanation of the role of each component that took part in the XBee Beacon Advertise demo that covers the functionality of the Beacon Advertiser use case:
Component | Role | Sorftware used | Technology | Tasks |
---|---|---|---|---|
XBee 3 BLU device |
Advertiser device |
Embedded MicroPython app |
|
|
Smartphone |
Scanner device |
XBee Mobile app |
|
|