## 1 Introduction  
The emerging paradigm of the Internet of Things (IoT) has become a prominent technology in our world and currently offers an unparalleled framework for the development of applications where many devices need to be connected. The IoT can be defined as an information network that allows the connection among various types of devices through the Internet, allowing monitoring and even remote control of objects through a network [1, 2]. The IoT is one of the fastest evolving technologies and is currently significantly changing many aspects of people's daily lives. The ability of any device to communicate from anywhere at any time and in real time is causing a revolution in the type of applications that can be developed. At present, this technology is applied in different environments, such as agriculture [3, 4], where traditional agricultural activities are being transformed into intelligent agricultural systems. Industrial environments are also adapting to this new IoT technology; nowadays, it is being used to perform predictive maintenance and quality management, as well as guarantee manufacturing without defects [5, 6]. Even in the field of medicine, the application of the IoT systems is increasing the capabilities of diagnosing and treating diseases [7, 8]. At the lowest layer of the IoT, wireless sensor networks (WSNs) play an important and fundamental role. In general, WSNs are made up of small, connected nodes working autonomously [9]. WSNs combine a wide range of different types of devices and are the cornerstone of all IoT systems [10]. However, this technology is not exempt from problems, and one of the challenges in this field is the application of IoT technology in large areas, where devices can be scattered, far apart from each other, and where communication coverage can also be poor or even null [11]. Some proposed solutions to address this issue are based on the application of cellular or satellite communication; however, these alternatives are very complex and expensive [12]. Due to these problems, a new wireless communication technology, called low power wide area network (LPWAN), has recently emerged. This approach supports communication over long distances (10-40 Km), requiring low consumption and allowing budget decreases [13]. Among the different alternatives proposed to develop these types of networks, LoRaWAn, which is based on applying the LoRa communication protocol in its physical layer, stands out [14]. LoRa is a modulation technology designed to allow long-range transmissions in the 433, 868, or 915 MHz frequency bands. One of the most widespread applications in IoT environments is remote monitoring, in which all the data retrieved by a set of sensors distributed in a given area are centralized and stored. Most traditional monitoring systems consist of a few fixed stations, equipped with one to several sensors and measurement units sparsely deployed over large geographic areas. In this sense, meteorological [15], seismic [16], oceanographic [17], or even atmospheric pollution [18] monitoring systems have been developed. However, these types of networks are installed in fixed and static locations and can provide sufficient coverage only in very small areas. To extend sensor networks over large areas, in recent years, there has been a growing interest in the application of unmanned aerial vehicles (UAVs) in the field of sensor networks. UAV-LoRa networks have the advantage of ensuring direct visibility between this type of aircraft and ground sensors, allowing the exchange of data even if there is a large distance between them [19]. Furthermore, the use of UAVs as mobile communication nodes is perfectly adapted in environments where there is not enough communication coverage, or a very high investment is needed to implement it [20]. Different methods have been proposed combining LoRa communications and UAVs. Recently, a LoRa-based approach system was developed to transmit the identifier of a UAV and track its status in real time [21].