# Efficient Runtime Firmware Update Mechanism for LoRaWAN Class A Devices
## 2 Related Work
The document addresses the problem of reconstructing lost fragments due to possible communication failures and describes a redundant process of sending fragments as a solution. This process ensures that the end device maintains its FUOTA session after transmitting all firmware fragments to recover the lost fragments by reconstructing them based on the implemented redundancy. The update process is based on sending a file in fragments of about 40 bytes and requires that the IoT device has enough memory to keep a copy of the previous firmware for recovery in case of update failure. [PERSON], [PERSON] [8] discusses the issue of bugs and security problems in the firmware of LoRaWAN devices that remain without firmware updates for long periods. This study identifies that packet loss is an unresolved problem in FUOTA. [PERSON] [9] presents the limitations and implementation difficulties of the FUOTA method in LoRaWAN networks, specifically in ChirpStack network servers, which do not support FUOTA in the multicast mode. The study analyzes the balance between low-energy networks and large amounts of data, investigating the impact on energy management. It proposes the use of a firmware update server that operates in conjunction with the ChirpStack network server to handle FUOTA updates differently in a true multicast session, also studying the necessary energy. The study concludes that in terms of energy, switching from Class A to B or C offers benefits both in energy terms and in reducing downtime. [PERSON], [PERSON] et al. [10] present a proof of concept demonstrating the use of NB-IoT to update firmware in IoT devices. The study analyzes several topics, namely the energy challenges of IoT devices, the need to update firmware, and the advantages of using LPWAN networks. The firmware update process is described in four distinct domains: firmware generation; firmware distribution; firmware verification; and the update of the microcontroller's program memory involved. One of the contributions of this work includes developing a remote firmware update architecture using the NB-IoT network to transfer firmware images to a large number of devices with negligible impact on battery lifespan given its low energy consumption. In the domain of firmware update processes applied to LoRaWAN devices, several noteworthy studies can be found. [PERSON], [PERSON] [1] proposes a firmware update method based on sending fragmented firmware in packets, using error correction algorithms due to the lack of guaranteed quality of service and packet loss. The firmware fragments are indexed so that the device knows which ones have failed and can recover them. After receiving and reconstructing the complete firmware, the device verifies the integrity of the firmware and proceeds with the update. To minimize the amount of data to be sent, the use of delta updates is mentioned where only the altered parts of the firmware image are sent, potentially reducing data traffic by about 90%. [PERSON] [11] addresses the firmware update process with the aim of developing energy-efficient methods that achieve high data rates with low error rates using Adaptive Data Rate (ADR). Besides the challenges associated with ADR, considerations of reliability and security are presented, including ensuring the proper completion of the firmware update process and protection against malicious attacks during the process. The study concludes that using ADR to find the ideal RF configuration with the highest available data rate is crucial for energy-efficient updates. [PERSON] [12] addresses the challenge of performing firmware updates on IoT devices connected by LPWAN networks such as LoRaWAN, Sigfox, and NB-IoT. Although these networks offer low power consumption and long range, their low data rates and duty cycle constraints make supporting firmware updates difficult. The authors propose a solution highlighting the efficient multicast support and the packet loss recovery.