From 304bea64fb5efee628f6777c32257c2e225b860b Mon Sep 17 00:00:00 2001 From: technyon Date: Wed, 15 Mar 2023 21:23:48 +0100 Subject: [PATCH] add lilygo support --- Config.h | 2 +- Network.cpp | 7 +++++++ Network.h | 3 ++- Ota.cpp | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Config.h b/Config.h index 0e5992f..faf5950 100644 --- a/Config.h +++ b/Config.h @@ -1,6 +1,6 @@ #pragma once -#define NUKI_HUB_VERSION "8.18" +#define NUKI_HUB_VERSION "8.18-lilygo-1" #define MQTT_QOS_LEVEL 1 #define MQTT_CLEAN_SESSIONS false diff --git a/Network.cpp b/Network.cpp index ab7d45d..9a76860 100644 --- a/Network.cpp +++ b/Network.cpp @@ -89,6 +89,10 @@ void Network::setupDevice() Log->println(F("M5STACK PoESP32 Unit")); _networkDeviceType = NetworkDeviceType::M5STACK_PoESP32_Unit; break; + case 7: + Log->println(F("LilyGO T-ETH-POE")); + _networkDeviceType = NetworkDeviceType::LilyGO_T_ETH_POE; + break; default: Log->println(F("Unknown hardware selected, falling back to Wifi.")); _networkDeviceType = NetworkDeviceType::WiFi; @@ -110,6 +114,9 @@ void Network::setupDevice() case NetworkDeviceType::M5STACK_PoESP32_Unit: _device = new EthLan8720Device(_hostname, _preferences, _ipConfiguration, "M5STACK PoESP32 Unit", 1, 5, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_IP101); break; + case NetworkDeviceType::LilyGO_T_ETH_POE: + _device = new EthLan8720Device(_hostname, _preferences, _ipConfiguration, "LilyGO T-ETH-POE", 0, -1, ETH_PHY_MDC, ETH_PHY_MDIO, ETH_PHY_TYPE, ETH_CLOCK_GPIO17_OUT); + break; case NetworkDeviceType::WiFi: _device = new WifiDevice(_hostname, _preferences, _ipConfiguration); break; diff --git a/Network.h b/Network.h index 26218d0..9cd3085 100644 --- a/Network.h +++ b/Network.h @@ -13,7 +13,8 @@ enum class NetworkDeviceType W5500, Olimex_LAN8720, WT32_LAN8720, - M5STACK_PoESP32_Unit + M5STACK_PoESP32_Unit, + LilyGO_T_ETH_POE }; #define JSON_BUFFER_SIZE 1024 diff --git a/Ota.cpp b/Ota.cpp index 8e4872f..73d78db 100644 --- a/Ota.cpp +++ b/Ota.cpp @@ -45,7 +45,7 @@ bool Ota::updateCompleted() return _updateCompleted; } -bool Ota::restart() +void Ota::restart() { _updateCompleted = false; _updateStarted = false;