Skip to content

Commit

Permalink
0.8.104
Browse files Browse the repository at this point in the history
* fix reboot on inverter save (ESP32) #1559
* fix NRF and Ethernet #1506
  • Loading branch information
lumapu committed Apr 3, 2024
1 parent 7ee1f99 commit f105e25
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 37 deletions.
2 changes: 1 addition & 1 deletion scripts/applyPatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ def applyPatch(libName, patchFile):
if env['PIOENV'][:13] == "opendtufusion":
applyPatch("GxEPD2", "../patches/GxEPD2_SW_SPI.patch")

if (env['PIOENV'][:13] == "opendtufusion"): # or (env['PIOENV'][:13] == "esp32-wroom32"):
if (env['PIOENV'][:13] == "opendtufusion") or (env['PIOENV'][:5] == "esp32"):
applyPatch("RF24", "../patches/RF24_Hal.patch")
4 changes: 4 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Development Changes

## 0.8.104 - 2024-04-04
* fix reboot on inverter save (ESP32) #1559
* fix NRF and Ethernet #1506

## 0.8.103 - 2024-04-02
* merge PR: fix: get refresh property from object #1552
* merge PR: fix typos and spelling in Github Issue template #1550
Expand Down
10 changes: 5 additions & 5 deletions src/hm/hmRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "SPI.h"
#include "radio.h"
#include "../config/config.h"
#if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(SPI_HAL)
#if defined(SPI_HAL)
#include "nrfHal.h"
#endif

Expand All @@ -34,7 +34,7 @@ class HmRadio : public Radio {
HmRadio() {
mDtuSn = DTU_SN;
mIrqRcvd = false;
#if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(SPI_HAL)
#if defined(SPI_HAL)
//mNrf24.reset(new RF24());
#else
mNrf24.reset(new RF24(CE_PIN, CS_PIN, SPI_SPEED));
Expand All @@ -55,7 +55,7 @@ class HmRadio : public Radio {
mDtuRadioId = ((uint64_t)(((mDtuSn >> 24) & 0xFF) | ((mDtuSn >> 8) & 0xFF00) | ((mDtuSn << 8) & 0xFF0000) | ((mDtuSn << 24) & 0xFF000000)) << 8) | 0x01;

#ifdef ESP32
#if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(SPI_HAL)
#if defined(SPI_HAL)
mNrfHal.init(mosi, miso, sclk, cs, ce, SPI_SPEED);
mNrf24.reset(new RF24(&mNrfHal));
#else
Expand All @@ -72,7 +72,7 @@ class HmRadio : public Radio {
mSpi->begin();
#endif

#if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(SPI_HAL)
#if defined(SPI_HAL)
mNrf24->begin();
#else
mNrf24->begin(mSpi.get(), ce, cs);
Expand Down Expand Up @@ -432,7 +432,7 @@ class HmRadio : public Radio {

std::unique_ptr<SPIClass> mSpi;
std::unique_ptr<RF24> mNrf24;
#if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(SPI_HAL)
#if defined(SPI_HAL)
nrfHal mNrfHal;
#endif
Inverter<> *mLastIv = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/network/AhoyWifiEsp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AhoyWifi : public AhoyNetwork {
mConnected = true;
ah::welcome(WiFi.localIP().toString(), F("Station"));
MDNS.begin(mConfig->sys.deviceName);
MDNS.addServiceTxt("http", "tcp", "path", "/");
//MDNS.addServiceTxt("http", "tcp", "path", "/");
mOnNetworkCB(true);
}
break;
Expand Down
35 changes: 19 additions & 16 deletions src/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -148,41 +148,42 @@ monitor_filters =
esp8266_exception_decoder

[env:esp32-wroom32-minimal]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_d32
build_flags = ${env.build_flags}
-DUSE_HSPI_FOR_EPD
-DSPI_HAL
monitor_filters =
esp32_exception_decoder

[env:esp32-wroom32]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_d32
build_flags = ${env:esp32-wroom32-minimal.build_flags}
-DUSE_HSPI_FOR_EPD
-DENABLE_MQTT
-DPLUGIN_DISPLAY
-DENABLE_HISTORY
monitor_filters =
esp32_exception_decoder

[env:esp32-wroom32-de]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_d32
build_flags = ${env:esp32-wroom32.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder

[env:esp32-wroom32-prometheus]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_d32
build_flags = ${env:esp32-wroom32.build_flags}
-DENABLE_PROMETHEUS_EP
monitor_filters =
esp32_exception_decoder

[env:esp32-wroom32-prometheus-de]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_d32
build_flags = ${env:esp32-wroom32-prometheus.build_flags}
-DLANG_DE
Expand All @@ -199,7 +200,7 @@ build_flags = ${env:esp32-wroom32.build_flags}
-DDEF_ETH_MISO_PIN=12
-DDEF_ETH_MOSI_PIN=13
-DDEF_ETH_IRQ_PIN=4
-DDEF_ETH_RST_PIN=2
-DDEF_ETH_RST_PIN=255
-DDEF_NRF_CS_PIN=5
-DDEF_NRF_CE_PIN=17
-DDEF_NRF_IRQ_PIN=16
Expand All @@ -218,10 +219,11 @@ monitor_filters =
esp32_exception_decoder

[env:esp32-s2-mini]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_s2_mini
build_flags = ${env.build_flags}
-DUSE_HSPI_FOR_EPD
-DSPI_HAL
-DENABLE_MQTT
-DPLUGIN_DISPLAY
-DENABLE_HISTORY
Expand All @@ -240,18 +242,19 @@ monitor_filters =
esp32_exception_decoder

[env:esp32-s2-mini-de]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_s2_mini
build_flags = ${env:esp32-s2-mini.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder

[env:esp32-c3-mini]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_c3_mini
build_flags = ${env.build_flags}
-DUSE_HSPI_FOR_EPD
-DSPI_HAL
-DENABLE_MQTT
-DPLUGIN_DISPLAY
-DENABLE_HISTORY
Expand All @@ -270,15 +273,15 @@ monitor_filters =
esp32_exception_decoder

[env:esp32-c3-mini-de]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = lolin_c3_mini
build_flags = ${env:esp32-c3-mini.build_flags}
-DLANG_DE
monitor_filters =
esp32_exception_decoder

[env:opendtufusion-minimal]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env.build_flags}
Expand All @@ -303,7 +306,7 @@ monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-minimal.build_flags}
Expand All @@ -314,7 +317,7 @@ monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-de]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion.build_flags}
Expand All @@ -323,7 +326,7 @@ monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-ethernet]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-minimal.build_flags}
Expand All @@ -342,7 +345,7 @@ monitor_filters =
esp32_exception_decoder, colorize

[env:opendtufusion-ethernet-de]
platform = espressif32@6.5.0
platform = espressif32@6.6.0
board = esp32-s3-devkitc-1
upload_protocol = esp-builtin
build_flags = ${env:opendtufusion-ethernet.build_flags}
Expand Down
26 changes: 12 additions & 14 deletions src/web/html/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@
<div class="s_content">
<fieldset class="mb-2">
<legend class="des">WiFi</legend>

<div class="row mb-3">
<div class="col-12 col-sm-3 my-2">{#AP_PWD}</div>
<div class="col-12 col-sm-9"><input type="text" name="ap_pwd" minlength="8" /></div>
</div>
<!--IF_ETHERNET-->
<!--ELSE-->
<div class="row mb-2 mb-sm-3">
<div class="col-12 col-sm-3 my-2">SSID</div>
<div class="col-12 col-sm-9"><input type="text" name="ssid"/><br/><a href="/wizard">{#SCAN_WIFI}</a></div>
<div class="col-12 col-sm-9">
<input type="text" name="ssid"/><br/>
<a href="/wizard">{#SCAN_WIFI}</a>
</div>
</div>
<div class="row mb-2 mb-sm-3">
<div class="col-12 col-sm-3">{#SSID_HIDDEN}</div>
Expand All @@ -69,6 +73,7 @@
<div class="col-12 col-sm-3 my-2">{#PASSWORD}</div>
<div class="col-12 col-sm-9"><input type="password" name="pwd" value="{PWD}"/></div>
</div>
<!--ENDIF_ETHERNET-->
</fieldset>
<fieldset class="mb-4">
<legend class="des">{#STATIC_IP}</legend>
Expand Down Expand Up @@ -652,9 +657,14 @@
}

function parseSys(obj) {
/*IF_ETHERNET*/
for(var i of [["device", "device_name"], ["ap_pwd", "ap_pwd"]])
document.getElementsByName(i[0])[0].value = obj[i[1]];
/*ELSE*/
for(var i of [["device", "device_name"], ["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
document.getElementsByName(i[0])[0].value = obj[i[1]];
document.getElementsByName("hidd")[0].checked = obj["hidd"];
/*ENDIF_ETHERNET*/
document.getElementsByName("darkMode")[0].checked = obj["dark_mode"];
document.getElementsByName("schedReboot")[0].checked = obj["sched_reboot"];
e = document.getElementsByName("adminpwd")[0];
Expand Down Expand Up @@ -1288,18 +1298,6 @@
}
}

function listNetworks(root) {
var s = document.getElementById("networks");
selDelAllOpt(s);
if(root["networks"].length > 0) {
s.appendChild(opt("-1", "{#NETWORK_PLEASE_SELECT}"));
for(i = 0; i < root["networks"].length; i++) {
s.appendChild(opt(root["networks"][i]["ssid"], root["networks"][i]["ssid"] + " (" + root["networks"][i]["rssi"] + " dBm)"));
}
} else
s.appendChild(opt("-1", "{#NO_NETWORK_FOUND}"));
}

getAjax("/api/setup", parse);
</script>
</body>
Expand Down

0 comments on commit f105e25

Please sign in to comment.