Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HeishaMon/HeishaMon.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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...!!)
Expand Down
1 change: 1 addition & 0 deletions HeishaMon/htmlcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,7 @@ static const char settingsForm2[] FLASHPROG = R"====(
<div class='setting-row'><label class='setting-label'>Emulate optional PCB</label><div class='checkbox-wrap'><input type='checkbox' name='optionalPCB' value='enabled'></div></div>
<div class='setting-row'><label class='setting-label'>Enable Opentherm processing</label><div class='checkbox-wrap'><input type='checkbox' name='opentherm' value='enabled'></div></div>
<div class='setting-row'><label class='setting-label'>Enable CZ-TAW1 proxy port</label><div class='checkbox-wrap'><input type='checkbox' name='proxy' value='enabled'></div></div>
<div class='setting-row'><label class='setting-label'>Ethernet module (W5500)</label><div style='display:flex;align-items:center;gap:10px'><div class='checkbox-wrap'><input type='checkbox' name='ethernet' value='enabled'></div><span class='setting-hint' style='display:block;margin-top:4px'>Disable on boards without the ethernet module to skip the W5500 probe and leave GPIO10-15 untouched. Needs a reboot.</span></div></div>
<div class='setting-row'><label class='setting-label'>Force rules on boot</label><div class='checkbox-wrap'><input type='checkbox' name='force_rules' value='enabled'></div></div>
</div></div>
<div class='panel' style='margin-bottom:16px'>
Expand Down
9 changes: 9 additions & 0 deletions HeishaMon/webfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions HeishaMon/webfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading