Browse Source

Merge branch 'main' into esp32s3-test

jomjol 10 tháng trước cách đây
mục cha
commit
58c7bce8b5

+ 9 - 7
.github/workflows/build.yaml

@@ -84,7 +84,8 @@ jobs:
         cd ../..
 
         cp -r ./sd-card/html/* ./html/
-
+        rm -f ./html/edit_config_template.html # Remove the config page template, it is no longer needed
+        
         echo "Replacing variables..."
         cd html
         find . -type f -exec sed -i 's/$COMMIT_HASH/${{ steps.vars.outputs.sha_short }}/g' {} \;
@@ -285,8 +286,9 @@ jobs:
         rm -rf ./sd-card/html
         rm -rf ./sd-card/demo
         cp -r ./html ./sd-card/ # Overwrite the Web UI with the preprocessed files
+        rm -f ./sd-card/Readme.md
         cp -r ./demo ./sd-card/
-        cd sd-card; zip -r ../manual_setup/sd-card.zip *; cd ..
+        cd sd-card; rm -rf html/param-tooltips; zip -r ../manual_setup/sd-card.zip *; cd ..
         cd ./manual_setup
 
     - name: Upload manual_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI)
@@ -433,13 +435,13 @@ jobs:
     - name: Add binary to Web Installer and update manifest
       run: |
         echo "Updating Web installer to use firmware from ${{ steps.last_release.outputs.tag_name }}..."
-        rm -f docs/binary/firmware.bin
+        rm -f webinstaller/binary/firmware.bin
         wget ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.last_release.outputs.tag_name }}/AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
         unzip AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
-        cp -f firmware.bin docs/binary/firmware.bin
+        cp -f firmware.bin webinstaller/binary/firmware.bin
         echo "Updating index and manifest file..."
-        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/index.html
-        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/manifest.json
+        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' webinstaller/index.html
+        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' webinstaller/manifest.json
 
     - name: Setup Pages
       uses: actions/configure-pages@v4
@@ -447,7 +449,7 @@ jobs:
     - name: Upload artifact
       uses: actions/upload-pages-artifact@v2
       with:
-        path: 'docs'
+        path: 'webinstaller'
 
     - name: Deploy to GitHub Pages
       id: deployment

+ 8 - 8
.github/workflows/manual-update-webinstaller.yaml

@@ -1,4 +1,4 @@
-# This updates the Web Installer with the files from the docs folder and the binary of the latest release
+# This updates the Web Installer with the files from the webinstaller folder and the binary of the latest release
 # it only gets run on:
 #  - Manually triggered
 # Make sure to also update the lower part of build.yml!
@@ -11,7 +11,7 @@ on:
 #    branches:
 #    - rolling
 #    paths:
-#    - docs # The path filter somehow does not work, so lets run it on every change to rolling
+#    - webinstaller # The path filter somehow does not work, so lets run it on every change to rolling
 
 jobs:
   manually-update-web-installer:    
@@ -42,13 +42,13 @@ jobs:
     - name: Add binary to Web Installer and update manifest
       run: |
         echo "Updating Web installer to use firmware from ${{ steps.last_release.outputs.tag_name }}..."
-        rm -f docs/binary/firmware.bin
-        wget https://github.com/jomjol/AI-on-the-edge-device/releases/download/${{ steps.last_release.outputs.tag_name }}/AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
+        rm -f webinstaller/binary/firmware.bin
+        wget ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.last_release.outputs.tag_name }}/AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
         unzip AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
-        cp -f firmware.bin docs/binary/firmware.bin
+        cp -f firmware.bin webinstaller/binary/firmware.bin
         echo "Updating index and manifest file..."
-        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/index.html
-        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/manifest.json
+        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' webinstaller/index.html
+        sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' webinstaller/manifest.json
 
     - name: Setup Pages
       uses: actions/configure-pages@v5
@@ -56,7 +56,7 @@ jobs:
     - name: Upload artifact
       uses: actions/upload-pages-artifact@v3
       with:
-        path: 'docs'
+        path: 'webinstaller'
 
     - name: Deploy to GitHub Pages
       id: deployment

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 158 - 229
Changelog.md


+ 1 - 1
code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

@@ -898,7 +898,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) {
         #endif
 
         if (PreValueUse && NUMBERS[j]->PreValueOkay) {
-            if (NUMBERS[j]->Nachkomma > 0) {
+            if ((NUMBERS[j]->Nachkomma > 0) && (NUMBERS[j]->ChangeRateThreshold > 0)) {
                 double _difference1 = (NUMBERS[j]->PreValue - (NUMBERS[j]->ChangeRateThreshold / pow(10, NUMBERS[j]->Nachkomma)));
                 double _difference2 = (NUMBERS[j]->PreValue + (NUMBERS[j]->ChangeRateThreshold / pow(10, NUMBERS[j]->Nachkomma)));
 

+ 5 - 0
sd-card/Readme.md

@@ -0,0 +1,5 @@
+# SD Card content
+This folder contains the files which are required to setup the SD card.
+
+❗ Do not directly copy this folder onto your SD card, **it will not work!** Instead, you can use any of the artifacts generaded in any of the Pipeline runs of the [Build-Pipeline](https://github.com/jomjol/AI-on-the-edge-device/actions/workflows/build.yaml).
+The files in the `html` folder here only serve as templates. The real `html` folder get generated using the Github actions.

+ 1 - 1
sd-card/config/config.ini

@@ -73,7 +73,7 @@ main.MaxRateValue = 0.05
 main.ExtendedResolution = false
 main.IgnoreLeadingNaN = false
 ErrorMessage = true
-CheckDigitIncreaseConsistency = false
+main.CheckDigitIncreaseConsistency = false
 
 ;[MQTT]
 ;Uri = mqtt://IP-ADRESS:1883

+ 6 - 4
sd-card/demo/config.ini

@@ -43,14 +43,14 @@ AlignmentAlgo = default
 /config/ref1.jpg 536 113
 
 [Digits]
-Model = /config/dig-cont_0710_s3_q.tflite
+Model = /config/dig-cont_0810_s3_q.tflite
 CNNGoodThreshold = 0.5
 ;ROIImagesLocation = /log/digit
 ;ROIImagesRetention = 3
 main.dig1 438 62 49 71 false
 
 [Analog]
-Model = /config/ana-cont_1300_s2.tflite
+Model = /config/ana-cont_1400_s2_q.tflite
 ;ROIImagesLocation = /log/analog
 ;ROIImagesRetention = 3
 main.ana1 452 199 120 120 false
@@ -67,7 +67,7 @@ main.AllowNegativeRates = true
 main.ExtendedResolution = true
 main.IgnoreLeadingNaN = false
 ErrorMessage = true
-CheckDigitIncreaseConsistency = false
+main.CheckDigitIncreaseConsistency = false
 
 ;[MQTT]
 ;Uri = mqtt://IP-ADRESS:1883
@@ -76,11 +76,14 @@ CheckDigitIncreaseConsistency = false
 ;user = USERNAME
 ;password = PASSWORD
 RetainMessages = false
+;DomoticzTopicIn = undefined
+;main.DomoticzIDX = undefined
 HomeassistantDiscovery = false
 ;MeterType = other
 ;CACert = /config/certs/RootCA.pem
 ;ClientCert = /config/certs/client.pem.crt
 ;ClientKey = /config/certs/client.pem.key
+;ValidateServerCert = true
 
 ;[InfluxDB]
 ;Uri = undefined
@@ -133,4 +136,3 @@ TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
 RSSIThreshold = -75
 CPUFrequency = 160
 SetupMode = false
- 

+ 1 - 1
sd-card/html/edit_config_template.html

@@ -968,7 +968,7 @@
                 <label for=PostProcessing_ChangeRateThreshold_enabled><class id="PostProcessing_ChangeRateThreshold_text" style="color:black;">Change Rate Threshold</class></label>
             </td>
             <td>
-                <input required type="number" id="PostProcessing_ChangeRateThreshold_value1" step="1" min="1" max="9" value="2"
+                <input required type="number" id="PostProcessing_ChangeRateThreshold_value1" step="1" min="0" max="9" value="2"
                     oninput="(!validity.rangeUnderflow||(value=1)) && (!validity.rangeOverflow||(value=9)) && 
                         (!validity.stepMismatch||(value=parseInt(this.value)));">
             </td>

+ 3 - 0
webinstaller/Readme.md

@@ -0,0 +1,3 @@
+# Webinstaller
+This folder is used to provide the required files to generate the [Web-Installer](https://jomjol.github.io/AI-on-the-edge-device/).
+The Webinstaller gets automatically updated on a release using the Github actions.

+ 2 - 0
webinstaller/binary/Readme.md

@@ -0,0 +1,2 @@
+# Binary folder of the webinstaller
+The firmware itself (`firmware.bin`) gets copied to this folder through the Github action.

+ 0 - 0
docs/binary/bootloader.bin → webinstaller/binary/bootloader.bin


+ 0 - 0
docs/binary/partitions.bin → webinstaller/binary/partitions.bin


+ 4 - 6
docs/index.html → webinstaller/index.html

@@ -67,21 +67,19 @@
 
    <div class="footer">
       <div class="footer-section">
-       <span>Support & Contact Us</span>
+       <span>Support & Contact</span>
        <a href="https://github.com/jomjol/AI-on-the-edge-device" target="_blank" title="GitHub">
-          <img src="https://github.com/jomjol/AI-on-the-edge-device/images/github-logo.png" alt="GitHub">
-       </a>
-          <img src="https://github.com/jomjol/AI-on-the-edge-device/images/gmail-logo.png" alt="Email">
+          <img src="https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/refs/heads/main/images/github-logo.png" alt="GitHub">
        </a>
        <a href="https://github.com/jomjol/AI-on-the-edge-device/discussions" target="_blank" title="GitHub">
-          <img src="https://github.com/jomjol/AI-on-the-edge-device/images/discussion-logo" alt="GitHub">
+          <img src="https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/refs/heads/main/images/discussion-logo.png" alt="GitHub">
        </a>
 	
     </div>
       <div class="footer-section">
          <span>Donations</span>
          <a href="https://www.paypal.com/donate?hosted_button_id=8TRSVYNYKDSWL" target="_blank" title="Donate via PayPal">
-            <img src="https://github.com/jomjol/AI-on-the-edge-device/images/paypal.png" alt="PayPal" style="width: 60px; height: auto;">
+            <img src="https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/refs/heads/main/images/paypal.png" alt="PayPal" style="width: 60px; height: auto;">
          </a>
       </div>
    </div>

+ 0 - 0
docs/manifest.json → webinstaller/manifest.json


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác