# LoRa Enabled Smart Inverters for Microgrid Scenarios with Widespread Elements
## 6 LoRaWAN/MQTT for Residential MG in Rural Areas: A Futuristic Case Study  
In Section 5, the feasibility of equipping smart inverters with LoRa communication technology has been discussed. This translates to enabling these devices to connect and communicate over longer ranges and harsher environments while maintaining a low implementation and operational cost. In this section, a prospective application has been introduced that can benefit from LoRaWAN enabled smart inverters to a large extent. The implementation of MG philosophy for the residential sector gains a lot of interest recently. As explained in Section 4.3, if such a residential MG is situated in a rural or a remote area, it can benefit from smart inverters with long-range communication capabilities. Furthermore, based on the discussions provided in Section 3, for such a private communication network LoRaWAN is the preferred choice among the other LPWAN protocols. Therefore, it is used for the proposed communication framework in this case study. As illustrated in Figure 17, in this configuration there are two class of devices connecting through the communication architecture:  
* Outdoor nodes: DGs, ESSs, electrical car charging stations, and field sensors are examples, among many more for the first class of devices. In general, all the end-nodes that are outdoors and are separated by distances more than tens of meters fit into this category. * Indoor nodes: LoRaWAN Gateways and application servers, EMS, MG supervisory control system, user interfaces, and other indoor applications. According to this system configuration, all the outdoor communications are coordinated by LoRaWAN MAC over a LoRa physical link. LoRaWAN enabled smart inverters are used to interface the DGs, ESSs, and loads to the MG bus. Other nodes, mostly sensors, are also LoRaWAN enabled, although they do not use power-electronics interfaces. Once the transmissions and measurements are received by the LoRaWAN gateways (emulated by Node B in the previous section), the payloads are extracted from the LoRaWAN frames and converted to MQTT message format. From this point forward, the LoRaWAN gateway's role is changed to an MQTT client and publishes the messages to a local broker by a short-range physical layer communication technology such as IEEE 802.11, since the long-range capability is no longer required. The other indoor users can also connect to the same MQTT broker and subscribe to the topics that they are interested in or publish relevant messages. One distinctive characteristic of this proposed structure, comparing with most other private LoRaWAN networks, is the localization of the communication servers. In LoRaWAN systems, normally a cloud-based network server is used to collect, manage, and store the data. For instance, the things network (TTN), which is a LoRa Alliance contributor, is a global internet-hosted server that can be used to create LoRaWAN networks [79; 80; 81]. Figure 16: Smart inverter power following test for high and low Transmission power. In the TTN platform, each gateway should be registered and a user interface is provided to screen the received data. Furthermore, it is possible to use higher-level application layer protocols such as MQTT for better messaging services in coordination with TTN. This platform ensures reliable messaging by utilizing three security keys. Two of these keys are session keys that are automatically updated for each session and are unique for each device. The other security key, the application key, is used to coordinate the activation process and trigger the generation of session keys. The security methodology used here is generally similar to the algorithm utilized for the ZigBee communication system. In other words, TTN offers great security measures in terms of authentication and encryption [82]. From another viewpoint, the authors have two concerns as follows:  
1. TTN, like other available LoRaWAN network servers [83], are cloud-based.