BLE Beacon - ESP32 - Eddystone TLM / URL
The BLE (Bluetooth Low Energy) Beacon is a hardware-unidirectional transmitter, also called a beacon, that cyclically transmits its identifier and various information to all available electronic devices within range. It most often transmits telemetry data e.g. temperature, supply voltage, uptime, GPS coordinates, counter of sent messages, time. For the device to interact with the beacon, it is necessary to have a specific application / software that is able to process the data and notify the user.
The ESP32 development platform has one 2.4 GHz antenna that can be used for WiFi or Bluetooth individually. In addition to Bluetooth 4.2 support, ESP32 also supports BLE. One of the modes that can be used for BLE is the creation of a Beacon.
Depending on the configuration and preset actions, the Android / iOS system user may be automatically notified of the Beacon within range by system notifications.
Software implementations for ESP32 in the Arduino IDE allows you to create the following BLE Beacon profiles:
iBeacon - Apple profile from 2013 designed for indoor navigation, used in Apple centuries, but also in the Grévin wax museum in Prague, for example.
Eddystone - a more popular BLE Beacon profile from Google from 2015, designed for the distribution of telemetry data, but also URL addresses.
Today we will take a closer look at the implementation of the Eddystone profile, specifically the telemetry variant - Eddystone-TLM and Eddystone-URL containing an executable hyperlink.
Eddystone contains 4 types of frames:
Eddystone-UID - plaintext identifier. It can be used for indoor localization, identification of a physical object
Eddystone-EID - encrypted identifier
Eddystone-TLM - Information on Beacone. Battery voltage, system data, sensor data
Eddystone-URL - A URL of up to 18 characters that redirects the device to a web page that runs under SSL (HTTPS). This type of Beacon contains an identifier in the header: Physical Web
Eddystone- TLM sample implementation:
The beacon transmits every 100ms
Transmits information about running firmware version, battery voltage (supply voltage), processor temperature, transmission counter, Beacon uptime
After the transmission, the ESP32 sleeps until the next transmission
To obtain information from Beacon on Android devices, we can use the nRF Connect for Mobile application from Nordic Semiconductor ASA. After installing and opening the application, we can scan the surroundings and view the distributed Beaconom data within range.
Eddystone-URL sample implementation:
The beacon transmits every 100ms
Transmits one telemetry information - TX signal power and URL (hypertext link to link shortener with redirection to HTTPS page)
After the transmission, the ESP32 sleeps until the next transmission
The Eddystone-URL profile has also added the ability to open a hyperlink directly in the main report.
For what purposes can a Beacon built on ESP32 be used?
- Information about the shop, operation, distribution of opening hours, contacts, link to the e-shop
- Information panels on castles, chateaux, museums or open-air museums for each building
- Mobile portable Beacon broadcast advertising for operation (thanks to the size it can be placed in a purse or watch [ESP32-PICO-D4])
- Beacon in the car - dissemination of information about the VIN number of the vehicle, battery voltage, registration number, mileage
- Internal navigation system to improve orientation
- Implementation into own application with client-side conversion of distance to Beacon based on received signal power
- Use for Escape Room games
- other interactive uses