###### Abstract
Deployments in cities or industrial environments can find the effective coverage to be notably reduced due to the presence of multiple obstacles [16]. The use of multi-hop network topologies is a solution that could substantially improve the performance and applicability of LoRaWAN networks in this type of scenario. Other possible benefits of using multi-hop topologies include (1) improved overall communications as a result of adapting the topology to the lossy environment caused by obstacles or interference [17], (2) decreased network deployment costs since the required number of gateways is reduced, (3) less energy consumption as gateways need more energy to operate than end devices [18], and (4) a smaller network carbon footprint due to fewer required gateways [19]. The improvement that multi-hop topologies could bring to LoRa networks has been addressed in several works that evaluate these solutions in simulated and real environments [20; 21; 22; 23]. However, those approaches are not compatible with the LoRaWAN specifications, which clearly jeopardizes extending the functionality of LoRa networks. The LoRa Alliance has also attempted to provide a one-hop solution through a range extender depicted as a relay node that forwards uplink or downlink frames to the next hop [24]. However, the operation of the relay device is exclusively dedicated to that purpose, disallowing leveraging it for other tasks. This means that the network needs to be planned in advance or modified with the addition of relay nodes deployed by an operator, according to the identified obstacles. The result is a static network that cannot be rearranged to accommodate new needs unless an operator decides to explicitly address that issue. Therefore, there is a gap in the literature regarding flexible LoRaWAN networks with adaptive topology management enabling automatic switching between star and mesh topologies, as this is not addressed in any of the above-mentioned works. In this context, this paper presents a straightforward adaptive topology solution, fully compatible with the LoRaWAN standard, that enables users to change from star to mesh LoRaWAN network topologies according to physical link performance metrics. Our solution can be easily adopted by conventional networks and applications on top. The contributions of this work are manifold:  
* The proposal of a straightforward approach for LoRaWAN, enabling the coexistence of star and mesh network topologies (hybrid) completely compliant with the LoRaWAN standard and seamless to IoT applications. * The provision of a topology manager to assess network link quality and the decision to change the role of end devices to single-hop or multiple-hop transmission modes. * As a consequence of the previous point, an end device code integrates star, mesh, and hybrid topology states to perform the changes in the transmission modes. * The addition of a control user interface to customize the parameters used by the topology manager and allow the user to change transmission mode at will. This proposal has been implemented for LoRaWAN end devices from different vendors. A battery of tests has been conducted to validate the proposed enhanced LoRaWAN functionality in different case scenarios in a real campus environment. The rest of the paper is organized as follows: Section 2 introduces the related work. The methodology is described in Section 3. The evaluation scenarios are detailed in Section 4. Section 5 discusses the results obtained. Finally, the conclusion and future work are presented in Section 6.