Compare commits

..

19 Commits

Author SHA1 Message Date
jomjol
2d6d89adc7 Update tflite 2025-04-06 09:42:36 +02:00
CaCO3
f06ef7b80e remove msg_id in the log, it is of no use (#3678) 2025-03-30 20:58:20 +02:00
Erik
962a674058 Refine Home Assistant MQTT Auto Discovery (#3659)
Add a proper device_class (duration) to "uptime"
2025-03-29 13:28:23 +01:00
SybexX
c57cd83948 Update README.md 2025-03-26 23:07:37 +01:00
The Random DIY
6991c41060 README updated with missed English translation (#3673)
* README updated with missed English translation

* Readme updated
2025-03-26 22:53:16 +01:00
SybexX
8bb274cd84 Merge pull request #3668 from nechry/main
Update NUMBER.ChangeRateThreshold.md
2025-03-24 03:19:41 +01:00
SybexX
168ec5b485 Update edit_config_template.html 2025-03-22 18:07:56 +01:00
Jean-François Auger
7a0a34e32e Update NUMBER.ChangeRateThreshold.md 2025-03-22 17:28:45 +01:00
CaCO3
64bf79b288 Update config.ini in demo folder 2025-03-18 22:36:53 +01:00
CaCO3
61085d3861 webinstaller: remove broken email link (#3639) 2025-03-16 18:32:27 +01:00
CaCO3
8494f36069 Rename webinstaller folder and add readme's (#3637) 2025-03-16 18:25:41 +01:00
CaCO3
3e67aeec0d Add note to sd card folder (#3635) to make people aware that the HTML folder only contains templates
* Create Readme.md

* Update Readme.md

* Update build.yaml

* Update Readme.md
2025-03-16 18:24:16 +01:00
CaCO3
e85e92762e Fix webinstaller-imgs 2025-03-15 22:56:33 +01:00
CaCO3
eb9bf3c7c1 Update index.html (#3636) 2025-03-15 22:52:53 +01:00
CaCO3
f542d842cf Update changelog (consolidate all RC changes into one) (#3614)
* Update changelog (consolidate all RC changes into one)

* Update Changelog.md

---------

Co-authored-by: CaCO3 <caco@ruinelli.ch>
Co-authored-by: jomjol <mueller.josef@gmail.com>
2025-03-15 14:24:06 +01:00
SybexX
5bbc2f3da5 Update ClassFlowPostProcessing.cpp
fix for: ChangeRateThreshold could not be deactivated
2025-03-02 13:26:07 +01:00
SybexX
2831478e02 Update edit_config_template.html
fix for: ChangeRateThreshold could not be deactivated
2025-03-02 13:25:49 +01:00
CaCO3
1e0cdfaba1 Remove unused config template page and empty, unused folder in zip files (#3599)
* Update build.yaml

* Update build.yaml

* remove empty folder in sd-card.zip in manual package
2025-03-02 08:31:22 +01:00
SybexX
bfebcd5d15 Update config.ini 2025-03-01 18:21:40 +01:00
20 changed files with 229 additions and 288 deletions

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
```
git clone https://github.com/jomjol/AI-on-the-edge-device.git
cd AI-on-the-edge-device
git checkout rolling
git checkout main
git submodule update --init
```
@@ -12,10 +12,10 @@ git submodule update --init
```
cd /components/submodule-name (e.g. tflite-micro-example)
git checkout VERSION (e.g. HASH of latest tflite-micro-example build)
cd ../../ (auf Ebene von code)
cd ../../ (at the code level)
git submodule update --init
```
Evt. muss man vorher noch einige Verzeichnisse in compenents von Hand löschen, da sie beim checkout nicht gelöscht wurden (vor update -- init)
You may need to manually delete some directories in the 'components' folder beforehand, as they were not deleted during checkout (before update -- init)
## Build and Flash within terminal
See further down to build it within an IDE.
@@ -51,7 +51,7 @@ pio device monitor -p /dev/ttyUSB0
```
git clone https://github.com/jomjol/AI-on-the-edge-device.git
cd AI-on-the-edge-device
git checkout rolling
git checkout main
git submodule update --init
```

View File

@@ -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)));

View File

@@ -85,7 +85,7 @@ bool MQTTPublish(std::string _key, std::string _content, int qos, bool retained_
_content.append("..");
}
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Published topic: " + _key + ", content: " + _content + " (msg_id=" + std::to_string(msg_id) + ")");
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Published topic: " + _key + ", content: " + _content);
return true;
}
else {
@@ -465,7 +465,7 @@ void MQTTconnected(){
if (subscribeFunktionMap != NULL) {
for(std::map<std::string, std::function<bool(std::string, char*, int)>>::iterator it = subscribeFunktionMap->begin(); it != subscribeFunktionMap->end(); ++it) {
int msg_id = esp_mqtt_client_subscribe(client, it->first.c_str(), 0);
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "topic " + it->first + " subscribe successful, msg_id=" + std::to_string(msg_id));
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "topic " + it->first + " subscribe successful");
}
}

View File

@@ -174,14 +174,14 @@ bool MQTThomeassistantDiscovery(int qos) {
int aFreeInternalHeapSizeBefore = heap_caps_get_free_size(MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL);
// Group | Field | User Friendly Name | Icon | Unit | Device Class | State Class | Entity Category
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "uptime", "Uptime", "clock-time-eight-outline", "s", "", "", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "uptime", "Uptime", "progress-clock", "s", "duration", "measurement", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "MAC", "MAC Address", "network-outline", "", "", "", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "fwVersion", "Firmware Version", "application-outline", "", "", "", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "hostname", "Hostname", "network-outline", "", "", "", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "freeMem", "Free Memory", "memory", "B", "", "measurement", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "wifiRSSI", "Wi-Fi RSSI", "wifi", "dBm", "signal_strength", "", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "CPUtemp", "CPU Temperature", "thermometer", "°C", "temperature", "measurement", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "interval", "Interval", "clock-time-eight-outline", "min", "" , "measurement", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "interval", "Interval", "clock-time-eight-outline", "min", "", "measurement", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "IP", "IP", "network-outline", "", "", "", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "status", "Status", "list-status", "", "", "", "diagnostic", qos);
allSendsSuccessed |= sendHomeAssistantDiscoveryTopic("", "flowstart", "Manual Flow Start", "timer-play-outline", "", "", "", "", qos);

View File

@@ -1,7 +1,7 @@
# Parameter `ChangeRateThreshold`
Default Value: `2`
Range: `1` .. `9`.
Range: `0` .. `9`.
Threshold parameter for change rate detection.<br>
This parameter is intended to compensate for small reading fluctuations that occur when the meter does not change its value for a long time (e.g. at night) or slightly turns backwards. This can eg. happen on watermeters.

5
sd-card/Readme.md Normal file
View File

@@ -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.

Binary file not shown.

View File

@@ -43,7 +43,7 @@ AlignmentAlgo = default
/config/ref1.jpg 442 142
[Digits]
Model = /config/dig-cont_0712_s3_q.tflite
Model = /config/dig-cont_0900_s3_q.tflite
CNNGoodThreshold = 0.5
;ROIImagesLocation = /log/digit
;ROIImagesRetention = 3
@@ -52,7 +52,7 @@ main.dig2 343 126 30 54 false
main.dig3 391 126 30 54 false
[Analog]
Model = /config/ana-cont_1300_s2.tflite
Model = /config/ana-cont_1500_s2_q.tflite
CNNGoodThreshold = 0.5
;ROIImagesLocation = /log/analog
;ROIImagesRetention = 3
@@ -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

Binary file not shown.

View File

@@ -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

View File

@@ -968,8 +968,8 @@
<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"
oninput="(!validity.rangeUnderflow||(value=1)) && (!validity.rangeOverflow||(value=9)) &&
<input required type="number" id="PostProcessing_ChangeRateThreshold_value1" step="1" min="0" max="9" value="2"
oninput="(!validity.rangeUnderflow||(value=0)) && (!validity.rangeOverflow||(value=9)) &&
(!validity.stepMismatch||(value=parseInt(this.value)));">
</td>
<td>$TOOLTIP_PostProcessing_NUMBER.ChangeRateThreshold</td>

3
webinstaller/Readme.md Normal file
View File

@@ -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.

View File

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

View File

@@ -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>