From 8def04fe825575e1cdf38e34c322a420ba3b69e1 Mon Sep 17 00:00:00 2001 From: Patrick Amrhein Date: Mon, 3 Jun 2024 13:15:11 +0200 Subject: [PATCH 1/2] 0.8.1230001 --- .github/workflows/compile_development.yml | 223 ---------------------- .github/workflows/compile_zero-export.yml | 87 +++++++-- 2 files changed, 69 insertions(+), 241 deletions(-) delete mode 100644 .github/workflows/compile_development.yml diff --git a/.github/workflows/compile_development.yml b/.github/workflows/compile_development.yml deleted file mode 100644 index b5e0e0e1..00000000 --- a/.github/workflows/compile_development.yml +++ /dev/null @@ -1,223 +0,0 @@ -name: Ahoy Development - -on: - push: - branches: development* - paths-ignore: - - '**.md' # Do no build on *.md changes - -jobs: - check: - name: Check Repository - runs-on: ubuntu-latest - if: github.repository == 'lumapu/ahoy' && github.ref_name == 'development03' - continue-on-error: true - steps: - - uses: actions/checkout@v4 - - build-en: - name: Build (EN) - needs: check - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - variant: - - opendtufusion - - opendtufusion-ethernet - - 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 - 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: dev-${{ matrix.variant }} - path: firmware/* - - build-de: - name: Build (DE) - needs: check - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - variant: - - opendtufusion-de - - opendtufusion-ethernet-de - - 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 - 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: dev-${{ matrix.variant }} - path: firmware/* - - deploy: - name: Update Artifacts / Deploy - needs: [build-en, build-de] - runs-on: ubuntu-latest - continue-on-error: false - steps: - - uses: actions/checkout@v4 - #- name: Copy boot_app0.bin - # run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin - - - name: Get Artifacts - uses: actions/download-artifact@v4 - with: - merge-multiple: true - path: firmware - - - name: Get Version from code - id: version_name - run: python scripts/getVersion.py ${{ matrix.variant }} >> $GITHUB_OUTPUT - - - name: Set Version - uses: cschleiden/replace-tokens@v1 - with: - files: manual/User_Manual.md - env: - VERSION: ${{ steps.version_name.outputs.name }} - - - - name: Create ESP Web Tools Manifest - working-directory: src - run: python ../scripts/buildManifest.py - - - name: Copy install html - run: mv scripts/gh-action-dev-build-flash.html firmware/install.html - - - name: Copy Changes.md - run: mv src/CHANGES.md firmware/CHANGES.md - - - - name: Rename firmware directory - run: mv firmware ${{ steps.version_name.outputs.name }} - - - name: delete environment Artifacts - uses: geekyeggo/delete-artifact@v4 - with: - name: dev-* - - - name: Deploy - uses: nogsantos/scp-deploy@master - with: - src: ${{ steps.version_name.outputs.name }}/ - host: ${{ secrets.FW_SSH_HOST }} - remote: ${{ secrets.FW_SSH_DIR }}/dev - port: ${{ secrets.FW_SSH_PORT }} - user: ${{ secrets.FW_SSH_USER }} - key: ${{ secrets.FW_SSH_KEY }} - - - name: Clean elf files (7z compressed) for Artifact - run: | - rm -f \ - ${{ steps.version_name.outputs.name }}/*/*.elf.7z - - - name: Create Artifact - uses: actions/upload-artifact@v4 - with: - name: dev-${{ steps.version_name.outputs.name }} - path: | - ${{ steps.version_name.outputs.name }}/* - manual/User_Manual.md - manual/Getting_Started.md diff --git a/.github/workflows/compile_zero-export.yml b/.github/workflows/compile_zero-export.yml index f5321428..1c552ce1 100644 --- a/.github/workflows/compile_zero-export.yml +++ b/.github/workflows/compile_zero-export.yml @@ -23,13 +23,21 @@ jobs: strategy: matrix: variant: - - esp32-wroom32 - - esp32-wroom32-prometheus - - esp32-wroom32-ethernet - - esp32-s2-mini - - esp32-c3-mini - - opendtufusion - - opendtufusion-ethernet + #- opendtufusion + #- opendtufusion-ethernet + #- 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-zero_export + - opendtufusion-ethernet-zero_export steps: - uses: actions/checkout@v4 - uses: benjlevesque/short-sha@v3.0 @@ -64,6 +72,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 @@ -81,13 +94,19 @@ jobs: strategy: matrix: variant: - - esp32-wroom32-de - - esp32-wroom32-prometheus-de - - esp32-wroom32-ethernet-de - - esp32-s2-mini-de - - esp32-c3-mini-de - - opendtufusion-de - - opendtufusion-ethernet-de + #- opendtufusion-de + #- opendtufusion-ethernet-de + #- 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-zero_export-de + - opendtufusion-ethernet-zero_export-de steps: - uses: actions/checkout@v4 - uses: benjlevesque/short-sha@v3.0 @@ -122,6 +141,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 @@ -131,8 +155,8 @@ jobs: name: zero-${{ matrix.variant }} path: firmware/* - combine: - name: Combine Artifacts + deploy: + name: Update Artifacts / Deploy needs: [build-en, build-de] runs-on: ubuntu-latest continue-on-error: false @@ -158,6 +182,18 @@ jobs: env: VERSION: ${{ steps.version_name.outputs.name }} + + - name: Create ESP Web Tools Manifest + working-directory: src + run: python ../scripts/buildManifest.py + + - name: Copy install html + run: mv scripts/gh-action-dev-build-flash.html firmware/install.html + + - name: Copy Changes.md + run: mv src/CHANGES.md firmware/CHANGES.md + + - name: Rename firmware directory run: mv firmware ${{ steps.version_name.outputs.name }} @@ -166,11 +202,26 @@ jobs: with: name: zero-* + - name: Deploy + uses: nogsantos/scp-deploy@master + with: + src: ${{ steps.version_name.outputs.name }}/ + host: ${{ secrets.FW_SSH_HOST }} + remote: ${{ secrets.FW_SSH_DIR }}/zero + port: ${{ secrets.FW_SSH_PORT }} + user: ${{ secrets.FW_SSH_USER }} + key: ${{ secrets.FW_SSH_KEY }} + + - name: Clean elf files (7z compressed) for Artifact + run: | + rm -f \ + ${{ steps.version_name.outputs.name }}/*/*.elf.7z + - name: Create Artifact uses: actions/upload-artifact@v4 with: name: zero-${{ steps.version_name.outputs.name }} path: | - ${{ steps.version_name.outputs.name }} + ${{ steps.version_name.outputs.name }}/* manual/User_Manual.md - manual/Getting_Started.md + manual/Getting_Started.md \ No newline at end of file From 321bfc34477f148ab8a5a4781110197691804fe8 Mon Sep 17 00:00:00 2001 From: Patrick Amrhein Date: Mon, 3 Jun 2024 13:15:26 +0200 Subject: [PATCH 2/2] 0.8.1230002 --- src/defines.h | 2 +- src/plugins/zeroExport/zeroExport.h | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/defines.h b/src/defines.h index d7a4927d..24e1a30e 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 1230001 +#define VERSION_PATCH 1230002 //------------------------------------- typedef struct { uint8_t ch; diff --git a/src/plugins/zeroExport/zeroExport.h b/src/plugins/zeroExport/zeroExport.h index 28d792db..fa5ce459 100644 --- a/src/plugins/zeroExport/zeroExport.h +++ b/src/plugins/zeroExport/zeroExport.h @@ -385,7 +385,7 @@ class ZeroExport { // MQTT - Inverter if (mMqtt->isConnected()) { - mqttPublish(String("zero/state/groups/" + String(group) + "/inverter/" + String(inv)).c_str(), mDocLog.as().c_str()); + mqttPublish(String("zero/state/groups/" + String(group) + "/inverter/" + String(inv)).c_str(), _log.toString().c_str()); } sendLog(); @@ -915,13 +915,11 @@ class ZeroExport { } // Log over MQTT -/// BUG: 004 Anfang -// if (mCfg->log_over_mqtt) { -// if (mMqtt->isConnected()) { -// mMqtt->publish("zero/log", mDocLog.as().c_str(), false); -// } -// } -/// BUG: 004 Ende + if (mCfg->log_over_mqtt) { + if (mMqtt->isConnected()) { + mMqtt->publish("zero/log", _log.toString().c_str(), false); + } + } } /** clearLog