Added OTA methods, fixed subwwoofer template

This commit is contained in:
Nis Wechselberg 2017-09-17 17:44:18 +02:00
parent 145984c2f8
commit 7fc8cda783
3 changed files with 19 additions and 3 deletions

View file

@ -34,6 +34,9 @@
**********************************************************************/
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <PubSubClient.h>
#include "ESP8266-MQTT-BenQ.h"
@ -91,6 +94,8 @@ void setup_wifi() {
Serial.print("My IP address: ");
Serial.println(WiFi.localIP());
}
ArduinoOTA.setHostname("esp8266-BenQ");
ArduinoOTA.begin();
}
/*
@ -177,6 +182,9 @@ void updateLamptime() {
}
void loop() {
// Check OTA update
ArduinoOTA.handle();
// Ensure MQTT connection
if (!client.connected()) {
reconnect();