Updated RGBControl for OTA

This commit is contained in:
Nis Wechselberg 2017-09-25 18:35:04 +02:00
parent 1ab323025f
commit c337565dc1

View file

@ -37,6 +37,9 @@
**********************************************************************/
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <PubSubClient.h>
#include "ESP8266-MQTT-RGBControl.h"
@ -113,6 +116,9 @@ void setup_wifi() {
// Print IP address to serial
Serial.print("My IP address: ");
Serial.println(WiFi.localIP());
ArduinoOTA.setHostname("esp8266-Lighting2");
ArduinoOTA.begin();
}
/*
@ -288,6 +294,9 @@ void setColor() {
}
void loop() {
// Check OTA update
ArduinoOTA.handle();
if (!client.connected()) {
reconnect();
}