diff --git a/.github/workflows/compile_development.yml b/.github/workflows/compile_development.yml index 9b3b68b3..cdd2cdf3 100644 --- a/.github/workflows/compile_development.yml +++ b/.github/workflows/compile_development.yml @@ -92,7 +92,7 @@ jobs: matrix: variant: - opendtufusion-de - - opendtufusion-16MB-de + #- opendtufusion-16MB-de #not needed, only the partions.bin is different and can be used from english build - esp8266-de - esp8266-all-de - esp8266-prometheus-de diff --git a/.github/workflows/compile_release.yml b/.github/workflows/compile_release.yml index 59adf28c..6ea3dcf2 100644 --- a/.github/workflows/compile_release.yml +++ b/.github/workflows/compile_release.yml @@ -7,34 +7,100 @@ on: - '**.md' # Do no build on *.md changes jobs: - build: - name: Build Environments + check: + name: Check Repository runs-on: ubuntu-latest if: github.repository == 'lumapu/ahoy' && github.ref_name == 'main' continue-on-error: false + steps: + - uses: actions/checkout@v4 + + build-en: + name: Build (EN) + needs: check + runs-on: ubuntu-latest + continue-on-error: false strategy: matrix: variant: + - opendtufusion + - opendtufusion-16MB - esp8266 + - esp8266-all + - esp8266-minimal - esp8266-prometheus - esp8285 - esp32-wroom32 + - esp32-wroom32-minimal - esp32-wroom32-prometheus - - esp32-wroom32-ethernet - esp32-s2-mini - esp32-c3-mini - - opendtufusion - - opendtufusion-ethernet + steps: + - uses: actions/checkout@v4 + - uses: benjlevesque/short-sha@v3.0 + id: short-sha + with: + length: 7 + + - name: Cache Pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Cache PlatformIO + uses: actions/cache@v4 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install PlatformIO + run: | + python -m pip install setuptools --upgrade pip + pip install --upgrade platformio + + - name: Run PlatformIO + run: pio run -d src -e ${{ matrix.variant }} + + - name: Compress .elf + uses: edgarrc/action-7z@v1 + with: + args: 7z a -t7z -mx=9 src/.pio/build/${{ matrix.variant }}/firmware.elf.7z ./src/.pio/build/${{ matrix.variant }}/firmware.elf + + - name: Rename Firmware + run: python scripts/getVersion.py ${{ matrix.variant }} >> $GITHUB_OUTPUT + + - name: Create Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.variant }} + path: firmware/* + + build-de: + name: Build (DE) + needs: check + runs-on: ubuntu-latest + continue-on-error: false + strategy: + matrix: + variant: + - opendtufusion-de + #- opendtufusion-16MB-de #not needed, only the partions.bin is different and can be used from english build - esp8266-de + - esp8266-all-de - esp8266-prometheus-de - esp8285-de - esp32-wroom32-de - esp32-wroom32-prometheus-de - - esp32-wroom32-ethernet-de - esp32-s2-mini-de - esp32-c3-mini-de - - opendtufusion-de - - opendtufusion-ethernet-de steps: - uses: actions/checkout@v4 - uses: benjlevesque/short-sha@v3.0 @@ -69,6 +135,11 @@ jobs: - name: Run PlatformIO run: pio run -d src -e ${{ matrix.variant }} + - name: Compress .elf + uses: edgarrc/action-7z@v1 + with: + args: 7z a -t7z -mx=9 src/.pio/build/${{ matrix.variant }}/firmware.elf.7z ./src/.pio/build/${{ matrix.variant }}/firmware.elf + - name: Rename Firmware run: python scripts/getVersion.py ${{ matrix.variant }} >> $GITHUB_OUTPUT @@ -78,11 +149,10 @@ jobs: name: ${{ matrix.variant }} path: firmware/* - release: name: Create Release + needs: [build-en, build-de] runs-on: ubuntu-latest - needs: [build] continue-on-error: false permissions: contents: write @@ -140,7 +210,7 @@ jobs: deploy: name: Deploy Environments to fw.ahoydtu.de - needs: [build, release] + needs: [build-en, build-de, release] runs-on: ubuntu-latest continue-on-error: false steps: diff --git a/scripts/__pycache__/htmlPreprocessorDefines.cpython-311.pyc b/scripts/__pycache__/htmlPreprocessorDefines.cpython-311.pyc index 6dca7de6..6681c7af 100644 Binary files a/scripts/__pycache__/htmlPreprocessorDefines.cpython-311.pyc and b/scripts/__pycache__/htmlPreprocessorDefines.cpython-311.pyc differ diff --git a/src/CHANGES.md b/src/CHANGES.md index dccaa36a..a48295d1 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,19 @@ # Development Changes +# RELEASE 0.8.140 - 2024-08-16 + +## 0.8.139 - 2024-08-15 +* fix reload after save for WiFi configurations (5s -> 20s) + +## 0.8.138 - 2024-08-15 +* fix ePaper not functional #1722 + +## 0.8.137 - 2024-08-13 +* fix storage of timezone and region #1723 + +## 0.8.136 - 2024-08-12 +* fix save settings for ESP32 devices #1720 + ## 0.8.135 - 2024-08-11 * translated `/system` #1717 * added default pin seetings for opendtufusion board diff --git a/src/defines.h b/src/defines.h index b1d7395d..94674315 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 135 +#define VERSION_PATCH 140 //------------------------------------- typedef struct { uint8_t ch; diff --git a/src/network/AhoyEthernet.h b/src/network/AhoyEthernet.h index f6564e1f..9ed2de98 100644 --- a/src/network/AhoyEthernet.h +++ b/src/network/AhoyEthernet.h @@ -22,6 +22,9 @@ class AhoyEthernet : public AhoyWifi { }; public: + AhoyEthernet() + : mMode (Mode::WIRELESS) {} + virtual void begin() override { mMode = Mode::WIRELESS; mAp.enable(); diff --git a/src/platformio.ini b/src/platformio.ini index 3156b206..860699e5 100644 --- a/src/platformio.ini +++ b/src/platformio.ini @@ -329,6 +329,7 @@ monitor_filters = platform = espressif32@6.7.0 board = esp32-s3-devkitc-1 board_upload.flash_size = 16MB +board_build.partitions = default_16MB.csv upload_protocol = esp-builtin build_flags = ${env:opendtufusion.build_flags} monitor_filters = diff --git a/src/plugins/Display/Display.h b/src/plugins/Display/Display.h index 1694fec6..4654a4f4 100644 --- a/src/plugins/Display/Display.h +++ b/src/plugins/Display/Display.h @@ -45,7 +45,7 @@ class Display { case DISP_TYPE_T4_SSD1306_128X32: mMono = new DisplayMono128X32(); break; // SSD1306_128X32 (0.91") case DISP_TYPE_T5_SSD1306_64X48: mMono = new DisplayMono64X48(); break; // SSD1306_64X48 (0.66" - Wemos OLED Shield) case DISP_TYPE_T6_SSD1309_128X64: mMono = new DisplayMono128X64(); break; // SSD1309_128X64 (2.42") - #if defined(ESP32) && !defined(ETHERNET) + #if defined(ESP32) case DISP_TYPE_T10_EPAPER: mMono = NULL; // ePaper does not use this mRefreshCycle = 0; @@ -73,7 +73,7 @@ class Display { } void loop() { - #if defined(ESP32) && !defined(ETHERNET) + #if defined(ESP32) if ((nullptr != mCfg) && (DISP_TYPE_T10_EPAPER == mCfg->type)) { mEpaper.refreshLoop(); } @@ -96,7 +96,7 @@ class Display { mLoopCnt = 0; } } - #if defined(ESP32) && !defined(ETHERNET) + #if defined(ESP32) else if (DISP_TYPE_T10_EPAPER == mCfg->type) { // maintain ePaper at least every 15 seconds if (mNewPayload || (((++mLoopCnt) % 15) == 0)) { @@ -193,7 +193,7 @@ class Display { if (mMono ) { mMono->disp(); } - #if defined(ESP32) && !defined(ETHERNET) + #if defined(ESP32) else if (DISP_TYPE_T10_EPAPER == mCfg->type) { mEpaper.loop((totalPower), totalYieldDay, totalYieldTotal, nrprod); mRefreshCycle++; @@ -254,7 +254,7 @@ class Display { RADIO *mHmsRadio = nullptr; uint16_t mRefreshCycle = 0; - #if defined(ESP32) && !defined(ETHERNET) + #if defined(ESP32) DisplayEPaper mEpaper; #endif DisplayMono *mMono = nullptr; diff --git a/src/web/RestApi.h b/src/web/RestApi.h index 9163839e..eac91cb9 100644 --- a/src/web/RestApi.h +++ b/src/web/RestApi.h @@ -457,8 +457,8 @@ class RestApi { void getHtmlReboot(AsyncWebServerRequest *request, JsonObject obj) { getGeneric(request, obj.createNestedObject(F("generic"))); - #if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3) - obj[F("refresh")] = 5; + #if defined(ETHERNET) + obj[F("refresh")] = (mConfig->sys.eth.enabled) ? 5 : 20; #else obj[F("refresh")] = 20; #endif @@ -471,8 +471,8 @@ class RestApi { obj[F("pending")] = (bool)mApp->getSavePending(); obj[F("success")] = (bool)mApp->getLastSaveSucceed(); obj[F("reboot")] = (bool)mApp->getShouldReboot(); - #if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3) - obj[F("reload")] = 5; + #if defined(ETHERNET) + obj[F("reload")] = (mConfig->sys.eth.enabled) ? 5 : 20; #else obj[F("reload")] = 20; #endif @@ -489,7 +489,7 @@ class RestApi { mApp->setRebootFlag(); obj[F("html")] = F("Erase settings: success"); #if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3) - obj[F("reload")] = 5; + obj[F("reload")] = (mConfig->sys.eth.enabled) ? 5 : 20; #else obj[F("reload")] = 20; #endif @@ -507,8 +507,8 @@ class RestApi { mApp->eraseSettings(true); mApp->setRebootFlag(); obj[F("html")] = F("Factory reset: success"); - #if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3) - obj[F("reload")] = 5; + #if defined(ETHERNET) + obj[F("reload")] = (mConfig->sys.eth.enabled) ? 5 : 20; #else obj[F("reload")] = 20; #endif diff --git a/src/web/html/setup.html b/src/web/html/setup.html index 63b700bf..2b59146c 100644 --- a/src/web/html/setup.html +++ b/src/web/html/setup.html @@ -682,31 +682,24 @@ } function parseSys(obj) { - 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"]; + document.getElementsByName("device")[0].value = obj.device_name; + for(var i of [["ssid", "ssid"], ["ap_pwd", "ap_pwd"]]) + document.getElementsByName(i[0])[0].value = obj.network[i[1]]; + document.getElementsByName("hidd")[0].checked = obj.network.hidd; - document.getElementsByName("darkMode")[0].checked = obj["dark_mode"]; - document.getElementsByName("schedReboot")[0].checked = obj["sched_reboot"]; + document.getElementsByName("darkMode")[0].checked = obj.dark_mode; + document.getElementsByName("schedReboot")[0].checked = obj.sched_reboot; e = document.getElementsByName("adminpwd")[0]; - if(!obj["pwd_set"]) + if(!obj.pwd_set) e.value = ""; var d = document.getElementById("prot_mask"); var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System", "{#NAV_HISTORY}"]; var el = []; for(var i = 0; i < 7; i++) { - var chk = ((obj["prot_mask"] & (1 << i)) == (1 << i)); + var chk = ((obj.prot_mask & (1 << i)) == (1 << i)); el.push(mlCb("protMask" + i, a[i], chk)) } d.append(...el); - - var tz = [] - for(i = 0; i < 24; i += 0.5) - tz.push([i, ((i-12 > 0) ? "+" : "") + String(i-12)]); - document.getElementById("timezone").append(sel("timezone", tz, obj.timezone + 12)) - var region = [[0, "Europe (860 - 870 MHz)"], [1, "USA, Indonesia (905 - 925 MHz)"], [2, "Brazil (915 - 928 MHz)"]] - document.getElementById("region").append(sel("region", region, obj.region)) - } function parseGeneric(obj) { @@ -720,8 +713,15 @@ document.getElementsByName("cstLnkTxt")[0].value = obj.cst_lnk_txt } - ts = obj["ts_now"]; + ts = obj.ts_now; window.setInterval("tick()", 1000); + + var tz = [] + for(i = 0; i < 24; i += 0.5) + tz.push([i, ((i-12 > 0) ? "+" : "") + String(i-12)]); + document.getElementById("timezone").append(sel("timezone", tz, obj.timezone + 12)) + var region = [[0, "Europe (860 - 870 MHz)"], [1, "USA, Indonesia (905 - 925 MHz)"], [2, "Brazil (915 - 928 MHz)"]] + document.getElementById("region").append(sel("region", region, obj.region)) } function parseStaticIp(obj) { @@ -1330,23 +1330,23 @@ function parse(root) { if(null != root) { - parseGeneric(root["generic"]); - parseSys(root["system"]); - parseStaticIp(root["static_ip"]); - parseMqtt(root["mqtt"]); - parseNtp(root["ntp"]); - parseSun(root["sun"]); + parseGeneric(root.generic); + parseSys(root.system); + parseStaticIp(root.static_ip); + parseMqtt(root.mqtt); + parseNtp(root.ntp); + parseSun(root.sun); parsePinout(root.pinout); - parseNrfRadio(root["radioNrf"], root["pinout"]); + parseNrfRadio(root.radioNrf, root.pinout); /*IF_ESP32*/ parseCmtRadio(root.radioCmt); /*ENDIF_ESP32*/ /*IF_ETHERNET*/ parseEth(root.eth) /*ENDIF_ETHERNET*/ - parseSerial(root["serial"]); + parseSerial(root.serial); /*IF_PLUGIN_DISPLAY*/ - parseDisplay(root["display"], root["system"]["esp_type"], root["system"]); + parseDisplay(root.display, root.system.esp_type, root.system); /*ENDIF_PLUGIN_DISPLAY*/ getAjax("/api/inverter/list", parseIv); } diff --git a/src/web/web.h b/src/web/web.h index 8001bb6e..64071e51 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -268,8 +268,8 @@ class Web { bool reboot = (!Update.hasError()); String html = F("