   Serial.println();
 
   configTime(9 * 3600, 0, "pool.ntp.org", "time.nist.gov");
+
+  //OTA
+  // Port defaults to 8266
+  ArduinoOTA.setPort(8266);
+  ArduinoOTA.setHostname("esp-slackbot");
+  ArduinoOTA.setPassword(otapassword);
+  ArduinoOTA.onStart([]()
+  {
+    //sendUdpSyslog("ArduinoOTA Start");
+  });
+  ArduinoOTA.onEnd([]()
+  {
+    //sendUdpSyslog("ArduinoOTA End");
+  });
+  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total)
+  {
+    //syslogPayload = "Progress: ";
+    //syslogPayload += (progress / (total / 100));
+    //sendUdpSyslog(syslogPayload);
+  });
+  ArduinoOTA.onError([](ota_error_t error)
+  {
+    //ESP.restart();
+    if (error == OTA_AUTH_ERROR) abort();
+    else if (error == OTA_BEGIN_ERROR) abort();
+    else if (error == OTA_CONNECT_ERROR) abort();
+    else if (error == OTA_RECEIVE_ERROR) abort();
+    else if (error == OTA_END_ERROR) abort();
+  });
+
+  ArduinoOTA.begin();
 }
 
 unsigned long lastPing = 0;


WiFiClientSecure sslclient;
WebSocketsClient webSocket;

long nextCmdId = 1;
bool connected = false;

#include <lgWhisen.h>
// https://github.com/markszabo/IRremoteESP8266
#include <IRremoteESP8266.h>
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include <WiFiUdp.h>

#include "/usr/local/src/ap_setting.h"
#include "/usr/local/src/slack_setting.h"
const char* otapassword = OTA_PASSWORD;

const char* api_fingerprint = "AB F0 5B A9 1A E0 AE 5F CE 32 2E 7C 66 67 49 EC DD 6D 6A 38";

