Abstract
With the rapid expansion of Internet of Things (IoT) devices, current low-power wide-area network (LPWAN) technologies are increasingly susceptible to performance deterioration. LoRaWAN stands out as a leading LPWAN solution due to its ability to support long-range, low-power communication in massive IoT deployments. However, ensuring data reliability in dense and dynamic environments while optimizing transmission settings poses significant challenges, particularly in terms of interference mitigation and energy efficiency. To overcome these limitations, this article proposes an innovative approach that integrates K-means clustering and leverages reinforcement learning (RL) to effectively manage gateway placement and configure transmission parameters, such as spreading factors (SFs) and power levels, based on local signal conditions and environmental feedback. The model explicitly accounts for the capture effect and the imperfect orthogonality of SFs, allowing for more realistic and robust adaptation strategies without relying on the conventional centralized adaptive data rate (ADR) mechanism. The approach is validated through a real-world experimental deployment. Furthermore, we highlighted the novelty of our approach by a detailed analysis of LoRaWAN SF sensitivity thresholds and evaluated the impact of gateway densification and SF reallocation on network performance. Both experimental and simulation outcomes show significant improvements in data extraction rate (DER) and energy efficiency, particularly in large-scale, congested network scenarios.