From 6d60d6b4c8d76055262732b5f8da8f615825991c Mon Sep 17 00:00:00 2001 From: rforro Date: Fri, 17 Jan 2025 18:34:37 +0100 Subject: [PATCH] LilyGO T-ETH ELite (ESP32-S3+Ethernet POE) support (#611) * LilyGO T-ETH ELite (ESP32-S3+Ethernet POE) support * Update W5500Definitions.h * Update README.md --------- Co-authored-by: iranl --- README.md | 5 ++++- src/Gpio.cpp | 8 ++++++++ src/WebCfgServer.cpp | 1 + src/enums/NetworkDeviceType.h | 1 + src/networkDevices/W5500Definitions.h | 8 +++++++- src/util/NetworkDeviceInstantiator.cpp | 11 +++++++++++ src/util/NetworkUtil.cpp | 3 +++ 7 files changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c1aac1..3a02e5f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,9 @@ As an alternative to Wi-Fi (which is available on any supported ESP32), the foll - [M5Stack Atom POE](https://docs.m5stack.com/en/atom/atom_poe) - [M5Stack PoESP32 Unit](https://docs.m5stack.com/en/unit/poesp32) - [LilyGO-T-ETH-POE](https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-POE) +- [LilyGO-T-ETH-Lite](https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series) +- [LilyGO-T-ETH-Lite-ESP32S3](https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series) +- [LilyGO-T-ETH ELite](https://github.com/Xinyuan-LilyGO/LilyGO-T-ETH-Series) - [GL-S10 (Revisions 2.1, 2.3 / 1.0 is not supported)](https://www.gl-inet.com/products/gl-s10/) In principle all ESP32 (and variants) devices with built-in ethernet port are supported, but might require additional setup using the "Custom LAN setup" option. @@ -58,7 +61,7 @@ The ESP32-S3 is a dual-core CPU with many GPIO's, ability to enlarge RAM using P The only functions missing from the ESP32-S3 as compared to other ESP devices is the ability to use some Ethernet modules only supported by the original ESP32 (and ESP32-P4) and the ability to connect over WIFI6 (C6 or ESP32-P4 with C6 module) Other considerations: -- If Ethernet/PoE is required: An ESP32-S3 with PSRAM in combination with a SPI Ethernet module ([W5500](https://www.aliexpress.com/w/wholesale-w5500.html)) and [PoE to Ethernet and USB type B/C splitter](https://aliexpress.com/w/wholesale-poe-splitter-usb-c.html) or the M5stack Atom S3R with the M5stack AtomPoe W5500 module +- If Ethernet/PoE is required: An ESP32-S3 with PSRAM in combination with a SPI Ethernet module ([W5500](https://www.aliexpress.com/w/wholesale-w5500.html)) and [PoE to Ethernet and USB type B/C splitter](https://aliexpress.com/w/wholesale-poe-splitter-usb-c.html) or the LilyGO-T-ETH ELite, LilyGO-T-ETH-Lite-ESP32S3 or M5stack Atom S3R with the M5stack AtomPoe W5500 module - If WIFI6 is absolutely required (it probably isn't): ESP32-C6 Devices ranked best-to-worst: diff --git a/src/Gpio.cpp b/src/Gpio.cpp index b40d88d..a8ae3a0 100644 --- a/src/Gpio.cpp +++ b/src/Gpio.cpp @@ -284,6 +284,14 @@ const std::vector Gpio::getDisabledPins() const disabledPins.push_back(ETH_PHY_SPI_MISO_M5_W5500); disabledPins.push_back(ETH_PHY_SPI_MOSI_M5_W5500); break; + case 12: + disabledPins.push_back(ETH_PHY_CS_ELITE_W5500); + disabledPins.push_back(ETH_PHY_IRQ_ELITE_W5500); + disabledPins.push_back(ETH_PHY_RST_ELITE_W5500); + disabledPins.push_back(ETH_PHY_SPI_SCK_ELITE_W5500); + disabledPins.push_back(ETH_PHY_SPI_MISO_ELITE_W5500); + disabledPins.push_back(ETH_PHY_SPI_MOSI_ELITE_W5500); + break; case 11: disabledPins.push_back(_preferences->getInt(preference_network_custom_cs, -1)); disabledPins.push_back(_preferences->getInt(preference_network_custom_irq, -1)); diff --git a/src/WebCfgServer.cpp b/src/WebCfgServer.cpp index 5423b94..d3ac43c 100644 --- a/src/WebCfgServer.cpp +++ b/src/WebCfgServer.cpp @@ -5912,6 +5912,7 @@ const std::vector> WebCfgServer::getNetworkDetectionOp options.push_back(std::make_pair("5", "WT32-ETH01")); options.push_back(std::make_pair("6", "M5STACK PoESP32 Unit")); options.push_back(std::make_pair("7", "LilyGO T-ETH-POE")); + options.push_back(std::make_pair("12", "LilyGO T-ETH ELite")); options.push_back(std::make_pair("8", "GL-S10")); options.push_back(std::make_pair("9", "ETH01-Evo")); options.push_back(std::make_pair("11", "Custom LAN module")); diff --git a/src/enums/NetworkDeviceType.h b/src/enums/NetworkDeviceType.h index ea326c8..af66eda 100644 --- a/src/enums/NetworkDeviceType.h +++ b/src/enums/NetworkDeviceType.h @@ -10,6 +10,7 @@ enum class NetworkDeviceType WT32_LAN8720, M5STACK_PoESP32_Unit, LilyGO_T_ETH_POE, + LilyGO_T_ETH_ELite, GL_S10, ETH01_Evo, CUSTOM diff --git a/src/networkDevices/W5500Definitions.h b/src/networkDevices/W5500Definitions.h index 6d08cbd..7a0d5c9 100644 --- a/src/networkDevices/W5500Definitions.h +++ b/src/networkDevices/W5500Definitions.h @@ -14,9 +14,15 @@ #define ETH_PHY_SPI_SCK_M5_W5500_S3 5 #define ETH_PHY_SPI_MISO_M5_W5500_S3 7 #define ETH_PHY_SPI_MOSI_M5_W5500_S3 8 +#define ETH_PHY_IRQ_ELITE_W5500 14 +#define ETH_PHY_RST_ELITE_W5500 -1 +#define ETH_PHY_CS_ELITE_W5500 45 +#define ETH_PHY_SPI_SCK_ELITE_W5500 48 +#define ETH_PHY_SPI_MISO_ELITE_W5500 47 +#define ETH_PHY_SPI_MOSI_ELITE_W5500 21 #define ETH_PHY_IRQ_GENERIC_W5500 3 #define ETH_PHY_RST_GENERIC_W5500 4 #define ETH_PHY_CS_GENERIC_W5500 5 #define ETH_PHY_SPI_SCK_GENERIC_W5500 8 #define ETH_PHY_SPI_MISO_GENERIC_W5500 9 -#define ETH_PHY_SPI_MOSI_GENERIC_W5500 10 \ No newline at end of file +#define ETH_PHY_SPI_MOSI_GENERIC_W5500 10 diff --git a/src/util/NetworkDeviceInstantiator.cpp b/src/util/NetworkDeviceInstantiator.cpp index af4fda5..9bc841d 100644 --- a/src/util/NetworkDeviceInstantiator.cpp +++ b/src/util/NetworkDeviceInstantiator.cpp @@ -68,6 +68,17 @@ NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDevice ETH_PHY_SPI_MOSI_M5_W5500, ETH_PHY_W5500); break; + case NetworkDeviceType::LilyGO_T_ETH_ELite: + device = new EthernetDevice(hostname, preferences, ipConfiguration, "LilyGO T-ETH ELite", + ETH_PHY_ADDR_W5500, + ETH_PHY_CS_ELITE_W5500, + ETH_PHY_IRQ_ELITE_W5500, + ETH_PHY_RST_ELITE_W5500, + ETH_PHY_SPI_SCK_ELITE_W5500, + ETH_PHY_SPI_MISO_ELITE_W5500, + ETH_PHY_SPI_MOSI_ELITE_W5500, + ETH_PHY_W5500); + break; case NetworkDeviceType::CUSTOM: { int custPHY = preferences->getInt(preference_network_custom_phy, 0); diff --git a/src/util/NetworkUtil.cpp b/src/util/NetworkUtil.cpp index 463898d..eef08af 100644 --- a/src/util/NetworkUtil.cpp +++ b/src/util/NetworkUtil.cpp @@ -46,6 +46,9 @@ NetworkDeviceType NetworkUtil::GetDeviceTypeFromPreference(int hardwareDetect, i return NetworkDeviceType::WiFi; } break; + case 12: + return NetworkDeviceType::LilyGO_T_ETH_ELite; + break; default: Log->println(("Unknown hardware selected, falling back to Wi-Fi.")); return NetworkDeviceType::WiFi;