From 53cb75691f32f70be4b56e7c5668642bff7a4c6c Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Thu, 19 Oct 2023 19:47:36 +0100 Subject: [PATCH] Swap OTA --- sensor/platformio.ini | 2 ++ sensor/src/sensor.ino | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sensor/platformio.ini b/sensor/platformio.ini index 05cafd2..9958023 100644 --- a/sensor/platformio.ini +++ b/sensor/platformio.ini @@ -19,6 +19,8 @@ lib_deps = https://github.com/dawidchyrzynski/arduino-home-assistant.git#2.0.0 links2004/WebSockets@^2.3.7 https://github.com/EinarArnason/ArduinoQueue.git@^1.2.5 + https://github.com/scottchiefbaker/ESP-WebOTA.git#aefb6c1a9190601b12b973a0c1cce39cb4e0f453 + [env:wemos_d1_mini32] platform = espressif32 diff --git a/sensor/src/sensor.ino b/sensor/src/sensor.ino index 0625fad..72d0cf3 100644 --- a/sensor/src/sensor.ino +++ b/sensor/src/sensor.ino @@ -12,10 +12,10 @@ #include // - https://github.com/plerup/espsoftwareserial #endif #include -#include #include #include #include +#include // ************************************************************************************************ // Start of config @@ -336,9 +336,8 @@ void setup() { tub.updateBaudRate(115200); #endif - ArduinoOTA.setHostname("hottub-sensor"); - - ArduinoOTA.begin(); + init_wifi(ssid, passphrase, "hottub-sensor"); + webota.init(8080, "/update"); // start telnet server server.begin(); @@ -500,7 +499,7 @@ void loop() { } mqtt.loop(); - ArduinoOTA.handle(); + webota.handle(); telnetLoop();