## 5 Conclusions and Future Work
In addition, some tests were not performed, such as packet loss and power consumption for logistical reasons. However, these are studies that will be carried out later or possibly by the state of the art as a continuation of this research. In terms of the number of nodes in the network, 5,907,692 SMs were obtained that can be connected to the gateway with only minor SF configurations, and 329,687 SMs with only major SFs, which is a very significant amount when dealing with a low cost communication infrastructure. Another important point is that these numbers are also valid for the devices in the mesh network, so whether from LoRaWAN or LoRaMESH, this is the approximate amount of devices that can be connected to a gateway with the configurations used in this work. Finally, HyDSMaaS services are considered and could be implemented in this communication infrastructure, because the packets are already modeled to receive and send information that these types of services need to travel between EPC and homes, so the infrastructure is already enabled to allow operating DSM services without further investment in the communication infrastructure. To validate the infrastructure, the service was modeled and implemented in the TTN network server, which will receive the data, transform them into JSON packets, and send them to the application server. In the application server, the microsoft Power BI service was used and a REST API was implemented that is able to receive these JSON packets, extract the data and register them in a database that will be used by Power BI to generate reports and visualize the BI data for both final consumers and EPC. The main contribution of this work is the study, implementation and analysis of the LoRa network under LoRaWAN, LoRaMESH and hybrid protocols. The implementation was performed and tested on the bench and in a real scenario, which makes the work more consistent in terms of analysis of the technology itself for the proposed scenario. In addition, a proposal was made to implement a hybrid DAP, which is the device responsible for hybridizing the two networks and allowing data exchange between MESH and LoRaWAN. Another contribution of this work was the proposal of breaking the packets according to the network specifications, this division made the network achieve a range of 1 km more than it was reaching before, moreover, managing to reduce delay and ToA. We implemented the routing services in the TTN using JSON, the REST API in Microsoft Power BI to receive these JSON and register them in the database, and an interactive dashboard for consumers and the EEC using the data from this database, thus validating one of the applications that will be present in the AMI proposed in this work. Finally, a mathematical modeling was presented to calculate the network scalability for the different SF, this will allow to budget or have a better notion of the network capacity. As future work, it is intended to implement an algorithm for dynamic allocation of the DAPs, in order to hybridize the network in a scalable way with the least possible communication infrastructure cost. Furthermore, it is intended to analyze the behavior of DSM services on the infrastructure. Additionally, we intend to study the implementation of the mesh topology using the LoRaWAN protocol. Finally, we intend to collect packet loss and power consumption data that have not yet been collected in this work and the capacity is based on theoretical calculations, however, they will be worked on in more detail in future work. Based on everything that was developed in this work, the lessons learned are (1) LoRaWAN is a technology that varies depending on several factors, including distances, barriers, type of antenna, type of configuration and even the type of hardware that is used. (2) the Radioenge modules are good, but there are better modules on the market.