From 37f8146656e1950c362ad354bdea70f4c8b0b857 Mon Sep 17 00:00:00 2001 From: Dmitrijs <7899764+dimkin-eu@users.noreply.github.com> Date: Thu, 15 Oct 2026 17:35:51 +0300 Subject: [PATCH] ESP32: add setting to skip W5500 ethernet probe --- HeishaMon/HeishaMon.ino | 4 ++++ HeishaMon/htmlcode.h | 1 + HeishaMon/webfunctions.cpp | 9 +++++++++ HeishaMon/webfunctions.h | 1 + 4 files changed, 15 insertions(+) diff --git a/HeishaMon/HeishaMon.ino b/HeishaMon/HeishaMon.ino index 62f2160a..8af40fa0 100644 --- a/HeishaMon/HeishaMon.ino +++ b/HeishaMon/HeishaMon.ino @@ -178,6 +178,10 @@ int timerqueue_size = 0; #define ETH_SPI_MOSI 11 void setupETH() { + if (!heishamonSettings.ethernet) { + loggingSerial.println(F("Ethernet disabled in settings, skipping W5500 init")); + return; + } SPI.begin(ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI); if (ETH.begin(ETH_TYPE, ETH_ADDR, ETH_CS, ETH_IRQ, ETH_RST, SPI)) { //sethostname on ESP32 after eth.begin (!! for wifi is most be before...!!) diff --git a/HeishaMon/htmlcode.h b/HeishaMon/htmlcode.h index 7e552f99..09299d66 100644 --- a/HeishaMon/htmlcode.h +++ b/HeishaMon/htmlcode.h @@ -1705,6 +1705,7 @@ static const char settingsForm2[] FLASHPROG = R"====(
+
Disable on boards without the ethernet module to skip the W5500 probe and leave GPIO10-15 untouched. Needs a reboot.
diff --git a/HeishaMon/webfunctions.cpp b/HeishaMon/webfunctions.cpp index 38efded6..4ae8e003 100644 --- a/HeishaMon/webfunctions.cpp +++ b/HeishaMon/webfunctions.cpp @@ -258,6 +258,7 @@ void loadSettings(settingsStruct *heishamonSettings) { heishamonSettings->opentherm = ( jsonDoc[F("opentherm")] == "enabled" ) ? true : false; #ifdef ESP32 heishamonSettings->proxy = ( jsonDoc[F("proxy")] == "enabled" ) ? true : false; + heishamonSettings->ethernet = ( jsonDoc[F("ethernet")] == "disabled" ) ? false : true; //default to true if not found in settings #endif if ( jsonDoc[F("waitTime")]) heishamonSettings->waitTime = jsonDoc[F("waitTime")]; if (heishamonSettings->waitTime < 5) heishamonSettings->waitTime = 5; @@ -489,6 +490,11 @@ void settingsToJson(JsonDocument &jsonDoc, settingsStruct *heishamonSettings) { } else { jsonDoc[F("proxy")] = "disabled"; } + if (heishamonSettings->ethernet) { + jsonDoc[F("ethernet")] = "enabled"; + } else { + jsonDoc[F("ethernet")] = "disabled"; + } #endif jsonDoc[F("waitTime")] = heishamonSettings->waitTime; jsonDoc[F("waitDallasTime")] = heishamonSettings->waitDallasTime; @@ -630,6 +636,7 @@ int saveSettings(struct webserver_t *client, settingsStruct *heishamonSettings) #ifdef ESP32 jsonDoc[F("proxy")] = String("disabled"); + jsonDoc[F("ethernet")] = String("disabled"); #endif #ifdef TLS_SUPPORT jsonDoc[F("mqtt_tls_enabled")] = String("disabled"); @@ -679,6 +686,8 @@ int saveSettings(struct webserver_t *client, settingsStruct *heishamonSettings) #ifdef ESP32 } else if (strcmp(tmp->name.c_str(), "proxy") == 0) { jsonDoc[F("proxy")] = tmp->value; + } else if (strcmp(tmp->name.c_str(), "ethernet") == 0) { + jsonDoc[F("ethernet")] = tmp->value; #endif } else if (strcmp(tmp->name.c_str(), "ntp_servers") == 0) { jsonDoc[F("ntp_servers")] = tmp->value; diff --git a/HeishaMon/webfunctions.h b/HeishaMon/webfunctions.h index f485158f..b1b9fd2b 100644 --- a/HeishaMon/webfunctions.h +++ b/HeishaMon/webfunctions.h @@ -68,6 +68,7 @@ struct settingsStruct { bool hotspot = true; //enable wifi hotspot when wifi is not connected #ifdef ESP32 bool proxy = true; //cztaw proxy port enable flag + bool ethernet = true; //probe for W5500 ethernet module at boot (disable on boards without it) #endif s0SettingsStruct s0Settings[NUM_S0_COUNTERS]; gpioSettingsStruct gpioSettings;