# Efficient Runtime Firmware Update Mechanism for LoRaWAN Class A Devices
## 5 Conclusions  
The method proposed in this study represents a significant advancement in firmware updates for LoRaWAN Class A devices. By implementing code segment-based updates during runtime, we substantially reduced device downtime, which is crucial for maintaining high availability in critical applications. Additionally, the reduction in energy consumption during the update process helps preserve device autonomy, which is critical for remote and hard-to-access units. Furthermore, it results in a significantly higher energy efficiency compared to existing solutions. The proposed firmware update mechanism is compatible with a wide range of microcontrollers, ensuring data integrity throughout the process. Its robustness makes it particularly well-suited for applications such as smart agriculture, smart cities, smart metering, and other use cases relying on LoRaWAN infrastructure. These features are especially relevant in environments where continuous and efficient updates of remote devices are required. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Method** & **[PERSON] et al. [3]** & **[PERSON] et al. [5]** & **[PERSON] [9]** & **[PERSON] [11]** & **Proposed System** \\ \hline Transmission topology & Multicast & Multicast & Multicast & N. A. & Peer to Peer \\ End device class & C & C & C & N. A. & A \\ Memory update type & Full image & Full image & Deltas & Full image & Segments \\ Firmware Update Size (kB) & 100 & 100 & 15.8 & 128 & 0.641 \\ Update firmware image & 100.00 & 100.00 & 11.68 & 100.00 & 0.60 \\ \multicolumn{5}{l}{Transmission data records} \\ \multicolumn{5}{l}{time (min)} & 32[DR5] & 1140[DR5] & 5[DR5] & 16[DR6] & 1.61[DR5] \\ \multicolumn{5}{l}{Update type} & Bootloader & Bootloader & Bootloader & Dual Boot & Self-Programming \\ Downtime (s) & N. A. & N. A. & 42.48 & N. A. & 0.017 \\ Energy consumption (J) & 80.00 & N. A. & 10.68 & 200.00 & 8.04 \\ Efficiency [\%] & 45.00 & 100.00 & N. A. & N. A. & 100.00 \\ \hline \hline \end{tabular} N. A.—Not available.  
\end{table} 
Table 4: Comparison table between several firmware update methods present in the literature. The proposed approach stands out due to the reduction in transmitted data, alleviating the communication network's overhead and increasing overall system efficiency. The simplicity and agility of the update process are achieved by focusing efforts on the network server's application layer and on the IoT device's update process, avoiding the complexity and inflexibility of the LoRa Alliance's FUOTA specifications. This method not only simplifies implementation and operation but also ensures that updates can be performed without changes to the existing network infrastructure. However, some limitations need to be addressed. The proposed method has limitations regarding the program memory size to be updated, which is limited to 1024 bytes. Additionally, it is also incompatible with operating systems and intermediate hardware abstraction layers. In update failure scenarios, the proposed process is repeated in the next iteration in its entirety. As future work, we suggest classifying update failures to address this issue, for example, identifying whether the failure occurred due to a missing line (in this case, performing only the downlink of the missing line), whether a line did not pass the integrity test (verifying the integrity of the line on the application server), or whether the failure occurred in the verification process after writing to the program memory (which may indicate aging of the program memory and the need to allocate changes in another memory area). Data compression algorithms can be integrated to further optimize the update process, while the implementation of advanced security protocols, such as end-to-end encryption, enhances system robustness in vulnerable environments.