A LoRaWAN Architecture for Communications in Areas without Coverage: Design and Pilot Trials

: This article proposes a system based on a long-distance communications system with low economic and energy costs that allows connectivity to be carried out independently from the existing cellular coverage in the area. In addition, it describes the design, development, implementation and analysis of an Internet of Things (IoT) architecture based on Long-Range Wide-Area Network (LoRaWAN). Moreover, the system has been deployed as a prototype, and the behavior and scope of the system have been analyzed in various real environments: urban, rural and natural. The results obtained from the analysis show that the system is suitable for working in areas without coverage such as mountains.


Introduction
Natural disasters are unanticipated and damaging events. Nowadays, natural disasters are beyond our control and have a great impact on society. Some of the disasters that occur annually are volcanic eruptions, snowstorms, torrential rains and floods, as well as fires, mostly forest fires, which have devastated thousands of hectares. These natural disasters require management, monitoring and action by professionals such as the country's security forces, including rescue teams and firefighting teams, among others. These professionals act according to their duty and face extreme conditions in the interest of public safety, but they also act in times of emergency which endanger people or their property. To give a little more context with data, the number of fires reported in Spain in a year is over 500. These fires are usually reported to the Spanish National Center for Tracking and Coordination of Emergencies (CENEM) [1]. Approximately one fifth of these cases happened in the mountain areas of Andalusia, and with regard to civil emergency cases, there were more than 30 active searches for missing people per 100,000 people in Andalusia, as well as almost 1000 rescues performed by the Guardia Civil mountain rescue team in Spain [2,3]. In addition to the problem of natural disasters, there is also the problem of connectivity for these professionals when their work is carried out in areas where there is no cellular coverage. These areas without coverage are called shadow zones and are found in rural and natural areas where mobile network operators (MNOs) have not deployed their infrastructures, as shown in Figure 1.
Being aware of acknowledging the occurrence of natural disasters that might lead to emergency situations, joined with the existence of areas without cellular coverage and the lack of solutions to face these connectivity issues, motivated the realization of this work and thus the idea of developing a backup system for radio communications. This system offers Figure 1. Areas without mobile coverage in "Sierra Morena" (Andujar) and "Sierra Nevada" (Granada). The green areas correspond to areas where the intensity of coverage is high, the purple areas correspond to areas of medium intensity, and the unmarked areas are shaded areas.
Being aware of acknowledging the occurrence of natural disasters that might lead to emergency situations, joined with the existence of areas without cellular coverage and the lack of solutions to face these connectivity issues, motivated the realization of this work and thus the idea of developing a backup system for radio communications. This system offers an additional enhancement such as connectivity via chat and geolocation. Moreover, this network, called TeamUp, was tested by a civil protection team in "Sierra Morena" of Andujar.
This work is motivated by the need for communication in areas without cellular coverage. There are several alternatives for deploying this type of communication. In this work, LoRaWAN technology is used. This technology is not intended to work on the move, but it offers features such as low energy cost and a low cost for long-range communications. This technology has not been used in previous work for person-to-person communications. For these reasons, the following objectives are covered in this paper: • Design a centralized network employing LoRaWAN architecture. This architecture provides end-to-end security and a wide range of coverage. • Prototype the network with mobility, minimizing energy and economic costs.

•
Analyze the data rate required for sending end-to-end network information.

•
Conduct an experimental study of the performance of the proposed solution in different real environments: urban, rural and natural.
This article is structured as follows. The related works are described in Section 2. Section 3 presents an overview of the LoRaWAN technology. The proposed design of the network, called TeamUp, and its operation are described in Section 4. Then, Section 5 provides the hardware and software materials and the experimental set-up for the development of the work. In addition, the results obtained in the experiments are shown and explained. Finally, in Section 6, the theoretical and experimental results obtained are discussed. To conclude, the lines of future work are also depicted.

Related Work
This section relates different research to the main lines of investigation in this work. This work is innovative because it employs wireless networking technology in a field for which it is not intended. For this reason, the works mentioned below focus on only one of the lines of research. These lines of research consist of LoRaWAN technology and wireless networks used in mountainous areas or areas without cellular coverage.
Lalle et al. [4] proposed establishing multi-hop or peer-to-peer communication to increase the coverage of LoRaWAN networks. They set up a network of interconnected This work is motivated by the need for communication in areas without cellular coverage. There are several alternatives for deploying this type of communication. In this work, LoRaWAN technology is used. This technology is not intended to work on the move, but it offers features such as low energy cost and a low cost for long-range communications. This technology has not been used in previous work for person-to-person communications. For these reasons, the following objectives are covered in this paper: • Design a centralized network employing LoRaWAN architecture. This architecture provides end-to-end security and a wide range of coverage. • Prototype the network with mobility, minimizing energy and economic costs. • Analyze the data rate required for sending end-to-end network information.

•
Conduct an experimental study of the performance of the proposed solution in different real environments: urban, rural and natural.
This article is structured as follows. The related works are described in Section 2. Section 3 presents an overview of the LoRaWAN technology. The proposed design of the network, called TeamUp, and its operation are described in Section 4. Then, Section 5 provides the hardware and software materials and the experimental set-up for the development of the work. In addition, the results obtained in the experiments are shown and explained. Finally, in Section 6, the theoretical and experimental results obtained are discussed. To conclude, the lines of future work are also depicted.

Related Work
This section relates different research to the main lines of investigation in this work. This work is innovative because it employs wireless networking technology in a field for which it is not intended. For this reason, the works mentioned below focus on only one of the lines of research. These lines of research consist of LoRaWAN technology and wireless networks used in mountainous areas or areas without cellular coverage.
Lalle et al. [4] proposed establishing multi-hop or peer-to-peer communication to increase the coverage of LoRaWAN networks. They set up a network of interconnected peer-to-peer gateways to relay devices in urban areas. This work focused on a solution for monitoring smart water grids (SWGs). Different routing protocols in the mesh network were presented in the paper. The main problem of this type of network is its high energy consumption, as highlighted by the authors. In our work, a network with mobility using LoRaWAN is proposed. This network is centralized, with a wide coverage range and low energy cost. Therefore, users can move in a similar way. The solution proposed by Lalle et al. was intended for monitoring in urban areas. The network will transmit messaging and positioning asynchronously.
Chaudhari et al. [5] proposed a LoRaWAN-based system for monitoring smart sanitation systems in urban environments. In this paper, they described the system that detects the status of manhole covers and alerts the cloud server in real time. This server notifies the responsible person to solve the problem as soon as possible. LoRaWAN is also used in our work. Instead of monitoring, our solution proposes messaging and user tracking services. Similar to the work of Chaudhari et al., the information is stored on servers and used to improve the system.
Apriantoro et al. [6] presented signal quality analysis for an IoT disaster solution using LoRaWAN. The work proposed the deployment of a LoRaWAN network with multiple gateways and validation of the system by a driving test in an urban area. The results showed that the average RSSI was −100 dBm, with the RSSI varying between −24 dBm and −131 dBm, while the SNR varied between −24 dBm and 13 dBm. In our work, we only tested the system using a gateway. Validation was performed in three environments: urban, rural and natural). The results obtained in our analysis are similar to the one presented by Apriantoro et al.
Liu et al. [7] investigated how LoRaWAN networks are affected in their packet transmission performance in various scenarios. Their work presents a detailed study of the packet loss rate using measurements obtained over eight months in Shanghai. In addition, the study includes an analysis of the circumstances leading to data packet losses. The analysis employed in our work considers the packet loss circumstances of the study by Liu et al. In addition, we focused on analysis of the signal strength. For this reason, it is necessary that the transmissions arrive correctly at the receiver.
Basili et al. [8] proposed a network architecture that integrates a long-range linear network using LoRa. This linear network consists of a multi-hop network within a larger LoRaWAN network structure. The linear network elements act as data relays. They collect the LoRa-modulated packets and encapsulate them within the LoRaWAN network until they reach the application server. The operation of the intermediate nodes is controlled by an ad hoc routing protocol that aims to reduce power consumption and increase the lifetime of the system. On the other hand, the nodes are synchronized to reduce packet losses. The results showed that the proposed configuration was robust and guaranteed a long uptime. The proposal seems interesting. In the future lines of our work, we propose the inclusion of a meshed network of gateways that can offer a wide range. The main difference we propose is the mobility of the gateways. This causes the coverage range of LoRaWAN to be modified.
Kim et al. [9] presented a mechanism for sending packets to the Internet through multiple gateways. For this purpose, they studied the implementation of a multi-hop network in a LoRaWAN communication system that could communicate between gateways with a single hop. In addition, they included an analysis of the performance and feasibility of the proposed network. Our work is similar with respect to the analysis. In our case, a more concise field of use is proposed. Our system is intended for communications in areas without cellular coverage. Instead, a LoRaWAN network without multi-hop is used.
Valente et al. [10] developed a low-power node using LoRaWAN communication. Their work focused on sensors for measuring parameters in agriculture. They developed three different nodes. The nodes send data to a server through the gateway. Among the most important results, they showed that the energy consumption depended on the distance to the gateway and the number and type of sensors connected to each node, with the maximum consumption being ≈400 µA. Low-power commercial devices are used in our work. As in works seen previously, this work uses LoRaWAN for periodical data transmission. In our proposal, messages are sent when necessary due to emergency situations. Sato et al. [11] proposed a visualization system for mobile ad hoc networks (MANETs). This system implements packet flow visualization that allows for verifying the efficiency of packet flow and routing of the MANET network. A visualization service to the network manager is proposed in our work. This service is for the network owner and allows for displaying the messages and positions of the emergency team members. It should be noted that the work is carried out over a MANET network, and our deployment uses LoRaWAN technology.
Lien et al. [12] focused on supporting emergency rescue operations, especially city rescues due to building collapse. Normally, these disasters disable communications. This paper proposed an emergency communication and information system based on MANET to support the rescue of people in case of natural disasters. Both works have similarities due to the use cases, although the work of Lien et al. involved a MANET network using LoRaWAN for urban areas, and our system is a dynamic LoRaWAN network. This network is mainly intended for rural and natural areas.
Srivastava et al. [13] proposed a model of movement in an emergency scenario by managing the coordination task through four-way directional movement. The communication is considered to be based on MANET networks. Three routing protocols (LAR, DYMO and AODV) were analyzed in the paper. For each protocol, they estimated the delivered packet rate, the end-to-end delay, the routing load and the number of retransmissions. This work is focused on communication in emergency areas. In our work, we focus on this type of situation, although the system is intended for areas without coverage using LoRaWAN. In our analysis, the performance in terms of coverage range and transmission rate is tested.
Hayakawa et al. [14] developed an emergency rescue evacuation support system where mobile terminals exchange sensor information with each other using a MANET network. The system is activated when a disaster is occurring and searches for an evacuation route in real time. In addition, they analyzed the behavior of people in case of emergencies. Our work focuses on the communication of emergency teams. Our system features messaging and team tracking services using LoRaWAN technology.
Lien et al. [15] designed a multi-hop walkie-talkie communication system based on a P2Pnet. It is a MANET P2P network built with laptop computers. This system can provide support in case of a natural disaster when external assistance is blocked. The multi-hop mechanism enables communication while avoiding obstacles. The approach is interesting. A centralized LoRaWAN network with a wide coverage range is proposed. The devices used are cost-effective and have low power consumption. The main advantage is the change of the LoRaWAN coverage area when moving the central station.
Atutxa et al. [16] presented a reconfigurable architecture to support multimedia services in rescue operations such as radio communication or video surveillance. The services are provided by an unmanned aerial vehicle (UAV). This vehicle implements a standard digital mobile radio (DMR) hotspot and a video streaming server on an unmanned aerial vehicle (UAV). To achieve fast and flexible deployment of the planned services, they proposed virtualization using Kubernetes. In addition, they tested performance by measuring the deployment time and recovery time after disconnection. This work is complementary to our system, due to the fact that UAV nodes and our network can use the same frequencies.
The main problem of the system using UAVs is the operating time, while our network is designed with low-power devices to extend the operating time.
The mentioned works present a practical approach based on monitoring networks or parameters periodically using LoRaWAN technology. They also present the possibility of offering wide coverage ranges and extending them using multi-hop mechanisms. On the other hand, works related to emergencies propose the use of ad hoc networks for communications or the deployment of new infrastructures. Regarding our work, it is considered to be an intersection between the two points of view. We opted to work with low-power wide-area networks (LPWANs [17]) due to their low power and +20 dB gain with respect to the standard cellular system. LPWAN networks such as Sigfox, LTE-M and NB-IoT can provide extensive wireless connectivity between the IoT devices in the network. These technologies are complex and usually require high economic and energy costs compared with LoRaWAN [18]. This work is innovative due to using LoRaWAN for human-to-human emergency communications. In addition, the proposed system offers mobility despite being a centralized network.

LoRaWAN Wireless Technology
Due to the requirements of a long range and low power consumption, it was decided to focus on LPWAN standards. NB-IoT depends on 3GPP (4G or 5G) networks already deployed or specific high-cost deployment. On the other hand, SigFox and LoRaWAN allow a more extended reach. Both are similar in technical specifications, but LoRaWAN has the advantage of remaining an open protocol and therefore allowing the deployment of a low-cost proprietary network. For these reasons, LoRaWAN was chosen as the protocol and architecture for this work. A comparison between the mentioned LPWAN technologies is shown in Table 1 [19][20][21][22]. LoRaWAN is a protocol for LPWAN networks that specifies the physical layer, the logical or medium access control (MAC) layer and the application layer. Figure 2 shows the LoRaWAN protocol stack. It also proposes a network architecture indicating how the devices are to be connected, as well as the management and parameterization of the channels. The latest version of the protocol published by the LoRa Alliance is version 1.1 [23], which guarantees compatibility with its predecessor 1.0, the first version of the protocol. In the following subsections, the main features of LoRaWAN technology are presented. These subsections explain the logical layer of the technology. For more information related to the physical layer and how it works in this technology, please refer to [24][25][26]. In the following subsections, the main features of LoRaWAN technology are presented. These subsections explain the logical layer of the technology. For more information related to the physical layer and how it works in this technology, please refer to [24][25][26].

Classes of LoRaWAN Devices by MAC
LoRaWAN devices [27] can be classified depending on the type of medium access control (MAC) they use, thus defining three types: class A, class B and class C. Each class is intended to meet certain specifications related to latency and power consumption. Each class of device is distinguished by its power consumption profile, which is related to the time (duty cycle) it takes for its receivers to receive a LoRaWAN message. LoRaWAN devices are limited by regulation to transmit below 1% of the time, manage the spectrum and reduce collisions. All three classes are based on the same physical layer characteristics [28], and this is seen graphically in Figure 3: • Class A devices are based on the ALOHA transmission protocol. This implies that downlink transmissions will be queued and delayed (higher latency) when initiating two transmissions simultaneously (i.e., devices only receive downlink packets in two short duration windows, RX1 and RX2, immediately after the uplink transmission, TX1). The duration of the windows is configurable, and the reception delay is 1 s for maximum efficiency, depending on the SF applied. • Class B devices have higher power consumption, since they are designed to increase the reception windows of the downlink transmissions that are scheduled without requiring an uplink transmission [29]. In this case, a synchronization message (beacon) is transmitted from the gateways that increases the power demand in exchange for more receiving windows. • Class C devices are application-dependent due to their high power consumption. The operation consists of continuously listening for downlink messages, except when transmitting.

LoRaWAN Architecture
The typical architecture of a LoRaWAN network [30] is based on a star topology consisting of motes or end nodes, gateways and the network and application servers (see Figure 4):

LoRaWAN Architecture
The typical architecture of a LoRaWAN network [30] is based on a star topology consisting of motes or end nodes, gateways and the network and application servers (see Figure 4):

•
End node (mote): low-power communication device that collects data from sensors. • Gateway: receives transmissions from the motes and forwards the information to the network servers and vice versa. Its functionality is similar to that of a bridge.

•
Network server: routes the information packets between the motes and the application servers and vice versa, depending on the predefined topic or application.

•
Application server: manages the information packets transmitted from the end nodes. Then, it is possible to process them depending on the type of information received.

Design of the TeamUp Network Based on LoRaWAN
The TeamUp network has been specifically designed to provide a solution to the problem of connection of an emergency team in areas without cellular coverage. Therefore, the idea was to develop a private network with its own low-cost and mobile infrastructure that was capable of transmitting information (messages and location) from any mobile device to the central node, even if the end nodes were located in areas out of the cellular coverage. As a summary, the main objectives in the design of the TeamUp network are presented: • End-to-end transmission over long distances (minimum 300 m); • Bit rate to support plain text emergency messages, location messages and location images. (minimum 1 Kbps); • Mobility of users in a controlled, known and uncovered area.
The TeamUp network is designed around the architecture of a standard LoRaWAN network. This LoRaWAN architecture was implemented using the Chirpstack platform at the core of our design. ChirpStack [31] is an implementation for LoRaWAN networks that can be installed in a private deployment. The architecture is similar to the LoRaWAN architecture and consists of ChirpStack Network Server, ChirpStack Application Server, Redis and PostgreSQL databases and Mosquitto MQTT Broker [32,33]. A series of improvements is added to the core through external elements and software such as a mobile application, a server designed exclusively for this work and a web interface for complete management of the network. Figure 5 shows the two alternatives proposed for the deployment of the TeamUp network: • Set-up A provides freedom of movement at both ends of the net. Although the architecture is centralized, the central node can move around the work area. This configuration facilitates the modification of the coverage area dynamically. It is a design intended for activities where the execution area is unknown. • Set-up B presents a centralized structure, but in this case, the central node is static In addition, LoRaWAN provides certain pre-established security functionalities in the network [31], as shown in Figure 4: • Integrity: establishes an MIC code using the NwkSKey to provide the integrity of the information transmitted between the fine node and the network server. • Confidentiality: uses information encryption with AES-128 and the AppSKey key to provide confidentiality of the messages between the end nodes and the application servers.
In addition, LoRaWAN allows the activation of devices by Activation By Personalization (ABP), in which the keys are pre-recorded in the mote, or by Over-the-Air Activation (OTAA), in which the keys are generated after a signal is sent.

Design of the TeamUp Network Based on LoRaWAN
The TeamUp network has been specifically designed to provide a solution to the problem of connection of an emergency team in areas without cellular coverage. Therefore, the idea was to develop a private network with its own low-cost and mobile infrastructure that was capable of transmitting information (messages and location) from any mobile device to the central node, even if the end nodes were located in areas out of the cellular coverage. As a summary, the main objectives in the design of the TeamUp network are presented: • End-to-end transmission over long distances (minimum 300 m); • Bit rate to support plain text emergency messages, location messages and location images. (minimum 1 Kbps); • Mobility of users in a controlled, known and uncovered area.
The TeamUp network is designed around the architecture of a standard LoRaWAN network. This LoRaWAN architecture was implemented using the Chirpstack platform at the core of our design. ChirpStack [31] is an implementation for LoRaWAN networks that can be installed in a private deployment. The architecture is similar to the LoRaWAN architecture and consists of ChirpStack Network Server, ChirpStack Application Server, Redis and PostgreSQL databases and Mosquitto MQTT Broker [32,33]. A series of improvements is added to the core through external elements and software such as a mobile application, a server designed exclusively for this work and a web interface for complete management of the network. Figure 5 shows the two alternatives proposed for the deployment of the TeamUp network: • Set-up A provides freedom of movement at both ends of the net. Although the architecture is centralized, the central node can move around the work area. This configuration facilitates the modification of the coverage area dynamically. It is a design intended for activities where the execution area is unknown. • Set-up B presents a centralized structure, but in this case, the central node is static due to the need for a light point, while the end nodes can move freely as long as they are in the coverage range of the central node. This configuration is intended for small and well-known areas.
Electronics 2022, 11, x FOR PEER REVIEW 9 of 22 In the implementation, both configurations are similar with respect to the nodes. The main difference is the use of the node called "Gateway Hardware" and the ability to use LoRa by the central node: • Set-up A: all nodes are small, with low computational cost and battery-powered devices. This configuration uses the hardware gateway that acts as a LoRa bridge and sends the information to the central node. • Set-up B: the end devices are small battery-powered devices to provide mobility, but the central node is a larger device and has a built-in LoRaWAN gateway.
The following subsections discuss the nodes used and their functionalities. After that, Section 4.6 explains the exchange of messages through the entire network.
The designed network offers a number of advantages. The network employs wireless links using different technologies, such as Bluetooth Low Energy, LoRaWAN, Wi-Fi or 4G. The LoRaWAN links provide the network with a wide range of coverage for sending emergency and location messages. The network maintains a star architecture using small devices. This allows the position of the nodes to be constantly modified and provides mobility to the users. The network is easy to deploy in cases of emergencies. In addition, the network consists of three types of servers that mainly allow the storage of information and the monitoring of users. However, the use of LoRaWAN technology poses challenges. The main challenges of the network are latency and the data transmission rate. Section 5 discusses both aspects and concludes that the network is valid for emergency systems in areas without coverage. In the implementation, both configurations are similar with respect to the nodes. The main difference is the use of the node called "Gateway Hardware" and the ability to use LoRa by the central node:

Mobile Device and TeamUp Application
• Set-up A: all nodes are small, with low computational cost and battery-powered devices. This configuration uses the hardware gateway that acts as a LoRa bridge and sends the information to the central node. • Set-up B: the end devices are small battery-powered devices to provide mobility, but the central node is a larger device and has a built-in LoRaWAN gateway.
The following subsections discuss the nodes used and their functionalities. After that, Section 4.6 explains the exchange of messages through the entire network.
The designed network offers a number of advantages. The network employs wireless links using different technologies, such as Bluetooth Low Energy, LoRaWAN, Wi-Fi or 4G. The LoRaWAN links provide the network with a wide range of coverage for sending emergency and location messages. The network maintains a star architecture using small devices. This allows the position of the nodes to be constantly modified and provides mobility to the users. The network is easy to deploy in cases of emergencies. In addition, the network consists of three types of servers that mainly allow the storage of information and the monitoring of users. However, the use of LoRaWAN technology poses challenges. The main challenges of the network are latency and the data transmission rate. Section 5 discusses both aspects and concludes that the network is valid for emergency systems in areas without coverage.

Mobile Device and TeamUp Application
The mobile device hosts the application developed for the teams, called TeamUp, and will be used by each member of the team. The interface of this application is shown in Figure 6 and consists of the navigation screens available to the user.  Table. Then, the users are in a position to send a location by activating the GPS tab and send messages via the Chat tab.
The internal implementation of the application is organized in four blocks, depending on the functionality. The development was also performed so that it would be compatible with all devices that incorporate an Android version equal to or higher than 4.0.3 (Ice Cream Sandwich). The four blocks implemented are login and registration, Bluetooth Low Energy (BLE) functionality to establish and manage the connection between the smartphone and the device, chat functionality to manage messages on the smartphone and GPS functionality to control the user's positioning.

Mote
The end devices or motes are elements that must be carried by each member of the group because they are responsible for receiving messages from the smartphone using the BLE communications protocol and performing the technology change to LoRaWAN for the retransmission of information packets to the gateway and in the opposite direction.
Two types of devices were tested for configuration: NodeMCUv03 and PyCom Fipy. The first is a class A device and is programmed using the arduino IDE. It has certain advantages, such as a smaller size, lower power consumption and lower cost. The problems it may present are due to the transmission time that must remain below 1% of the duty cycle, which indicates the time the devices are able to transmit and does not allow sending messages bidirectionally. Meanwhile, the second device was programmed using Mi-croPython, and this allows it to transmit at any time and bidirectionally. This seems ideal, but the problem with these devices is the energy consumption and their being somewhat more expensive economically.  Table. Then, the users are in a position to send a location by activating the GPS tab and send messages via the Chat tab.
The internal implementation of the application is organized in four blocks, depending on the functionality. The development was also performed so that it would be compatible with all devices that incorporate an Android version equal to or higher than 4.0.3 (Ice Cream Sandwich). The four blocks implemented are login and registration, Bluetooth Low Energy (BLE) functionality to establish and manage the connection between the smartphone and the device, chat functionality to manage messages on the smartphone and GPS functionality to control the user's positioning.

Mote
The end devices or motes are elements that must be carried by each member of the group because they are responsible for receiving messages from the smartphone using the BLE communications protocol and performing the technology change to LoRaWAN for the retransmission of information packets to the gateway and in the opposite direction. Two types of devices were tested for configuration: NodeMCUv03 and PyCom Fipy. The first is a class A device and is programmed using the arduino IDE. It has certain advantages, such as a smaller size, lower power consumption and lower cost. The problems it may present are due to the transmission time that must remain below 1% of the duty cycle, which indicates the time the devices are able to transmit and does not allow sending messages bidirectionally. Meanwhile, the second device was programmed using MicroPython, and this allows it to transmit at any time and bidirectionally. This seems ideal, but the problem with these devices is the energy consumption and their being somewhat more expensive economically.

Gateway
Gateways are intermediary elements that are usually located close to the central node or even incorporated into it. Their function is to receive the packets coming from the motes and relay them to the network server located at the central node. Three variants of the gateway have been implemented. The first is a one-channel gateway on a NodeMCUv03, which does not offer the best performance due to the use of a single reception channel but may be interesting for future developments. The second case is a gateway over a PyCom Fipy as a hardware gateway, which is an interesting implementation due to its good performance, the mobility it offers and lower consumption than the third case. Finally, the most complete alternative is installed directly at the central node using IMST Gateway Lite. It uses eight channels for reception. In addition, it has a greater computational capacity, and this allows it to serve as a central node.

Central Node
The central node is the network manager and allows both to remain static and be a dynamic node that allows us to modify the network depending on the circumstances, and it must always offer coverage to the motes. The final node hosts the Chirpstack servers (network and application) and the TeamUp server. This proprietary server has three functions: to request new message information from the application server using MQTT Broker, to process the messages (see Figure 7) and store them in the databases (messages, users and location) so that they are kept up to date, and to handle HTTP requests [34] from the network administrator using the developed interface. and relay them to the network server located at the central node. Three variants of the gateway have been implemented. The first is a one-channel gateway on a NodeMCUv03, which does not offer the best performance due to the use of a single reception channel but may be interesting for future developments. The second case is a gateway over a PyCom Fipy as a hardware gateway, which is an interesting implementation due to its good performance, the mobility it offers and lower consumption than the third case. Finally, the most complete alternative is installed directly at the central node using IMST Gateway Lite. It uses eight channels for reception. In addition, it has a greater computational capacity, and this allows it to serve as a central node.

Central Node
The central node is the network manager and allows both to remain static and be a dynamic node that allows us to modify the network depending on the circumstances, and it must always offer coverage to the motes. The final node hosts the Chirpstack servers (network and application) and the TeamUp server. This proprietary server has three functions: to request new message information from the application server using MQTT Broker, to process the messages (see Figure 7) and store them in the databases (messages, users and location) so that they are kept up to date, and to handle HTTP requests [34] from the network administrator using the developed interface.

Web Interface
The web interface is intended to be used by a network administrator. It only needs connectivity to the central node and offers a list of functionalities such as adding, deleting or consulting users, querying the messages or location of a specific user and sending messages in broadcast or unicast mode.

Bidirectional Message Exchange
Once the network is implemented, regardless of the configuration used, the message exchange is checked. These messages are transmitted from node to node in the network using their corresponding technology. Figure 8 shows the bidirectional exchange necessary for a user to log in. Similarly, message exchanges between users occur within the network.
The network is deployed as a prototype for proof-of-concept testing. Currently, it does not implement timeout or retry mechanisms. However, it is intended to implement them as improvements to the proposed prototype.

Web Interface
The web interface is intended to be used by a network administrator. It only needs connectivity to the central node and offers a list of functionalities such as adding, deleting or consulting users, querying the messages or location of a specific user and sending messages in broadcast or unicast mode.

Bidirectional Message Exchange
Once the network is implemented, regardless of the configuration used, the message exchange is checked. These messages are transmitted from node to node in the network using their corresponding technology. Figure 8 shows the bidirectional exchange necessary for a user to log in. Similarly, message exchanges between users occur within the network. Electronics 2022, 11, x FOR PEER REVIEW 12 of 22

Results
This section provides the set-ups and results obtained from the experimental evaluations.

Experimental Set-up
In this subsection, the hardware and software resources used in the work are detailed. Hardware resources refer to the devices used in the development of the work and the physical components that make up the proposed network. The devices used are described below and summarized in Table 2: • One Plus 7t [35]: a smartphone used in the testing of the TeamUp mobile application and analysis of the proposed scenarios.  Software resources refer to the programs used for the implementation and analysis of the results. Throughout the work, free software was used as much as possible. In the following, the software programs used are described:  [42]: an open source platform used for the implementation of the Lo-RaWAN network core privately and the authentication of the LoRaWAN network The network is deployed as a prototype for proof-of-concept testing. Currently, it does not implement timeout or retry mechanisms. However, it is intended to implement them as improvements to the proposed prototype.

Results
This section provides the set-ups and results obtained from the experimental evaluations.

Experimental Set-Up
In this subsection, the hardware and software resources used in the work are detailed. Hardware resources refer to the devices used in the development of the work and the physical components that make up the proposed network. The devices used are described below and summarized in Table 2: • One Plus 7t [35]: a smartphone used in the testing of the TeamUp mobile application and analysis of the proposed scenarios. • Motes: the devices in charge of receiving messages through the mobile application and acting as a repeater to transmit them to the other corresponding gateway motes. Two models were used in the work: TTGO ESP32-LoRa [36] and PyCom Fipy [37]. • LoRaWAN gateway: a gateway between the motes and the servers. Three models were used in the work: TTGO ESP32-LoRa (1-channel), PyCom Fipy and IMST Gateway Lite (IMST ic880A concentrator) [38]. Software resources refer to the programs used for the implementation and analysis of the results. Throughout the work, free software was used as much as possible. In the following, the software programs used are described: • Chirpstack [42]: an open source platform used for the implementation of the LoRaWAN network core privately and the authentication of the LoRaWAN network components. It also includes a web interface for device management and APIs for the integration of motes and gateways. • Matlab [43]: a programming and numeric computing platform used to analyze data. Version R2019b was used.
In the first experiment, the simulated analysis of the data transmission rate was performed using Matlab. The results of this experiment are shown in Section 5.2. This simulation was performed because of the need to know the transmission capacity of the network as a function of the modulation parameters used. The number of bits that could be encoded in each symbol was given by the spreading factor (SF). Then, the information bit rate (R b ) was defined, as discussed in [22], as follows: where SF can take integer values between 7 and 12, BW refers to the bandwidth used in transmission, LoRa supports bandwidths of 125, 250 and 500 KHz and the coding rate (CR) is the ratio of non-redundant bits for forward error correction (FEC) and can take the values 4/5, 4/6, 4/7 and 4/8 [22]. Finally, in the second experiment proposes the analysis of system coverage and performance in terms of signal strength. This analysis considers the received signal strength indication (RSSI) and signal-to-noise ratio (SNR) in real environments. The real environments were urban, rural and natural areas. These areas are described below and shown in Figure 9:

•
The urban environment (worst case) was located in the "Avenida Andalucía" of the city of Granada.

•
The rural environment was located in a little village in the province of Jaen called "Llanos del Sotillo".

•
The natural environment was located in "Sierra Morena" of Andujar in the province of Jaen.
In each of these areas, the data capture experiment was performed three times. In each data capture, the data were obtained at distances of 0, 25, 50, 75, 100, 200, 300, 400, 500, 750 and 1000 m. Each trial consisted of 10 measurements for each of the mentioned distances. In this way, randomness of the measurements was avoided, and the measurements were thus reliable.
For the measurements, design B in Figure 5 was used due to the areas where the experiments were performed being well known. The end nodes were implemented on PyCom Fipy devices. These devices are suitable for bidirectional communications due to their support for class C in MAC. In addition, they are small devices that emergency team members could comfortably carry with them. The central node was deployed on top of IMST Gateway Lite because of its higher accuracy in RSSI measurements and lower probability of error in signal capture [44]. On the other hand, LoRa modulation with a spreading factor (SF = 7), bandwidth (BW = 125 KHz) and coding rate (CR = 4/5) was used because it offered a data rate suitable for sending text messages (R b = 5.47 Kbps). The results of this experiment are shown in Section 5.3.
of Jaen.
In each of these areas, the data capture experiment was performed three times. In each data capture, the data were obtained at distances of 0, 25, 50, 75, 100, 200, 300, 400, 500, 750 and 1000 m. Each trial consisted of 10 measurements for each of the mentioned distances. In this way, randomness of the measurements was avoided, and the measurements were thus reliable. For the measurements, design B in Figure 5 was used due to the areas where the experiments were performed being well known. The end nodes were implemented on PyCom Fipy devices. These devices are suitable for bidirectional communications due to their support for class C in MAC. In addition, they are small devices that emergency team members could comfortably carry with them. The central node was deployed on top of IMST Gateway Lite because of its higher accuracy in RSSI measurements and lower probability of error in signal capture [44]. On the other hand, LoRa modulation with a spreading factor (SF = 7), bandwidth (BW = 125 KHz) and coding rate (CR = 4/5) was used because it offered a data rate suitable for sending text messages (Rb = 5.47 Kbps). The results of this experiment are shown in Section 5.3.

Data Rate Analysis
In the data rate analysis, all possible combinations depending on the SF, CR and bandwidth were taken. In Figure 10, the graphs that we obtained are shown. In the first duplex, SF was fixed, and the behavior was evaluated depending on the rest of the parameters. In the second duplex, the bandwidth value was fixed at 125 KHz, and finally, the CR value was fixed at 4/5, since it was the one that was providing the best data bit rates.
This first simulated analysis of the data rate gave us an insight into the capacities of the system depending on the LoRa modulation configuration and the opportunity to know all the alternatives, since other works [24,45] only showed this theoretical analysis of the data rate in a partial way. The analysis of Figure 10 shows that when the SF was higher, then the bit rate was lower. If the bandwidth increased and the coding rate was high (4/5), the bit rate transmitted also increased. On the other hand, the coverage range theoretically behaved in the opposite way to the data rate (i.e., the lower the SF and the CR, the more robust the transmitted signal would be to noise and interference, so the coverage range should have been higher). It is important to reach a trade-off between the data rate and the desired coverage range. Table 3 shows a summary of the data results. The results show that the above-mentioned deductions were verified.

Data Rate Analysis
In the data rate analysis, all possible combinations depending on the SF, CR and bandwidth were taken. In Figure 10, the graphs that we obtained are shown. In the first duplex, SF was fixed, and the behavior was evaluated depending on the rest of the parameters. In the second duplex, the bandwidth value was fixed at 125 KHz, and finally, the CR value was fixed at 4/5, since it was the one that was providing the best data bit rates.
This first simulated analysis of the data rate gave us an insight into the capacities of the system depending on the LoRa modulation configuration and the opportunity to know all the alternatives, since other works [24,45] only showed this theoretical analysis of the data rate in a partial way. The analysis of Figure 10 shows that when the SF was higher, then the bit rate was lower. If the bandwidth increased and the coding rate was high (4/5), the bit rate transmitted also increased. On the other hand, the coverage range theoretically behaved in the opposite way to the data rate (i.e., the lower the SF and the CR, the more robust the transmitted signal would be to noise and interference, so the coverage range should have been higher). It is important to reach a trade-off between the data rate and the desired coverage range. Table 3 shows a summary of the data results. The results show that the abovementioned deductions were verified.

Experimental Coverage Analysis
Experimental analysis for coverage testing was performed in three types of real-world environments-urban, rural and natural-for testing the system in different situations. After several practical experiments in each environment, RSSI and SNR data were collected to estimate the reception quality. Figure 11 shows the RSSI values as a function of the distance from the end device to the central node. The black line represents the RSSI set with the free space propagation model calculated for the measurement distances [44,46]. The red line represents the mean RSSI values taken for given distances in the urban environment. The blue line represents the mean RSSI values in the rural environment, and the green line shows the experimental measurements in the natural environment.

Experimental Coverage Analysis
Experimental analysis for coverage testing was performed in three types of realworld environments-urban, rural and natural-for testing the system in different situations. After several practical experiments in each environment, RSSI and SNR data were collected to estimate the reception quality. Figure 11 shows the RSSI values as a function of the distance from the end device to the central node. The black line represents the RSSI set with the free space propagation model calculated for the measurement distances [44,46]. The red line represents the mean RSSI values taken for given distances in the urban environment. The blue line represents the mean RSSI values in the rural environment, and the green line shows the experimental measurements in the natural environment. Using the free space model, our experimental results were compared with the theoretical ones in each of the case studies. As expected, the experimental results followed the trend of the ideal model, although they presented clearly worse values. In short, the RSSI decreased as a function of the distance to the central node. In addition, the RSSI was also affected by other effects such as large-and small-scale fading [25]. Large-scale fading is mainly caused by reflection, refraction and scattering against large obstacles. Small-scale fading is produced by multipathing or due to doppler effects. These effects can considerably decimate the signal. The three types of environments show that the system behaved similarly. This highlights that the urban measurement environment was not the most suitable because the bidirectionality capability was lost early (around 600 m). Moreover, as shown in the study [26], our results were relatively low. It is worth noting that the rural and natural environments presented similar behaviors, but the natural environment was slightly better due to the fact that the obstacles that appeared in the rural area interfered with the signal. This result was positive, because our main focus in this work was on natural areas. In turn, the rural environment presented a lower RSSI than those measured in the urban environment. These results aere due to the fact that the measurements taken in the urban environment were made with a line of sight until finding buildings. This may also affect that the measurements in the rural environment presented buildings close to our central node, and at the time of measurement, the weather conditions were not favorable (e.g., fog and rain).
Similarly, the averaging of the values obtained in terms of the SNR is shown in Figure  12, which establishes a direct relationship between the transmitted signal and the noise introduced as a function of the distance to the central node and the differences between the environments. The natural and urban environment offered the best performance in terms of the SNR, and the rural environment stood out for its low SNR. In this case, most Using the free space model, our experimental results were compared with the theoretical ones in each of the case studies. As expected, the experimental results followed the trend of the ideal model, although they presented clearly worse values. In short, the RSSI decreased as a function of the distance to the central node. In addition, the RSSI was also affected by other effects such as large-and small-scale fading [25]. Large-scale fading is mainly caused by reflection, refraction and scattering against large obstacles. Small-scale fading is produced by multipathing or due to doppler effects. These effects can considerably decimate the signal. The three types of environments show that the system behaved similarly. This highlights that the urban measurement environment was not the most suitable because the bidirectionality capability was lost early (around 600 m). Moreover, as shown in the study [26], our results were relatively low. It is worth noting that the rural and natural environments presented similar behaviors, but the natural environment was slightly better due to the fact that the obstacles that appeared in the rural area interfered with the signal. This result was positive, because our main focus in this work was on natural areas. In turn, the rural environment presented a lower RSSI than those measured in the urban environment. These results aere due to the fact that the measurements taken in the urban environment were made with a line of sight until finding buildings. This may also affect that the measurements in the rural environment presented buildings close to our central node, and at the time of measurement, the weather conditions were not favorable (e.g., fog and rain).
Similarly, the averaging of the values obtained in terms of the SNR is shown in Figure 12, which establishes a direct relationship between the transmitted signal and the noise introduced as a function of the distance to the central node and the differences between the environments. The natural and urban environment offered the best performance in terms of the SNR, and the rural environment stood out for its low SNR. In this case, most of the SNR measurements taken were negative due to the chosen area and climate conditions. This proves that the system is robust to noise and fading that might appear in emergencies, as the TeamUp system was able to maintain the connection bidirectionally even when the signal was below the noise floor. of the SNR measurements taken were negative due to the chosen area and climate conditions. This proves that the system is robust to noise and fading that might appear in emergencies, as the TeamUp system was able to maintain the connection bidirectionally even when the signal was below the noise floor. These previous analyses provided us with information on the signal strength or its relationship with the noise usually introduced by the transmission channel. Therefore, it was decided to make a statistical study of the measurements obtained as a function of the three environments (urban, rural and natural). Figures 13 and 14 show the experimental cumulative distribution function (ECDF) and upper and lower confidence bounds (UCB and LCB, respectively) of the RSSI and SNR measurements as a function of the test areas. Concerning the experimental CDF of the RSSI measurements, Figure 13 shows that the urban environment had high values, which would be a benefit for our work, but it should take into account that if the RSSI decreases, the bidirectional interconnection is lost, and therefore, the system would be useless. The rural and natural environments were again similar, and the rural environment had a large percentage of its measurements very close to the RSSI limit, where the operability of the system would be lost. These previous analyses provided us with information on the signal strength or its relationship with the noise usually introduced by the transmission channel. Therefore, it was decided to make a statistical study of the measurements obtained as a function of the three environments (urban, rural and natural). Figures 13 and 14 show the experimental cumulative distribution function (ECDF) and upper and lower confidence bounds (UCB and LCB, respectively) of the RSSI and SNR measurements as a function of the test areas.
Concerning the experimental CDF of the RSSI measurements, Figure 13 shows that the urban environment had high values, which would be a benefit for our work, but it should take into account that if the RSSI decreases, the bidirectional interconnection is lost, and therefore, the system would be useless. The rural and natural environments were again similar, and the rural environment had a large percentage of its measurements very close to the RSSI limit, where the operability of the system would be lost.
On the other hand, looking at the experimental CDF plot for the SNR, Figure 14 shows that in the rural case, half of our measurements were negative, as previously mentioned. As for the SNR, the natural environment showed adequate behavior, as did the urban case.
Considering all the results, LoRa modulation configuration and the chosen scenarios, our solution offered a sufficient coverage range for the interconnection of emergency equipment even without cellular coverage. This statement was due to the fact that the signal strength decayed rapidly with this technology in the considered environments. Furthermore, in comparison with the theoretical results presented in [47], this configuration allowed coverage ranges up to 3 km for radio (i.e., about three times more than the range used in this study).
Finally, it is known that the latency will depend on the slowest technology. In our case, this will be LoRaWAN because Bluetooth is intended to operate in real time, and Wi-Fi and 4G have latencies of milliseconds. The latency in LoRaWAN depends on the SF and can take a few seconds, as shown in [48]. Therefore, it was considered that the total latency in end-to-end forwarding should be a few seconds. This time is high compared with LANs, but it is an acceptable delay for messaging services in environments without coverage or in cases of emergency.
These previous analyses provided us with information on the signal strength or its relationship with the noise usually introduced by the transmission channel. Therefore, it was decided to make a statistical study of the measurements obtained as a function of the three environments (urban, rural and natural). Figures 13 and 14 show the experimental cumulative distribution function (ECDF) and upper and lower confidence bounds (UCB and LCB, respectively) of the RSSI and SNR measurements as a function of the test areas. Concerning the experimental CDF of the RSSI measurements, Figure 13 shows that the urban environment had high values, which would be a benefit for our work, but it should take into account that if the RSSI decreases, the bidirectional interconnection is lost, and therefore, the system would be useless. The rural and natural environments were again similar, and the rural environment had a large percentage of its measurements very close to the RSSI limit, where the operability of the system would be lost. On the other hand, looking at the experimental CDF plot for the SNR, Figure 14 shows that in the rural case, half of our measurements were negative, as previously mentioned. As for the SNR, the natural environment showed adequate behavior, as did the urban case. Considering all the results, LoRa modulation configuration and the chosen scenarios, our solution offered a sufficient coverage range for the interconnection of emergency equipment even without cellular coverage. This statement was due to the fact that the signal strength decayed rapidly with this technology in the considered environments. Furthermore, in comparison with the theoretical results presented in [47], this configuration allowed coverage ranges up to 3 km for radio (i.e., about three times more than the range used in this study).
Finally, it is known that the latency will depend on the slowest technology. In our case, this will be LoRaWAN because Bluetooth is intended to operate in real time, and Wi-Fi and 4G have latencies of milliseconds. The latency in LoRaWAN depends on the SF and can take a few seconds, as shown in [48]. Therefore, it was considered that the total latency in end-to-end forwarding should be a few seconds. This time is high compared with LANs, but it is an acceptable delay for messaging services in environments without coverage or in cases of emergency.

Conclusions
This article proposes an innovative and low-cost network based on LoRaWAN technology, whose functionality consists of establishing the team in areas without coverage. It is specially designed to interconnect members of emergency teams in areas without coverage. This network established a connection between a smartphone and the base station or central node using different communication technologies between devices. The network design proposes alternatives in terms of mobility, information transmission capacity

Conclusions
This article proposes an innovative and low-cost network based on LoRaWAN technology, whose functionality consists of establishing the team in areas without coverage. It is specially designed to interconnect members of emergency teams in areas without coverage. This network established a connection between a smartphone and the base station or central node using different communication technologies between devices. The network design proposes alternatives in terms of mobility, information transmission capacity and coverage range. LoRaWAN technology is not intended for real-time applications and is mainly used for monitoring. Therefore, the emergency communications service adapts to the established time constraints in exchange for providing a wide coverage range. The network was tested by a civil protection team with good results in terms of functionality, and an amount of feedback has been obtained for the improvement of the network.
Our solution was established with specific parameters for LoRa modulation (SF = 7, CR = 4/5 and BW = 125 KHz) in order to offer the maximum data transfer rate (R b = 5.4688 Kbps) using the lowest possible bandwidth. This data rate was higher than the minimum required in the design objectives and was sufficient for sending the information. In addition, the possibilities in terms of coverage range were taken into account. In addition, the possibilities in terms of coverage range were taken into account, such as the possibility of increasing the coverage range by increasing the signal's robustness, albeit with a decrease in the data rate.
On the other hand, a series of experiments was realized in real areas (urban, rural and natural). These experiments showed that the performance of the TeamUp network was acceptable in all areas for a distance of approximately 500 m. Furthermore, in rural and natural areas, the bidirectional connection distance increased up to 1000 m. It is noteworthy that the best network performance was provided in the natural scenario. This scenario was relevant to the research, given that areas without coverage are often found in similar areas.
Future work includes the addition of gateways using a mesh architecture. These gateways will be tested to see if they can improve the coverage offered in the different environments. In addition, the impairments and attenuations caused by the different environments will be observed when conducting a new measurement campaign. It is also proposed to add retry mechanisms for automatic message forwarding. Finally, although it is a non-significant improvement, group tracking functionality will be added to detect emergencies before they are reported by the user.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Abbreviations
The following abbreviations are used in this manuscript: