<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>TraceMeNow: an Open-Source Software Framework for Indoor Localization Applications</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mauro Borrazzo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giuseppe D'Ambrosio</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vittorio Scarano</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carmine Spagnuolo</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dipartimento di Informatica, Università degli Studi di Salerno</institution>
          ,
          <addr-line>Salerno</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The increased number of smartphone-connected devices and the pervasive presence of sensors enabled the application of localization and tracking technologies in multiple contexts. Health, customer care, traveling, crowd management are just some of the possible fields where an Indoor Positioning System could be useful. Despite the efort of the research community, the integration of an Indoor Positioning System within an application is still dificult since it requires expertise in diverse fields like communication technologies, localization techniques, and hardware. This paper presents TraceMeNow, an open-source framework for developing applications comprising an Indoor Positioning System based on Bluetooth Low Energy and low-cost hardware. TraceMeNow is designed to improve developers' experience without requiring specific knowledge to be used, thus aiming to be a simple and valuable tool suitable for diferent situations and accessible to any developer. TraceMeNow adopts a modular architecture enhancing the interoperability between components and supporting the developer throughout all the implementation phases. We aim to show the flexibility and ease of use of our framework by presenting an application to address a real-world use case. TraceMeNow aims to reduce the cost and the efort needed to create an application comprising an Indoor Positioning System, providing the basis for all the components and relying on mainstream technologies for hardware and communication. Moreover, TraceMeNow allows developers exploiting cloud computing when facing large scenarios with specific requirements such as high scalability and reliability, maintaining the same ease of use since the interaction with the provider is entirely abstracted.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Indoor Localization</kwd>
        <kwd>Indoor Positioning System</kwd>
        <kwd>Bluetooth Low Energy</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Nowadays, Indoor Positioning System (IPS) is a growing research area due to the rising necessity
to track people and objects in a variety of contexts [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] exploiting indoor localization. This field
involves several technologies to obtain information associated with a particular position within
buildings. The global market size of indoor localization is expected to increase from USD 6.1
billion in 2020 to USD 17.0 billion by 2025 [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The major growth factors are the increased number
of smartphone-connected devices and location-aware technologies, as well as the pervasive
presence of sensors and smart objects, enabling the integration of indoor localization in countless
applications. Most IPSs are used in diferent vertical sectors, such as health, to help in hospital
tracking [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and improve epidemic control measures [5], workspace-management [6], and
tourism [7], but there are many possible use cases. Spacing from customer care and traveling,
from crowd management and surveillance, many fields could benefit from adopting an IPS
improving people’s experience, services, security, and organization [8].
      </p>
      <p>Despite the great interest of the scientific community, indoor localization is still far from
mature and has many open challenges [9]. Developing an application exploiting an IPS requires
knowledge in diverse fields due to the number of involved technologies, techniques, and
algorithms. Programmers need to choose the communication technology, the localization
techniques, the hardware involved besides the software to use, and the application design.</p>
      <p>Although some attempts have been made to ease the development of an IPS, it is still an
open research area. In general, prior studies are limited to a subset of issues regarding indoor
localization, namely identifying the most suitable communication technology or improving the
position estimation through signal processing and filtering. Moreover, no other works in the
literature focus the attention on the developers’ experience. The existing solutions are usually
related to a specific context or hard to use for non-experts and rarely provide code access.</p>
      <p>The aim of this work is to propose a tool specifically designed to support programmers for
the development and the integration of an IPS within an application without requiring deep
knowledge in signal processing, communication technologies, or hardware implementation.</p>
      <p>In this work, we introduce TraceMeNow, an open-source framework for developing
applications exploiting IPS, based on Bluetooth Low Energy (BLE). TraceMeNow allows programmers
to build software thanks to a modular architecture simplifying the implementation of tracking
and localization modules within an indoor environment using low-cost devices. Each
component of the framework has a dedicated library with default functionalities designed to support
the developer in several situations. Additionally, every method can be easily customized, and
new features can be introduced if needed. Furthermore, the framework includes the possibility
to exploit cloud computing resources to gain scalability and manage large scenarios. Complete
code, full documentation and other material about TraceMeNow is available on GitHub1.</p>
      <p>We present the flexibility and ease of use of TraceMeNow by describing an application
designed to address a real-world scenario. We propose the Attendance Management System (AMS)
helping to manage the presence and the punctuality of employees within companies, ofices,
and factories. In detail, AMS turns employees’ smartphones into an access badge automatically
detected and tracked when located within the workplace where the tracking nodes are installed.
The devices sense the employees’ movements and report the information to a central server
monitoring the building. The application complete code is available on GitHub2.</p>
      <p>The paper is structured as follows. Section 2 describes the related work. Section 3 presents
TraceMeNow, its architecture, and its components. Section 4 introduces the AMS design.
Section 5 includes the conclusion and future work.</p>
      <sec id="sec-1-1">
        <title>1TraceMeNow oficial GitHub repository - https://github.com/isislab-unisa/trace-me-now 2TraceMeNow: Attendance Management System - https://bit.ly/attendance-management-system</title>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>Several studies in the literature regard techniques to improve the accuracy of position estimation,
using algorithms and filtering techniques concerning signal processing. Jiang et al. [ 10] described
an algorithm based on trilateration and a dynamic-circle-expanding mechanism, while Yan
et al. [11] proposed a multi-dimensional scaling-based approach. The work of Zhuang et
al. [12] exploited a more sophisticated technique based on a combination of channel-separate
polynomial regression model, channel-separate fingerprinting, outlier detection, and extended
Kalman filtering to increment the accuracy in smartphone-based indoor localization. The
same problem is addressed in Satan et al. [13] and Ciabattoni et al. [14], proposing an Android
application and an architecture for IPS, based on smartphones, respectively.</p>
      <p>
        Another area of research in indoor localization concerns systems to address specific situations
or tied to particular hardware. SmartITS [15] is a human identification, monitoring, and location
tracking system based on GPS, Wi-Fi, and BLE. However, the system needs devices with certain
characteristics, and the authors do not provide an open-source implementation. Similar issues
are found in the IoT-based and BLE-based IPS presented in Mekki et al. [16] since it requires
specific devices. Regarding solutions for vertical sectors, the work of Nguyen et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] proposes
an asset tracking and real-time location system for hospitals using RSSI-based estimation and
BLE. Belka et al. [7] presents an IoT solution for BLE-based indoor tracking systems for smart
tourism exploiting IoT sensors, while Li et al. [17] introduces a framework for indoor localization
with dedicated algorithms for emergency systems.
      </p>
      <p>Other works in the literature report several solutions aiming to improve the development
process of an IPS. Anyplace 4.0 IoT [18] is an open-source architecture for localization using
the physical environment data stored in a database for estimation. Teran et al. [19] employed a
similar approach introducing a modular system able to compute the position after a training
and calibration phase. A framework for IPS development is present in Jimenez et al. [20] with
an open-source multi-sensor framework for indoor smartphone positioning providing a series
of tools to collect and interpret data. However, the system requires knowledge in managing and
exploiting the information received from the diferent sensors.</p>
      <p>The scientific community exhibited a growing interest in indoor localization, proposing
various studies addressing diferent aspects of the topic. However, although some attempts
have been made to ease the development and the integration of an IPS within an application,
it is still an open problem. As described before, the existing solutions are complex to use
or focus only on acquiring better positioning accuracy giving little attention to code and
developer experience. A practical IPS should bear the properties like easy implementation,
acceptable localization accuracy, feasible system cost, scalability and robustness, and reasonable
computational complexity [9]. Moreover, an application needs to be accurately designed to
exploit an IPS with these characteristics. Programmers have to deal with the diferent hardware
and software technologies included, besides writing the code.</p>
      <p>
        The objective of this work is to propose a simple and valuable tool suitable for any situation
and accessible for developers with low experience in indoor localization and related technologies.
We introduce TraceMeNow, an open-source framework for developing IPS compatible with
standard and cheap devices, suitable for any scenario. The flexibility of TraceMeNow unties it
from a specific usage, as it happens in existing works dedicated to specific contexts, such as
hospitals [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], smart tourism [7] or emergency management [17]. TraceMeNow does not require
a strong knowledge of signal processing, communication techniques, or hardware since it ofers
a series of libraries comprising of default implementations designed to be helpful in most cases,
as well as methods to customize existing functionalities and introduce new ones.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. TraceMeNow</title>
      <p>TraceMeNow supports programmers in developing applications comprising localization and
tracking capabilities providing interoperability between components thanks to its modular
architecture. The IPS implemented with the framework consists of mobile nodes, whose position
is unknown, and several localization nodes, with known locations, placed within the indoor
environment communicating with an application module acting as a server.</p>
      <p>The position estimation and the communication between the nodes rely on BLE, a protocol
that already demonstrated its value in IPS [21] [22]. BLE is designed for short-range wireless
transmission of small amounts of data with low energy and cost, granting a convenient
tradeof between power consumption and accuracy [ 23]. TraceMeNow exploits the one-to-many
communication provided by BLE called broadcasting, enabling data sent to any listening device
in range. Specifically, the mobile nodes transmit BLE packets in broadcast, allowing the nearby
anchor node to detect and localize them. Another reason for using BLE is the high market
penetration of the protocol [22] that increases the hardware compatible with our framework
since nowadays, almost every smartphone, tablet, and smart device supports BLE or can be
equipped with cheap external modules.</p>
      <p>TraceMeNow is designed to guide the developer through the implementation and integration
of the IPS within any application, thanks to the libraries available for each system component.
The framework proposes several default implementations useful in most scenarios as well
as methods to modify the existing features and/or introduce new ones. For instance, other
localization techniques can be used, or additional components can be included.</p>
      <p>The modular architecture of TraceMeNow is illustrated in Figure 1 where each element
corresponds to a specific component of the IPS. The system includes mobile nodes, tracking
nodes, the communication protocol, and the application module. The mobile node can be
any device with a BLE and Wi-Fi interface on which an application built with TraceMeNow
is installed. This enables the node to continuously broadcast a message with some defined
information via BLE while the Wi-Fi interface is used to interact with the application module
using a specific communication protocol. A group of tracking nodes is responsible for the
localization process and consists of embedded systems supporting the two wireless technologies
used. TraceMeNow provides the localization system exploiting the BLE interface and the
communication protocol using Wi-Fi. The application module handles the whole IPS and can be
hosted on a Cloud or on-premise architecture. It contains a lightweight server engine, a database
to store the collected data, maintaining the global status of the system, and the TraceMeNow
communication protocol based on the Event/Notification system.</p>
      <p>The workflow of an IPS based on TraceMeNow is the following:
1. the mobile node continuously sends BLE packets in broadcast;
2. the nearby tracking node detects the packets, collects the information about the mobile
node, computes the distance, and sends all data through the Event/Notification system;
3. the Event/Notification system receives the message causing the generation of an event
triggering a notification;
4. the application module receives the notification about the new event, collects the attached
information, and executes the correspondent functions, if needed.</p>
      <p>The modular architecture adopted in TraceMeNow allows developers implementing a fully
functional IPS easily and quickly using the libraries available for each component. In particular,
a series of default implementations provides the basic tracking and localization functionalities
as well as methods for communication and data storage. Moreover, the developer is supported in
customizing and extending the system functionalities. For instance, diferent position estimation
techniques can be integrated within the localization system, and the Event/Notification system
can handle additional events. Furthermore, the server engine exposes its functionalities using
a series of RESTFul APIs allowing developers to easily integrate the application module with
other components such as web app or visualization engines.</p>
      <sec id="sec-3-1">
        <title>3.1. Mobile node</title>
        <p>TraceMeNow provides a library to implement a mobile application that will turn any BLE device
into a BLE beacon, i.e., a node that continuously sends BLE packets in broadcast. These packets
are based on the iBeacon protocol, firstly developed by Apple but currently compatible with
a wide selection of hardware and operating systems. The iBeacon protocol defines a specific
data structure included in the BLE packet containing a Universal Unique Identifier (UUID) and
additional information [24].</p>
        <p>The library is based on Android and comprehends all the dependencies and requirements
needed to build a ready-to-use application. The methods available help the developer to set
up, start and stop the broadcast transmission making the mobile node visible and detectable
by the tracking nodes. Moreover, functions exist to communicate with the application module
using the Event/Notification system. In detail, the mobile node can send a message to a topic
or subscribe to it to receive notifications when an event occurs. If the notifications are no
longer required, the node can unsubscribe from the topic. The developer can implement a
function triggered when a message is sent on a specific topic, defining the behavior of the node
in response to the notification.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Tracking node</title>
        <p>The tracking node library is based on Javascript and runs over a NodeJS engine3 requiring a
device with a compatible operating system in addition to the BLE and Wi-Fi interfaces. The
methods included allow the developer to start and stop the scan of the room and communicate
with the application module using the Event/Notification system. Once the scanning is started,
the tracking node will automatically localize and track the mobile nodes within the range,
sending messages according to the events recorded. It is important to note that each tracking
node needs to be configured with the room number where it is placed to perform the localization
since the position must be known. The library provides specific methods supporting the addition
of new functionalities, such as introducing new actions in response to events. The default
configuration of TraceMeNow involves a series of Raspberry Pi boards as tracking nodes.
However, any hardware with Wi-Fi and BLE, compatible with NodeJS, can be used. Raspberry
Pi is a portable computer board with a Linux-based operating system particularly suitable for
indoor localization thanks to its low cost, low power consumption, and high availability of
built-in hardware like Wi-Fi and BLE module. The use of Raspberry Pi for indoor localization
is not a novelty in literature. Several works exist including these boards within their IPS
architecture [7] [18] [25].</p>
        <p>Localization system The localization system of TraceMeNow is included in the tracking
node and the default implementation uses the Received Signal Strength Indicator (RSSI) to
estimate the position.</p>
        <p>The RSSI is one of the most used methods for localization in IPS [26] since it does not require
additional hardware or complex software [9]. The RSSI value indicates the power signal strength
of a received radio signal. The higher the value, the smaller the distance between the sender
and the receiver. The default implementation present in the library uses the most commonly
adopted formula, described in Shang et al. [27], to estimate the distance between the mobile
node and the tracking node.</p>
        <sec id="sec-3-2-1">
          <title>3NodeJS - https://nodejs.org</title>
          <p>The formula employing the RSSI is described below:
• : path loss exponent.</p>
        </sec>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Communication protocol: Event/Notification system</title>
        <p>The Event/Notification system realizes the communication protocol of TraceMeNow exploiting
the MQTT protocol. MQTT is a lightweight publish/subscribe messaging protocol ideal for
connecting remote devices with a small code footprint and minimal network bandwidth4.</p>
        <p>The system includes two MQTT topics for each event, with some exceptions that use only one
topic. The first one is the event topic, where the tracking node publishes the message indicating
the detection of an event. The second one is the notification topic, where the function triggered
by the event sends the processed data in the form of notification and where the components
interested in a particular event will subscribe. When a change in the IPS occurs, a message with
attached information is sent on the event topic, triggering a function. This function performs
some action and then publishes a response on the notification topic. The use of two or more
topics for each event type improves communication management granting more control to the
developer. For instance, the interested device can subscribe only to the notification topic where
the function will publish the elaborated data.</p>
        <p>The framework provides a default implementation of the Event/Notification system, including
the most commonly occurring events that may happen within an IPS. However, custom events
can be easily implemented using TraceMeNow libraries, defining the related functions for each
of them.</p>
        <p>The topics of the default Event/Notification system are shown in Table 1 and detailed below:
• device/new - contains the events related to the detection of a new mobile node. The
correspondent notify/new notification topic notifies all the subscribers every time a device
enters into the system;
• device/delete - contains the events related to the exit of a mobile node. The correspondent
notify/delete notification topic notifies all the subscribers every time a device leaves the
system;
• device/location - the position requests of a specific device. Publishing a message with
the uuid of the device of interest on this topic allows to receive the device position on
the correspondent notify/location/uuid notification topic, where the uuid will be the one
specified;
• notify/position/uuid - notifies all the subscribers every time the device position with the
specified uuid changes;</p>
        <sec id="sec-3-3-1">
          <title>4MQTT - https://mqtt.org</title>
          <p>• notify/change/uuid - notifies all the subscribers every time the tracing node of the device
with the specified uuid changes, i.e., moves under the range of a node diferent from the
previous one.</p>
          <p>All the messages exchanged through the MQTT protocol respect the default JSON format
depicted in Listing 1. However, following the customizable principle of TraceMeNow, the
developer can customize the message format adding additional values, modifying or removing
the existing ones. The default values are the following:
• uuid: unique identifier of the mobile node;
• lastPosition: distance in meters between the mobile node and the tracking node under
which it is located;
• lastSeen: time of the last interaction with the last seen tracking node;
• trackingNodeId: identifier of the last seen tracking node;
• roomNumber: identifier of the room where the device is located; the room corresponds
to the localization area of a tracking node.
{
}
"uuid": "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXX",
"lastPosition": "1.11",
"lastSeen": "11:11",
"trackingNodeId": "xxxx-xxxx-xxxx-xxxx-xxxxxx",
"roomNumber": "1"</p>
        </sec>
        <sec id="sec-3-3-2">
          <title>Listing 1: MQTT Message format representing a device in the system.</title>
        </sec>
      </sec>
      <sec id="sec-3-4">
        <title>3.4. Application module</title>
        <p>The application module manages the whole IPS and includes the server engine, the database,
and the Event/Notification system. The server engine represents the core of the application
module connecting all the diferent components. It maintains the global status of the system
within a NoSQL database, storing all the information of the devices seen so far. Moreover, the
server engine handles all the application functionalities implementing the functions executed
in response to the events received through the Event/Notification system. For example, when
a message is published on the notify/location/uuid topic, the server executes a query on the
database to get the device position with the specified uuid.</p>
        <p>TraceMeNow provides two diferent architectures for hosting the application module based
on the application requirements. The on-premise architecture is suited for small systems with
few devices involved and grants low cost if not null. The low requirements of the application
module enable the use of a regular computer for the execution. On the opposite side, when
facing scenarios with many devices involved, the cloud architecture grants the scalability and
the performance needed, keeping the costs low thanks to the appropriate use of the cloud
computing service models. TraceMeNow includes a library for each architecture handling all
the needed tasks automatically, from the connection with the database to the communication
with other components. However, the developer can customize each process and implement
additional functionalities, such as custom events and functions.</p>
        <p>On-premise architecture The on-premise architecture implements the application module
using a series of Docker containers, ensuring high compatibility and making the installation
as quick and simple as possible. In detail, TraceMeNow provides a Docker Compose file
which includes all the dependencies and the services needed to execute the application module
exploiting the TraceMeNow image available on DockerHub5. The server engine is realized
through several Python modules while the Event/Notifications system is based on Eclipse
Mosquitto6, an open-source message broker based on the MQTT protocol. The database exploits
MongoDB7, a cross-platform NoSQL database with high scalability and flexibility. Finally, the
security of the architecture relies on the Transport Layer Security protocol.</p>
        <p>Developers can add new functionalities following the standard workflow of TraceMeNow.
For instance, a new event can be introduced, creating one topic where it is generated, one where
the notification is provided, and defining the function triggered in response. The function can
be written in Python language, whose input parameters consist of the body of the message sent
on the event topic and the returned values are the response sent on the notification topic. Both
follow the JSON format defining a standard to follow simplifying the implementation process.
Cloud architecture The cloud architecture exploits cloud computing to realize the
application module. TraceMeNow handles all the processes regarding the cloud services, from their
creation to the integration within the IPS, abstracting the developer from the interaction with
the cloud provider.</p>
        <p>
          The use of cloud in indoor localization is a growing trend thanks to the advantages provided,
such as easy maintenance, cost-efectiveness, agility, flexibility, scalability, and efective
management [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. The integration of cloud computing within an IPS is based on the computation
ofloading process, a standard solution used in the Internet of Things (IoT) field to overcome the
        </p>
        <sec id="sec-3-4-1">
          <title>5TraceMeNow Image - https://hub.docker.com/r/isislab/trace-me-now 6Eclipse Mosquitto - https://mosquitto.org 7MongoDB - https://www.mongodb.com</title>
          <p>limits in computational power and memory of the devices. Computational ofloading transfers
intensive computational tasks from the local to an external environment, such as a cloud server,
granting the high scalability needed to manage thousands of devices or large scenarios.</p>
          <p>The application module for the cloud architecture employs Amazon Web Services (AWS)8.
The server engine is realized using AWS Lambda functions9, the serverless service of AWS. A
serverless function is a block of code that can be run on cloud with zero administration since the
provider automatically allocates the resources needed for the execution. Moreover, the serverless
paradigm follows the event-driven model meaning that a function is triggered in response to a
defined event, making it particularly suited for IPS. TraceMeNow uses Lambda functions to
perform the actions in response to the events and manage interaction with the other components.
The Event/Notification system is based on AWS IoT Core 10 acting as the MQTT broker. The
service enables the integration of IoT devices with other AWS resources like AWS Lambda. The
database is implemented through Amazon DynamoDB11, a serverless key-value and document
database with high performance and high scalability. The interaction with the application
module relies on Amazon API Gateway12, a service for the creation and management of APIs.
In detail, the APIs represent the trigger of the Lambda functions, working as entry points. For
instance, any database operation is performed using the endpoint provided by API Gateway.
Finally, the system security is based on AWS Identity and Access Management (IAM)13 that
enables the access management to the AWS services using specific roles and policies enhancing
the privacy protection within applications. Moreover, all the tracking nodes need to have an
AWS PEM certificate to access the environment.</p>
          <p>All the services required in the cloud architecture can be deployed using dedicated scripts
provided by TraceMeNow. After their execution, the resulting environment will be up and
running with the following resources:
• a group of Lambda functions related to the default events;
• an IoT Core instance configured to trigger the default Lambda functions;
• a group of API Gateway APIs acting as the entry points for the default Lambda functions;
• a DynamoDB database;
• a new IAM role and a new IAM policy.</p>
          <p>The developer can add new events and functions without using the AWS console, thanks to
specific scripts abstracting the interaction with the provider. In detail, the new Lambda function
can be written in Python code whose input parameters and returned values follow the same
rules of the on-premise architecture. A new API Gateway represents the entry point, while the
IoT core provides the implementation of the trigger event generated when a message comes
from a specific MQTT topic. The function deployment is done automatically through the scripts
making the integration phase as simple as possible.</p>
          <p>8Amazon Web Services (AWS) - https://aws.amazon.com
9AWS Lambda - https://aws.amazon.com/lambda
10AWS IoT Core - https://aws.amazon.com/iot-core
11Amazon DynamoDB - https://aws.amazon.com/dynamodb
12Amazon API Gateway - https://aws.amazon.com/api-gateway
13AWS IAM - https://aws.amazon.com/iam</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Use Case: Attendance Management System</title>
      <p>This section describes an application developed with TraceMeNow designed for a real-world
scenario to demonstrate the flexibility and ease of use of our framework. We developed the
Attendance Management System (AMS) that helps to track employees’ attendance, monitoring
their presence and punctuality by exploiting indoor localization. The application complete code
is available on GitHub14.</p>
      <p>Employee attendance tracking is a priority for many employers, making it easier to schedule
work shifts and identify any attendance issues. Nowadays, ofices and factories provide access
badges to their employees to report the start, the end of the work shift, and the breaks, checking
the respect of the working time. However, this kind of system is not safe and can be easily
tricked, for example, by clocking in and then leaving the workplace or by giving the badge to a
colleague who clocks in for multiple employees not present. Therefore, access badges are not
reliable and, in addition, the infrastructure needed to realize the system is usually expensive
since it requires proprietary hardware and software and frequent maintenance.</p>
      <p>An architecture composed of an IPS and an application specifically designed can overcome
the problems of traditional access card systems, introducing innovative solutions. The AMS
developed with TraceMeNow aims to be one of these solutions, providing an efective and
low-cost system easy to install and maintain. The idea is to turn employees’ smartphones into
badges using an Android application. A group of devices installed within the workplace senses
the employees’ movements and reports the information to a central server monitoring the
building. The application provides a registration phase to gain the information and the working
time of the employee. Based on that data, the smartphone shows a notification if the user leaves
the building during the work shift, asking for a reason. All the information acquired and the
movements detected are registered within a database accessible through a web interface. The
use of TraceMeNow reduces the cost and the efort needed to create AMS since the default
implementations included in the libraries already provide the basis for all the components. In
addition, the installation of the IPS is easy since the Raspberry Pi boards can be used as the
tracking node and placed everywhere within the building, thanks to their tiny size. Finally, the
upfront investment is small considering that smartphones with BLE are widely used, Raspberry
Pi boards are cheap, and the server does not require any specific requirements.</p>
      <sec id="sec-4-1">
        <title>4.1. Android application</title>
        <p>The Android application15 developed using the mobile node library turns the smartphone into
an access badge automatically detected and tracked when located within the workplace. On the
ifrst start, a registration form is shown where the employee inserts name and working time to
sign-up to the system. When activated, the badge constantly sends BLE packets in broadcast
with the employee data allowing the tracking nodes to identify and track them. Using this
mechanism, the badge is automatically registered as soon as it goes in or out of the building.
AMS can notice if the employee leaves the workplace during the shift by sending a notification
on the smartphone. The application does not allow other operations until a reason for the
14TraceMeNow: Attendance Management System - https://bit.ly/attendance-management-system
15TraceMeNow: AMS Android Application - https://bit.ly/ams-android-application
movement is provided. Finally, the badge can be disabled when needed, such as when the
employee is not at work or whenever the localization should not be performed. The overall
interface of the Android application is shown in Figure 2.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Detector</title>
        <p>The tracking node library transforms the Raspberry Pi boards into detectors16, allowing them
to scan the building and detect the employees’ smartphones. The boards communicate with the
central server reporting the information collected through the Event/Notification system. The
default implementation of TraceMeNow already provides the mobile node detection, position
estimation, and data report without requiring additional coding, simplifying the development
of the tracking node application.</p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Central server</title>
        <p>The central server17 handling AMS uses the application module library hosted on the on-premise
architecture. The default implementation realizes the data collection and the communication
with the boards and the smartphones. However, some additional events and functions are needed
to realize AMS. In detail, the system needs to get the information about all the employees, those
within the workplace or who left it at least once, in addition to the registration phase. The
Event/Notification system allows the central server managing all the events detected within the
building. Whenever a new device is detected, the database is updated and accessed to check if
the employee is late. On the other hand, when a badge is no longer within the workplace, the
server controls if the work shift is finished and, if not, sends a notification to the smartphone
asking for a reason.</p>
        <p>16TraceMeNow: AMS Detector - https://bit.ly/ams-detector
17TraceMeNow: AMS Central Server - https://bit.ly/ams-central-server</p>
      </sec>
      <sec id="sec-4-4">
        <title>4.4. Web interface</title>
        <p>A web interface18 built from scratch using React19 provides access to all the data of the system,
including employees’ information and notifications responses. Even though TraceMeNow does
not provide a specific library for a web client, its design helps the programmer developing the
interface efortlessly using the application module libraries. In detail, the Event/Notification
system allows the update of the visualized data in real-time, triggering a function each time
an event of interest occurs. Figure 3 shows the admin dashboard displaying all the employees
within the building and Figure 4 depicts the arrival of notifications.</p>
        <p>18TraceMeNow: AMS Web Interface - https://bit.ly/ams-web-interface
19React - https://it.reactjs.org</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>In this work, we presented TraceMeNow, an open-source framework for developing applications
exploiting a BLE-based IPS using low-cost hardware and without requiring specific knowledge.
TraceMeNow aims to provide a simple and valuable tool suitable for diferent situations and
accessible for any developers with low experience in localization systems, signal processing, and
communication technologies. The modular architecture of our framework grants interoperability
between components providing dedicated libraries for each one. Developers are supported
in all phases of the implementation, with default functionalities useful in most situations. In
addition, TraceMeNow includes methods to customize every aspect of the components or add
additional features. The IPS based on TraceMeNow consists of mobile nodes, whose position is
unknown, localized by a group of tracking nodes with known locations placed within the indoor
environment. An application module manages the whole system realizing the communication
protocol and the data storage. It can be hosted either on a cloud architecture or an on-premise one
allowing the developer to choose according to the requirements while still maintaining the same
ease of use. Full documentation and other material is available on GitHub20. TraceMeNow is
still under active development. Future work includes refining the existing methods, introducing
additional default implementations, and extending the compatibility with hardware and cloud
providers. We plan to introduce the support to other operative systems, like iOS, and further
BLE modules. The NodeJS library21 used is compatible only with specific models, even if the
most common ones. Although the developer can easily change the library, a more generalized
approach is preferred. Moreover, we intend to support other cloud providers besides AWS, such
as Microsoft Azure22 and Google Cloud Platform23. Finally, diferent techniques for localization
can be introduced as default implementation, allowing the developer to choose between a more
accurate or a more rough position based on the requirements of the IPS.
20TraceMeNow oficial GitHub repository - https://github.com/isislab-unisa/trace-me-now
21Noble - https://github.com/noble
22Microsoft Azure - https://azure.microsoft.com
23Google Cloud Platform - https://cloud.google.com
for localization and tracking of people within healthcare environment, Global IoT Summit,
GIoTS 2019 - Proceedings (2019).
[5] K. A. Nguyen, Z. Luo, C. Watkins, Epidemic contact tracing with smartphone sensors,
Journal of Location Based Services 14 (2020) 92–128. doi:10.1080/17489725.2020.
1805521.
[6] B. Doherty, N. Gardner, A. Ray, B. Higgs, I. Varshney, The shakedown: developing an
indoor-localization system for quantifying toilet usage in ofices, Architectural Science
Review 63 (2020) 325–338. doi:10.1080/00038628.2020.1748869.
[7] R. Belka, R. S. Deniziak, G. Łukawski, P. Pi¸eta, Ble-based indoor tracking system with
overlapping-resistant iot solution for tourism applications, Sensors (Switzerland) 21 (2021)
1–21. doi:10.3390/s21020329.
[8] R. Melamed, Indoor localization: Challenges and opportunities, Proceedings of the
International Conference on Mobile Software Engineering and Systems (2016) 1–2. doi:10.
1145/2897073.2897074.
[9] S. Subedi, J. Y. Pyun, A survey of smartphone-based indoor positioning system using
RF-based wireless technologies, Sensors (Switzerland) 20 (2020) 1–32. doi:10.3390/
s20247230.
[10] J. A. Jiang, X. Y. Zheng, Y. F. Chen, C. H. Wang, P. T. Chen, C. L. Chuang, C. P. Chen, A
distributed rss-based localization using a dynamic circle expanding mechanism, IEEE
Sensors Journal 13 (2013) 3754–3766.
[11] S. Yan, H. Luo, F. Zhao, W. Shao, Z. Li, A. Crivello, Wi-Fi RTT based indoor positioning with
dynamic weighted multidimensional scaling, 2019 International Conference on Indoor
Positioning and Indoor Navigation, IPIN 2019 (2019) 12–15. doi:10.1109/IPIN.2019.
8911783.
[12] Y. Zhuang, J. Yang, Y. Li, L. Qi, N. El-Sheimy, Smartphone-based indoor localization
with bluetooth low energy beacons, Sensors (Switzerland) 16 (2016) 1–20. doi:10.3390/
s16050596.
[13] A. Satan, Z. Toth, Development of bluetooth based indoor positioning application, 2018
IEEE International Conference on Future IoT Technologies, Future IoT 2018 2018-Janua
(2018) 1–6. doi:10.1109/FIOT.2018.8325586.
[14] L. Ciabattoni, G. Foresi, A. Monteriù, L. Pepa, D. Proietti, P. Luca, S. Federica, Real time
indoor localization integrating a model based pedestrian dead reckoning on smartphone
and BLE beacons, Journal of Ambient Intelligence and Humanized Computing 10 (2019)
1–12.
[15] T. Kulshrestha, D. Saxena, R. Niyogi, V. Raychoudhury, M. Misra, SmartITS:
Smartphonebased identification and tracking using seamless indoor-outdoor localization, Journal of
Network and Computer Applications 98 (2017) 97–113. doi:10.1016/j.jnca.2017.09.
003.
[16] K. Mekki, E. Bajic, F. Meyer, Indoor positioning system for iot device based on ble
technology and mqtt protocol, IEEE 5th World Forum on Internet of Things, WF-IoT 2019
- Conference Proceedings (2019) 787–792.
[17] N. Li, B. Becerik-Gerber, L. Soibelman, B. Krishnamachari, Comparative assessment
of an indoor localization framework for building emergency response, Automation in
Construction 57 (2015) 42–54.
[18] P. Mpeis, T. Roussel, M. Kumar, C. Costa, C. Laoudiasdenis, D. Capot-Ray, D.
ZeinalipourYazti, The Anyplace 4.0 IoT Localization Architecture, Proceedings - IEEE
International Conference on Mobile Data Management 2020-June (2020) 218–225. doi:10.1109/
MDM48529.2020.00045.
[19] M. Terán, J. Aranda, H. Carrillo, D. Mendez, C. Parra, Iot-based system for indoor location
using bluetooth low energy, 2017 IEEE Colombian Conference on Communications and
Computing (COLCOM) (2017) 1–6. doi:10.1109/ColComCon.2017.8088211.
[20] A. R. Jimenez, F. Seco, J. Torres-Sospedra, Tools for smartphone multi-sensor data
registration and GT mapping for positioning applications, 2019 International Conference
on Indoor Positioning and Indoor Navigation, IPIN 2019 (2019) 1–9. doi:10.1109/IPIN.
2019.8911784.
[21] Z. Jianyong, L. Haiyong, C. Zili, L. Zhaohui, Rssi based bluetooth low energy indoor
positioning, 2014 International Conference on Indoor Positioning and Indoor Navigation
(IPIN) (2014) 526–533. doi:10.1109/IPIN.2014.7275525.
[22] D. Giovanelli, E. Farella, D. Fontanelli, D. MacIi, Bluetooth-Based Indoor Positioning
Through ToF and RSSI Data Fusion, IPIN 2018 - 9th International Conference on Indoor
Positioning and Indoor Navigation (2018) 24–27. doi:10.1109/IPIN.2018.8533853.
[23] R. Khullar, Z. Dong, Indoor localization framework with WiFi fingerprinting, 2017 26th
Wireless and Optical Communication Conference, WOCC 2017 (2017). doi:10.1109/WOCC.
2017.7928970.
[24] M. Estel, L. Fischer, Feasibility of bluetooth ibeacons for indoor localization, Lecture Notes
in Informatics (LNI), Proceedings - Series of the Gesellschaft fur Informatik (GI) 244 (2015)
97–108.
[25] B. Bonné, A. Barzan, P. Quax, W. Lamotte, Wifipi: Involuntary tracking of visitors at mass
events, 2013 IEEE 14th International Symposium on "A World of Wireless, Mobile and
Multimedia Networks" (WoWMoM) (2013) 1–6. doi:10.1109/WoWMoM.2013.6583443.
[26] F. Haouari, R. Faraj, J. M. AlJa’am, Fog computing potentials, applications, and challenges,
2018 International Conference on Computer and Applications (ICCA) (2018) 399–406.
doi:10.1109/COMAPP.2018.8460182.
[27] F. Shang, W. Su, Q. Wang, H. Gao, Q. Fu, A location estimation algorithm based on rssi
vector similarity degree, International Journal of Distributed Sensor Networks 10 (2014).
doi:10.1155/2014/371350.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Yassin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Nasser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Awad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Al-Dubai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Yuen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Raulefs</surname>
          </string-name>
          , E. Aboutanios,
          <source>Recent Advances in Indoor Localization: A Survey on Theoretical Approaches and Applications</source>
          ,
          <source>IEEE Communications Surveys and Tutorials</source>
          <volume>19</volume>
          (
          <year>2017</year>
          )
          <fpage>1327</fpage>
          -
          <lpage>1346</lpage>
          . doi:
          <volume>10</volume>
          .1109/COMST.
          <year>2016</year>
          .
          <volume>2632427</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2] MarketsandMarkets™, Indoor Location Market by Component, Deployment Mode, Organization Size, Technology, Application, Vertical, and Region - Global Forecast to
          <year>2025</year>
          ,
          <year>2020</year>
          . https://www.marketsandmarkets.com/Market-Reports/indoor-location-market-
          <volume>989</volume>
          . html.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>C.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Shao</surname>
          </string-name>
          ,
          <article-title>Wifi-based indoor positioning</article-title>
          ,
          <source>IEEE Communications Magazine</source>
          <volume>53</volume>
          (
          <year>2015</year>
          )
          <fpage>150</fpage>
          -
          <lpage>157</lpage>
          . doi:
          <volume>10</volume>
          .1109/
          <string-name>
            <surname>MCOM</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <volume>7060497</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Q. H.</given-names>
            <surname>Nguyen</surname>
          </string-name>
          , P. Johnson, T. T. Nguyen,
          <string-name>
            <given-names>M.</given-names>
            <surname>Randles</surname>
          </string-name>
          ,
          <article-title>A novel architecture using iBeacons</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>