Updated RGBControl for OTA
This commit is contained in:
parent
1ab323025f
commit
c337565dc1
1 changed files with 9 additions and 0 deletions
|
@ -37,6 +37,9 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
|
#include <ESP8266mDNS.h>
|
||||||
|
#include <WiFiUdp.h>
|
||||||
|
#include <ArduinoOTA.h>
|
||||||
#include <PubSubClient.h>
|
#include <PubSubClient.h>
|
||||||
#include "ESP8266-MQTT-RGBControl.h"
|
#include "ESP8266-MQTT-RGBControl.h"
|
||||||
|
|
||||||
|
@ -113,6 +116,9 @@ void setup_wifi() {
|
||||||
// Print IP address to serial
|
// Print IP address to serial
|
||||||
Serial.print("My IP address: ");
|
Serial.print("My IP address: ");
|
||||||
Serial.println(WiFi.localIP());
|
Serial.println(WiFi.localIP());
|
||||||
|
|
||||||
|
ArduinoOTA.setHostname("esp8266-Lighting2");
|
||||||
|
ArduinoOTA.begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -288,6 +294,9 @@ void setColor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
// Check OTA update
|
||||||
|
ArduinoOTA.handle();
|
||||||
|
|
||||||
if (!client.connected()) {
|
if (!client.connected()) {
|
||||||
reconnect();
|
reconnect();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue