Decoding iBeacon Advertising Using Javascript

iBeacon advertising consists of a UUID, major, minor and measured power. To decode the advertising using Javascript:

function decodeIBeacon(packet) {
  var uuid = packet.substring(4, 40);
  var major = parseInt(packet.substring(40, 44), 16);
  var minor = parseInt(packet.substring(44, 48), 16);
  var power = parseInt(packet.substring(48, 50), 16) - 256;

  var beacon = {
    uuid: uuid,
    major: major,
    minor: minor,
    power: power
  };

  return beacon;
}

This function takes a hexadecimal string representation of an iBeacon advertisement packet as input and decodes it into an object that contains the UUID, major and minor values and the measured power (measured in dBm) of the beacon.

To use this function, you need to extract the iBeacon advertisement packet from the Bluetooth Low Energy advertisement data received by the BLE scanning device. The iBeacon advertisement packet typically starts with a pattern similar to the following: 02 01 06 1a ff 4c 00 02 15. You can extract the iBeacon part by searching for these bytes in the advertisement data and then take the next 20 bytes as the packet.

View iBeacons

Subscription-free Bluetooth Gateways

Bluetooth to WiFi gateways allow Bluetooth devices to communicate with WiFi networks and onward to local or Internet servers. A gateway converts the Bluetooth data into data that’s received at the server. This data usually includes the gateway MAC address, the beacon MAC address, the received signal strength (RSSI) and the raw beacon payload that’s usually iBeacon but can alternatively contain sensor information.


Some commercial gateways require financial subscriptions and use of a specific Internet platform. All gateways BeaconZone supply have open HTTP and MQTT data format allowing use of your own local or remote server. This is much more cost-effective and eliminates the need for ongoing fees. Another advantage of a gateway that doesn’t require a subscription is that it offers greater privacy and security. Platforms may collect and store user data that can raise concerns about privacy and security.

Not using a subscription-based platform means you are not dependent on a provider’s technical issues. You also become isolated from any existential business provider issues that might cause large increases in pricing or the service disappearing because the company is no longer in business.

Controlling your own server ultimately provides more options for customisation and scalability, allowing you to meet specific requirements that are unique to your business processes.

Temperature Powered Bluetooth Beacons

Bluetooth Low Energy (BLE) beacons transmit a radio signal at regular intervals, powered by small batteries. The batteries need periodic replacement that can be time-consuming and costly when a large number of beacons are in use. There’s a new paper from Rzeszów University of Technology, Poland on Bluetooth Low Energy Beacon Powered by the Temperature Difference.


The paper proposes a power source that gathers energy through the Peltier effect. As temperature differences between two surfaces are present in most environments, the authors evaluated this energy source’s effectiveness in powering the beacons through measurements and simulations. They measured the beacon’s power supply demand in different modes and examined the Peltier module under different loads and temperature differences.


Based on the data gathered, they defined an energy conditioning system sufficient to power the beacon at a given temperature difference and developed a model of the proposed device. This solution eliminates the need for batteries, making the beacon maintenance-free.

New Bluetooth Location Market Research

Bluetooth SIG, the organisation responsible for Bluetooth standards, has a new Bluetooth® Market Update in collaboration with ABI Research. Bluetooth covers a large range of device types and application areas. Here are some insights related to location services.

Bluetooth location services device growth will trend significantly upward and return to pre-pandemic forecasts due to heightened awareness of the benefits of Bluetooth location services. There will be 2.46x growth in annual Bluetooth location services device shipments from 2023 to 2027.

Bluetooth real time location systems (RTLS) are set for rapid growth. New regulatory and safety requirements in manufacturing, stricter compliance procedures and sustainable operation requirements are making RTLS solutions more attractive. There will be 178,000 Bluetooth® RTLS implementations by the end of 2023. Many commercial and industrial facilities are now relying on asset tracking solutions to optimise resource and inventory control. The commoditisation of off-the-shelf Bluetooth asset tracking gateways and beacons are major drivers behind continued growth. 112 million Bluetooth asset tracking devices will ship in 2023.

Read about BeaconRTLS™

Read about PrecisionRTLS™

Is it Possible To Use One App to Manage All Beacons?

There are lots of brands of iBeacon and Eddystone beacon. Each brand has its own management app. We have often been asked,

“Is it possible to have just one app to manage different brands of beacon?”

While it’s technically possible, there’s no incentive for anyone to create such an app. Creating just one app to manage one beacon brand, across iOS and Android is significant effort in itself.

Google identified this problem and created the Eddystone Configuration GATT Service. The idea is that if manufacturers used just this, apps and beacons would be inter-operable. However, people want to configure iBeacon as well as Eddystone. Manufacturers also want to allow users to configure and read sensor data. Also, using Eddystone Configuration GATT Service software in all future beacons does nothing to help manage the large number of beacons that are already out there.

As of writing this, in 7 years since Eddystone Configuration GATT Service was published, no apps have been published that work with the Eddystone Configuration GATT Service. However, the Nordic nRF Connect app does understand some of the Bluetooth Characteristics to better read these kinds of beacons. There hasn’t been a rush for manufacturers to use Eddystone Standard GATT.

Back to the question. It looks like there will be a separate app per manufacturer for the foreseeable future.

SWOT Analysis of Using Beacons in Retail

There’s a recent paper by Ruchita Pangriya, of L. S. M. Government P. G. College, India on Beacon Technology the Future of Retail: A Review of the Literature and SWOT Analysis (pdf). The paper addresses the, so far, limited use of beacons in retail. The paper says:

“Despite the enormous scope in this field… many people are unaware of this technology”

The paper describes a systematic review of current literature and does a SWOT analysis on beacons. It covers the results of 80 academic papers and two-phase interviews. The first phase of interviews was with six experts in the area of digital technology and retail.

The second phase questionnaire was sent to 46 customers who had experienced this technology.

Challenges include:

  • The readiness of various stakeholders to adopt the technology on a large scale
  • Balancing customer personalisation, privacy and also respecting regulations on direct marketing
  • Ensuring customers have an app and Bluetooth on

Opportunites include:

  • The potential to revive the bricks and mortar retail model
  • The ability to integrate offline operations into the online world
  • The possibility to better serve customers with superior personalised experiences, customised notifications and loyalty benefits
  • Improving efforts to match advertising endeavours with customer conversions

It was found that in order to use beacons in retail, retailers need to educate customers and tell them about the benefit of using Beacon driven apps.

The paper spreads the misconception that:

“Bluetooth-connected devices are not battery friendly, and very few customers keep their Bluetooth activated all the time”

This used to be so, but is no longer the case with modern smartphones using the latest iOS and Android APIs.

More Accurate Beacon Locating Using AI Machine Learning

There’s new research in the Bulletin of Electrical Engineering and Informatics on Bluetooth beacons based indoor positioning in a shopping malls using machine learning. Researchers from Algeria and Italy improved the accuracy of RSSI locating by using AI machine learning techniques. They used extra-trees classifier (ETC) and a k-neighbours classifier to achieve greater than 90% accuracy.

A smartphone app was used to receive beacon RSSI and send it to an indoor positioning system’s data collection module. RSSI data was also filtered by a data processing module to limit the error range. KNN, RFC, extra trees classifiers (ETC), SVM, gradient boosting classifiers (GBC) and decision trees (DT) algorithms were evaluated.

The ETC model gave the best accuracy. ETC is an algorithm that uses a group of decision trees to classify data. It is similar to a random forest classifier but uses a different method to construct the decision trees. ETC fits a number of randomised decision trees on sub-samples of the dataset and uses averaging to improve the predictive accuracy and control over-fitting. ETC is a good choice for applications where accuracy is important but the data is noisy and where computational efficiency is important.

Bluetooth Classic vs Bluetooth LE

Beacons use Bluetooth Low Energy (LE). Some people confuse this with ‘Bluetooth Classic’ so here’s concise explanation.

Bluetooth Classic or, more technically, Basic Rate/Enhanced Data Rate (BR/EDR) is an older Bluetooth standard announced in 1998. Bluetooth Low Energy (LE) was introduced in 2010, as part of the Bluetooth 4.0 specification. It came out of Nokia’s previous Wibree technology.

Although Bluetooth Classic is older, it is not obsolete and is instead used for different types of applications such as streaming audio and video. Bluetooth Classic is used when transferring files by Bluetooth between devices, such as photos, videos, and documents. It’s also commonly used for hands-free calling in vehicles. Bluetooth Classic is also used in medical devices such as glucose meters, blood pressure monitors, and heart rate monitors to transmit data to smartphones or other devices. Bluetooth Basic Rate/Enhanced Data Rate (BR/EDR) requires pairing, the process of establishing a secure wireless connection between the two Bluetooth-enabled devices.

Bluetooth LE is designed for applications that require lower power consumption and low data transfer rates such as fitness trackers, smartwatches, beacons and other IoT devices. It uses a different protocol for data transmission which allows it to achieve higher throughput using smaller packet sizes. Bluetooth LE does not need pairing.

Both Bluetooth Classic and Bluetooth LE use the 2.4GHz unlicensed frequency band which is part the industrial, scientific, and medical (ISM) frequency band. Bluetooth Classic and Bluetooth LE differ in how they use the frequency and can coexist together.

Tracking Work in Progress (WIP) with Bluetooth Beacons

Work-in-progress (WIP) monitoring is tracking the progress of production. It allows managers to make informed decisions about resource allocation and scheduling as well as determine the current status of a job or subassembly. Work-in-progress (WIP) monitoring is part of Industry 4.0, the term used to describe the fourth industrial revolution, which use digital technologies to create more efficient and automated production processes.

WIP monitoring saves costs by identifying bottlenecks in the production process, reduces the amount manual tracking and enables proactive decisions. Also, real-time data can be used to optimise production schedules and minimise downtime, reducing the overall cost of production.

Tracking work in progress (WIP) has several advantages for manufacturing and production operations:

  • Improved Production Planning: By tracking WIP, manufacturers can better understand how much inventory they have at each stage of production, which can help them plan for future production runs, adjust staffing levels, and optimise production schedules.
  • Better Resource Allocation: WIP tracking can help identify areas of the production process where resources are being over-utilised or under-utilised. This information can be used to allocate resources more efficiently, reducing waste and increasing productivity.
  • Quality Control: WIP tracking can help identify quality issues earlier in the production process, allowing manufacturers to take corrective action before the product reaches the final assembly stage. This can reduce the amount of rework required and improve overall product quality.
  • Reduced Lead Times: By tracking WIP, manufacturers can identify bottlenecks in the production process and take action to resolve them more quickly. This can help reduce lead times and improve on-time delivery to customers.
  • Cost Savings: By optimising production schedules and resource allocation, WIP tracking can help manufacturers reduce costs associated with over-production, inventory storage, and waste.

Bluetooth beacons can be used to track WIP by attaching a small, low-power Bluetooth device to each job or unit of production. These beacons transmit a unique signal that can be detected by Bluetooth-enabled gateways located throughout the production line. This allows for real-time tracking of the location and status of each job or unit of production.

Some legacy system use barcodes or RFID for WIP tracking. The problem with these is the information is only as up-to-date as the last scan. Bluetooth beacons transmit all the time allowing for real-time tracking of WIP with no manual scanning. Additionally, Bluetooth beacons can be easily integrated with existing IoT infrastructure, making them a cost-effective solution for WIP monitoring. RFID and barcodes, on the other hand, require specialised equipment to read the tags. Bluetooth beacons can transmit data up to 100 meters or more, also making them more suitable for large spaces such as warehouses and factories.

Bluetooth beacons

BeaconRTLS™

Configuring Bluetooth Beacons

The configuration of a Bluetooth beacon can vary depending on the manufacturer and the specific use case. However, in general, the configuration includes iBeacon settings such as the beacon’s UUID (Universally Unique Identifier), major and minor values, transmit power, advertising interval, and other parameters that define the behaviour of the beacon.

  • UUID: This is a 128-bit value that uniquely identifies the beacon. It can be used by an application to identify a beacon among many others in the vicinity.
  • Major and Minor values: These are 16-bit values that can be used to group beacons into different categories or to identify specific beacons within a group.
  • Transmit power: This setting determines the strength of the signal transmitted by the beacon. A higher transmit power will increase the range of the beacon, but will also consume more battery power.
  • Advertising interval: This setting determines how often the beacon broadcasts its signal. A shorter interval will provide more frequent updates on the beacon’s location, but will also consume more battery power.

These settings are configured using smartphone apps. These use Bluetooth GATT (Generic Attribute Profile), a protocol used to define the way that data is exchanged between Bluetooth devices. Some beacon manufacturers also publish how they use Bluetooth GATT’s services and characteristics to update these settings so that you can also update them via your own apps or from other Bluetooth devices.