Browse Source

Merge branch 'lumapu:development03' into development03

pull/1148/head
fsck-block 1 year ago
committed by GitHub
parent
commit
9c7079ad15
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/compile_development.yml
  2. 4
      .github/workflows/compile_release.yml
  3. 2
      scripts/applyPatches.py
  4. 4
      scripts/getVersion.py
  5. 6
      src/CHANGES.md
  6. 7
      src/app.cpp
  7. 2
      src/defines.h
  8. 4
      src/platformio.ini
  9. 2
      src/web/RestApi.h
  10. 5
      src/web/html/api.js
  11. 9
      src/web/html/index.html
  12. 16
      src/web/html/setup.html

4
.github/workflows/compile_development.yml

@ -47,10 +47,10 @@ jobs:
run: python convert.py run: python convert.py
- name: Run PlatformIO - name: Run PlatformIO
run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusionv1 run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusion
- name: Copy boot_app0.bin - name: Copy boot_app0.bin
run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusionv1/ota.bin run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin
- name: Rename Binary files - name: Rename Binary files
id: rename-binary-files id: rename-binary-files

4
.github/workflows/compile_release.yml

@ -51,10 +51,10 @@ jobs:
run: python convert.py run: python convert.py
- name: Run PlatformIO - name: Run PlatformIO
run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusionv1 run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusion
- name: Copy boot_app0.bin - name: Copy boot_app0.bin
run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusionv1/ota.bin run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin
- name: Rename Binary files - name: Rename Binary files
id: rename-binary-files id: rename-binary-files

2
scripts/applyPatches.py

@ -28,5 +28,5 @@ def applyPatch(libName, patchFile):
# list of patches to apply (relative to /src) # list of patches to apply (relative to /src)
applyPatch("ESP Async WebServer", "../patches/AsyncWeb_Prometheus.patch") applyPatch("ESP Async WebServer", "../patches/AsyncWeb_Prometheus.patch")
if env['PIOENV'] == "opendtufusionv1": if env['PIOENV'] == "opendtufusion":
applyPatch("GxEPD2", "../patches/GxEPD2_SW_SPI.patch") applyPatch("GxEPD2", "../patches/GxEPD2_SW_SPI.patch")

4
scripts/getVersion.py

@ -94,7 +94,7 @@ def readVersion(path, infile):
os.rename(src, dst) os.rename(src, dst)
versionout = version[:-1] + "_" + sha + "_esp32s3.bin" versionout = version[:-1] + "_" + sha + "_esp32s3.bin"
src = path + ".pio/build/opendtufusionv1/firmware.bin" src = path + ".pio/build/opendtufusion/firmware.bin"
dst = path + "firmware/ESP32-S3/" + versionout dst = path + "firmware/ESP32-S3/" + versionout
os.rename(src, dst) os.rename(src, dst)
@ -113,7 +113,7 @@ def readVersion(path, infile):
genOtaBin(dst) genOtaBin(dst)
# other ESP32-S3 bin files # other ESP32-S3 bin files
src = path + ".pio/build/opendtufusionv1/" src = path + ".pio/build/opendtufusion/"
dst = path + "firmware/ESP32-S3/" dst = path + "firmware/ESP32-S3/"
os.rename(src + "bootloader.bin", dst + "bootloader.bin") os.rename(src + "bootloader.bin", dst + "bootloader.bin")
os.rename(src + "partitions.bin", dst + "partitions.bin") os.rename(src + "partitions.bin", dst + "partitions.bin")

6
src/CHANGES.md

@ -1,5 +1,11 @@
# Development Changes # Development Changes
## 0.7.47 - 2023-09-07
* fix boot loop #1140
* fix regex in `setup` page
* fix MI serial number display `max-module-power` in `setup` #1142
* renamed `opendtufusionv1` to `opendtufusion`
## 0.7.46 - 2023-09-04 ## 0.7.46 - 2023-09-04
* removed `delay` from ePaper * removed `delay` from ePaper
* started improvements of `/system` * started improvements of `/system`

7
src/app.cpp

@ -453,12 +453,15 @@ void app::tickSend(void) {
int8_t maxLoop = MAX_NUM_INVERTERS; int8_t maxLoop = MAX_NUM_INVERTERS;
Inverter<> *iv = mSys.getInverterByPos(mSendLastIvId); Inverter<> *iv = mSys.getInverterByPos(mSendLastIvId);
do { while(maxLoop > 0) {
do { do {
mSendLastIvId = ((MAX_NUM_INVERTERS - 1) == mSendLastIvId) ? 0 : mSendLastIvId + 1; mSendLastIvId = ((MAX_NUM_INVERTERS - 1) == mSendLastIvId) ? 0 : mSendLastIvId + 1;
iv = mSys.getInverterByPos(mSendLastIvId); iv = mSys.getInverterByPos(mSendLastIvId);
} while ((NULL == iv) && ((maxLoop--) > 0)); } while ((NULL == iv) && ((maxLoop--) > 0));
} while((!iv->config->enabled) && (maxLoop > 0)); if(NULL != iv)
if(iv->config->enabled)
break;
}
if (NULL != iv) { if (NULL != iv) {
if (iv->config->enabled) { if (iv->config->enabled) {

2
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 7 #define VERSION_MINOR 7
#define VERSION_PATCH 46 #define VERSION_PATCH 47
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {

4
src/platformio.ini

@ -123,7 +123,7 @@ build_flags = ${env.build_flags}
monitor_filters = monitor_filters =
esp32_exception_decoder esp32_exception_decoder
[env:opendtufusionv1] [env:opendtufusion]
platform = espressif32@6.3.2 platform = espressif32@6.3.2
board = esp32-s3-devkitc-1 board = esp32-s3-devkitc-1
upload_protocol = esp-builtin upload_protocol = esp-builtin
@ -141,6 +141,6 @@ build_flags = ${env.build_flags}
-DDEF_LED1=17 -DDEF_LED1=17
-DLED_ACTIVE_HIGH -DLED_ACTIVE_HIGH
-DARDUINO_USB_MODE=1 -DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1 ;-DARDUINO_USB_CDC_ON_BOOT=1
monitor_filters = monitor_filters =
esp32_exception_decoder, colorize esp32_exception_decoder, colorize

2
src/web/RestApi.h

@ -493,7 +493,7 @@ class RestApi {
void getRadioCmt(JsonObject obj) { void getRadioCmt(JsonObject obj) {
obj[F("csb")] = mConfig->cmt.pinCsb; obj[F("csb")] = mConfig->cmt.pinCsb;
obj[F("fcsb")] = mConfig->cmt.pinFcsb; obj[F("fcsb")] = mConfig->cmt.pinFcsb;
obj[F("irq")] = mConfig->cmt.pinIrq; obj[F("gpio3")] = mConfig->cmt.pinIrq;
obj[F("en")] = (bool) mConfig->cmt.enabled; obj[F("en")] = (bool) mConfig->cmt.enabled;
} }

5
src/web/html/api.js

@ -132,11 +132,12 @@ function toIsoTimeStr(d) { // UTC!
function setHide(id, hide) { function setHide(id, hide) {
var elm = document.getElementById(id); var elm = document.getElementById(id);
if(null == elm)
return;
if(hide) { if(hide) {
if(!elm.classList.contains("hide")) if(!elm.classList.contains("hide"))
elm.classList.add("hide"); elm.classList.add("hide");
} } else
else
elm.classList.remove('hide'); elm.classList.remove('hide');
} }

9
src/web/html/index.html

@ -126,16 +126,13 @@
icon = iconWarn; icon = iconWarn;
cl = "icon-warn"; cl = "icon-warn";
avail = "disabled"; avail = "disabled";
} } else if(false == i["is_avail"]) {
else if(false == i["is_avail"]) {
icon = iconInfo; icon = iconInfo;
cl = "icon-info"; cl = "icon-info";
avail = "not yet available"; avail = "not yet available";
} } else if(0 == i["ts_last_success"]) {
else if(0 == i["ts_last_success"]) {
avail = "available but no data was received until now"; avail = "available but no data was received until now";
} } else {
else {
avail = "available and is "; avail = "available and is ";
if(false == i["is_producing"]) if(false == i["is_producing"])
avail += "not "; avail += "not ";

16
src/web/html/setup.html

@ -50,7 +50,7 @@
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-12 col-sm-3 my-2">Interval [s]</div> <div class="col-12 col-sm-3 my-2">Interval [s]</div>
<div class="col-12 col-sm-9"><input type="text" name="serIntvl" pattern="[0-9]+" title="Invalid input"/></div> <div class="col-12 col-sm-9"><input type="number" name="serIntvl" title="Invalid input"/></div>
</div> </div>
</fieldset> </fieldset>
</div> </div>
@ -267,7 +267,7 @@
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-12 col-sm-3 my-2">Topic</div> <div class="col-12 col-sm-3 my-2">Topic</div>
<div class="col-12 col-sm-9"><input type="text" name="mqttTopic" pattern="[A-Za-z0-9./#$%&=+_-]+" title="Invalid input" /></div> <div class="col-12 col-sm-9"><input type="text" name="mqttTopic" pattern="[\-\+A-Za-z0-9\.\/#\$%&=_]+" title="Invalid input" /></div>
</div> </div>
<p class="des">Send Inverter data in a fixed interval, even if there is no change. A value of '0' disables the fixed interval. The data is published once it was successfully received from inverter. (default: 0)</p> <p class="des">Send Inverter data in a fixed interval, even if there is no change. A value of '0' disables the fixed interval. The data is published once it was successfully received from inverter. (default: 0)</p>
<div class="row mb-3"> <div class="row mb-3">
@ -449,7 +449,7 @@
[1, "high active"], [1, "high active"],
]; ];
const re = /1[1,3][2,4,6,8][1,2,4].*/; const re = /1[0,1,3][2,4,6,8][1,2,4].*/;
window.onload = function() { window.onload = function() {
for(it of document.getElementsByClassName("s_collapsible")) { for(it of document.getElementsByClassName("s_collapsible")) {
@ -576,7 +576,8 @@
iv.appendChild(des("Inverter " + id)); iv.appendChild(des("Inverter " + id));
id = "inv" + id; id = "inv" + id;
var addr = inp(id + "Addr", obj["serial"], 12, ["text"], null, "text", "[0-9]+", "Invalid input"); var addr = ml("input", {name: id + "Addr", class: "text", type: "number", max: 138999999999, value: obj["serial"]}, null);
iv.append( iv.append(
mlCb(id + "Enable", "Communication Enable", obj["enabled"]), mlCb(id + "Enable", "Communication Enable", obj["enabled"]),
mlE("Serial Number (12 digits)*", addr) mlE("Serial Number (12 digits)*", addr)
@ -599,6 +600,7 @@
if((serial.charAt(1) == 0) || (serial.charAt(1) == 1) || (serial.charAt(1) == 3)) { if((serial.charAt(1) == 0) || (serial.charAt(1) == 1) || (serial.charAt(1) == 3)) {
if((serial.charAt(3) == 1) || (serial.charAt(3) == 2) || (serial.charAt(3) == 4)) { if((serial.charAt(3) == 1) || (serial.charAt(3) == 2) || (serial.charAt(3) == 4)) {
switch(serial.charAt(2)) { switch(serial.charAt(2)) {
default:
case "2": max = 1; break; case "2": max = 1; break;
case "4": max = 2; break; case "4": max = 2; break;
case "6": max = 4; break; case "6": max = 4; break;
@ -621,12 +623,12 @@
}) })
}); });
iv.append(mlE("Name*", inp(id + "Name", obj["name"], 16, ["text"], null, "text", "[A-Za-z0-9./#$%&=+_-]+", "Invalid input"))); iv.append(mlE("Name*", inp(id + "Name", obj["name"], 16, ["text"], null, "text", "[\\-\\+A-Za-z0-9.\\/#$%&=_]+", "Invalid input")));
for(var j of [ for(var j of [
["ModPwr", "ch_max_pwr", "Max Module Power (Wp)", 4, "[0-9]+"], ["ModPwr", "ch_max_pwr", "Max Module Power (Wp)", 4, "[0-9]+"],
["ModName", "ch_name", "Module Name", 15, null], ["ModName", "ch_name", "Module Name", 15, null],
["YieldCor", "ch_yield_cor", "Yield Total Correction [kWh]", 8, "[0-9-\.]+"]]) { ["YieldCor", "ch_yield_cor", "Yield Total Correction [kWh]", 8, "[\\-0-9\.]+"]]) {
var cl = (re.test(obj["serial"])) ? "" : " hide"; var cl = (re.test(obj["serial"])) ? "" : " hide";
@ -799,7 +801,7 @@
ml("div", {class: "col-4 col-sm-9"}, en) ml("div", {class: "col-4 col-sm-9"}, en)
]) ])
); );
pins = [['csb', 'pinCsb'], ['fcsb', 'pinFcsb'], ['irq', 'pinGpio3']]; pins = [['csb', 'pinCsb'], ['fcsb', 'pinFcsb'], ['gpio3', 'pinGpio3']];
for(p of pins) { for(p of pins) {
e.append( e.append(
ml("div", {class: "row mb-3"}, [ ml("div", {class: "row mb-3"}, [

Loading…
Cancel
Save