 #include <ESP8266mDNS.h>
 #include <WiFiUdp.h>
 #include <ArduinoOTA.h>
+#include <Average.h>
 #include "/usr/local/src/ap_setting.h"
 
-extern "C" {
+extern "C" 
+{
 #include "user_interface.h"
 }
 

        bdoor_status = sensor_data.door;
      }
      
        if (_hash != sensor_data.hash) {
        payload = "{\"powerAvg\":";
        payload += sensor_data.ct1_rp;
        payload += ",\"FreeHeap\":";
        payload += ESP.getFreeHeap();
        payload += ",\"RSSI\":";

  WiFi.hostname("esp-emontxv2");

  int Attempt = 0;
  while (WiFi.status() != WL_CONNECTED) 
  {
    delay(100);
    Attempt++;
    if (Attempt == 300)
