## 6 Conclusions  
LoRaWAN networks allow data transmission at long distances for countless added-value IoT applications. However, factors such as coverage in inaccessible areas, energy consumption limitations, and physical link quality may make the conventional star topology of LoRaWAN networks less than an ideal option for wireless IoT deployments. In this paper, a specification-compliant solution for star and mesh adaptable topology coexistence in LoRaWAN networks that introduces multi-hop transmissions while remaining completely transparent to the gateway and LoRaWAN server has been presented. The proposed solution has been implemented with the use of open-source software for the creation of LoRaWAN networks and the development of a set of software modules for topology management, network control through a user interface, and operation in star, mesh, and hybrid  
Figure 19: SNR of the devices in scenario 3. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Metric** & **Device** & **Minimum** & **Maximum** & **Average** & **Variance** \\ \hline \multirow{6}{*}{Latency (s)} & 1 & 1.4 & 2.3 & 2.2 & 0.02 \\  & 2 & 0.8 & 2.2 & 1.7 & 0.05 \\  & 3 & 1.5 & 2.5 & 2.3 & 0.03 \\  & 4 & 1.2 & 2.3 & 1.9 & 0.03 \\  & 5 & 0.7 & 2.3 & 1.7 & 0.12 \\  & 6 & 1.3 & 2.4 & 2.1 & 0.05 \\ \hline \multirow{6}{*}{RSSI (dBm)} & 1 & \(-99\) & \(-83\) & \(-89.4\) & 10.51 \\  & 2 & \(-86\) & \(-76\) & \(-89.4\) & 10.51 \\  & 3 & \(-103\) & \(-79\) & \(-90.7\) & 27.09 \\  & 4 & \(-79\) & \(-69\) & \(-73.81\) & 3.09 \\  & 5 & \(-95\) & \(-70\) & \(-78.53\) & 26.70 \\  & 6 & \(-88\) & \(-69\) & \(-75.41\) & 10.62 \\ \hline \multirow{6}{*}{SNR (dB)} & 1 & 4.5 & 11.2 & 8.6 & 1.44 \\  & 2 & 5.8 & 11.8 & 9.4 & 0.87 \\ \cline{1-1}  & 3 & 1.2 & 11 & 8.22 & 3.19 \\ \cline{1-1}  & 4 & 6.8 & 11.5 & 9.5 & 0.78 \\ \cline{1-1}  & 5 & 6.2 & 11 & 9.4 & 0.85 \\ \cline{1-1}  & 6 & 6.2 & 11.5 & 9.1 & 1.38 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Link quality metrics collected in scenario 3.  
topology modes at the end devices. This implementation has allowed for a testbed for experimentation on a university campus. Three scenarios for proof-of-concept experiments were designed to evaluate the feasibility and performance of coexisting star and mesh topology end devices under different configurations. The results obtained from these tests corroborate the operability of our proposed solution where, under the conditions of the experiments, the latency does not exhibit a significant increase and can even be improved in the case of multi-hop topologies. Therefore, LoRaWAN networks can benefit from mesh topologies while maintaining the performance expected for conventional LoRaWAN IoT telemetry applications characterized by not operating in strict real time. As this paper has demonstrated the technical feasibility of star and mesh topology coexistence in LoRaWAN networks, for future work, we are planning to equip the topology manager with reinforcement learning techniques. This will allow for exploring the optimization of selecting the network topology mode according to multiple factors, such as link quality, energy consumption, and carbon footprint, among many others. Conceptualization, R.A.-C.; methodology, R.A.-C.; software, C.C. ; validation, J.G.-H.; formal analysis, C.C., L.G. and J.G.-H.; investigation, C.C. ; resources, C.-L.Z.-C.; data curation, C.C. and L.G. ; writing--original draft preparation, L.G. ; writing--review and editing, L.G. and [PERSON]-H.; visualization, L.G. ; supervision, L.G., R.A.-C., C.-L.Z.-C. and A.-J.G.-S; project administration, C.-L.Z.-C.; funding acquisition, L.G., R.A.-C., C.-L.Z.-C., A.-J.G.-S. and [PERSON]-H. All authors have read and agreed to the published version of the manuscript. This work was supported by the grants TED2021-129336B-I00, and FJC2021-047073-I, funded by MCIN/AEI/10.13039/501100011033 and by the European Union NextGenerationEU/PRTR. This work is also supported by PID2023-1482140B-C21 funded by MICIU/AEI/10.13039/501100011033/ and by FEDER, EU.