Eddystone beacon practice with the SARK-110-ULM

The SARK-110-ULM Antenna Analyzer includes the RN4871 Bluetooth Low Energy (BLE) module from Microchip, for the remote operation of the analyzer from an Android device or a computer. The BLE module can be controlled externally from a terminal emulator program running on a computer by using the special firmware SARK110ULM_BTOOL.dfu that must be installed on the analyzer. This enables the user to experiment with the BLE module as it were a development board. In this practice, we are going to configure the module to send Eddystone URL beacons.

Eddystone beacons

Eddystone is a Bluetooth Low Energy beacon profile released by Google similar to the iBeacon profile propietary from Apple. The profile contains several frame types, including Eddystone-UID, Eddystone-EID, Eddystone-TLM and Eddystone-URL. The latest frame type will be used in this practice for the broadcast of the URL www.sark110.com.

Setup

The standard firmware does not include the functionality for controlling the module, so you will need to download and install the special firmware SARK110ULM_BTOOL.dfu on the analyzer as a first step; download link. Before installing it, ensure that the normal firmware is installed in the internal drive, so you can switch back to it later.

Note that the special firmware does not support the USB mass storage function, so the internal disk drive will not be accessible when running this firmware. However, it will be accessible from the Device Firmware Upgrade mode if necessary. 

Then install the STM32 Virtual COM Port Driver from ST Microelectronics, if not installed; download link.

Finally, install a terminal emulator program, such as TeraTerm. Configure the serial port settings using the enumerated COM port as shown below.


To verify the operation of the beacon function with an Android device, use a Beacon Scanner application available at Google Play, e.g. the ones from Matthias Scheider or Nicolas Bridoux. 

Testing the setup

Connect the SARK-110-ULM analyzer to the computer using an USB cable, power on the analyzer with the special firmware installed and select "Normal mode" from the popup menu:
 
Launch TeraTerm on the computer, select the proper COM port and baudrate if not set, and type $$$ to enter into Command mode. Terminal must show the prompt CMD> as shown in the screenshot below:

Type V and ENTER to show the version of the Bluetooth module:
In order to have feedback about the typed commands, it is convenient to enable the echo by typing + and ENTER.
The complete set of commands supported by the RN4871 module is available in the module's User's Guide; download link

Configuring the beacon

For configuring the beacon you will need to type the following commands in TeraTerm:
 
CMD>STB,00A0
CMD>IB,Z
CMD>IB,03,AAFE
CMD>IB,16,AAFE1080007361726B31313007
CMD>R,1

Then, verify that the Beacon Scanner App detects the beacon. As you can see in the screenshot below, the App detected the Eddystone-URL beacon emitted from the analyzer and pointing to the URL http:www.sark110.com. Also, the App estimates the distance to the beacon based on the TX power value indicated in the Eddystone frame and the received power level, RSSI. 


Now, we will enter in the details of the commands used to set the beacon:

CMD>STB,00A0
This command sets the advertisement interval for the beacons. The interval parameter unit is 0.625ms, so in this case it was set to 100ms (160*0.625ms)

CMD>IB,Z
IB command is used to set the payload, using the format IB,<hex8>,<Hex>. Please refer to the detailed information in the module User's Guide at download link.
Parameter "Z" is used to clear all Advertisement Structures (AD).

CMD>IB,03,AAFE
This command sets the complete list of 16-bit UUIDs for an Eddystone payload.

CMD>IB,16,AAFE1080007361726B31313007
This command sets the sevice data for the Eddystone-URL payload. Details are as follows:
  • AAFE: Eddystone UUID
  • 10: frame type is URL 
  • 80: TX power = 0x80 (approximate value; not calibrated)
  • 00: URL Scheme prefix = http://www.
  • 7361726B31313007: encoded URL sark110.com
For encoding the URL, there is an online URL generator that facilitates this task.

CMD>R,1
This command forces a reboot of the module, so all previous made setting changes takes effect. The module exits command mode, so to return to command mode type $$$ if necessary.

Conclusion

This post shows that the SARK-110-ULM can be used as a experimentation platform for the RN4871 BLE module and it will provide you some learning experience on BLE beacons. I leave to the reader to modify the commands to configure an Eddystone-UID beacon or an Apple iBeacon.

Comments

Popular posts from this blog

Software arsenal for the HackRF One

Simple impedance meter project with STM32F4 Discovery board

Python notebooks and the SARK-110 Antenna Analyzer