From 3a81c7001823dae498f022c5e1ccd0df1a53f45b Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 5 Aug 2026 15:43:30 +0200 Subject: [PATCH] add DHCP workaround (disabled for now) --- src/core/network.cpp | 11 +++++++++++ src/core/network.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/core/network.cpp b/src/core/network.cpp index 96fc2f50d..3eee3ae14 100644 --- a/src/core/network.cpp +++ b/src/core/network.cpp @@ -539,6 +539,17 @@ void Network::startEthernet() { return; } + /* + // The Tasmota SDK is built with CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=2, so the Ethernet MAC is derived as + // a locally-administered address from base+1 instead of the universal base+3 that Arduino Core 2 used. + // Seed the MAC table with the old value before the EMAC driver reads it, so DHCP reservations survive an upgrade. + uint8_t eth_mac[6]; + if (esp_read_mac(eth_mac, ESP_MAC_BASE) == ESP_OK) { + eth_mac[5] += 3; + esp_iface_mac_addr_set(eth_mac, ESP_MAC_ETH); + } + */ + // reset power and add a delay as ETH doesn't not always start up correctly after a warm boot if (eth_power_ != -1) { pinMode(eth_power_, OUTPUT); diff --git a/src/core/network.h b/src/core/network.h index 92da60be3..d081f0232 100644 --- a/src/core/network.h +++ b/src/core/network.h @@ -20,6 +20,7 @@ #define EMSESP_NETWORK_H_ #ifndef EMSESP_STANDALONE +#include #include #include #include