1. Introduction
Traditionally, the long-range wide area network (LoRaWAN) protocol has established itself as one of the most effective technologies for internet of things (IoT) applications, offering long-distance connectivity with low power consumption. This technology is particularly suitable for environments where other communication solutions might be unfeasible due to limited range or high power consumption. In particular, LoRaWAN enables data transmission over several kilometers, with devices featuring long battery life and low cost, making it an ideal choice for low-cost, distributed IoT networks [
1]. In a LoRaWAN network, a star-type topology is usually employed where gateways act as intermediaries, transmitting messages between nodes and a central network server. Such gateways connect to the network server using internet protocol (IP) links over wired or wireless technologies. Also, nodes communicate with the gateways using LoRa- or frequency shift keying (FSK)-modulated point-to-point wireless links [
2,
3].
However, describing the requirements of LoRaWAN device classes is crucial because it defines the minimum capabilities needed for interoperability and operation in the network. Devices must comply with Class A functionalities, which ensures that they can operate in a basic and effective manner in the LoRaWAN network. Likewise, Classes B and C, although optional, offer additional features, such as improvements in synchronization and responsiveness, which can optimize performance in specific applications. In addition, the protocol specification details critical aspects such as the format of messages in the physical and media access control (MAC) layers, reception window management, and security methods, including encryption and integrity, ensuring that all devices can communicate securely and efficiently while complying with the necessary standards [
4].
A significant amount of research has been driven by its potential in diverse areas. For example, to assess the performance measurement of LoRaWAN technology, the authors in [
2] executed a performance evaluation using the specialized tool SimpleIoTSimulator, which enables the generation of traffic from tens of thousands of LoRa nodes and their direct connection to the things network (TTN) server to emulate real-world conditions. Furthermore, the authors in [
5] utilized LoRa/LoRaWAN technology to connect objects to the internet reliably and securely and to study its development and application in Ecuador, emphasizing its benefits and application scenarios in simulated environments for future implementations both indoors and outdoors. Similarly, in [
6], the authors presented a prototype application to detect the occupancy level of garbage containers using ultrasonic sensors based on LoRaWAN technology, aiming to optimize garbage collection in Ecuadorian cities. Lastly, in [
7], the authors offered a review of various LoRa and LoRaWAN device configurations across different applications, highlighting the impact of regional regulations and the use of default settings. They investigated different deployment scenarios, ranging from indoor settings to extensive outdoor communication.
Additionally, in more recent studies such as [
8,
9], the future of IoT is focused on the growing number of applications communicated with LoRaWAN and complemented by the advanced processing capacity of deep learning, which can improve efficiency in the detection of anomalies, the prediction of failures, and the optimization of energy use in IoT networks.
Unlike previous studies, we present a practical approach by implementing a LoRaWAN-based measurement prototype in both urban and rural areas of Quito, using the default settings for simplicity and ensuring smooth network integration. Additionally, we examine the usability of LoRaWAN, concentrating on a comprehensive analysis of the technology’s performance under various environmental conditions and its efficiency in data collection across different scenarios. In essence, we propose an experimental prototype to perform proof-of-concept tests of the LoRaWAN protocol in both urban and rural settings in Quito. This prototype enables us to assess the performance and effectiveness of LoRa in various situations, offering a practical and detailed perspective on the technology’s behavior and aiding in understanding its relevance in specific urban contexts.
2. Materials and Methods
In order to carry out a proof of concept of LoRa technology in both urban and rural environments, we implement a communication prototype, as described in
Figure 1. Here, we employ the structured methodology consisting of three main phases: node configuration, server deployment, and communication and monitoring establishment, as explained below.
The first phase involves configuring the LoRaWAN devices that act as nodes. These nodes are usually equipped with sensors to collect relevant data, such as temperature, humidity, or any other parameter needed for the specific application. Each node must be configured correctly to send data via the LoRa protocol. Specifically, configurations include assigning unique identifiers to each node and scheduling it to transmit data at specific intervals. Furthermore, nodes are also required to have sufficient power, either through lithium batteries or alternative power sources suitable for their operating environment [
10].
The second phase focuses on configuring and integrating the necessary servers: the join server, the network server, and the application server. In particular, the join server handles the authentication and authorization of the nodes that wish to join the network. The network server manages data routing between the nodes and the application server, applying network rules, and ensuring correct packet transmission. The application server receives the processed data from the network server and stores or displays it in specific applications. Each of these servers must be configured and tested to ensure that it can handle the expected volume of data and that network security is guaranteed [
11].
The last phase involves establishing effective communication between the nodes and servers and implementing the necessary monitoring tools. The nodes need to be deployed in situ and checked for proper communication with the LoRaWAN gateways that relay data to the network server. It is essential to monitor the network server to ensure accurate reception and forwarding of data to the application server, avoiding any information loss. Ultimately, the application server should provide a user interface for data visualization and analysis, granting users access to the information via mobile devices or web applications. Continuous oversight of the entire infrastructure will allow for real-time problem detection and resolution, thereby guaranteeing the robustness and reliability of the LoRaWAN prototype [
12].
2.1. Requirements
In this section, we thoroughly detail the essential hardware needed for the suggested prototype. This involves an in-depth analysis of each required component, as presented in
Table 1. The choice of hardware is crucial, as it significantly impacts the system’s performance and dependability across different conditions. Our goal is to lay a robust groundwork for the prototype’s implementation and future assessment by carefully specifying the components and their characteristics.
2.2. Implementation
In
Figure 2, we illustrate the primary components of The Things Network Stack Community Edition platform, which serves as the foundation for developing and implementing the proposed network prototype. In this context,
Table 2 provides a concise description of each of these components.
2.3. Programming Data Acquisition
The operational sequence of the LoRa communication prototype starts with the inclusion of essential modules, variable definitions, and the creation of an instance of the LoRaModem class, which sets up the communication environment. The Setup function, responsible for configuration, initializes the parameters needed for sensor reading. Subsequently, the sensor data are read and converted to bytes, making it ready for transmission. This data are stored in a byte array within the payload variable.
The gateway and network server configuration are set up prior to practical deployment. The gateway is configured through files such as global_conf.json and local_conf.json, and the network server is configured to manage nodes using The Things Stack (TTS) version 3.18 platform. The node code structure is detailed in the LoRa_Tx_MonAmb.ino file, which implements the core functionality, and the secrets.h file, which contains the session keys needed for pairing with the network server. The configuration process initializes the radio module in the US915 band and uses the Over-The-Air Activation (OTAA) method to pair the node with the server. During the run cycle, the system takes readings from sensors, converts the values to byte arrays, and transmits them through the radio module.
Once the data are prepared in the payload array, the LoRa message transmission proceeds. During transmission, the reception buffer is monitored to confirm successful message sending. The received message is displayed on the serial monitor for inspection and analysis. Moreover, a function to convert floats to bytes (float2Bytes) is provided, and care is taken to ensure that configuration files such as arduino_secrets.h and global_conf.json are correctly set up and accessible for the prototype’s proper operation.
2.4. Test Environment Description
Here, to carry out the proposed tests, the gateway is positioned on a three-meter high platform in a rural area of Quito, specifically in the Cocotog zone. This area is characterized by its low building density and relatively flat terrain with minimal altitude variations. These conditions favor the transmission of radio signals, especially in scenarios where there is a clear line of sight between the transmitter and the receiver, which allows the anticipation of an optimal communication range.
For the measurement campaign, in
Figure 3, we illustrate a detailed view of the coverage and performance of the system as a function of distance and the specific conditions of the rural environment. Specifically, data were collected at nine points (blue markers) located at various distances from the node to the gateway (red marker).
On the other hand, for the scenario in
Figure 4, note that the environment is exposed to a significantly higher level of interference, which could negatively affect the range of the radio link compared to the rural environment. In particular, the gateway was installed on the terrace of a building in the La Florida zone, in the north of Quito. This location is characterized by its density of buildings and possible obstructions, which introduces a greater number of obstacles and sources of interference for the radio signal. For this setup, the tests were carried out at four different points (blue markers) within this urban area. These points were selected to assess the system’s performance in more complex conditions and to measure how urban interference impacts the quality of communication and the range of the radio link.
3. Results and Discussion
In this work, the airtime of the packet within the radio link has been analyzed as an indicator of energy consumption in the node of the LoRa network. Specifically, packet airtime is defined as the duration for which the antenna actively transmits the message. Consequently, extended airtime correlates with increased energy consumption. Additionally, the signal-to-noise ratio (SNR) has been evaluated, given its utilization by the adaptive data rate (ADR) algorithm to determine the spreading factor. In summary, the operation and efficacy of the ADR mechanism are discerned through variations in these specified transmission parameters.
The LoRaWAN packet itself serves as the source for the test data, as it is the gateway that appends metadata to the packet, including the SNR, before it is forwarded to the network server. At this stage, the ADR field is processed, and the spreading factor (SF) is determined. Two distinct test environments were selected based on their unique environmental conditions, which influence the transmission characteristics of the radio link differently. In both the urban and rural test scenarios, a maximum of fifteen packets were transmitted at specific distances between the node and the gateway. Nevertheless, variations in the packet’s airtime and SNR values are observed only in the packets that were successfully received.
In
Figure 5, we illustrate the 3D scatter plot delineating the interrelation among the received signal strength indicator (RSSI), spreading factor (SF), and consumed airtime in milliseconds. Concerning LoRa communications, the reliable RSSI range is typically between
dBm and
dBm. Values around
dBm indicate a strong signal and reliable communication, while values around
dBm may still be acceptable, although the communication quality may start to decline. Values below
dBm suggest a very weak signal, commonly resulting in unreliable communication, high error rate, and connection issues.
Figure 6 exemplifies the RSSI vs. Consumed Airtime Scatterplot results grouped by SF, demonstrating that stable and effective communication is ensured. It is important to note that the variation in consumed airtime depends not only on the RSSI value, but also on the SF. Lower RSSI values (approximately between −105 dBm and −100 dBm) are associated with higher consumed airtime when the SF is higher (e.g., SF values of 9 or 10). This suggests that even if the signal is weak, communication can still be stable by increasing the SF, albeit at the cost of higher airtime. Therefore, efficient communication, especially in the trade-off between SF and RSSI, is experimentally verified, considering the specific needs of the network and the environment in which the system is deployed.
In both
Figure 7, the expected behavior of air-time is observed as a function of SF and SNR. As SF increases, air-time also increases, which is consistent with the nature of LoRa modulation, since higher SF implies longer transmission duration. Also, SNR seems to influence air-time, with higher SNR values associated with lower air-time, reflecting the system’s ability to improve transmission in cleaner signal conditions. The general alignment of the points suggests predictable and consistent behavior in both urban and rural environments.
In
Figure 8, we perform a curve analysis by applying a polynomial regression to the RSSI and SNR data at different distances. We extracted distance, SNR, and RSSI data from a raw file and filtered and converted them to numerical values. A polynomial function was fitted to generate trend lines showing how RSSI and SNR vary with distance. This process was applied to both rural and urban data sets. The resulting curves illustrate the relationship between distance and RSSI, providing insight into signal behavior in different environments. The results obtained in both scenarios were satisfactory, allowing the comparison of the LoRa protocol’s performance in different contexts, confirming the system’s robustness against environmental variations.
The results showed that in urban areas with tall buildings, the transmission signal had a shorter range due to interference but still remained stable over distances of up to 2 km. In rural areas without as many obstacles the signal reached much further, up to 5 km. This shows that the technology is effective in collecting data in different environments, but performance can vary depending on geographic features and building density.
A simple use case of environmental monitoring in Quito, a city with both urban and rural areas. The LoRaWAN-based communication prototype was deployed to measure air quality in different zones. Sensors were placed on nodes connected to a LoRa network to transmit data such as temperature, humidity, and pollution levels to a central server.
4. Conclusions
A prototyping environment for LoRaWAN solutions was created using Arduino MKR WAN 1310 for nodes, Raspberry Pi 3 model B+ for gateways, and The Things Stack for the network server, all with free software and hardware. The Raspberry Pi provided an economical and functional gateway solution, while The Things Stack supported the integration and development of applications with node data through its graphical interface and LoRaWAN 1.0.3 features.
This experiment confirmed that the LoRa protocol maintains stable communication in both rural and urban environments, even with weaker signals, ensuring reliable data transmission over long distances. Its robustness allows it to handle interference efficiently, underlining its suitability for various applications. The protocol is highly adaptable, adjusting performance based on environmental conditions and demonstrating versatility in different scenarios.
Experiments have shown that a smaller SF for short-range transmissions decreases packet airtime and battery consumption. In addition, our results indicated that packet loss increases with distance in both urban and rural settings. In urban environments, minor distance variations, for example, from m to m, can result in complete communication failure between the node and the gateway.
This paper lays the groundwork for future studies in network optimization, prediction models, interference, robustness analysis, scenario comparison, and practical applications. Future work will focus on: (a) Optimizing LoRaWAN node configuration to enhance coverage and reduce low reception areas. This includes examining how vegetation, topography, and buildings affect signal quality. Additionally, assess transmission power and coding techniques to improve network performance for rural applications in environmental monitoring, precision agriculture, and resource management; and (b) using machine learning algorithms to build more precise models to forecast signal attenuation due to distance and environmental variables, thus improving predictions of coverage and signal quality.
Author Contributions
Conceptualization, M.R. and L.U.; methodology, R.M. and M.R.; Investigation, R.M. and M.R.; software, M.R.; validation, M.R. and L.U.; formal analysis, R.M. and L.U.; investigation, M.R., R.M. and L.U.; Writing—Original Draft Preparation, R.M. and M.R.; Writing—Review and Editing, L.U. and J.D.V.-S.; Visualization, J.D.V.-S.; Supervision, L.U. and J.D.V.-S. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by project PII-DETRI-2024-02, “Análisis de desempeño de comunicaciones 6G asistidas por superficies inteligentes reconfigurables o antenas fluidas”.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Data is contained within the article.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Nolan, K.E.; Guibene, W.; Kelly, M.Y. An evaluation of low power wide area network technologies for the Internet of Things. In Proceedings of the 2016 International Wireless Communications and Mobile Computing Conference (IWCMC), Paphos, Cyprus, 5–9 September 2016; pp. 439–444. [Google Scholar]
- Lavric, A.; Petrariu, A.I.; Coca, E.; Popa, V. LoRaWAN analysis from a high-density Internet of Things perspective. In Proceedings of the 2020 International Conference on Development and Application Systems (DAS), Suceava, Romania, 21–23 May 2020; pp. 94–97. [Google Scholar]
- Ebi, C.; Schaltegger, F.; Rüst, A.; Blumensaat, F. Synchronous LoRa mesh network to monitor processes in underground infrastructure. IEEE Access 2019, 7, 57663–57677. [Google Scholar] [CrossRef]
- Jouhari, M.; Saeed, N.; Alouini, M.S.; Amhoud, E.M. A survey on scalable LoRaWAN for massive IoT: Recent advances, potentials, and challenges. IEEE Commun. Surv. Tutor. 2023, 25, 1841–1876. [Google Scholar] [CrossRef]
- Pinto-Erazo, A.M.; Suárez-Zambrano, L.E.; Mediavilla-Valverde, M.M.; Andrade-Guevara, R.E. Introductory analysis of LoRa/LoRaWAN technology in Ecuador. In Communication, Smart Technologies and Innovation for Society: Proceedings of CITIS 2021; Springer: Singapore, 2022; pp. 547–557. [Google Scholar]
- Valle Paillacho, B.R. Desarrollo de Un Prototipo de Aplicación Para Detectar el Nivel de Ocupación de Contenedores de Basura de Gran Capacidad Utilizando Tecnología Lorawan. Bachelor’s Thesis, Escuela Politécnica Nacional, Quito, Ecuador, 2022. [Google Scholar]
- Khutsoane, O.; Isong, B.; Abu-Mahfouz, A.M. IoT devices and applications based on LoRa/LoRaWAN. In Proceedings of the IECON 2017—43rd Annual Conference of the IEEE Industrial Electronics Society, Beijing, China, 29 October–1 November 2017; pp. 6107–6112. [Google Scholar]
- Chinnasamy, P.; Sathya, K.S.; Jebamani, B.J.A.; Nithyasri, A.; Fowjiya, S. Deep Learning: Algorithms, techniques, and applications—A systematic survey. In Deep Learning Research Applications for Natural Language Processing; IGI Global: Hershey, PA, USA, 2023; pp. 1–17. [Google Scholar]
- Arulananth, T.; Kuppusamy, P.; Ayyasamy, R.K.; Alhashmi, S.M.; Mahalakshmi, M.; Vasanth, K.; Chinnasamy, P. Semantic segmentation of urban environments: Leveraging U-Net deep learning model for cityscape image analysis. PLoS ONE 2024, 19, e0300767. [Google Scholar] [CrossRef] [PubMed]
- Prauzek, M.; Konecny, J.; Borova, M.; Janosova, K.; Hlavica, J.; Musilek, P. Energy harvesting sources, storage devices and system topologies for environmental wireless sensor networks: A review. Sensors 2018, 18, 2446. [Google Scholar] [CrossRef] [PubMed]
- Košt’ál, K.; Helebrandt, P.; Belluš, M.; Ries, M.; Kotuliak, I. Management and monitoring of IoT devices using blockchain. Sensors 2019, 19, 856. [Google Scholar] [CrossRef] [PubMed]
- Hou, L.; Zhao, S.; Xiong, X.; Zheng, K.; Chatzimisios, P.; Hossain, M.S.; Xiang, W. Internet of things cloud: Architecture and implementation. IEEE Commun. Mag. 2016, 54, 32–39. [Google Scholar] [CrossRef]
- CatSensors. Tecnología LoRa y LoRaWAN. 2024. Available online: https://www.catsensors.com/es/lorawan/tecnologia-lora-y-lorawan (accessed on 22 August 2024).
- Zhou, Q.; Zheng, K.; Hou, L.; Xing, J.; Xu, R. Design and Implementation of Open LoRa for IoT. IEEE Access 2019, 7, 100649–100657. [Google Scholar] [CrossRef]
| Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).