*3.2. BLE Beacons*

The requirement of being able to infer the location of people within a building has been a long-standing problem, mainly due to more traditional localisation services signals such as Global Navigation Satellite System (GNSS) being unable to reach the devices of users, especially in the context of large-scale buildings. BLE beacons have been successfully used in a wide range of location-aware applications, including remote healthcare monitoring [35,36], indoor navigation [37], tourism [38] and transportation [39]. Here, we decided to use a building occupancy detection approach [40–42].

This approach requires a reduced number of Access Points (AP) compared to other Indoor Positioning Systems (IPSs), resulting in a lower deployment cost and a more unobtrusive deployment. Furthermore, the battery life of these devices ranges from 6 to 24 months [7], which minimises

maintenance requirements. Finally, the beacons use the BLE protocol, which is also used by most smart watch devices, and are able to communicate with the majority of mobile phones.

To construct the BLE beacons for our system, we used off-the-shelf Bluetooth Low Energy (BLE) technology based on Apple's iBeacon protocol. As shown in Figure 2, our beacons are based on a Raspberry Pi 2 Model B with an attached Bluetooth 4 LE module via a USB interface. The Raspberry Pis uses the BlueZ package to emulate a beacon and allow the customisation of the BLE advertising data being transmitted. Our beacons act as transmitters and broadcast a preset BLE advertising packet at set time intervals.

To separate our beacons from other unassociated Bluetooth traffic and to be able to identify the beacons individually, a small hierarchy was introduced, which made use of the different identifiers available in the beacon packet structure, as illustrated in Figure 3. The Universally Unique Identifier (UUID) is used to define a universal group between all beacons; thus, giving the ability of being able to distinguish the BLE packets being used in our experiments from other Bluetooth traffic. The major number is used to define local groups of beacons who's geographical locations are loosely connected. For example, beacons deployed on certain floors or buildings will have the same major number. Lastly, the minor number is used to identify each individual beacon within its local group.

**Figure 2.** Raspberry Pi-based beacon.

**Figure 3.** BLE beacon advertising packet structure.
