diff --git a/404.html b/404.html
index 660b81d..f5d4f88 100644
--- a/404.html
+++ b/404.html
@@ -139,7 +139,7 @@
Assorted Pages
diff --git a/Additional-Information/index.html b/Additional-Information/index.html
index 3895bae..6142743 100644
--- a/Additional-Information/index.html
+++ b/Additional-Information/index.html
@@ -149,7 +149,7 @@
Assorted Pages
diff --git a/Alignment/index.html b/Alignment/index.html
index 06ac23c..b559182 100644
--- a/Alignment/index.html
+++ b/Alignment/index.html
@@ -153,7 +153,7 @@
Assorted Pages
diff --git a/Best-Practice/index.html b/Best-Practice/index.html
index e111900..f5746e9 100644
--- a/Best-Practice/index.html
+++ b/Best-Practice/index.html
@@ -155,7 +155,7 @@
Assorted Pages
diff --git a/Build-Instructions/index.html b/Build-Instructions/index.html
index 71304d0..d087828 100644
--- a/Build-Instructions/index.html
+++ b/Build-Instructions/index.html
@@ -149,7 +149,7 @@
Assorted Pages
diff --git a/Choosing-the-Model/index.html b/Choosing-the-Model/index.html
index 4d3ffa4..b289e5a 100644
--- a/Choosing-the-Model/index.html
+++ b/Choosing-the-Model/index.html
@@ -185,7 +185,7 @@
Assorted Pages
diff --git a/Configuration/index.html b/Configuration/index.html
index 02b71de..a36c679 100644
--- a/Configuration/index.html
+++ b/Configuration/index.html
@@ -177,7 +177,7 @@
Assorted Pages
diff --git a/Correction Algorithm/index.html b/Correction Algorithm/index.html
index 1be778a..0c11d35 100644
--- a/Correction Algorithm/index.html
+++ b/Correction Algorithm/index.html
@@ -169,7 +169,7 @@
Assorted Pages
diff --git a/Demo-Mode/index.html b/Demo-Mode/index.html
index a3af4d6..c6072ed 100644
--- a/Demo-Mode/index.html
+++ b/Demo-Mode/index.html
@@ -169,7 +169,7 @@
Assorted Pages
diff --git a/Error-Codes/index.html b/Error-Codes/index.html
index f00c1f7..7c9a1f8 100644
--- a/Error-Codes/index.html
+++ b/Error-Codes/index.html
@@ -159,7 +159,7 @@
Assorted Pages
diff --git a/Error-Debugging/index.html b/Error-Debugging/index.html
index 571147b..e1af3bf 100644
--- a/Error-Debugging/index.html
+++ b/Error-Debugging/index.html
@@ -169,7 +169,7 @@
Assorted Pages
diff --git a/External-LED/index.html b/External-LED/index.html
index 8a24295..e26f479 100644
--- a/External-LED/index.html
+++ b/External-LED/index.html
@@ -153,7 +153,7 @@
Assorted Pages
diff --git a/FAQs/index.html b/FAQs/index.html
index 1aa71c6..c1ed9d5 100644
--- a/FAQs/index.html
+++ b/FAQs/index.html
@@ -161,7 +161,7 @@
Assorted Pages
diff --git a/Frequent-Reboots/index.html b/Frequent-Reboots/index.html
index 77a13fc..94f80ac 100644
--- a/Frequent-Reboots/index.html
+++ b/Frequent-Reboots/index.html
@@ -175,7 +175,7 @@
Assorted Pages
diff --git a/Hardware-Compatibility/index.html b/Hardware-Compatibility/index.html
index fa5ae4c..0b65985 100644
--- a/Hardware-Compatibility/index.html
+++ b/Hardware-Compatibility/index.html
@@ -151,7 +151,7 @@
Assorted Pages
diff --git a/Influx-DB/index.html b/Influx-DB/index.html
index 26e9559..cdbabcd 100644
--- a/Influx-DB/index.html
+++ b/Influx-DB/index.html
@@ -149,7 +149,7 @@
Assorted Pages
diff --git a/Installation/index.html b/Installation/index.html
index 2333f2b..892e593 100644
--- a/Installation/index.html
+++ b/Installation/index.html
@@ -191,7 +191,7 @@
Assorted Pages
diff --git a/Integration-Home-Assistant/index.html b/Integration-Home-Assistant/index.html
index a34c5d3..ba6df5c 100644
--- a/Integration-Home-Assistant/index.html
+++ b/Integration-Home-Assistant/index.html
@@ -167,7 +167,7 @@
Assorted Pages
diff --git a/Learn-models-with-your-own-images/index.html b/Learn-models-with-your-own-images/index.html
index 6af5854..6cc3ba0 100644
--- a/Learn-models-with-your-own-images/index.html
+++ b/Learn-models-with-your-own-images/index.html
@@ -157,7 +157,7 @@
Assorted Pages
diff --git a/MQTT-API/index.html b/MQTT-API/index.html
index 71debf3..0517001 100644
--- a/MQTT-API/index.html
+++ b/MQTT-API/index.html
@@ -219,7 +219,7 @@
Assorted Pages
diff --git a/Neural-Network-Types/index.html b/Neural-Network-Types/index.html
index f10f21d..2333cf3 100644
--- a/Neural-Network-Types/index.html
+++ b/Neural-Network-Types/index.html
@@ -187,7 +187,7 @@
Assorted Pages
diff --git a/New-Releases-Notification/index.html b/New-Releases-Notification/index.html
index 7199053..5ff0170 100644
--- a/New-Releases-Notification/index.html
+++ b/New-Releases-Notification/index.html
@@ -153,7 +153,7 @@
Assorted Pages
diff --git a/Parameters/index.html b/Parameters/index.html
index 2b462d7..9dccf9d 100644
--- a/Parameters/index.html
+++ b/Parameters/index.html
@@ -357,7 +357,7 @@
Assorted Pages
diff --git a/REST-API/index.html b/REST-API/index.html
index dfc7952..f182101 100644
--- a/REST-API/index.html
+++ b/REST-API/index.html
@@ -225,7 +225,7 @@
Assorted Pages
diff --git a/ROI-Configuration/index.html b/ROI-Configuration/index.html
index 3afd995..fbccb6b 100644
--- a/ROI-Configuration/index.html
+++ b/ROI-Configuration/index.html
@@ -167,7 +167,7 @@
Assorted Pages
diff --git a/Reference-Image/index.html b/Reference-Image/index.html
index e5a4663..b3d3648 100644
--- a/Reference-Image/index.html
+++ b/Reference-Image/index.html
@@ -155,7 +155,7 @@
Assorted Pages
diff --git a/Release-creation/index.html b/Release-creation/index.html
index d5932af..f18971b 100644
--- a/Release-creation/index.html
+++ b/Release-creation/index.html
@@ -151,7 +151,7 @@
Assorted Pages
diff --git a/StatusLED_BlinkCodes/index.html b/StatusLED-BlinkCodes/index.html
similarity index 97%
rename from StatusLED_BlinkCodes/index.html
rename to StatusLED-BlinkCodes/index.html
index abf1f1a..c608b26 100644
--- a/StatusLED_BlinkCodes/index.html
+++ b/StatusLED-BlinkCodes/index.html
@@ -3,7 +3,7 @@
-
+
StatusLED BlinkCodes - AI on the Edge Device
@@ -13,8 +13,8 @@
@@ -171,7 +171,7 @@
Assorted Pages »
StatusLED BlinkCodes
- Edit on GitHub
+ Edit on GitHub
@@ -198,8 +198,6 @@ cpu_start: Failed to init external RAM!
The firmware was unable to initialize the Camera Framebuffer.
The firmware will continue to work, but other consequential error might arise.
A reboot of the device might help.
-0x00000200 NTP failed
-The firmware failed to get the world time from an NTP server. The firmware will continue to work, but has a wrong time.
diff --git a/Testing/index.html b/Testing/index.html
index 46df473..450cb7a 100644
--- a/Testing/index.html
+++ b/Testing/index.html
@@ -149,7 +149,7 @@
Assorted Pages
diff --git a/Upload-files-by-script/index.html b/Upload-files-by-script/index.html
index bdb2acd..62e5e6a 100644
--- a/Upload-files-by-script/index.html
+++ b/Upload-files-by-script/index.html
@@ -149,7 +149,7 @@
Assorted Pages
diff --git a/Watermeter-specific-analog---digital-transition/index.html b/Watermeter-specific-analog---digital-transition/index.html
index 150ed78..f9ad1f4 100644
--- a/Watermeter-specific-analog---digital-transition/index.html
+++ b/Watermeter-specific-analog---digital-transition/index.html
@@ -157,7 +157,7 @@
Assorted Pages
diff --git a/collect-new-images/index.html b/collect-new-images/index.html
index 1de2a84..cecb710 100644
--- a/collect-new-images/index.html
+++ b/collect-new-images/index.html
@@ -161,7 +161,7 @@
Assorted Pages
diff --git a/data-logging/index.html b/data-logging/index.html
index 94d58c8..f6d831e 100644
--- a/data-logging/index.html
+++ b/data-logging/index.html
@@ -151,7 +151,7 @@
Assorted Pages
diff --git a/index.html b/index.html
index ca9ea66..fcf0e05 100644
--- a/index.html
+++ b/index.html
@@ -161,7 +161,7 @@
Assorted Pages
diff --git a/initial-setup/index.html b/initial-setup/index.html
index 2ad8bae..90065cb 100644
--- a/initial-setup/index.html
+++ b/initial-setup/index.html
@@ -153,7 +153,7 @@
Assorted Pages
diff --git a/ota/index.html b/ota/index.html
index c234e6e..07dcf67 100644
--- a/ota/index.html
+++ b/ota/index.html
@@ -157,7 +157,7 @@
Assorted Pages
diff --git a/outdated--Integrated-Functions/index.html b/outdated--Integrated-Functions/index.html
index 26b8366..4d0d314 100644
--- a/outdated--Integrated-Functions/index.html
+++ b/outdated--Integrated-Functions/index.html
@@ -161,7 +161,7 @@
Assorted Pages
@@ -223,7 +223,7 @@ This can be used for a very simple web server for information or simple web page
@@ -253,7 +253,7 @@ This can be used for a very simple web server for information or simple web page
« Previous
- Next »
+ Next »
diff --git a/rolling-installation/index.html b/rolling-installation/index.html
index e69e296..b3f210c 100644
--- a/rolling-installation/index.html
+++ b/rolling-installation/index.html
@@ -151,7 +151,7 @@
Assorted Pages
diff --git a/search.html b/search.html
index 58f48f5..e94451a 100644
--- a/search.html
+++ b/search.html
@@ -140,7 +140,7 @@
Assorted Pages
diff --git a/search/search_index.json b/search/search_index.json
index 087a795..c3168cf 100644
--- a/search/search_index.json
+++ b/search/search_index.json
@@ -1 +1 @@
-{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome Welcome to the AI-on-the-edge-device project! This is the documentation. For the source code, please head to github.com/jomjol/AI-on-the-edge-device . Artificial intelligence based systems have been established in our everyday lives. Just think of speech or image recognition. Most of the systems rely on either powerful processors or a direct connection to the cloud for doing the calculations up there. With the increasing power of modern processors the AI systems are coming closer to the end user - which is usually called edge computing . Here this edge computing is brought into a practice-oriented example, where a AI network is implemented on a ESP32 device so: AI on the edge . Key features Tensorflow Lite (TFlite) integration - including easy to use wrapper Inline image processing (feature detection, alignment, ROI extraction) Small and cheap device (3x4.5x2 cm\u00b3, < 10 EUR) Camera and illumination integrated Web surface to administrate and control OTA-Interface to update directly through the web interface Full integration into Home Assistant Support for Influx DB 1 MQTT REST API Idea Hardware Web interface Configuration Interface Have fun in studying the new possibilities and ideas This is about image recognition and digitalization, done totally on a cheap ESP32 board using artificial intelligence in form of convolutional neural networks (CNN). Everything, from image capture (OV2640), image preprocessing (auto alignment, ROI identification) all the way down to the image recognition (CNN structure) and result plausibility is done on a cheap 10 EUR device. This all is integrated in an easy to do setup and use environment, taking care for all the background processing and handling, including regular job scheduler. The user interface is an integrated web server, that can be easily adjusted and offers the data as an API in different options. The task to be demonstrated here is an automated readout of an analog water meter. The water consumption is to be recorded within a house automatization and the water meter is totally analog without any electronic interface. Therefore, the task is solved by regularly taking an image of the water meter and digitizing the reading. There are two types of CNN implemented, a classification network for reading the digital numbers and a single output network for digitalize the analog pointers for the sub digit readings. This project is an evolution of the water-meter-system-complete , which uses ESP32-CAM just for taking the image and a 1GB-Docker image to run the neural network's backbone. Here everything is integrated in an ESP32-CAM module with 8MB of RAM and a SD card as data storage.","title":"Welcome"},{"location":"#welcome","text":"Welcome to the AI-on-the-edge-device project! This is the documentation. For the source code, please head to github.com/jomjol/AI-on-the-edge-device . Artificial intelligence based systems have been established in our everyday lives. Just think of speech or image recognition. Most of the systems rely on either powerful processors or a direct connection to the cloud for doing the calculations up there. With the increasing power of modern processors the AI systems are coming closer to the end user - which is usually called edge computing . Here this edge computing is brought into a practice-oriented example, where a AI network is implemented on a ESP32 device so: AI on the edge .","title":"Welcome"},{"location":"#key-features","text":"Tensorflow Lite (TFlite) integration - including easy to use wrapper Inline image processing (feature detection, alignment, ROI extraction) Small and cheap device (3x4.5x2 cm\u00b3, < 10 EUR) Camera and illumination integrated Web surface to administrate and control OTA-Interface to update directly through the web interface Full integration into Home Assistant Support for Influx DB 1 MQTT REST API","title":"Key features"},{"location":"#idea","text":"","title":"Idea"},{"location":"#hardware","text":"","title":"Hardware"},{"location":"#web-interface","text":"","title":"Web interface"},{"location":"#configuration-interface","text":"Have fun in studying the new possibilities and ideas This is about image recognition and digitalization, done totally on a cheap ESP32 board using artificial intelligence in form of convolutional neural networks (CNN). Everything, from image capture (OV2640), image preprocessing (auto alignment, ROI identification) all the way down to the image recognition (CNN structure) and result plausibility is done on a cheap 10 EUR device. This all is integrated in an easy to do setup and use environment, taking care for all the background processing and handling, including regular job scheduler. The user interface is an integrated web server, that can be easily adjusted and offers the data as an API in different options. The task to be demonstrated here is an automated readout of an analog water meter. The water consumption is to be recorded within a house automatization and the water meter is totally analog without any electronic interface. Therefore, the task is solved by regularly taking an image of the water meter and digitizing the reading. There are two types of CNN implemented, a classification network for reading the digital numbers and a single output network for digitalize the analog pointers for the sub digit readings. This project is an evolution of the water-meter-system-complete , which uses ESP32-CAM just for taking the image and a 1GB-Docker image to run the neural network's backbone. Here everything is integrated in an ESP32-CAM module with 8MB of RAM and a SD card as data storage.","title":"Configuration Interface"},{"location":"Additional-Information/","text":"The following links point to additional information in other repos: Digits Training and using a neural network to readout the value of a digital counter Training the CNN neural network Analog Training and using a neural network to read out the value of an analog display Training the CNN neural network","title":"Additional Information"},{"location":"Additional-Information/#digits","text":"Training and using a neural network to readout the value of a digital counter Training the CNN neural network","title":"Digits"},{"location":"Additional-Information/#analog","text":"Training and using a neural network to read out the value of an analog display Training the CNN neural network","title":"Analog"},{"location":"Alignment/","text":"Alignment References The alignment references are used in every round to re-align the taken image to the reference coordinates. Two alignment structures must be defined and the taken image then in each round is shifted and rotated according to their position with the target to be in exactly the same position as the reference image. Note The alignment structures needs to be unique and have a good contrast. It is advised to have them as far apart as possible. Precondition Please make sure to have setup your camera properly and taken a good Reference Image . Define two Reference Images You can switch between this two marks with (1) . Then define the reference area in the image by either directly drag and drop with the mouse or use the input boxes below. To apply the currently marked image part you need to push \"Update Reference\" (2) . In some cases it might be useful to use a reference with a higher contrast. This can be achieved by pushing Enhance Contrast\" (3) . The result will be calculated on the ESP32 - so be a bit patient, before you see it active. To save push \"Save to config.ini\" (4) . Note A reboot is not required at this point of time. As next you should define the Digit and Analog ROIs .","title":"Alignment References"},{"location":"Alignment/#alignment-references","text":"The alignment references are used in every round to re-align the taken image to the reference coordinates. Two alignment structures must be defined and the taken image then in each round is shifted and rotated according to their position with the target to be in exactly the same position as the reference image. Note The alignment structures needs to be unique and have a good contrast. It is advised to have them as far apart as possible.","title":"Alignment References"},{"location":"Alignment/#precondition","text":"Please make sure to have setup your camera properly and taken a good Reference Image .","title":"Precondition"},{"location":"Alignment/#define-two-reference-images","text":"You can switch between this two marks with (1) . Then define the reference area in the image by either directly drag and drop with the mouse or use the input boxes below. To apply the currently marked image part you need to push \"Update Reference\" (2) . In some cases it might be useful to use a reference with a higher contrast. This can be achieved by pushing Enhance Contrast\" (3) . The result will be calculated on the ESP32 - so be a bit patient, before you see it active. To save push \"Save to config.ini\" (4) . Note A reboot is not required at this point of time. As next you should define the Digit and Analog ROIs .","title":"Define two Reference Images"},{"location":"Best-Practice/","text":"Best Practice This page shows some best practices: Camera Placement Move the Camera as close as possible (~4cm), this will help get rid of reflections. -> focus can be adjusted by turning the outer black ring of the camera. If the LED reflections are too strong, put tape over the LED to diffuse the light Change the ImageSize to QVGA under \"Expert mode\" configuration when close enough, this will be faster and is often good enough for digital recognition. Reflections Try to get rid of the reflections by rotating the camera, so that the reflections are at positions, where no number is. By using the external LED option, you can place WS2812 LEDs freely away from the main axis. Users report, that a handy cover foil could also help Post-processing Filter out the Number \"9\", as \"3\" will often be misread for a \"9\" and void every number between 3 and 9 due to it being negative flow. Split the readings into two, while the decimal numbers might move to fast to be recognized, at least the slower moving part will produce a correct reading. -> keep in mind that the offset needs to be adjusted, a.e if you have a comma reading of \"3\", it needs to become \"0.3\". This can be done wherever the data ends up being sent, like home assistant using sensor templates. If you are using a low resolution and only digital mode, processing can often be done in <1 minute. Check the logs to confirm how fast it is and then set the interval accordingly under \"Expert mode\" in configuration, as the normal mode will lock you to 3+ minutes.","title":"Best Practice"},{"location":"Best-Practice/#best-practice","text":"This page shows some best practices:","title":"Best Practice"},{"location":"Best-Practice/#camera-placement","text":"Move the Camera as close as possible (~4cm), this will help get rid of reflections. -> focus can be adjusted by turning the outer black ring of the camera. If the LED reflections are too strong, put tape over the LED to diffuse the light Change the ImageSize to QVGA under \"Expert mode\" configuration when close enough, this will be faster and is often good enough for digital recognition.","title":"Camera Placement"},{"location":"Best-Practice/#reflections","text":"Try to get rid of the reflections by rotating the camera, so that the reflections are at positions, where no number is. By using the external LED option, you can place WS2812 LEDs freely away from the main axis. Users report, that a handy cover foil could also help","title":"Reflections"},{"location":"Best-Practice/#post-processing","text":"Filter out the Number \"9\", as \"3\" will often be misread for a \"9\" and void every number between 3 and 9 due to it being negative flow. Split the readings into two, while the decimal numbers might move to fast to be recognized, at least the slower moving part will produce a correct reading. -> keep in mind that the offset needs to be adjusted, a.e if you have a comma reading of \"3\", it needs to become \"0.3\". This can be done wherever the data ends up being sent, like home assistant using sensor templates. If you are using a low resolution and only digital mode, processing can often be done in <1 minute. Check the logs to confirm how fast it is and then set the interval accordingly under \"Expert mode\" in configuration, as the normal mode will lock you to 3+ minutes.","title":"Post-processing"},{"location":"Build-Instructions/","text":"Build the Project See README.md","title":"Build the Project"},{"location":"Build-Instructions/#build-the-project","text":"See README.md","title":"Build the Project"},{"location":"Choosing-the-Model/","text":"Model Selection Notes See Neural Network Types for additional details. In the Graphical Configuration Page , you can choose different models depending on your needs. This page tries to help you on which model to select. For more technical/deeper explanations have a look on Neural-Network-Types . Digit Models For digits on water meters, gas-meters or power meters you can select between two main types of models. dig-class11 This model can recognize full digits. All intermediate states shown a \"N\" for not a number. But in post process it uses older values to fill up the \"N\" values if possible. Main features well suited for LCD digits with the ExtendedResolution option is not supported. (Only in conjunction with ana-class100 / ana-cont) dig-class100 / dig-cont These models are used to get a continuous reading with intermediate states. To see what the models are doing, you can go to the Recognition page. Main features suitable for all digit displays. Advantage over dig-class11 that results continue to be calculated in the transition between digits. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of digit images used for the training dig-class100 vs. dig-cont The difference is in the internal processing. Take the one that gives you the best results. Analog pointer models ana-class100 / ana-cont For pointers on water meters use the analog models. You can only choose between ana-class100 and ana-cont. Both do mainly the same. Main features for all analogue pointers, especially for water meters. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of pointer images used for the training ana-class100 vs. ana-cont The difference is in the internal processing. Take the one that gives you the best results. Both models learn from the same data. Different types of models (normal vs. quantized) The normally trained network is calculating with internal floating point numbers. The saving of floating point numbers naturally takes more space than an integer type. Often the increased accuracy is not needed. Therefore there is the option, to \"quantize\" a neural network. In this case the internal values are rescaled to integer values, which is called \"quantization\". The stored tflite files are usually much smaller. Usually the models are distrusted therefore in both versions. They can be distinguished by a \"-q\" at the end of the logfile. Example: Type Name Normal dig-cont_0610_s3.tflite Quantized dig-cont_0610_s3-q.tflite","title":"Model Selection"},{"location":"Choosing-the-Model/#model-selection","text":"Notes See Neural Network Types for additional details. In the Graphical Configuration Page , you can choose different models depending on your needs. This page tries to help you on which model to select. For more technical/deeper explanations have a look on Neural-Network-Types .","title":"Model Selection"},{"location":"Choosing-the-Model/#digit-models","text":"For digits on water meters, gas-meters or power meters you can select between two main types of models.","title":"Digit Models"},{"location":"Choosing-the-Model/#dig-class11","text":"This model can recognize full digits. All intermediate states shown a \"N\" for not a number. But in post process it uses older values to fill up the \"N\" values if possible.","title":"dig-class11"},{"location":"Choosing-the-Model/#main-features","text":"well suited for LCD digits with the ExtendedResolution option is not supported. (Only in conjunction with ana-class100 / ana-cont)","title":"Main features"},{"location":"Choosing-the-Model/#dig-class100-dig-cont","text":"These models are used to get a continuous reading with intermediate states. To see what the models are doing, you can go to the Recognition page.","title":"dig-class100 / dig-cont"},{"location":"Choosing-the-Model/#main-features_1","text":"suitable for all digit displays. Advantage over dig-class11 that results continue to be calculated in the transition between digits. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of digit images used for the training","title":"Main features"},{"location":"Choosing-the-Model/#dig-class100-vs-dig-cont","text":"The difference is in the internal processing. Take the one that gives you the best results.","title":"dig-class100 vs. dig-cont"},{"location":"Choosing-the-Model/#analog-pointer-models","text":"","title":"Analog pointer models"},{"location":"Choosing-the-Model/#ana-class100-ana-cont","text":"For pointers on water meters use the analog models. You can only choose between ana-class100 and ana-cont. Both do mainly the same.","title":"ana-class100 / ana-cont"},{"location":"Choosing-the-Model/#main-features_2","text":"for all analogue pointers, especially for water meters. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of pointer images used for the training","title":"Main features"},{"location":"Choosing-the-Model/#ana-class100-vs-ana-cont","text":"The difference is in the internal processing. Take the one that gives you the best results. Both models learn from the same data.","title":"ana-class100 vs. ana-cont"},{"location":"Choosing-the-Model/#different-types-of-models-normal-vs-quantized","text":"The normally trained network is calculating with internal floating point numbers. The saving of floating point numbers naturally takes more space than an integer type. Often the increased accuracy is not needed. Therefore there is the option, to \"quantize\" a neural network. In this case the internal values are rescaled to integer values, which is called \"quantization\". The stored tflite files are usually much smaller. Usually the models are distrusted therefore in both versions. They can be distinguished by a \"-q\" at the end of the logfile.","title":"Different types of models (normal vs. quantized)"},{"location":"Choosing-the-Model/#example","text":"Type Name Normal dig-cont_0610_s3.tflite Quantized dig-cont_0610_s3-q.tflite","title":"Example:"},{"location":"Configuration/","text":"Graphical Configuration Most of the settings can be modified on the Settings page: It can be reached via the menu Settings > Configuration . Note To activate the changes, the device needs to be restarted after saving the changes. Most of the commands need processing on the ESP32 device. This is not very fast - so please be patient. All parameters are documented on the Parameters page and as tooltips on the config page. Expert Parameters Some parameters are treated as Expert Parameters and are hidden by default. Tick the checkbox in the top left corner to enable them: The Expert Parameters then will be shown with a red background: Manual Editing of the Config File Even more configuration parameters can be edited manually in the config.ini : To edit the config.ini file directly, click on the Edit Config.ini directly button. Background Information Note You do not need to understand this! But you might be interested in it. The principle is very simple and can most easily be described as a flow of processing steps. Each step has a dedicated parameter description in the config.ini , which is indicated by brackets [name_of_step] . The steps are processed in the order written in the config file. That means, that you first have to describe the image taking, then the aligning and cutting and only after that you can start to config a neural network. The last step is the post processing. Processing steps - Overview In the following you get a short overview over the available steps. This order is also the suggested order for the processing flow. Single steps can be left out, if not needed (e.g. omit the analog part, if only digits are present) 1. [TakeImage] This steps parametrises the taking of the image by the ESP32-CAM. Size, quality and storage for logging and debugging can be set. 2. [Alignment] Image preprocessing, including image alignment with reference images 3. [Digits] Neural network evaluation of an image for digits. The neural network is defined by a tflite formatted file and the output is a number between 0 .. 9 or NaN (if image is not unique enough) 4. [Analog] Neural network evaluation of analog counter. The neural network is defined by a tflite formatted file and the output is a number between 0.0 .. 9.9, representing the position of the pointer. 5. [PostProcessing] Summarized the individually converted pictures to the overall result. It also implements some error corrections and consistency checks to filter wrong reading. 6. [MQTT] Transfer of the readings to a MQTT server. 7. [AutoTimer] Configuration of the automated flow start at the start up of the ESP32. 8. [Debug] Configuration for debugging details","title":"Graphical Configuration"},{"location":"Configuration/#graphical-configuration","text":"Most of the settings can be modified on the Settings page: It can be reached via the menu Settings > Configuration . Note To activate the changes, the device needs to be restarted after saving the changes. Most of the commands need processing on the ESP32 device. This is not very fast - so please be patient. All parameters are documented on the Parameters page and as tooltips on the config page.","title":"Graphical Configuration"},{"location":"Configuration/#expert-parameters","text":"Some parameters are treated as Expert Parameters and are hidden by default. Tick the checkbox in the top left corner to enable them: The Expert Parameters then will be shown with a red background:","title":"Expert Parameters"},{"location":"Configuration/#manual-editing-of-the-config-file","text":"Even more configuration parameters can be edited manually in the config.ini : To edit the config.ini file directly, click on the Edit Config.ini directly button.","title":"Manual Editing of the Config File"},{"location":"Configuration/#background-information","text":"Note You do not need to understand this! But you might be interested in it. The principle is very simple and can most easily be described as a flow of processing steps. Each step has a dedicated parameter description in the config.ini , which is indicated by brackets [name_of_step] . The steps are processed in the order written in the config file. That means, that you first have to describe the image taking, then the aligning and cutting and only after that you can start to config a neural network. The last step is the post processing.","title":"Background Information"},{"location":"Configuration/#processing-steps-overview","text":"In the following you get a short overview over the available steps. This order is also the suggested order for the processing flow. Single steps can be left out, if not needed (e.g. omit the analog part, if only digits are present)","title":"Processing steps - Overview"},{"location":"Configuration/#1-takeimage","text":"This steps parametrises the taking of the image by the ESP32-CAM. Size, quality and storage for logging and debugging can be set.","title":"1. [TakeImage]"},{"location":"Configuration/#2-alignment","text":"Image preprocessing, including image alignment with reference images","title":"2. [Alignment]"},{"location":"Configuration/#3-digits","text":"Neural network evaluation of an image for digits. The neural network is defined by a tflite formatted file and the output is a number between 0 .. 9 or NaN (if image is not unique enough)","title":"3. [Digits]"},{"location":"Configuration/#4-analog","text":"Neural network evaluation of analog counter. The neural network is defined by a tflite formatted file and the output is a number between 0.0 .. 9.9, representing the position of the pointer.","title":"4. [Analog]"},{"location":"Configuration/#5-postprocessing","text":"Summarized the individually converted pictures to the overall result. It also implements some error corrections and consistency checks to filter wrong reading.","title":"5. [PostProcessing]"},{"location":"Configuration/#6-mqtt","text":"Transfer of the readings to a MQTT server.","title":"6. [MQTT]"},{"location":"Configuration/#7-autotimer","text":"Configuration of the automated flow start at the start up of the ESP32.","title":"7. [AutoTimer]"},{"location":"Configuration/#8-debug","text":"Configuration for debugging details","title":"8. [Debug]"},{"location":"Correction%20Algorithm/","text":"Correction Algorithm After the digitization of the images and the composition to a number a checking and correction algorithm is applied. This is explained here. There are several reasons, that a check might be necessary: In case of digits there is the output of \"N\" (=NaN = Not-a-Number) in case the digit cannot be detected correctly. This happens for example if the image shows a digit between to states The replacement of the \"N\" with a previous value could be not sufficient, due to the fact, that it might have changed. There is a misreading of one one of the numbers. This can always happen in case of neural network processing. Terms and definitions PreValue The last correct read value. Either from a previous correctly identified value or manual setting by the user. This is used to replace \"N\"s and make a check for the absolute change. Digits Value that are digitized from a digital number. There are 11 allowed values for this: Digits: 0, 1, 2, ... 9 N = Not-a-Number - representing a not unique state between two numbers Analogs This are value derived from a pointer like meter. This never has the state \"N\". CheckDigitIncreaseConsistency If this is enabled an \"intelligent\" algorithm is used to derive from zero-crossing of discrete digit positions, if the number should have been increased. This is relevant because in some of the digit meters, the increase of a digit to the next number can be seen, before the sub-digit has gone through zero. For example: 16.6 --> 16.7 --> 1N.8 --> 17.9 corrected to 16.9 --> 17.0 --> 17.1 As you can see, the 17.9 is a false reading as the 7 is assumed to be already readable, although the sub-digit has not crossed the zero. In this case the CheckDigitIncreaseConsistency algorithm will correct this to 16.9 A detailed description of the algorithm can be found below (not yet ready!) Negative Rate allowed Most of the meters only have increasing numbers and do not count backwards. Therefore a negative rate (= negative change compared to the PreValue) is surely a false value. This can be checked an flagged as false reading MaxRateValue / MaxRateType Here the maximum change from one to the next reading can be limited. If a false reading of the neural network results in a change larger than this, the reading is flagged as false. There a two types of comparisons possible 1) AbsolutChange : Here the difference between the PreValue and the current reading is compared directly, independent how much time has passed since the last reading. 2) RelativeRate : in this case a change rate in the unit of change/minute is calculated, taking the time between the last and the current reading into account. Be careful, that with increasing time, the absolute allowed change increases. Example: relative rate of 0.05 m\u00b3/minute --> after 20 minutes a maximum change of 20 minutes * 0.05 m\u00b3/minute = 1 m\u00b3 is possible. That means that a false reading of 1 m\u00b3 cannot be detected false after about 20 minutes in this case Assume, that there might me no change in the meter for hours (e.g. during the night) a much bigger change could also be accepted. Flow Chart CheckDigitIncreaseConsistency Algorithm The check digit increase consistency algorithm is functional for the digits only. Due to the fact, that the rotation might be a little bit earlier or later compared to the zero crossing of the digit before, errors during the reading before and after a zero crossing can be wrong. Therefore a simple algorithm can be applied, checking the consistency of zero crossing and changes in the following digit. This is applied to one after the other digit, starting with the lowest priority digits.","title":"Correction Algorithm"},{"location":"Correction%20Algorithm/#correction-algorithm","text":"After the digitization of the images and the composition to a number a checking and correction algorithm is applied. This is explained here. There are several reasons, that a check might be necessary: In case of digits there is the output of \"N\" (=NaN = Not-a-Number) in case the digit cannot be detected correctly. This happens for example if the image shows a digit between to states The replacement of the \"N\" with a previous value could be not sufficient, due to the fact, that it might have changed. There is a misreading of one one of the numbers. This can always happen in case of neural network processing.","title":"Correction Algorithm"},{"location":"Correction%20Algorithm/#terms-and-definitions","text":"","title":"Terms and definitions"},{"location":"Correction%20Algorithm/#prevalue","text":"The last correct read value. Either from a previous correctly identified value or manual setting by the user. This is used to replace \"N\"s and make a check for the absolute change.","title":"PreValue"},{"location":"Correction%20Algorithm/#digits","text":"Value that are digitized from a digital number. There are 11 allowed values for this: Digits: 0, 1, 2, ... 9 N = Not-a-Number - representing a not unique state between two numbers","title":"Digits"},{"location":"Correction%20Algorithm/#analogs","text":"This are value derived from a pointer like meter. This never has the state \"N\".","title":"Analogs"},{"location":"Correction%20Algorithm/#checkdigitincreaseconsistency","text":"If this is enabled an \"intelligent\" algorithm is used to derive from zero-crossing of discrete digit positions, if the number should have been increased. This is relevant because in some of the digit meters, the increase of a digit to the next number can be seen, before the sub-digit has gone through zero. For example: 16.6 --> 16.7 --> 1N.8 --> 17.9 corrected to 16.9 --> 17.0 --> 17.1 As you can see, the 17.9 is a false reading as the 7 is assumed to be already readable, although the sub-digit has not crossed the zero. In this case the CheckDigitIncreaseConsistency algorithm will correct this to 16.9 A detailed description of the algorithm can be found below (not yet ready!)","title":"CheckDigitIncreaseConsistency"},{"location":"Correction%20Algorithm/#negative-rate-allowed","text":"Most of the meters only have increasing numbers and do not count backwards. Therefore a negative rate (= negative change compared to the PreValue) is surely a false value. This can be checked an flagged as false reading","title":"Negative Rate allowed"},{"location":"Correction%20Algorithm/#maxratevalue-maxratetype","text":"Here the maximum change from one to the next reading can be limited. If a false reading of the neural network results in a change larger than this, the reading is flagged as false. There a two types of comparisons possible 1) AbsolutChange : Here the difference between the PreValue and the current reading is compared directly, independent how much time has passed since the last reading. 2) RelativeRate : in this case a change rate in the unit of change/minute is calculated, taking the time between the last and the current reading into account. Be careful, that with increasing time, the absolute allowed change increases. Example: relative rate of 0.05 m\u00b3/minute --> after 20 minutes a maximum change of 20 minutes * 0.05 m\u00b3/minute = 1 m\u00b3 is possible. That means that a false reading of 1 m\u00b3 cannot be detected false after about 20 minutes in this case Assume, that there might me no change in the meter for hours (e.g. during the night) a much bigger change could also be accepted.","title":"MaxRateValue / MaxRateType"},{"location":"Correction%20Algorithm/#flow-chart","text":"","title":"Flow Chart"},{"location":"Correction%20Algorithm/#checkdigitincreaseconsistency-algorithm","text":"The check digit increase consistency algorithm is functional for the digits only. Due to the fact, that the rotation might be a little bit earlier or later compared to the zero crossing of the digit before, errors during the reading before and after a zero crossing can be wrong. Therefore a simple algorithm can be applied, checking the consistency of zero crossing and changes in the following digit. This is applied to one after the other digit, starting with the lowest priority digits.","title":"CheckDigitIncreaseConsistency Algorithm"},{"location":"Demo-Mode/","text":"Demo Mode For Demo and Testing Purpose, the device can use pre-recorded images. You need to enable it in the configuration ( TakeImage > Demo ) and also provide the needed files on the SD card. For each round one image gets used, starting with the first image for the first round. For the reference image and the alignment also the first image gets used. Once the last image got reached, it starts again with the first one. SD Card Structure demo/ \u251c\u2500\u2500 520.8983.jpg \u251c\u2500\u2500 520.9086.jpg \u251c\u2500\u2500 520.9351.jpg \u251c\u2500\u2500 ... \u2514\u2500\u2500 files.txt The jpg files can have any name The jpg files must be smaller than 30'000 bytes The files.txt must contains a list of those files, eg: 520.8983.jpg 520.9086.jpg 520.9351.jpg Recording To record real images of a meter, you have to periodically fetch http:///img_tmp/raw.jpg . To automate this, you can use the following shell script (Linux only): #!/bin/bash while [[ true ]]; do echo \"fetching value...\" wget -q http://192.168.1.151/value -O value.txt value=`cat value.txt` echo \"Value: $value\" diff=`diff value.txt value_previous.txt` changed=$? #echo \"Diff: $diff\" if [[ $changed -ne 0 ]]; then echo \"Value changed:\" echo $diff echo \"fetching image...\" wget -q http://192.168.1.151/img_tmp/raw.jpg -O $value.jpg else echo \"Value did not change, skipping image fetching!\" fi cp value.txt value_previous.txt echo \"waiting 60s...\" sleep 60 done Installation Just install the zip file using the OTA Update functionality. How does it work The Demo Mode tries to interfere as less as possible with the normal behavior. Whenever a Cam framebuffer gets taken ( esp_camera_fb_get() ), it replaces the framebuffer with the image from the SD card. Example Data of a Water Meter You can use the following demo images if you want: It covers a meter range from 530.00688 to 531.85882 . Animation Animation of the watermeter (77 MB!) All images (843 images) Demo_Images_Watermeter_530.00688-532.08243_843_images.zip Animation of it (186 MB!) Selection of 84 images Demo_Images_Watermeter_530.00688-532.08243_84_images.zip Selection of 42 images Demo_Images_Watermeter_530.00688-532.08243_42_images.zip","title":"Demo Mode"},{"location":"Demo-Mode/#demo-mode","text":"For Demo and Testing Purpose, the device can use pre-recorded images. You need to enable it in the configuration ( TakeImage > Demo ) and also provide the needed files on the SD card. For each round one image gets used, starting with the first image for the first round. For the reference image and the alignment also the first image gets used. Once the last image got reached, it starts again with the first one.","title":"Demo Mode"},{"location":"Demo-Mode/#sd-card-structure","text":"demo/ \u251c\u2500\u2500 520.8983.jpg \u251c\u2500\u2500 520.9086.jpg \u251c\u2500\u2500 520.9351.jpg \u251c\u2500\u2500 ... \u2514\u2500\u2500 files.txt The jpg files can have any name The jpg files must be smaller than 30'000 bytes The files.txt must contains a list of those files, eg: 520.8983.jpg 520.9086.jpg 520.9351.jpg","title":"SD Card Structure"},{"location":"Demo-Mode/#recording","text":"To record real images of a meter, you have to periodically fetch http:///img_tmp/raw.jpg . To automate this, you can use the following shell script (Linux only): #!/bin/bash while [[ true ]]; do echo \"fetching value...\" wget -q http://192.168.1.151/value -O value.txt value=`cat value.txt` echo \"Value: $value\" diff=`diff value.txt value_previous.txt` changed=$? #echo \"Diff: $diff\" if [[ $changed -ne 0 ]]; then echo \"Value changed:\" echo $diff echo \"fetching image...\" wget -q http://192.168.1.151/img_tmp/raw.jpg -O $value.jpg else echo \"Value did not change, skipping image fetching!\" fi cp value.txt value_previous.txt echo \"waiting 60s...\" sleep 60 done","title":"Recording"},{"location":"Demo-Mode/#installation","text":"Just install the zip file using the OTA Update functionality.","title":"Installation"},{"location":"Demo-Mode/#how-does-it-work","text":"The Demo Mode tries to interfere as less as possible with the normal behavior. Whenever a Cam framebuffer gets taken ( esp_camera_fb_get() ), it replaces the framebuffer with the image from the SD card.","title":"How does it work"},{"location":"Demo-Mode/#example-data-of-a-water-meter","text":"You can use the following demo images if you want: It covers a meter range from 530.00688 to 531.85882 .","title":"Example Data of a Water Meter"},{"location":"Demo-Mode/#animation","text":"Animation of the watermeter (77 MB!)","title":"Animation"},{"location":"Demo-Mode/#all-images-843-images","text":"Demo_Images_Watermeter_530.00688-532.08243_843_images.zip Animation of it (186 MB!)","title":"All images (843 images)"},{"location":"Demo-Mode/#selection-of-84-images","text":"Demo_Images_Watermeter_530.00688-532.08243_84_images.zip","title":"Selection of 84 images"},{"location":"Demo-Mode/#selection-of-42-images","text":"Demo_Images_Watermeter_530.00688-532.08243_42_images.zip","title":"Selection of 42 images"},{"location":"Error-Codes/","text":"This page lists the possible error codes, their meaning and possible solutions. The effective error codes can be found here . Critical Errors Those Errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue! 0x00000001 PSRAM bad Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM! 0x00000002 Heap too small The firmware failed to allocate enough memory. This most likely is a consequential error of a bad PSRAM! 0x00000004 Cam bad The attached camera can not be initialized. This usually is because on of the following reasons: The camera is not supported, see Hardware Compatibility The camera is not attached properly -> Try to remove and attach it again. Make sure you move the black part enough into the socket! The camera or the camera cable is damaged 0x00000008 SD card basic check failed One or more basic SD card checks failed. The following checks are performed during boot sequence: Write a file (sdcard/sdcheck.txt) to SD card with some generic text Read the written file back CRC verification Delete the file Detailed error indication (write, rerad or delete error) can be derived from blinking code of red board status LED. Please have a look to !!!TODO!!! Recommendation: Reformat SD card and check again or try another SD card 0x00000010 SD folder or file presence check failed One or more mandatory folders and/or files are missing on SD card. To have early indication that SD card is potentially ready for operation, some folder and files, which are mandatory are presence checked. This is not a 100% check and a successful test does not mean everthing is OK. The following folders / files get checked during boot sequence: /sdcard/config /sdcard/html /sdcard/demo --> created automatically in firmware /sdcard/firmware --> created automatically in firmware /sdcard/img_tmp --> created automatically in firmware /sdcard/log --> created automatically in firmware /sdcard/wlan.ini /sdcard/config/config.ini /sdcard/html/index.html /sdcard/html/ota_page.html /sdcard/html/log.html /sdcard/html/common.js /sdcard/html/gethost.js /sdcard/html/version.txt Recommendation: Check logs and / or redo a Over-The-Air Update (OTA Update) to ensure proper SD card structure Non-Critical Errors Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it. 0x00000100 Cam Framebuffer bad The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help. 0x00000200 NTP failed The firmware failed to get the world time from an NTP server. The firmware will continue to work, but has a wrong time.","title":"Error Codes"},{"location":"Error-Codes/#critical-errors","text":"Those Errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue!","title":"Critical Errors"},{"location":"Error-Codes/#0x00000001-psram-bad","text":"Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM!","title":"0x00000001 PSRAM bad"},{"location":"Error-Codes/#0x00000002-heap-too-small","text":"The firmware failed to allocate enough memory. This most likely is a consequential error of a bad PSRAM!","title":"0x00000002 Heap too small"},{"location":"Error-Codes/#0x00000004-cam-bad","text":"The attached camera can not be initialized. This usually is because on of the following reasons: The camera is not supported, see Hardware Compatibility The camera is not attached properly -> Try to remove and attach it again. Make sure you move the black part enough into the socket! The camera or the camera cable is damaged","title":"0x00000004 Cam bad"},{"location":"Error-Codes/#0x00000008-sd-card-basic-check-failed","text":"One or more basic SD card checks failed. The following checks are performed during boot sequence: Write a file (sdcard/sdcheck.txt) to SD card with some generic text Read the written file back CRC verification Delete the file Detailed error indication (write, rerad or delete error) can be derived from blinking code of red board status LED. Please have a look to !!!TODO!!! Recommendation: Reformat SD card and check again or try another SD card","title":"0x00000008 SD card basic check failed"},{"location":"Error-Codes/#0x00000010-sd-folder-or-file-presence-check-failed","text":"One or more mandatory folders and/or files are missing on SD card. To have early indication that SD card is potentially ready for operation, some folder and files, which are mandatory are presence checked. This is not a 100% check and a successful test does not mean everthing is OK. The following folders / files get checked during boot sequence: /sdcard/config /sdcard/html /sdcard/demo --> created automatically in firmware /sdcard/firmware --> created automatically in firmware /sdcard/img_tmp --> created automatically in firmware /sdcard/log --> created automatically in firmware /sdcard/wlan.ini /sdcard/config/config.ini /sdcard/html/index.html /sdcard/html/ota_page.html /sdcard/html/log.html /sdcard/html/common.js /sdcard/html/gethost.js /sdcard/html/version.txt Recommendation: Check logs and / or redo a Over-The-Air Update (OTA Update) to ensure proper SD card structure","title":"0x00000010 SD folder or file presence check failed"},{"location":"Error-Codes/#non-critical-errors","text":"Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it.","title":"Non-Critical Errors"},{"location":"Error-Codes/#0x00000100-cam-framebuffer-bad","text":"The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help.","title":"0x00000100 Cam Framebuffer bad"},{"location":"Error-Codes/#0x00000200-ntp-failed","text":"The firmware failed to get the world time from an NTP server. The firmware will continue to work, but has a wrong time.","title":"0x00000200 NTP failed"},{"location":"Error-Debugging/","text":"Error Debugging Rebooting General Remark Due to the rather complex code with a lot of external libraries and the limited availability of memory a reboot of the device from time to time is \"normal\". Background are memory leakages and therefore running out of free memory. The hardware of the ESP32CAM has a varying quality. I have one and the same hardware with a reboot range from every 5 detection runs to up to 250 detection runs. Getting deeper inside Have a look into the log file ( /log/message/... ). If the log file is very short you need to enable a enhanced logging in the config.ini (Debug --> logfile = true ) . Analyze the debugging output of the serial interface Connect a serial to USB interface (like for flashing) and make a logging of the serial communication There are a lot more intermediate information and the lines before the reboot tell you, where the firmware fails If you make an issue about this, please post these two information additionally Don't forget to remove your WLAN password in the serial log Often observed problems Hardware failure Camera not working --> check the interface, test another module Low cost module with only 2MB of PSRAM instead of 4MB --> image taking will fail first. This will never work due to too low memory ROI misaligned This typically happens if you have suboptimal \"Alignment Marks\". A very simple and working solution is to put put higly contrasted stickers on your meter and put \"Alignment Marks\" on it (see picture below) If after those adjustment you still have some issues, you can try to adjust your alignment settings in expert mode: My Analog Meter are recognized as Digital Counter or vice versa First, check that your ROI are correctly defined (yey!) Second, verify that the name of your ROI analog and digital ROIs are different Recognition is working well, but number aren't sorted correctly You have to sort your ROI correctly (Bigger to smaller). Select your ROI and click either \"move next\" or \"move previous\". Repeat until your ROI are correctly sorted","title":"Error Debugging"},{"location":"Error-Debugging/#error-debugging","text":"","title":"Error Debugging"},{"location":"Error-Debugging/#rebooting","text":"","title":"Rebooting"},{"location":"Error-Debugging/#general-remark","text":"Due to the rather complex code with a lot of external libraries and the limited availability of memory a reboot of the device from time to time is \"normal\". Background are memory leakages and therefore running out of free memory. The hardware of the ESP32CAM has a varying quality. I have one and the same hardware with a reboot range from every 5 detection runs to up to 250 detection runs.","title":"General Remark"},{"location":"Error-Debugging/#getting-deeper-inside","text":"Have a look into the log file ( /log/message/... ). If the log file is very short you need to enable a enhanced logging in the config.ini (Debug --> logfile = true ) . Analyze the debugging output of the serial interface Connect a serial to USB interface (like for flashing) and make a logging of the serial communication There are a lot more intermediate information and the lines before the reboot tell you, where the firmware fails If you make an issue about this, please post these two information additionally Don't forget to remove your WLAN password in the serial log","title":"Getting deeper inside"},{"location":"Error-Debugging/#often-observed-problems","text":"","title":"Often observed problems"},{"location":"Error-Debugging/#hardware-failure","text":"Camera not working --> check the interface, test another module Low cost module with only 2MB of PSRAM instead of 4MB --> image taking will fail first. This will never work due to too low memory","title":"Hardware failure"},{"location":"Error-Debugging/#roi-misaligned","text":"This typically happens if you have suboptimal \"Alignment Marks\". A very simple and working solution is to put put higly contrasted stickers on your meter and put \"Alignment Marks\" on it (see picture below) If after those adjustment you still have some issues, you can try to adjust your alignment settings in expert mode:","title":"ROI misaligned"},{"location":"Error-Debugging/#my-analog-meter-are-recognized-as-digital-counter-or-vice-versa","text":"First, check that your ROI are correctly defined (yey!) Second, verify that the name of your ROI analog and digital ROIs are different","title":"My Analog Meter are recognized as Digital Counter or vice versa"},{"location":"Error-Debugging/#recognition-is-working-well-but-number-arent-sorted-correctly","text":"You have to sort your ROI correctly (Bigger to smaller). Select your ROI and click either \"move next\" or \"move previous\". Repeat until your ROI are correctly sorted","title":"Recognition is working well, but number aren't sorted correctly"},{"location":"External-LED/","text":"External LED The internal flash LED is very close to the camera axis. This results in reflection, especially in case of flat glass surfaces such as for power meters. To circumvent this problem, it is now possible to control external LEDs, which than can be places somewhere else in the setup. As not simples LEDs are used, but RGB LEDs with a digital interface like WS2812 not only the position, but also the color and intensity of the illumination can now be adjusted. The following image shows a direct comparison of the \"old\" internal flash LED and two off axis LEDs. There is also a new meter adapter available. This has two features: designed for small clearings in front of the meter and prepared for WS2812 LEDs . 1. Hardware installation of the LED stripe The control line of the LED stripe is connected with a 470 Ohm resistor to the GPIO12. For power supply stabilization a capacitor between 5V and ground is recommended. Here a 470\u00b5F polymer capacitor is used. As a power supply a 5V from the ESP32 is used like in the following wiring. 2. Software configuration The handling of the WS2812 LED controller needs some other libraries, therefore it is controlled within a dedicated section called GPIO Settings . The external LED stripe is connected to GPIO12. After activating the \"GPIO Settings\" section, the internal flash is per default disabled. In order to activate the external LED, you need to activate GPIO 12 state and select \"extern flash light ws281x ...\" . Parameter Meaning LED-Type There are several types of controller implemented: WS2812(B), WS2813, SK6812 Numbers of LED Number of LEDs on the LED stripe LED Color The color and intensity can be controlled directly by a red/green/blue value, each within the range from 0 (off) to 255 (full) Enabling the GPIO settings automatically disables the flash LED. Therefore you can enable it here manually by checking GPIO4 and choose \"build-in led flash light\" . It is not recommended to use both illumination parallel.","title":"External LED"},{"location":"External-LED/#external-led","text":"The internal flash LED is very close to the camera axis. This results in reflection, especially in case of flat glass surfaces such as for power meters. To circumvent this problem, it is now possible to control external LEDs, which than can be places somewhere else in the setup. As not simples LEDs are used, but RGB LEDs with a digital interface like WS2812 not only the position, but also the color and intensity of the illumination can now be adjusted. The following image shows a direct comparison of the \"old\" internal flash LED and two off axis LEDs. There is also a new meter adapter available. This has two features: designed for small clearings in front of the meter and prepared for WS2812 LEDs .","title":"External LED"},{"location":"External-LED/#1-hardware-installation-of-the-led-stripe","text":"The control line of the LED stripe is connected with a 470 Ohm resistor to the GPIO12. For power supply stabilization a capacitor between 5V and ground is recommended. Here a 470\u00b5F polymer capacitor is used. As a power supply a 5V from the ESP32 is used like in the following wiring.","title":"1. Hardware installation of the LED stripe"},{"location":"External-LED/#2-software-configuration","text":"The handling of the WS2812 LED controller needs some other libraries, therefore it is controlled within a dedicated section called GPIO Settings . The external LED stripe is connected to GPIO12. After activating the \"GPIO Settings\" section, the internal flash is per default disabled. In order to activate the external LED, you need to activate GPIO 12 state and select \"extern flash light ws281x ...\" . Parameter Meaning LED-Type There are several types of controller implemented: WS2812(B), WS2813, SK6812 Numbers of LED Number of LEDs on the LED stripe LED Color The color and intensity can be controlled directly by a red/green/blue value, each within the range from 0 (off) to 255 (full) Enabling the GPIO settings automatically disables the flash LED. Therefore you can enable it here manually by checking GPIO4 and choose \"build-in led flash light\" . It is not recommended to use both illumination parallel.","title":"2. Software configuration"},{"location":"FAQs/","text":"Frequently Asked Questions My device is reboot frequently. What can I do? There are several reasons for the reboot: Frequent HTML requests Wrong configuration, missing configuration files Unstable hardware - see Hardware Compatibility . There is a dedicated page about this: Frequent Reboots . How accurate are the detections? It is hard to give a specific accuracy number. It depends on many factors, e.g. How in-focus is your camera? How sturdy is the camera mount? Does it slightly move over extended periods of time? What type of meter are you reading? Is the meter already in the training data set? Are you trying to read digits, an analog dial, or both? etc. Anecdotally, the authors of this page have great success with the meter. While the AI algorithm itself is not perfect and sometimes returns NaN or incorrect values, other post-processing / prevalue / sanity checks help ensure such invalid values are filtered out. With the correct settings, one author has been running this device for 1 month without any incorrect values reported. See the FAQs below for more details and configuration hints. My numbers are not corrected detected. What can I do? There is a dedicated page about the correct setting ROI Configuration . This page also includes the instructions for gathering new images for the training. How can I ensure invalid numbers are never reported? As mentioned above, the AI algorithm is not perfect. Sometimes it may read an incorrect value. We can tune the software to almost never report an incorrect value. There is a tradeoff though: the software may report stale values - i.e. it will drop incorrect values for a potentially long period of time, resulting in the meter reading being outdated by hours. If never receiving an incorrect value is important to you, consider tolerating this tradeoff. You can change the following settings to reduce incorrect readings (but potentially increase staleness of data): Set a prevalue via the UI, then change PostProcessing configuration option PreValueAgeStartup to a much larger number (e.g. 43200 = 30 days). Change PostProcessing configuration option MaxRateType to be time based instead of absolute. Set MaxRateValue to something realistic (e.g. 5 gal/min). You can often find the max flow rate your meter supports directly on the cover. Reduce AutoTimer configuration option Interval to the lowest it can be (e.g. 3 min). The more often you take readings, the less likely for data staleness to occur. Even after I have setup everything perfect there is a false reading - especially around the zero crossing (roll over to next number) The roll over behavior is different for the different meters. E.g.: Rolling over start with different previous position (e.g. at 7, 8 or 9) The neutral position (no rolling) is not perfectly at zero, but rather at something like 7.9 or 8.1, even if it should be exactly 8 The \"PostProcessingAlgo\" is trying to judge out of the individual readings, what number it should be. For example if the previous number is a \"1\", but the next number seems to be a \"8.9\", most probably there was a \"zero crossing\" and the number is a \"9\" and not still an \"8\" Currently the setting of the algorithm is set to fit most of the meters and cases. But the parameters do not fit perfectly for all situations. Therefore there might be intermediate states, where the reading is false. This is especially the case, at the positions, where the roll over (zero crossing) is just starting. To prevent a sending of false parameters, there is the possibility to limit the maximum allowed change (MaxRateChange). Usually after some time and movement of the counters a bit further, the reading is getting back to a stable reading. To handle this, a parametrized setting would be needed. This is rather complicated to implement as subtle changes make a relevant difference. Currently this is not implemented. So please be a bit patient with your meter :-)","title":"Frequently Asked Questions"},{"location":"FAQs/#frequently-asked-questions","text":"","title":"Frequently Asked Questions"},{"location":"FAQs/#my-device-is-reboot-frequently-what-can-i-do","text":"There are several reasons for the reboot: Frequent HTML requests Wrong configuration, missing configuration files Unstable hardware - see Hardware Compatibility . There is a dedicated page about this: Frequent Reboots .","title":"My device is reboot frequently. What can I do?"},{"location":"FAQs/#how-accurate-are-the-detections","text":"It is hard to give a specific accuracy number. It depends on many factors, e.g. How in-focus is your camera? How sturdy is the camera mount? Does it slightly move over extended periods of time? What type of meter are you reading? Is the meter already in the training data set? Are you trying to read digits, an analog dial, or both? etc. Anecdotally, the authors of this page have great success with the meter. While the AI algorithm itself is not perfect and sometimes returns NaN or incorrect values, other post-processing / prevalue / sanity checks help ensure such invalid values are filtered out. With the correct settings, one author has been running this device for 1 month without any incorrect values reported. See the FAQs below for more details and configuration hints.","title":"How accurate are the detections?"},{"location":"FAQs/#my-numbers-are-not-corrected-detected-what-can-i-do","text":"There is a dedicated page about the correct setting ROI Configuration . This page also includes the instructions for gathering new images for the training.","title":"My numbers are not corrected detected. What can I do?"},{"location":"FAQs/#how-can-i-ensure-invalid-numbers-are-never-reported","text":"As mentioned above, the AI algorithm is not perfect. Sometimes it may read an incorrect value. We can tune the software to almost never report an incorrect value. There is a tradeoff though: the software may report stale values - i.e. it will drop incorrect values for a potentially long period of time, resulting in the meter reading being outdated by hours. If never receiving an incorrect value is important to you, consider tolerating this tradeoff. You can change the following settings to reduce incorrect readings (but potentially increase staleness of data): Set a prevalue via the UI, then change PostProcessing configuration option PreValueAgeStartup to a much larger number (e.g. 43200 = 30 days). Change PostProcessing configuration option MaxRateType to be time based instead of absolute. Set MaxRateValue to something realistic (e.g. 5 gal/min). You can often find the max flow rate your meter supports directly on the cover. Reduce AutoTimer configuration option Interval to the lowest it can be (e.g. 3 min). The more often you take readings, the less likely for data staleness to occur.","title":"How can I ensure invalid numbers are never reported?"},{"location":"FAQs/#even-after-i-have-setup-everything-perfect-there-is-a-false-reading-especially-around-the-zero-crossing-roll-over-to-next-number","text":"The roll over behavior is different for the different meters. E.g.: Rolling over start with different previous position (e.g. at 7, 8 or 9) The neutral position (no rolling) is not perfectly at zero, but rather at something like 7.9 or 8.1, even if it should be exactly 8 The \"PostProcessingAlgo\" is trying to judge out of the individual readings, what number it should be. For example if the previous number is a \"1\", but the next number seems to be a \"8.9\", most probably there was a \"zero crossing\" and the number is a \"9\" and not still an \"8\" Currently the setting of the algorithm is set to fit most of the meters and cases. But the parameters do not fit perfectly for all situations. Therefore there might be intermediate states, where the reading is false. This is especially the case, at the positions, where the roll over (zero crossing) is just starting. To prevent a sending of false parameters, there is the possibility to limit the maximum allowed change (MaxRateChange). Usually after some time and movement of the counters a bit further, the reading is getting back to a stable reading. To handle this, a parametrized setting would be needed. This is rather complicated to implement as subtle changes make a relevant difference. Currently this is not implemented. So please be a bit patient with your meter :-)","title":"Even after I have setup everything perfect there is a false reading - especially around the zero crossing (roll over to next number)"},{"location":"Frequent-Reboots/","text":"Frequent Reboots There are several types of reboots. To get a deeper insight turn on the logging: Internal logging ( config.ini ) Serial log of the UART interface (same as for flashing the firmware) There are two principle types of reboots Random reboots (always different timing and situation) Permanent Reboots always at the same time Random reboots Random reboots have two reasons: overload during HTML access and unstable system In general: there are several mechanisms in the firmware (like saving previous values), to have a \"smooth\" reboot without too many notable disturbance. Overload during HTML access If you frequently access the web server over HTML requests, the firmware tends to reboot. This especially happens during the first run and when the ESP32 is busy with the digitization flow. The reason for this are running out of memory during a flow, minor memory leakage in combination with missing error handling. There is noting you can do about this kind of reboot, beside two thing: Support the firmware development with improved and tested part of code Be patient :-) Unstable system If your system is sometimes running smoothly over several runs and sometimes reboots obviously randomly, you have an partially unstable device. You can check this in the standard log file on the SD card: 2021-12-26T06:34:09: task_autodoFlow - round done 2021-12-26T06:34:09: CPU Temperature: 56.1 2021-12-26T06:38:00: task_autodoFlow - next round - Round #23 Here you see, that the round #23 is starting, so obviously there were no reboots in the last 22 rounds. There is hardware (ESP32CAM), where only 2-3 stable rounds are possible and others, where way more than 100 rounds without any reboots is possible. There is noting you can do about it, beside testing different hardware. Permanent reboots Permanent reboots at the same situation during the flow has a systematic problem either in the hardware or the configuration. It usually happens during the first run as there all needed parts of the firmware have been loaded for the first time. To find the reason mostly the serial log of the UART interface from the startup until the reboots is very helpful. It can be stored using the USB / UART interface - the same as for flashing the firmware - and logging the serial output of the ESP32. Possible problems: SD card PSRAM too low Configuration missing SD card problems The ESP32CAM is a little bit \"picky\" with the supported SD cards. Due to the limited availability of GPIOs the SD card can only be accessed via 1-wire mode. Therefore not all SD cards are supported. Several error cases can happen: No SD card Easy to detect: fast blinking red LED directly after startup, no reaction of the web server etc. at all SD card not supported at all Error message of no detectable SC card in the log file. Normal looking log for a 16GB SD card is like this: 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.138 -> Name: SC16G 09:38:25.138 -> Type: SDHC/SDXC 09:38:25.138 -> Speed: 20 MHz 09:38:25.138 -> Size: 15193MB Otherwise there is some error message. SD card recognized but not supported This is the most annoying error. The SD card is detected, but the files cannot be read. Most probably this results in a problem with the WLAN connection, as the first file needed is the wlan.ini in the root directory. PSRAM too low In order to work, there are 4 MB of PSRAM necessary. Normally the ESP32CAM is equipped with 8 MB, whereof only 4 MB can be used effectively. Sometimes, there is hardware, where only 2 MB of PSRAM is present - even if you have bought a 8 MB module You can identify the amount of PSRAM in the serial log file: 09:38:21.224 -> \u001b[0;32mI (881) psram: This chip is ESP32-D0WD\u001b[0m 09:38:21.224 -> \u001b[0;32mI (885) spiram: Found 64MBit SPI RAM device\u001b[0m 09:38:21.224 -> \u001b[0;32mI (890) spiram: SPI RAM mode: flash 40m sram 40m\u001b[0m 09:38:21.224 -> \u001b[0;32mI (895) spiram: PSRAM initialized, cache is in low/high (2-core) mode.\u001b[0m Here you see 64MBit (= 8MByte) - which is okay. False reading would be: 16MBit The error in the SD log file is typically related with the taking of the image (tbd) as the first time, the system is running out of memory is usually, when it tries to transfer an image from the camera to the PSRAM. There is nothing to do, than to buy a new ESP32CAM with really 64MBit of PSRAM. Configuration missing There are several files needed during on run cycle. If one of this is missing, the firmware is missing information and tends to reboot due to missing error management: /wlan.ini /config/config.ini /config/XXXXX.tflite (1 time for analog and 1 time for digital) where XXXXX is the file name, that is written in the config.ini","title":"Frequent Reboots"},{"location":"Frequent-Reboots/#frequent-reboots","text":"There are several types of reboots. To get a deeper insight turn on the logging: Internal logging ( config.ini ) Serial log of the UART interface (same as for flashing the firmware) There are two principle types of reboots Random reboots (always different timing and situation) Permanent Reboots always at the same time","title":"Frequent Reboots"},{"location":"Frequent-Reboots/#random-reboots","text":"Random reboots have two reasons: overload during HTML access and unstable system In general: there are several mechanisms in the firmware (like saving previous values), to have a \"smooth\" reboot without too many notable disturbance.","title":"Random reboots"},{"location":"Frequent-Reboots/#overload-during-html-access","text":"If you frequently access the web server over HTML requests, the firmware tends to reboot. This especially happens during the first run and when the ESP32 is busy with the digitization flow. The reason for this are running out of memory during a flow, minor memory leakage in combination with missing error handling. There is noting you can do about this kind of reboot, beside two thing: Support the firmware development with improved and tested part of code Be patient :-)","title":"Overload during HTML access"},{"location":"Frequent-Reboots/#unstable-system","text":"If your system is sometimes running smoothly over several runs and sometimes reboots obviously randomly, you have an partially unstable device. You can check this in the standard log file on the SD card: 2021-12-26T06:34:09: task_autodoFlow - round done 2021-12-26T06:34:09: CPU Temperature: 56.1 2021-12-26T06:38:00: task_autodoFlow - next round - Round #23 Here you see, that the round #23 is starting, so obviously there were no reboots in the last 22 rounds. There is hardware (ESP32CAM), where only 2-3 stable rounds are possible and others, where way more than 100 rounds without any reboots is possible. There is noting you can do about it, beside testing different hardware.","title":"Unstable system"},{"location":"Frequent-Reboots/#permanent-reboots","text":"Permanent reboots at the same situation during the flow has a systematic problem either in the hardware or the configuration. It usually happens during the first run as there all needed parts of the firmware have been loaded for the first time. To find the reason mostly the serial log of the UART interface from the startup until the reboots is very helpful. It can be stored using the USB / UART interface - the same as for flashing the firmware - and logging the serial output of the ESP32. Possible problems: SD card PSRAM too low Configuration missing","title":"Permanent reboots"},{"location":"Frequent-Reboots/#sd-card-problems","text":"The ESP32CAM is a little bit \"picky\" with the supported SD cards. Due to the limited availability of GPIOs the SD card can only be accessed via 1-wire mode. Therefore not all SD cards are supported. Several error cases can happen:","title":"SD card problems"},{"location":"Frequent-Reboots/#no-sd-card","text":"Easy to detect: fast blinking red LED directly after startup, no reaction of the web server etc. at all","title":"No SD card"},{"location":"Frequent-Reboots/#sd-card-not-supported-at-all","text":"Error message of no detectable SC card in the log file. Normal looking log for a 16GB SD card is like this: 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.138 -> Name: SC16G 09:38:25.138 -> Type: SDHC/SDXC 09:38:25.138 -> Speed: 20 MHz 09:38:25.138 -> Size: 15193MB Otherwise there is some error message.","title":"SD card not supported at all"},{"location":"Frequent-Reboots/#sd-card-recognized-but-not-supported","text":"This is the most annoying error. The SD card is detected, but the files cannot be read. Most probably this results in a problem with the WLAN connection, as the first file needed is the wlan.ini in the root directory.","title":"SD card recognized but not supported"},{"location":"Frequent-Reboots/#psram-too-low","text":"In order to work, there are 4 MB of PSRAM necessary. Normally the ESP32CAM is equipped with 8 MB, whereof only 4 MB can be used effectively. Sometimes, there is hardware, where only 2 MB of PSRAM is present - even if you have bought a 8 MB module You can identify the amount of PSRAM in the serial log file: 09:38:21.224 -> \u001b[0;32mI (881) psram: This chip is ESP32-D0WD\u001b[0m 09:38:21.224 -> \u001b[0;32mI (885) spiram: Found 64MBit SPI RAM device\u001b[0m 09:38:21.224 -> \u001b[0;32mI (890) spiram: SPI RAM mode: flash 40m sram 40m\u001b[0m 09:38:21.224 -> \u001b[0;32mI (895) spiram: PSRAM initialized, cache is in low/high (2-core) mode.\u001b[0m Here you see 64MBit (= 8MByte) - which is okay. False reading would be: 16MBit The error in the SD log file is typically related with the taking of the image (tbd) as the first time, the system is running out of memory is usually, when it tries to transfer an image from the camera to the PSRAM. There is nothing to do, than to buy a new ESP32CAM with really 64MBit of PSRAM.","title":"PSRAM too low"},{"location":"Frequent-Reboots/#configuration-missing","text":"There are several files needed during on run cycle. If one of this is missing, the firmware is missing information and tends to reboot due to missing error management: /wlan.ini /config/config.ini /config/XXXXX.tflite (1 time for analog and 1 time for digital) where XXXXX is the file name, that is written in the config.ini","title":"Configuration missing"},{"location":"Hardware-Compatibility/","text":"Hardware Compatibility General Remark Although a board looks similar, it can have major differences, e.g.: Processor Ram (Size! & Type) -> this Project needs at least 4MB RAM! Flashrom Camera Modules Onboard/External Antenna Quality of Components Manufacture Quality of the PCB and soldering Different Components \"Clone\" Components -> ESPxx etc. This can cause different Power Consumption, Power Requirements, compatibility issues, etc. Most manufacturers and sellers buy what's cheap today on the Asian markets. In the end, it looks like it is sometimes a trial and error approach which ESP32-CAM Module works reliably. Below you find some remarks and experiences from the community: ESP32 core itself Chip Version Image Status ESP32-D0WDQ6 (revision 1) \u2714\ufe0f PSRAM There seems to be a lot of \"fake\" chips, or maybe wrongly configured ESP32 Boards. For AP MEMORY, all \"real\" APS 64 04*3SQR chips should work. For ESP PSRAM, all \"real\" PSRAM 64 * should work. 64Mbit density = 8Mbyte PSRAM This Table is just a snapshot of chips which worked Labeling on PSRAM module Image Status IPUS / IPS640LS0 / 1815XBGN \u2714\ufe0f AP MEMORY / 64 04L-3SOR / 1040H / 110089G \u2714\ufe0f AP MEMORY / 64 04L-3SQR / 12205 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 12208 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-350R / 1120A / 130027G \u274c PSRAM not accessible AP MEMORY / 64 04L-35QR / 11208 / 130025G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 13100 / 180026G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 11207 / 130024G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 1120A / 130027G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 1120B / 130028G \u2714\ufe0f 8MB AP MEMORY / 1604M-3SQR / 0280A / 070036G \u274c 2MB only! ESP PSRAM 64 H 462021 / 1B00286 \u2714\ufe0f ESP PSRAM 64 H 412021 / 1A0039G \u2714\ufe0f 8MB ESP PSRAM 64 H 402021 / 1A0017N \u274c PSRAM not accessible ESP PSRAM16M 302020 \u274c 2MB only! ESP PSRAM16H 202020 / 050022G \u274c 2MB only! OV2640 - Camera The experience with the camera only is based on single modules. It is well possible, that this module had a damage overall and other modules of the same type will work. Give it a try and report to me! Labeling on Flex-Connector Image Status TY-OV2 / 640-V2.0 \u2714\ufe0f DCX-OV2 / 640-V2 \u2714\ufe0f DC-26 / 40-V3 \u2714\ufe0f 3x \u274c 1x ESP32 Modules Module Image Status ESP32CAM / Different versions on the market! Especially the PSRAM is sometimes labeled wrong (Label: 4MB, Real: only 2 MB --> will not work!) \u2714\ufe0f with >=4 MB PSRAM! ESP32-S3-EYE No Flash LED, pins different used (e.g. LCD display) NOT OKAY SD Cards Due to the limited free available GPIOs (due to all the extensions needed like: camera, SD card, LED-flash, ...) the SD card is connected in 1-wire mode. There are some cards, that are compatible with the esp32cam module for unknown reasons. It is observed, that smaller cards (up to 4 GB) tend to be more stable and larger cards have more problems. But quite some exceptions in the forums (4 GB cards not working, 16 GB cards working like a charm). Devices known to work Modules (Old list, not up-to-date anymore): See https://github.com/jomjol/AI-on-the-edge-device/discussions/1732 for a more recent list. https://arduino-projekte.info/produkt/esp32-cam-v2-integriertem-ch340-mit-ov2640-kamera-modul/ (see https://github.com/jomjol/AI-on-the-edge-device/discussions/1041 ) https://www.amazon.de/-/en/gp/product/B0B51CQ13R https://www.reichelt.de/entwicklerboards-esp32-kamera-2mp-25--debo-cam-esp32-p266036.html?PROVID=2788&gclid=CjwKCAiAqaWdBhAvEiwAGAQlttJnV4azXWDYeaFUuNioMICh-jvxKp6Cifmcep9vvtoT2JRCDqBczRoC7Q0QAvD_BwE (27.12.2022) SD Card Sandisk 2GB Micro SD Class 2 Sandisk 2GB AITRIP ESP32 and CAM ESP-32/CAM Amazon US - Aideepen ESP32-CAM W BT Board ESP32-CAM-MB Micro USB to Serial Port CH-340G with OV2640 2MP Camera Module Dual Mode with Amazon US - Cloudisk 5Pack 4GB Micro SD Card 4 GB MicroSD Memory Card Class6 Weak Wifi The ESP32-CAM supports an external antenna. It requires some soldering skills but can improve the connection quality. See https://randomnerdtutorials.com/esp32-cam-connect-external-antenna/","title":"Hardware Compatibility"},{"location":"Hardware-Compatibility/#hardware-compatibility","text":"","title":"Hardware Compatibility"},{"location":"Hardware-Compatibility/#general-remark","text":"Although a board looks similar, it can have major differences, e.g.: Processor Ram (Size! & Type) -> this Project needs at least 4MB RAM! Flashrom Camera Modules Onboard/External Antenna Quality of Components Manufacture Quality of the PCB and soldering Different Components \"Clone\" Components -> ESPxx etc. This can cause different Power Consumption, Power Requirements, compatibility issues, etc. Most manufacturers and sellers buy what's cheap today on the Asian markets. In the end, it looks like it is sometimes a trial and error approach which ESP32-CAM Module works reliably. Below you find some remarks and experiences from the community:","title":"General Remark"},{"location":"Hardware-Compatibility/#esp32-core-itself","text":"Chip Version Image Status ESP32-D0WDQ6 (revision 1) \u2714\ufe0f","title":"ESP32 core itself"},{"location":"Hardware-Compatibility/#psram","text":"There seems to be a lot of \"fake\" chips, or maybe wrongly configured ESP32 Boards. For AP MEMORY, all \"real\" APS 64 04*3SQR chips should work. For ESP PSRAM, all \"real\" PSRAM 64 * should work. 64Mbit density = 8Mbyte PSRAM This Table is just a snapshot of chips which worked Labeling on PSRAM module Image Status IPUS / IPS640LS0 / 1815XBGN \u2714\ufe0f AP MEMORY / 64 04L-3SOR / 1040H / 110089G \u2714\ufe0f AP MEMORY / 64 04L-3SQR / 12205 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 12208 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-350R / 1120A / 130027G \u274c PSRAM not accessible AP MEMORY / 64 04L-35QR / 11208 / 130025G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 13100 / 180026G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 11207 / 130024G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 1120A / 130027G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 1120B / 130028G \u2714\ufe0f 8MB AP MEMORY / 1604M-3SQR / 0280A / 070036G \u274c 2MB only! ESP PSRAM 64 H 462021 / 1B00286 \u2714\ufe0f ESP PSRAM 64 H 412021 / 1A0039G \u2714\ufe0f 8MB ESP PSRAM 64 H 402021 / 1A0017N \u274c PSRAM not accessible ESP PSRAM16M 302020 \u274c 2MB only! ESP PSRAM16H 202020 / 050022G \u274c 2MB only!","title":"PSRAM"},{"location":"Hardware-Compatibility/#ov2640-camera","text":"The experience with the camera only is based on single modules. It is well possible, that this module had a damage overall and other modules of the same type will work. Give it a try and report to me! Labeling on Flex-Connector Image Status TY-OV2 / 640-V2.0 \u2714\ufe0f DCX-OV2 / 640-V2 \u2714\ufe0f DC-26 / 40-V3 \u2714\ufe0f 3x \u274c 1x","title":"OV2640 - Camera"},{"location":"Hardware-Compatibility/#esp32-modules","text":"Module Image Status ESP32CAM / Different versions on the market! Especially the PSRAM is sometimes labeled wrong (Label: 4MB, Real: only 2 MB --> will not work!) \u2714\ufe0f with >=4 MB PSRAM! ESP32-S3-EYE No Flash LED, pins different used (e.g. LCD display) NOT OKAY","title":"ESP32 Modules"},{"location":"Hardware-Compatibility/#sd-cards","text":"Due to the limited free available GPIOs (due to all the extensions needed like: camera, SD card, LED-flash, ...) the SD card is connected in 1-wire mode. There are some cards, that are compatible with the esp32cam module for unknown reasons. It is observed, that smaller cards (up to 4 GB) tend to be more stable and larger cards have more problems. But quite some exceptions in the forums (4 GB cards not working, 16 GB cards working like a charm).","title":"SD Cards"},{"location":"Hardware-Compatibility/#devices-known-to-work","text":"","title":"Devices known to work"},{"location":"Hardware-Compatibility/#modules-old-list-not-up-to-date-anymore","text":"See https://github.com/jomjol/AI-on-the-edge-device/discussions/1732 for a more recent list. https://arduino-projekte.info/produkt/esp32-cam-v2-integriertem-ch340-mit-ov2640-kamera-modul/ (see https://github.com/jomjol/AI-on-the-edge-device/discussions/1041 ) https://www.amazon.de/-/en/gp/product/B0B51CQ13R https://www.reichelt.de/entwicklerboards-esp32-kamera-2mp-25--debo-cam-esp32-p266036.html?PROVID=2788&gclid=CjwKCAiAqaWdBhAvEiwAGAQlttJnV4azXWDYeaFUuNioMICh-jvxKp6Cifmcep9vvtoT2JRCDqBczRoC7Q0QAvD_BwE (27.12.2022)","title":"Modules (Old list, not up-to-date anymore):"},{"location":"Hardware-Compatibility/#sd-card","text":"Sandisk 2GB Micro SD Class 2 Sandisk 2GB AITRIP ESP32 and CAM ESP-32/CAM Amazon US - Aideepen ESP32-CAM W BT Board ESP32-CAM-MB Micro USB to Serial Port CH-340G with OV2640 2MP Camera Module Dual Mode with Amazon US - Cloudisk 5Pack 4GB Micro SD Card 4 GB MicroSD Memory Card Class6","title":"SD Card"},{"location":"Hardware-Compatibility/#weak-wifi","text":"The ESP32-CAM supports an external antenna. It requires some soldering skills but can improve the connection quality. See https://randomnerdtutorials.com/esp32-cam-connect-external-antenna/","title":"Weak Wifi"},{"location":"Influx-DB/","text":"Influx DB The device also supports direct sending of data to an Influx DB. \u203c\ufe0f Only Influx DB 1 is supported!","title":"Influx DB"},{"location":"Influx-DB/#influx-db","text":"The device also supports direct sending of data to an Influx DB. \u203c\ufe0f Only Influx DB 1 is supported!","title":"Influx DB"},{"location":"Installation/","text":"Installation The installation requires multiple steps: Get the right hardware and wire it up Flash the firmware onto the ESP32 Write the data to the SD card Start it For point 2 and 3 we provide multiple ways to do it. Pick the one that looks the easiest for you! 1. Hardware ESP32-CAM OV2640 camera module Micro SD card slot 4 or 8 MB PSRAM. It can be easily found on the typical internet stores, searching for ESP32-CAM for less than 10 EUR. How ever since the hardware is cheap and coming from China, you unluckily could pick a malfunctioning device. See Hardware Compatibility for further advice! USB->UART interface For first time flashing the firmware a USB -> UART connector is needed. Later firmware upgrades than can be flashed via OTA. Power supply For power supply a 5V source is needed. Most easily this can be done via a USB power supply. The power supply should support minimum 500mA. For buffering current peaks some users reported to use a large electrolytic capacitor like a 2200uF between ground and VCC. \u203c\ufe0f Attention: in several internet forums there are problems reported, in case the ESP32-CAM is only supplied with 3.3V. Housing A small 3D-printable example for a very small case can be found in Thingiverse here: https://www.thingiverse.com/thing:4571627 \u203c\ufe0f Attention : the focus of the OV2640 needs to be adjusted, as it is normally set from ~40cm to infinity. In order to get an image that is big enough, it needs to be changed to about 10cm. Therefore the sealing glue on the objective ring needs to be removed with a scalpel or sharp knife. Afterwards the objective can be rotated clockwise until the image is sharp again. Wiring Beside the 5V power supply, only for the first flashing a connection to the USB-UART connector, including a short cut of GPIO0 to GND for bootloader start. A example for wiring can be found here: It is also possible to use external LEDs for the illumination instead of the internal flash LED. This is described here 2. Firmware Web Installer There is a Web Installer available which will work right out of the web browser Edge and Chrome. You can access it with the following link: Web Installer This is the preferred way for beginners as it also allows access to the USB Log: Manual Flashing Files Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please have a look on Living on the Edge first! You need: partitions.bin bootloader.bin firmware.bin Flashing using the Flash Tool from Espressif (GUI) Get the Flash Download Tool from Espressif. Download and extract the Flash tool, after starting choose \"Developer Mode\", then \"ESP32-DownloadTool\" and you are in the setup of the flashing tool. Connect the ESP32-CAM with the USB-UART connection and identify the COM-Port. \u203c\ufe0f Attention : if you are re-flashing the code again, it is strongly recommended to erase the flash memory before flashing the firmware. Especially if you used OTA in between, which might cause remaining information on the flash, to still boot from an old image in the OTA-area, which is not erased by a normal flash. But your ESP32 in bootloader mode and push start, then it will identify the board and you can configure the bin-configuration according to the following table: Filename Offset bootloader.bin 0x1000 partitions.bin 0x8000 firmware.bin 0x10000 Flashing using the Python based esptool (Console) For this you need a python environment (e.g. Anaconda in Win10). Here you need to install the esptool: pip install esptool Then connect the ESP32 with the USB-UART connector to the system, put it in boot mode and with the following command you can erase the flash and flash bootloader, partitions and firmware in two steps: esptool erase_flash esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin Maybe you need to specify the COM-port if it is not detected by default. If the erase command throws the error A fatal error occurred: ESP32 ROM does not support function erase_flash. , your esptool might be too old, see https://techoverflow.net/2022/02/08/how-to-fix-esp32-a-fatal-error-occurred-esp32-rom-does-not-support-function-erase_flash/ With some Python installations this may not work and you\u2019ll receive an error, try python -m pip install esptool or pip3 install esptool . Further recommendations can be found on the espressif webpage . 3. SD Card The software expects an SD card prepared with certain directory and file structure in order to work properly. SD card most top directory should look like this: This initial setup needs only to be done once as further updates (Firmware as well as SD card content) are possible with the Over-The-Air Update mechanism. Notes Due to the limited availability of GPIOs (OV2640, Flash-Light, PSRAM & SD card) the communication mode to the SD card is limited to 1-line SD-Mode. It showed up, that this results in problems with very large SD-Cards (64GB, sometimes 32 GB) and some no name low cost SD-cards. There must be no partition table on the SD-card (no GPT, but only MBR for the single partition) Following setting are necessary for formatting the SD-card: SINGLE PARTITION, MBR, FAT32 - 32K. NOT exFAT Some ESP32 devices share their SD-card and/or camera GPIOs with the pins for TX and RX. If you see errors like \u201cFailed to connect\u201d then your chip is probably not entering the bootloader properly. Remove the respective modules temporarily to free the GPIOs for flashing. You may find more information about troubleshooting on the homepage of Espressif . The ESP32 indicates problems with the SD card during startup with a fast, endless blinking. In this case, please try another SD card. Manual Setup with an SD Card Reader on a PC Take the AI-on-the-edge-device__manual-setup__*.zip from the Release page. Open it and extract the sd-card.zip . Open it and extract all files onto onto your SD card. On the SD card, open the wlan.ini file and configure it as needed: Set the corresponding SSID and password The other parameters are optional Note: The device provides a File Server which can be used to show, edit or delete the files on the SD card. For security reasons, the wlan.ini file is excluded from this and is hidden from external access to protect the password. After this, you can insert the SD card into the ESP32 board and start it. Remote Setup using the built-in Access Point On startup of the ESP32, it checks if the wlan.ini or the config/config.ini are available on the SD card. If not, the ESP32 switches to a special mode. In this mode, it provides a Wifi Access Point which can be used to add the missing wlan.ini or the config/config.ini file. Take the AI-on-the-edge-device__remote-setup__*.zip from the Release page. Connect to Access Point of the device. The SSID is \"AI-on-the-Edge\" and you can access it without any password: The device has the following fixed IP: http://192.168.4.1 . Upload initial configuration to SD card Use the select file and upload button to start the upload. A warning will show up if you have chosen a possible wrong file (without default configuration). Store WLAN access information. After the upload, a new page will be shown: Enter your SSID and password. Note: Only basic settings are supported. If you need advanced configuration (fixed ip, ...), you need to use the manual setup as documented above. \u203c\ufe0f Attention: Carefully check your wifi settings. To change them later on, you need to take out the SD card and edit the wlan.ini manually (or delete it and start again). The information is transferred without encryption! Finish the step by pushing Write wlan.ini Reboot The final step is the reboot: \u203c\ufe0f Warning: It will take up to 3 minutes. Afterwards you can find your device in the local network. Check your router for the IP. You can find it also in the USB Console output. 4. Initial Startup After the firmware is flashed and the SD card is setup properly, you can start it. After power on the connection status is indicated by 3x blinking of the red on board LED. WLAN-Status indication: 5 x fast blinking (< 1 second): connection still pending 3 x slow blinking (1 second on/off): WLAN connection established Note: It is normal that at first one or two times a pending connection is indicated.","title":"Installation"},{"location":"Installation/#installation","text":"The installation requires multiple steps: Get the right hardware and wire it up Flash the firmware onto the ESP32 Write the data to the SD card Start it For point 2 and 3 we provide multiple ways to do it. Pick the one that looks the easiest for you!","title":"Installation"},{"location":"Installation/#1-hardware","text":"","title":"1. Hardware"},{"location":"Installation/#esp32-cam","text":"OV2640 camera module Micro SD card slot 4 or 8 MB PSRAM. It can be easily found on the typical internet stores, searching for ESP32-CAM for less than 10 EUR. How ever since the hardware is cheap and coming from China, you unluckily could pick a malfunctioning device. See Hardware Compatibility for further advice!","title":"ESP32-CAM"},{"location":"Installation/#usb-uart-interface","text":"For first time flashing the firmware a USB -> UART connector is needed. Later firmware upgrades than can be flashed via OTA.","title":"USB->UART interface"},{"location":"Installation/#power-supply","text":"For power supply a 5V source is needed. Most easily this can be done via a USB power supply. The power supply should support minimum 500mA. For buffering current peaks some users reported to use a large electrolytic capacitor like a 2200uF between ground and VCC. \u203c\ufe0f Attention: in several internet forums there are problems reported, in case the ESP32-CAM is only supplied with 3.3V.","title":"Power supply"},{"location":"Installation/#housing","text":"A small 3D-printable example for a very small case can be found in Thingiverse here: https://www.thingiverse.com/thing:4571627 \u203c\ufe0f Attention : the focus of the OV2640 needs to be adjusted, as it is normally set from ~40cm to infinity. In order to get an image that is big enough, it needs to be changed to about 10cm. Therefore the sealing glue on the objective ring needs to be removed with a scalpel or sharp knife. Afterwards the objective can be rotated clockwise until the image is sharp again.","title":"Housing"},{"location":"Installation/#wiring","text":"Beside the 5V power supply, only for the first flashing a connection to the USB-UART connector, including a short cut of GPIO0 to GND for bootloader start. A example for wiring can be found here: It is also possible to use external LEDs for the illumination instead of the internal flash LED. This is described here","title":"Wiring"},{"location":"Installation/#2-firmware","text":"","title":"2. Firmware"},{"location":"Installation/#web-installer","text":"There is a Web Installer available which will work right out of the web browser Edge and Chrome. You can access it with the following link: Web Installer This is the preferred way for beginners as it also allows access to the USB Log:","title":"Web Installer"},{"location":"Installation/#manual-flashing","text":"","title":"Manual Flashing"},{"location":"Installation/#files","text":"Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please have a look on Living on the Edge first! You need: partitions.bin bootloader.bin firmware.bin","title":"Files"},{"location":"Installation/#flashing-using-the-flash-tool-from-espressif-gui","text":"Get the Flash Download Tool from Espressif. Download and extract the Flash tool, after starting choose \"Developer Mode\", then \"ESP32-DownloadTool\" and you are in the setup of the flashing tool. Connect the ESP32-CAM with the USB-UART connection and identify the COM-Port. \u203c\ufe0f Attention : if you are re-flashing the code again, it is strongly recommended to erase the flash memory before flashing the firmware. Especially if you used OTA in between, which might cause remaining information on the flash, to still boot from an old image in the OTA-area, which is not erased by a normal flash. But your ESP32 in bootloader mode and push start, then it will identify the board and you can configure the bin-configuration according to the following table: Filename Offset bootloader.bin 0x1000 partitions.bin 0x8000 firmware.bin 0x10000","title":"Flashing using the Flash Tool from Espressif (GUI)"},{"location":"Installation/#flashing-using-the-python-based-esptool-console","text":"For this you need a python environment (e.g. Anaconda in Win10). Here you need to install the esptool: pip install esptool Then connect the ESP32 with the USB-UART connector to the system, put it in boot mode and with the following command you can erase the flash and flash bootloader, partitions and firmware in two steps: esptool erase_flash esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin Maybe you need to specify the COM-port if it is not detected by default. If the erase command throws the error A fatal error occurred: ESP32 ROM does not support function erase_flash. , your esptool might be too old, see https://techoverflow.net/2022/02/08/how-to-fix-esp32-a-fatal-error-occurred-esp32-rom-does-not-support-function-erase_flash/ With some Python installations this may not work and you\u2019ll receive an error, try python -m pip install esptool or pip3 install esptool . Further recommendations can be found on the espressif webpage .","title":"Flashing using the Python based esptool (Console)"},{"location":"Installation/#3-sd-card","text":"The software expects an SD card prepared with certain directory and file structure in order to work properly. SD card most top directory should look like this: This initial setup needs only to be done once as further updates (Firmware as well as SD card content) are possible with the Over-The-Air Update mechanism.","title":"3. SD Card"},{"location":"Installation/#notes","text":"Due to the limited availability of GPIOs (OV2640, Flash-Light, PSRAM & SD card) the communication mode to the SD card is limited to 1-line SD-Mode. It showed up, that this results in problems with very large SD-Cards (64GB, sometimes 32 GB) and some no name low cost SD-cards. There must be no partition table on the SD-card (no GPT, but only MBR for the single partition) Following setting are necessary for formatting the SD-card: SINGLE PARTITION, MBR, FAT32 - 32K. NOT exFAT Some ESP32 devices share their SD-card and/or camera GPIOs with the pins for TX and RX. If you see errors like \u201cFailed to connect\u201d then your chip is probably not entering the bootloader properly. Remove the respective modules temporarily to free the GPIOs for flashing. You may find more information about troubleshooting on the homepage of Espressif . The ESP32 indicates problems with the SD card during startup with a fast, endless blinking. In this case, please try another SD card.","title":"Notes"},{"location":"Installation/#manual-setup-with-an-sd-card-reader-on-a-pc","text":"Take the AI-on-the-edge-device__manual-setup__*.zip from the Release page. Open it and extract the sd-card.zip . Open it and extract all files onto onto your SD card. On the SD card, open the wlan.ini file and configure it as needed: Set the corresponding SSID and password The other parameters are optional Note: The device provides a File Server which can be used to show, edit or delete the files on the SD card. For security reasons, the wlan.ini file is excluded from this and is hidden from external access to protect the password. After this, you can insert the SD card into the ESP32 board and start it.","title":"Manual Setup with an SD Card Reader on a PC"},{"location":"Installation/#remote-setup-using-the-built-in-access-point","text":"On startup of the ESP32, it checks if the wlan.ini or the config/config.ini are available on the SD card. If not, the ESP32 switches to a special mode. In this mode, it provides a Wifi Access Point which can be used to add the missing wlan.ini or the config/config.ini file. Take the AI-on-the-edge-device__remote-setup__*.zip from the Release page. Connect to Access Point of the device. The SSID is \"AI-on-the-Edge\" and you can access it without any password: The device has the following fixed IP: http://192.168.4.1 . Upload initial configuration to SD card Use the select file and upload button to start the upload. A warning will show up if you have chosen a possible wrong file (without default configuration). Store WLAN access information. After the upload, a new page will be shown: Enter your SSID and password. Note: Only basic settings are supported. If you need advanced configuration (fixed ip, ...), you need to use the manual setup as documented above. \u203c\ufe0f Attention: Carefully check your wifi settings. To change them later on, you need to take out the SD card and edit the wlan.ini manually (or delete it and start again). The information is transferred without encryption! Finish the step by pushing Write wlan.ini Reboot The final step is the reboot: \u203c\ufe0f Warning: It will take up to 3 minutes. Afterwards you can find your device in the local network. Check your router for the IP. You can find it also in the USB Console output.","title":"Remote Setup using the built-in Access Point"},{"location":"Installation/#4-initial-startup","text":"After the firmware is flashed and the SD card is setup properly, you can start it. After power on the connection status is indicated by 3x blinking of the red on board LED. WLAN-Status indication: 5 x fast blinking (< 1 second): connection still pending 3 x slow blinking (1 second on/off): WLAN connection established Note: It is normal that at first one or two times a pending connection is indicated.","title":"4. Initial Startup"},{"location":"Integration-Home-Assistant/","text":"Integration into Home Assistant There are 3 ways to get the data into your Home Assistant: Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery) Using MQTT (Manually Setup Entities) Using REST calls The first one is the easier way if you already have MQTT in use. Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery) \u203c\ufe0f This feature will be available with the next release! Starting with Version >12.0.1 , AI-on-the-edge-devices support Home Assistant Discovery. Check here to learn more about it and how to enable it in Homeassistant. You also have to enable it in the MQTT settings of your device: Make sure to select the right Meter Type to get the right units! On the next start of the device, it will send discovery topics and Home Assistant should pick them up and show them under Settings > Integrations > MQTT : Using MQTT (Manually Setup Entities) First make sure with an MQTT client (for example MQTT Explorer ) that MQTT works as expected and to get a list of the available topics! Then add a sensor for each property: mqtt: sensor: - state_topic: \"wasserzaehler/main/value\" name: \"Watermeter Value\" unique_id: watermeter_value unit_of_measurement: 'm\u00b3' state_class: total_increasing device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/rate\" name: \"Watermeter Rate\" unique_id: watermeter_rate unit_of_measurement: 'm\u00b3/min' state_class: measurement device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/error\" name: \"Watermeter Error\" unique_id: watermeter_error icon: \"mdi:water-alert\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/uptime\" name: \"Watermeter Uptime\" unique_id: watermeter_uptime unit_of_measurement: 's' state_class: measurement device_class: duration entity_category: diagnostic icon: \"mdi:timer-outline\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you run the discovery once, you can also extract the information from there (MQTT Info, untested): mqtt: # Extracted form the Discovery but untested! sensor: - name: Value unique_id: wasserzaehler-main_value icon: mdi:gauge state_topic: wasserzaehler/main/value unit_of_measurement: m\u00b3 device_class: water state_class: total_increasing availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you want to convert the m\u00b3 to l , use a template sensor: template: - sensor: - name: \"Watermeter in l\" unique_id: watermeter_in_l icon: \"mdi:gauge\" state: \"{{ states('sensor.watermeter_value')|float(default=0) * 1000 }}\" # Convert 1 m3 => 1000 l unit_of_measurement: l availability: \"{{ states('sensor.watermeter_value') not in ['unknown', 'unavailable', 'none'] }}\" If you you want to have the consumption per day, you can use an Utility Meter . it is a helper and can be used to reset the total increasing values once a day utility_meter: utility_meter_gas_per_day: source: sensor.gasmeter_value cycle: daily utility_meter_water_per_day: source: sensor.watermeter_value cycle: daily Note that you also can add it using the UI. Examples Statistics Graph Creating Statistics Graphs (e.g. usage per day) is easy using the Energy Dashboard : Note that there seems to be a bug in the graph, see https://github.com/home-assistant/frontend/issues/13995 ! InfluxDb Graphs See also Influx-DB . If you have setup InfluxDB already, it is also possible to fetch statistics from there, e.g. daily usage: from(bucket: \"HomeAssistant\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r[\"entity_id\"] == \"wasserverbrauch_tag\") |> filter(fn: (r) => r[\"_field\"] == \"value\") |> timeShift(duration: -1d) |> aggregateWindow(every: 1d, fn: max, createEmpty: false) |> yield(name: \"mean\") Using REST When using REST, Home Assistant has to periodically call an URL on the ESP32 which in return provides the requested data. See REST API for a list of available URLs. The most practical one is the json entrypoint which provides the most relevant data JSON formatted: http:///json This would return: { \"main\": { \"value\": \"512.3020\", \"raw\": \"0512.3020\", \"error\": \"no error\", \"rate\": 0.000000, \"timestamp\": \"2022-10-02T20:32:06\" [..] } } To do such a REST call, you need to create a REST sensor: sensor: - platform: rest name: \"Gasmeter JSON\" resource: http:///json json_attributes: - main value_template: '{{ value_json.value }}' headers: Content-Type: application/json scan_interval: 60 template: sensor: - name: \"Gasmeter Value from JSON\" unique_id: gas_meter_value_from_json state: \"{{ state_attr('sensor.gasmeter_json','main')['value'] }}\" unit_of_measurement: 'm\u00b3' - name: \"Watermeter Value from JSON\" unique_id: water_meter_value_from_json state: >- {{ state_attr('sensor.watermeter_json','main')['value'] | float }} unit_of_measurement: 'm\u00b3' device_class: water state_class: total_increasing icon: mdi:gauge See also https://community.home-assistant.io/t/rest-sensor-nested-json/243420/9 Photo REST can also be used to show the photo of the last round: To access it, use http:///img_tmp/alg_roi.jpg resp http:///img_tmp/raw.jpg .","title":"Integration into Home Assistant"},{"location":"Integration-Home-Assistant/#integration-into-home-assistant","text":"There are 3 ways to get the data into your Home Assistant: Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery) Using MQTT (Manually Setup Entities) Using REST calls The first one is the easier way if you already have MQTT in use.","title":"Integration into Home Assistant"},{"location":"Integration-Home-Assistant/#using-mqtt-automatically-setup-entities-using-home-assistant-mqtt-discovery","text":"\u203c\ufe0f This feature will be available with the next release! Starting with Version >12.0.1 , AI-on-the-edge-devices support Home Assistant Discovery. Check here to learn more about it and how to enable it in Homeassistant. You also have to enable it in the MQTT settings of your device: Make sure to select the right Meter Type to get the right units! On the next start of the device, it will send discovery topics and Home Assistant should pick them up and show them under Settings > Integrations > MQTT :","title":"Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery)"},{"location":"Integration-Home-Assistant/#using-mqtt-manually-setup-entities","text":"First make sure with an MQTT client (for example MQTT Explorer ) that MQTT works as expected and to get a list of the available topics! Then add a sensor for each property: mqtt: sensor: - state_topic: \"wasserzaehler/main/value\" name: \"Watermeter Value\" unique_id: watermeter_value unit_of_measurement: 'm\u00b3' state_class: total_increasing device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/rate\" name: \"Watermeter Rate\" unique_id: watermeter_rate unit_of_measurement: 'm\u00b3/min' state_class: measurement device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/error\" name: \"Watermeter Error\" unique_id: watermeter_error icon: \"mdi:water-alert\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/uptime\" name: \"Watermeter Uptime\" unique_id: watermeter_uptime unit_of_measurement: 's' state_class: measurement device_class: duration entity_category: diagnostic icon: \"mdi:timer-outline\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you run the discovery once, you can also extract the information from there (MQTT Info, untested): mqtt: # Extracted form the Discovery but untested! sensor: - name: Value unique_id: wasserzaehler-main_value icon: mdi:gauge state_topic: wasserzaehler/main/value unit_of_measurement: m\u00b3 device_class: water state_class: total_increasing availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you want to convert the m\u00b3 to l , use a template sensor: template: - sensor: - name: \"Watermeter in l\" unique_id: watermeter_in_l icon: \"mdi:gauge\" state: \"{{ states('sensor.watermeter_value')|float(default=0) * 1000 }}\" # Convert 1 m3 => 1000 l unit_of_measurement: l availability: \"{{ states('sensor.watermeter_value') not in ['unknown', 'unavailable', 'none'] }}\" If you you want to have the consumption per day, you can use an Utility Meter . it is a helper and can be used to reset the total increasing values once a day utility_meter: utility_meter_gas_per_day: source: sensor.gasmeter_value cycle: daily utility_meter_water_per_day: source: sensor.watermeter_value cycle: daily Note that you also can add it using the UI.","title":"Using MQTT (Manually Setup Entities)"},{"location":"Integration-Home-Assistant/#examples","text":"","title":"Examples"},{"location":"Integration-Home-Assistant/#statistics-graph","text":"Creating Statistics Graphs (e.g. usage per day) is easy using the Energy Dashboard : Note that there seems to be a bug in the graph, see https://github.com/home-assistant/frontend/issues/13995 !","title":"Statistics Graph"},{"location":"Integration-Home-Assistant/#influxdb-graphs","text":"See also Influx-DB . If you have setup InfluxDB already, it is also possible to fetch statistics from there, e.g. daily usage: from(bucket: \"HomeAssistant\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r[\"entity_id\"] == \"wasserverbrauch_tag\") |> filter(fn: (r) => r[\"_field\"] == \"value\") |> timeShift(duration: -1d) |> aggregateWindow(every: 1d, fn: max, createEmpty: false) |> yield(name: \"mean\")","title":"InfluxDb Graphs"},{"location":"Integration-Home-Assistant/#using-rest","text":"When using REST, Home Assistant has to periodically call an URL on the ESP32 which in return provides the requested data. See REST API for a list of available URLs. The most practical one is the json entrypoint which provides the most relevant data JSON formatted: http:///json This would return: { \"main\": { \"value\": \"512.3020\", \"raw\": \"0512.3020\", \"error\": \"no error\", \"rate\": 0.000000, \"timestamp\": \"2022-10-02T20:32:06\" [..] } } To do such a REST call, you need to create a REST sensor: sensor: - platform: rest name: \"Gasmeter JSON\" resource: http:///json json_attributes: - main value_template: '{{ value_json.value }}' headers: Content-Type: application/json scan_interval: 60 template: sensor: - name: \"Gasmeter Value from JSON\" unique_id: gas_meter_value_from_json state: \"{{ state_attr('sensor.gasmeter_json','main')['value'] }}\" unit_of_measurement: 'm\u00b3' - name: \"Watermeter Value from JSON\" unique_id: water_meter_value_from_json state: >- {{ state_attr('sensor.watermeter_json','main')['value'] | float }} unit_of_measurement: 'm\u00b3' device_class: water state_class: total_increasing icon: mdi:gauge See also https://community.home-assistant.io/t/rest-sensor-nested-json/243420/9","title":"Using REST"},{"location":"Integration-Home-Assistant/#photo","text":"REST can also be used to show the photo of the last round: To access it, use http:///img_tmp/alg_roi.jpg resp http:///img_tmp/raw.jpg .","title":"Photo"},{"location":"Learn-models-with-your-own-images/","text":"Learn a model with your own images Once you have collected and selected your own images (see Collect images to improve the models ), you can train your very own model with them. This is an optional step and only suggested for advances users! For training the model you will need a python and Jupyter installation. All current labeled images you can find under ziffer_sortiert_raw dig-class11 models (digits) Fork and checkout neural-network-digital-counter-readout . Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into /ziffer_sortiert_raw folder and run Image_Preparation.ipynb Train_CNN_Digital-Readout-Small-v2.ipynb It creates a dig-class11_xxxx_s2.tflite model, you can upload to the config folder on your device and test it. dig-class100 / dig-cont models (digits) Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under Images Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// Run dig-class100-s2.ipynb . The model to upload to your device you can find under '/output'. ana-class100/ana-cont models (analog pointers) Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under data_raw_all Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// After every adding of images you need to run Image_Preparation.ipynb before you train the models. Run Train_CNN_Analog-Readout_100-Small1_Dropout.ipynb and/or Train_CNN_Analog-Readout_Version-Small2.ipynb . The model to upload to your device you can find in the project folder. Share your images If the results are good you can share the images as pull-request. Please images only! See Share your images for details.","title":"Learn a model with your own images"},{"location":"Learn-models-with-your-own-images/#learn-a-model-with-your-own-images","text":"Once you have collected and selected your own images (see Collect images to improve the models ), you can train your very own model with them. This is an optional step and only suggested for advances users! For training the model you will need a python and Jupyter installation. All current labeled images you can find under ziffer_sortiert_raw","title":"Learn a model with your own images"},{"location":"Learn-models-with-your-own-images/#dig-class11-models-digits","text":"Fork and checkout neural-network-digital-counter-readout . Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into /ziffer_sortiert_raw folder and run Image_Preparation.ipynb Train_CNN_Digital-Readout-Small-v2.ipynb It creates a dig-class11_xxxx_s2.tflite model, you can upload to the config folder on your device and test it.","title":"dig-class11 models (digits)"},{"location":"Learn-models-with-your-own-images/#dig-class100-dig-cont-models-digits","text":"Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under Images Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// Run dig-class100-s2.ipynb . The model to upload to your device you can find under '/output'.","title":"dig-class100 / dig-cont models (digits)"},{"location":"Learn-models-with-your-own-images/#ana-class100ana-cont-models-analog-pointers","text":"Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under data_raw_all Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// After every adding of images you need to run Image_Preparation.ipynb before you train the models. Run Train_CNN_Analog-Readout_100-Small1_Dropout.ipynb and/or Train_CNN_Analog-Readout_Version-Small2.ipynb . The model to upload to your device you can find in the project folder.","title":"ana-class100/ana-cont models (analog pointers)"},{"location":"Learn-models-with-your-own-images/#share-your-images","text":"If the results are good you can share the images as pull-request. Please images only! See Share your images for details.","title":"Share your images"},{"location":"MQTT-API/","text":"MQTT API The device is capable to register to a MQTT broker to publish data and subscribe to specific topics. The MQTT service has to be enabled and configured properly in the device configuration via web interface ( Settings -> Configuration -> section MQTT ) The following parameters have to be defined: * URI * MainTopic (optional, if not set, the hostname is used) * ClientID (optional, if not set, AIOTED- + the MAC address gets used to make sure the ID is unique) * User (optional) * Password (optional) * RetainFlag (optional) Published topics Status MainTopic /{status topic}, e.g. watermeter/status Connection Interval MAC IP Hostname Uptime FreeMem WifiRSSI CPUTemp Status Result MainTopic /{NumberName}/{result topic}, e.g. watermeter/main/value Value Raw Error JSON Rate Rate_per_time_unit The time Unit gets set with the Home Assistant Discovery, e.g. h or m (minutes) Rate_per_digitalization_round The interval defines when the next round gets triggered Changeabsolut Timestamp JSON All relevant results in JSON syntax GPIO MainTopic /{GPIO topic}, e.g. watermeter/GPIO/GPIO12 GPIO/GPIO{PinNumber} Depending on device configuration ( Settings --> Configuration --> Chapter GPIO ) Subscibed topics MainTopic /{subscribed topic}, e.g. watermeter/ctrl/flow_start Control ctrl/flow_start Trigger a flow start by publishing to this topic (any character, length > 0) GPIO/GPIO{PinNumber} Depending on device configuration ( Settings --> Configuration --> Chapter GPIO )","title":"MQTT API"},{"location":"MQTT-API/#mqtt-api","text":"The device is capable to register to a MQTT broker to publish data and subscribe to specific topics. The MQTT service has to be enabled and configured properly in the device configuration via web interface ( Settings -> Configuration -> section MQTT ) The following parameters have to be defined: * URI * MainTopic (optional, if not set, the hostname is used) * ClientID (optional, if not set, AIOTED- + the MAC address gets used to make sure the ID is unique) * User (optional) * Password (optional) * RetainFlag (optional)","title":"MQTT API"},{"location":"MQTT-API/#published-topics","text":"","title":"Published topics"},{"location":"MQTT-API/#status","text":"MainTopic /{status topic}, e.g. watermeter/status","title":"Status"},{"location":"MQTT-API/#connection","text":"","title":"Connection"},{"location":"MQTT-API/#interval","text":"","title":"Interval"},{"location":"MQTT-API/#mac","text":"","title":"MAC"},{"location":"MQTT-API/#ip","text":"","title":"IP"},{"location":"MQTT-API/#hostname","text":"","title":"Hostname"},{"location":"MQTT-API/#uptime","text":"","title":"Uptime"},{"location":"MQTT-API/#freemem","text":"","title":"FreeMem"},{"location":"MQTT-API/#wifirssi","text":"","title":"WifiRSSI"},{"location":"MQTT-API/#cputemp","text":"","title":"CPUTemp"},{"location":"MQTT-API/#status_1","text":"","title":"Status"},{"location":"MQTT-API/#result","text":"MainTopic /{NumberName}/{result topic}, e.g. watermeter/main/value","title":"Result"},{"location":"MQTT-API/#value","text":"","title":"Value"},{"location":"MQTT-API/#raw","text":"","title":"Raw"},{"location":"MQTT-API/#error","text":"","title":"Error"},{"location":"MQTT-API/#json","text":"","title":"JSON"},{"location":"MQTT-API/#rate","text":"","title":"Rate"},{"location":"MQTT-API/#rate_per_time_unit","text":"The time Unit gets set with the Home Assistant Discovery, e.g. h or m (minutes)","title":"Rate_per_time_unit"},{"location":"MQTT-API/#rate_per_digitalization_round","text":"The interval defines when the next round gets triggered","title":"Rate_per_digitalization_round"},{"location":"MQTT-API/#changeabsolut","text":"","title":"Changeabsolut"},{"location":"MQTT-API/#timestamp","text":"","title":"Timestamp"},{"location":"MQTT-API/#json_1","text":"All relevant results in JSON syntax","title":"JSON"},{"location":"MQTT-API/#gpio","text":"MainTopic /{GPIO topic}, e.g. watermeter/GPIO/GPIO12","title":"GPIO"},{"location":"MQTT-API/#gpiogpiopinnumber","text":"Depending on device configuration ( Settings --> Configuration --> Chapter GPIO )","title":"GPIO/GPIO{PinNumber}"},{"location":"MQTT-API/#subscibed-topics","text":"MainTopic /{subscribed topic}, e.g. watermeter/ctrl/flow_start","title":"Subscibed topics"},{"location":"MQTT-API/#control","text":"","title":"Control"},{"location":"MQTT-API/#ctrlflow_start","text":"Trigger a flow start by publishing to this topic (any character, length > 0)","title":"ctrl/flow_start"},{"location":"MQTT-API/#gpiogpiopinnumber_1","text":"Depending on device configuration ( Settings --> Configuration --> Chapter GPIO )","title":"GPIO/GPIO{PinNumber}"},{"location":"Neural-Network-Types/","text":"Neural Network Types Note For an overview, see Choosing the Model . This section is describing the different types of neural networks, that are used with the AI-on-the-edge approach and gives an introduction on how and where to use them. Overview neural network type There are two types of input : digits with rolling number (top town) analog pointers (clockwise rotating pointer) There are two types of neural networks : classification networks with discrete output neurons for each result class: 11 classes for digits (0, 1, ... 8, 9 + \"Not-A-Number\") 100 classes for digits or analog pointers (0.1, 0.2, 0.3, ... , 9.7, 9.8, 9.9) continuous output networks with a continuous output in the interval [0, 10[ No setting of the type in the firmware is necessary. The type can detect by the output structure automatically. \u203c\ufe0f Attention: It is very important to choose the right network type (digits or analog pointers). Technically a wrong network will work and create output, but that would be totally arbitrary Not all type of pointers are trained in all networks. For the 11 classes digits network there many different types of digits trained. The reason is, that you 1) only need 20-30 training images and 2) the data collection is ongoing much longer For the continuous and 100 classes network especially for the digits, there are only a few types of digits trained up to now Therefore sometimes for the digits it is more effective to choose the simpler 11 classes network type (= default). Naming convention Classification 11 classes 0, 1, ... 9 + \"N\" Classification 100 classes 0.0, 0.1, ... 9.9 Continuous Interval [0, 10[ Digits dig-class11 _XXX.tflite dig-class100 _XXX.tflite dig-cont _XXX.tflite Analog Pointers ana-class100 _XXX.tflite ana-cont _XXX.tflite XXX contains the versioning and a parameter for different sizes with the following naming: XXX = versioning_sY versioning = version or in newer networks the training data Y = Neural network size (typically s1, s2, ..., s4). Whereas s1 is the maximum sized neural network and s4 is the smallest. Optional the naming ends with an \"_q\" to signal, that the tflite file has been quantized (size reduction with minimum accuracy loss). Example: dig-class11_1410_s2_q.tflite Classification network for digits with 11 classes (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, N) Version 1410 = 14.1.0 s2 = Size 2 (Medium) q = Quantized Version Overview of trained types and details Analog Pointer (\"ana-cont_XXX.tflite\" & \"ana-class100_XXX.tflite\") This is to transfer the direction of a pointer into a continuous number between 0 and 1, whereas 0 (=1) is the upwards position (12 o'clock), 0.25 corresponds to the 3 o'clock positions and so on. This network is a envelop for all different types of pointers. Currently there are no dedicated network trainings for specific types of pointers. There are two types of network structure, currently both are supported. The \"class100\" is a pure classification network, that might need a bit more accuracy in the labeling. \"cont\" is a no classic approach with a continuous output off only 2 neurons (details see below). Types of counters trained: Training data needs Quadratic images, minimum size: 32x32 pixel Typically 100 - 200 images with a resolution of 1/100 of the full rotation (every 0.1 value or 3.6\u00b0) Naming: x.y_ARBITRARY.jpg, where x.y = value 0.0 ... 9.9 CNN Technical details: Input 32 x 32 RGB images Output ana-cont _XXX.tflite: 2 neurons with output in range [-1, 1] - representing a sinus / cosine encoding of the angle needs to be converted to angle with arctan-hyperbolic function ana-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9 Digits with 11 classes (\"dig-class11_XXX.tflite\") The digit type is a classical classification network, with 11 classes representing the numbers 0, 1, ... 9 and the special class \"N\". It is trained for the rolling ring of gas and electric meters. As there is sometime a status between two images, the special class \"N\" is representing Not-A-Number for the case, that the image cannot be unique classified to one number e.g. because it is between two digits. For this type the lowest amount of training data per type is needed, resulting in a large variety of type being already part of the training set. Types of counters trained: Training data needs RGB images, with minimum size: 20x32 pixel Typically 10 - 20 images (1-2 for each digit and an arbitrary number for the \"N\" class Naming: x_ARBITRARY.jpg, where x = value 0 ... 9 + N CNN Technical details: Input 20 x 32 RGB images Output 11 neurons for image classification (last layer normalized to 1) Neuron 0 to 9 represent the corresponding numbers \"0\" to \"9\" Neuron 10 represents the \"Not-A-Number\" class, telling, that the image is not uniquely classified Digits with rolling results (\"dig-class100_XXX.tflite\" & \"dig-cont_XXX.tflite\") This type of network tries to overcome the problem, that there are intermediate values, when a rolling digit is between two numbers. Previous this was the \"N\" class. In this network type, there are also sub-digit values trained, so that the intermediate state can be used as additional information for the algorithms. Types of counters trained: [[images/dig-cont/dig-cont_1.jpg) [[images/dig-cont/dig-cont_2a.jpg) [[images/dig-cont/dig-cont_2b.jpg) [[images/dig-cont/dig-cont_3a.jpg) [[images/dig-cont/dig-cont_3b.jpg) [[images/dig-cont/dig-cont_3c.jpg) Training data needs RGB images, with minimum size: 20x32 pixel Typically 100 - 200 images (1-2 for each possible position) Naming: x.y_ARBITRARY.jpg, where x.y = 0.0, 0.1, ... 9.9 representing the intermediate state CNN Technical details: Input 20 x 32 RGB images Output dig-cont _XXX.tflite: 10 neurons representing the digits 0, 1, ... 9. The intermediate values are represented by weighted normalized values of two neighboring output neurons needs to be converted to angle with arctan-hyperbolic function dig-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9","title":"Neural Network Types"},{"location":"Neural-Network-Types/#neural-network-types","text":"Note For an overview, see Choosing the Model . This section is describing the different types of neural networks, that are used with the AI-on-the-edge approach and gives an introduction on how and where to use them.","title":"Neural Network Types"},{"location":"Neural-Network-Types/#overview-neural-network-type","text":"There are two types of input : digits with rolling number (top town) analog pointers (clockwise rotating pointer) There are two types of neural networks : classification networks with discrete output neurons for each result class: 11 classes for digits (0, 1, ... 8, 9 + \"Not-A-Number\") 100 classes for digits or analog pointers (0.1, 0.2, 0.3, ... , 9.7, 9.8, 9.9) continuous output networks with a continuous output in the interval [0, 10[ No setting of the type in the firmware is necessary. The type can detect by the output structure automatically. \u203c\ufe0f Attention: It is very important to choose the right network type (digits or analog pointers). Technically a wrong network will work and create output, but that would be totally arbitrary Not all type of pointers are trained in all networks. For the 11 classes digits network there many different types of digits trained. The reason is, that you 1) only need 20-30 training images and 2) the data collection is ongoing much longer For the continuous and 100 classes network especially for the digits, there are only a few types of digits trained up to now Therefore sometimes for the digits it is more effective to choose the simpler 11 classes network type (= default).","title":"Overview neural network type"},{"location":"Neural-Network-Types/#naming-convention","text":"Classification 11 classes 0, 1, ... 9 + \"N\" Classification 100 classes 0.0, 0.1, ... 9.9 Continuous Interval [0, 10[ Digits dig-class11 _XXX.tflite dig-class100 _XXX.tflite dig-cont _XXX.tflite Analog Pointers ana-class100 _XXX.tflite ana-cont _XXX.tflite XXX contains the versioning and a parameter for different sizes with the following naming: XXX = versioning_sY versioning = version or in newer networks the training data Y = Neural network size (typically s1, s2, ..., s4). Whereas s1 is the maximum sized neural network and s4 is the smallest. Optional the naming ends with an \"_q\" to signal, that the tflite file has been quantized (size reduction with minimum accuracy loss). Example: dig-class11_1410_s2_q.tflite Classification network for digits with 11 classes (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, N) Version 1410 = 14.1.0 s2 = Size 2 (Medium) q = Quantized Version","title":"Naming convention"},{"location":"Neural-Network-Types/#overview-of-trained-types-and-details","text":"","title":"Overview of trained types and details"},{"location":"Neural-Network-Types/#analog-pointer-ana-cont_xxxtflite-ana-class100_xxxtflite","text":"This is to transfer the direction of a pointer into a continuous number between 0 and 1, whereas 0 (=1) is the upwards position (12 o'clock), 0.25 corresponds to the 3 o'clock positions and so on. This network is a envelop for all different types of pointers. Currently there are no dedicated network trainings for specific types of pointers. There are two types of network structure, currently both are supported. The \"class100\" is a pure classification network, that might need a bit more accuracy in the labeling. \"cont\" is a no classic approach with a continuous output off only 2 neurons (details see below).","title":"Analog Pointer (\"ana-cont_XXX.tflite\" & \"ana-class100_XXX.tflite\")"},{"location":"Neural-Network-Types/#types-of-counters-trained","text":"","title":"Types of counters trained:"},{"location":"Neural-Network-Types/#training-data-needs","text":"Quadratic images, minimum size: 32x32 pixel Typically 100 - 200 images with a resolution of 1/100 of the full rotation (every 0.1 value or 3.6\u00b0) Naming: x.y_ARBITRARY.jpg, where x.y = value 0.0 ... 9.9","title":"Training data needs"},{"location":"Neural-Network-Types/#cnn-technical-details","text":"","title":"CNN Technical details:"},{"location":"Neural-Network-Types/#input","text":"32 x 32 RGB images","title":"Input"},{"location":"Neural-Network-Types/#output","text":"ana-cont _XXX.tflite: 2 neurons with output in range [-1, 1] - representing a sinus / cosine encoding of the angle needs to be converted to angle with arctan-hyperbolic function ana-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9","title":"Output"},{"location":"Neural-Network-Types/#digits-with-11-classes-dig-class11_xxxtflite","text":"The digit type is a classical classification network, with 11 classes representing the numbers 0, 1, ... 9 and the special class \"N\". It is trained for the rolling ring of gas and electric meters. As there is sometime a status between two images, the special class \"N\" is representing Not-A-Number for the case, that the image cannot be unique classified to one number e.g. because it is between two digits. For this type the lowest amount of training data per type is needed, resulting in a large variety of type being already part of the training set.","title":"Digits with 11 classes (\"dig-class11_XXX.tflite\")"},{"location":"Neural-Network-Types/#types-of-counters-trained_1","text":"","title":"Types of counters trained:"},{"location":"Neural-Network-Types/#training-data-needs_1","text":"RGB images, with minimum size: 20x32 pixel Typically 10 - 20 images (1-2 for each digit and an arbitrary number for the \"N\" class Naming: x_ARBITRARY.jpg, where x = value 0 ... 9 + N","title":"Training data needs"},{"location":"Neural-Network-Types/#cnn-technical-details_1","text":"","title":"CNN Technical details:"},{"location":"Neural-Network-Types/#input_1","text":"20 x 32 RGB images","title":"Input"},{"location":"Neural-Network-Types/#output_1","text":"11 neurons for image classification (last layer normalized to 1) Neuron 0 to 9 represent the corresponding numbers \"0\" to \"9\" Neuron 10 represents the \"Not-A-Number\" class, telling, that the image is not uniquely classified","title":"Output"},{"location":"Neural-Network-Types/#digits-with-rolling-results-dig-class100_xxxtflite-dig-cont_xxxtflite","text":"This type of network tries to overcome the problem, that there are intermediate values, when a rolling digit is between two numbers. Previous this was the \"N\" class. In this network type, there are also sub-digit values trained, so that the intermediate state can be used as additional information for the algorithms.","title":"Digits with rolling results (\"dig-class100_XXX.tflite\" & \"dig-cont_XXX.tflite\")"},{"location":"Neural-Network-Types/#types-of-counters-trained_2","text":"[[images/dig-cont/dig-cont_1.jpg) [[images/dig-cont/dig-cont_2a.jpg) [[images/dig-cont/dig-cont_2b.jpg) [[images/dig-cont/dig-cont_3a.jpg) [[images/dig-cont/dig-cont_3b.jpg) [[images/dig-cont/dig-cont_3c.jpg)","title":"Types of counters trained:"},{"location":"Neural-Network-Types/#training-data-needs_2","text":"RGB images, with minimum size: 20x32 pixel Typically 100 - 200 images (1-2 for each possible position) Naming: x.y_ARBITRARY.jpg, where x.y = 0.0, 0.1, ... 9.9 representing the intermediate state","title":"Training data needs"},{"location":"Neural-Network-Types/#cnn-technical-details_2","text":"","title":"CNN Technical details:"},{"location":"Neural-Network-Types/#input_2","text":"20 x 32 RGB images","title":"Input"},{"location":"Neural-Network-Types/#output_2","text":"dig-cont _XXX.tflite: 10 neurons representing the digits 0, 1, ... 9. The intermediate values are represented by weighted normalized values of two neighboring output neurons needs to be converted to angle with arctan-hyperbolic function dig-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9","title":"Output"},{"location":"New-Releases-Notification/","text":"Notification about new Releases Do you want to get notified about a new release? There are several ways for it: Github Notifications You will need a Github Account for this! Log into your Github account on Github . Go to AI-on-the-edge-device . On the top right side, click onto Watch and select Custom : Select Releases . You will get an email when a new release gets created. See also Github Documentation . CodeRelease.io Alternatively or if you do not want to create a Github account, CodeRelease.io can be an alternative. You also have to subscribe with an email address but no account is required.","title":"Notification about new Releases"},{"location":"New-Releases-Notification/#notification-about-new-releases","text":"Do you want to get notified about a new release? There are several ways for it:","title":"Notification about new Releases"},{"location":"New-Releases-Notification/#github-notifications","text":"You will need a Github Account for this! Log into your Github account on Github . Go to AI-on-the-edge-device . On the top right side, click onto Watch and select Custom : Select Releases . You will get an email when a new release gets created. See also Github Documentation .","title":"Github Notifications"},{"location":"New-Releases-Notification/#codereleaseio","text":"Alternatively or if you do not want to create a Github account, CodeRelease.io can be an alternative. You also have to subscribe with an email address but no account is required.","title":"CodeRelease.io"},{"location":"Parameters/","text":"Parameters This page lists all available Configuration Parameters. If a parameter or section has a tick box on its left side, you can disable it. In such case the functionality gets disabled respectively the default values will be used. Note This is an auto-generated page! See the README for details! Section TakeImage Parameter Brightness Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Brightness ( -2 .. 2 ) Parameter Contrast Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Contrast ( -2 .. 2 ) Parameter Demo Default Value: false Enable to use demo images instead of the real camera images. Make sure to have a /demo folder on your SD-Card and it contains the expected files! Check here for details. Parameter FixedExposure Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Fixes the illumination setting of camera at the startup and uses this later -> Individual round is faster. Parameter ImageQuality Default Value: 12 Warning This is an Expert Parameter ! Only change it if you understand what it does! Quality index for pictures: 8 (highest quality) ... 63 (lowest quality) Warning Value below 12 could result in system instabilities! Parameter ImageSize Default Value: VGA Warning This is an Expert Parameter ! Only change it if you understand what it does! Size of the camera picture. Available options: VGA (640 x 480 pixel) QVGA (320 x 240 pixel) Parameter LEDIntensity Default Value: 50 Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can also be set on the Reference Image configuration. Set the Flash LED Intensity: ( 0 .. 100 ) Parameter RawImagesLocation Default Value: /log/source Location on the SD-Card to store the raw images. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter RawImagesRetention Default Value: 15 Unit: Days Number of days to keep the raw images ( 0 = forever) Parameter Saturation Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Saturation ( -2 .. 2 ) Parameter WaitBeforeTakingPicture Default Value: 5 Unit: seconds Warning This is an Expert Parameter ! Only change it if you understand what it does! Waiting time between switching illumination on and taking the picture. Section Alignment Parameter AlignmentAlgo Default Value: Default Warning This is an Expert Parameter ! Only change it if you understand what it does! Algorithm used for the alignment step. Available options: Default : Use only red color channel HighAccuracy : Use all 3 color channels (3x slower) Fast : First time use HighAccuracy , then only check if the image is shifted Off : Disable alignment algorithm Parameter FlipImageSize Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. This parameter can be used to rotate the viewport together with the alignment rotation: Parameter InitialMirror Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Option for initially mirroring the image on the original x-axis. Parameter InitialRotate Default Value: 179 Unit: Degrees Initial rotation of image before alignment in degree (0 .. 359) Note This parameter is accessible on the Reference Image Page but not on the Config page! Parameter SearchFieldX Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! X-size (width) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size. Parameter SearchFieldY Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! Y-size (height) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size. Section Digits Parameter CNNGoodThreshold Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the dig-class100 models! Parameter Model Default Value: /config/dig-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details. Parameter ROIImagesLocation Default Value: /log/digit Location to store separated digit images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter ROIImagesRetention Default Value: 3 Unit: Days Days to keep the separated digit images ( 0 = forever). Section Analog Parameter CNNGoodThreshold Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the ana-class100 models! Parameter ExtendedResolution Warning This parameter is unused! Use NUMBER.ExtendedResolution instead! Parameter Model Default Value: /config/ana-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details. Parameter ROIImagesLocation Default Value: /log/analog Location to store separated analog images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter ROIImagesRetention Default Value: 3 Unit: Days Days to keep the separated analog images ( 0 = forever). Section PostProcessing Parameter AllowNegativeRates Warning This parameter is unused! Use NUMBER.AllowNegativeRates instead! Parameter CheckDigitIncreaseConsistency Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! An additional consistency check. It especially improves the zero crossing check between digits. Parameter ErrorMessage Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Do not show error message in return value. In an error case, the last valid number will be used for the various transmission protocols (MQTT, InfluxDB, REST, ...). Parameter .AllowNegativeRates Default Value: false Allow a meter to count backwards (decreasing values). Note This is unusual (it means there is a negative rate) and not wanted in most cases! Parameter .AnalogDigitalTransitionStart Default Value: 9.2 This can be used if you have wrong values, but the recognition of the individual ROIs are correct. Look for the start of changing of the first digit and note the analog pointer value behind. Set it here. Only used on combination of digits and analog pointers. See here for details. Parameter .DecimalShift Default Value: 0 Shift the decimal separator (positiv or negativ). Eg. to move from m\u00b3 to liter ( 1 m\u00b3 equals 1000 liters ), you need to set it to +3 . Parameter .ExtendedResolution Default Value: false Use the decimal place of the last analog counter for increased accuracy. Note This parameter is only supported on the *-class* and *-const models! See Choosing-the-Model for details. Parameter .IgnoreLeadingNaN Default Value: true Leading N 's will be deleted before further processing. This is only relevant for models which use N ! See here for details. Parameter .MaxRateType Default Value: AbsoluteChange Defines if the Change Rate compared to the previous value is calculated as absolute change ( AbsoluteChange ) or as rate normalized to the interval ( RateChange = change/minute). Parameter .MaxRateValue Default Value: 0.05 Maximum change of a reading. Depending on the settings of .MaxRateType it is either treated as absolute or relative ! Parameter PreValueAgeStartup Default Value: 720 Warning This is an Expert Parameter ! Only change it if you understand what it does! Time in minutes, how long a previous read value is valid after reboot. Parameter PreValueUse Default Value: true Use the previous value (value from previous round) for consistency checks. This also works through a reboot of the device! Section MQTT Parameter ClientID Default Value: watermeter Client ID used to connect to the MQTT broker. If disabled, the hostname will be used. Parameter HomeassistantDiscovery Default Value: true Enable or disable the Homeassistant Discovery. See here for details about the discovery. Parameter MainTopic Default Value: watermeter MQTT main topic, under which the counters are published. The single value will be published with the following key: MAINTOPIC/NUMBER/RESULT_TOPIC With: NUMBER : The name of the value (a meter might have more than one value). The names get defined in the analog and digital ROI configuration (defaults to main ). RESULT_TOPIC : Automatically filled with the right name, eg. value , rate , timestamp , error , .... The general connection status can be found in MAINTOPIC/CONNECTION . See MQTT Result Topics for a full list of topics. Parameter MeterType Default Value: other Select the Meter Type so the sensors have the right units in Homeassistant. Note For Watermeter you need to have Homeassistant 2022.11 or newer! Please also make sure that the selected Meter Type matches the dimension of the value provided by the meter! Eg. if your meter provides m\u00b3 , you need to also set it to m\u00b3 . Alternatively you can set the parameter DecimalShift to 3 so the value is converted to liters ! Parameter RetainMessages Default Value: true Enable or disable the Retain Flag for all MQTT entries. Parameter Uri Default Value: mqtt://IP-ADRESS:1883 URI to the MQTT broker including the port. E.g. mqtt://192.168.1.1:1883 . Parameter password Default Value: PASSWORD Password for MQTT authentication. Parameter user Default Value: USERNAME Username for MQTT authentication. Section InfluxDB Parameter Database Default Value: '' Name of the InfluxDB v1 Database into which to publish the values. Note See section InfluxDBv2 for InfluxDB v2 support! Parameter Measurement Default Value: undefined Name of the InfluxDB v1 Measurement to use to publish the value. Note See section InfluxDBv2 for InfluxDB v2 support! Parameter Uri Default Value: undefined URI of the HTTP interface to InfluxDB v1, without trailing slash, e.g. http://192.168.1.1:8086 . Note See section InfluxDBv2 for InfluxDB v2 support! Parameter password Default Value: undefined Password for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support! Parameter user Default Value: undefined Username for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support! Section InfluxDBv2 Parameter Database Default Value: '' Name of the InfluxDB v2 Database into which to publish the values. Parameter Measurement Default Value: undefined Name of the InfluxDB v2 Measurement to use to publish the value. Parameter .fieldname Default Value: undefined Fieldname for InfluxDB v2 to use for saving. Parameter Org Default Value: undefined Organisation (Org) for InfluxDB v2 authentication Parameter Token Default Value: undefined Token for InfluxDB v2 authentication Parameter Uri Default Value: undefined URI of the HTTP interface to InfluxDB v2, without trailing slash, e.g. http://192.168.1.1:8086 . Section GPIO Parameter IO0 Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO0 pin. Warning This pin is only usable with restrictions! It must be disabled when the camera is used. Additionally, it is used to activate Bootloader mode and must therefore be HIGH after a reset! Parameters: GPIO 0 state : One of input , input pullup , input pulldown or output . GPIO 0 use interrupt : Enable interrupt trigger GPIO 0 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 0 enable MQTT : Enable MQTT publishing/subscribing GPIO 0 enable HTTP : Enable HTTP write/read GPIO 0 name : MQTT topic name (empty = GPIO0 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO1 Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO1 pin. Warning This pin is by default used for the serial communication as TX pin (USB logging)! Parameters: GPIO 1 state : One of input , input pullup , input pulldown or output . GPIO 1 use interrupt : Enable interrupt trigger GPIO 1 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 1 enable MQTT : Enable MQTT publishing/subscribing GPIO 1 enable HTTP : Enable HTTP write/read GPIO 1 name : MQTT topic name (empty = GPIO1 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO12 Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO12 pin. Note This pin is usable without known restrictions! Parameters: GPIO 12 state : One of external-flash-ws281x , input , input pullup , input pulldown or output . GPIO 12 use interrupt : Enable interrupt trigger GPIO 12 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 12 enable MQTT : Enable MQTT publishing/subscribing GPIO 12 enable HTTP : Enable HTTP write/read GPIO 12 name : MQTT topic name (empty = GPIO12 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO13 Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO13 pin. Note This pin is usable without known restrictions! Parameters: GPIO 13 state : One of input , input pullup , input pulldown or output . GPIO 13 use interrupt : Enable interrupt trigger GPIO 13 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 13 enable MQTT : Enable MQTT publishing/subscribing GPIO 13 enable HTTP : Enable HTTP write/read GPIO 13 name : MQTT topic name (empty = GPIO13 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO3 Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO3 pin. Warning This pin is by default used for the serial communication as RX pin (USB logging)! Parameters: GPIO 3 state : One of input , input pullup , input pulldown or output . GPIO 3 use interrupt : Enable interrupt trigger GPIO 3 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 3 enable MQTT : Enable MQTT publishing/subscribing GPIO 3 enable HTTP : Enable HTTP write/read GPIO 3 name : MQTT topic name (empty = GPIO3 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO4 Default Value: built-in-led disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO4 pin. Warning This pin is only usable with restrictions! By default, it is used for build-in flash light (onboard LED). Parameters: GPIO 4 state : One of built-in-led , input , input pullup , input pulldown or output . GPIO 4 use interrupt : Enable interrupt trigger GPIO 4 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 4 enable MQTT : Enable MQTT publishing/subscribing GPIO 4 enable HTTP : Enable HTTP write/read GPIO 4 name : MQTT topic name (empty = GPIO4 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter LEDColor Default Value: 150 150 150 Color of the attached LEDs to GPIO12 in R ed, G reen B lue from 0 (full off) .. 255 (full on) (See IO12 parameter). Parameter LEDNumbers Default Value: 2 Number of LEDs on the external LED-stripe attached to GPIO12 (See IO12 parameter). Parameter LEDType Default Value: WS2812 Type of the WS2812x which is connected to GPIO12 (See IO12 parameter). Parameter MainTopicMQTT Default Value: wasserzaehler/GPIO Note This parameter is not accessible through the Web Interface Configuration Page! The GPIO Interface is prepared to report it's status and status changes as a MQTT topic. With this parameter you configure the MQTT main topic, under which the status is published. As this parameter is still experimental it can only be set manually in the config.ini itself and has not been tested in detail so far. Section AutoTimer Parameter AutoStart Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Automatically start the Flow (Digitization Rounds) immediately after power up. Note Typically this is set to true . The main reasons to set it to false is when you want to trigger it manually using the REST API or MQTT-API or for debugging. Parameter Interval Default Value: 5 Unit: Minutes Interval in which the Flow (Digitization Round) is run. If a round takes longer than this interval, the next round gets postponed until the current round completes. Section DataLogging Parameter DataFilesRetention Default Value: 3 Unit: Days Number of days to keep the data files ( 0 = forever). Parameter DataLogActive Default Value: true Activate data logging to the SD-Card. The files will be stored in /log/data/data_YYYY-MM-DD.csv . See Data Logging for details. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Section Debug Parameter LogLevel Default Value: 1 ( ERROR ) Define the log level for the logging to the SD-Card. Available options: 1 : ERROR 2 : WARNING 3 : INFO 4 : DEBUG As higher the level, as more log messages get written to the SD-Card. Warning DEBUG or INFO might damage the SD-Card if enabled long term due to excessive writes to the SD-Card! A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter LogfilesRetention Default Value: 3 Unit: Days Number of days to keep the log files ( 0 = forever). Section System Parameter Hostname Default Value: undefined Warning This is an Expert Parameter ! Only change it if you understand what it does! Hostname for the device. It gets automatically transferred to /wlan.ini on the SD-Card at the next startup. Parameter RSSIThreshold Default Value: '' WLAN Mesh Parameter: Threshold for the RSSI value to check for start switching access point in a mesh system. Possible values: -100 .. 0 ( 0 = disabled). It gets automatically transferred to /wlan.ini on the SD-Card at next startup. Parameter SetupMode Default Value: true Note This parameter is not accessible through the Web Interface Configuration Page! Set this parameter to true to stay in the Setup Mode after the next start of the device. Parameter TimeServer Default Value: pool.ntp.org Warning This is an Expert Parameter ! Only change it if you understand what it does! Time server to synchronize system time. If it is disabled or undefined , pool.ntp.org will be used. You can also set it to the IP of your router. Many routers like Fritzboxes can act as a local NTP server. To disable NTP, you need to activate it but set the TimeServer config to be empty ( \"\" ). In such case the time always starts at 01.01.1970 after each power cycle! Parameter TimeZone Default Value: CET-1CEST,M3.5.0,M10.5.0/3 Time zone in POSIX syntax (Europe/Berlin = CET-1CEST,M3.5.0,M10.5.0/3 - incl. daylight saving) Check the table on http:///timezones.html to find the settings for your region.","title":"Parameters"},{"location":"Parameters/#parameters","text":"This page lists all available Configuration Parameters. If a parameter or section has a tick box on its left side, you can disable it. In such case the functionality gets disabled respectively the default values will be used. Note This is an auto-generated page! See the README for details!","title":"Parameters"},{"location":"Parameters/#section-takeimage","text":"","title":"Section TakeImage"},{"location":"Parameters/#parameter-brightness","text":"Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Brightness ( -2 .. 2 )","title":"Parameter Brightness"},{"location":"Parameters/#parameter-contrast","text":"Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Contrast ( -2 .. 2 )","title":"Parameter Contrast"},{"location":"Parameters/#parameter-demo","text":"Default Value: false Enable to use demo images instead of the real camera images. Make sure to have a /demo folder on your SD-Card and it contains the expected files! Check here for details.","title":"Parameter Demo"},{"location":"Parameters/#parameter-fixedexposure","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Fixes the illumination setting of camera at the startup and uses this later -> Individual round is faster.","title":"Parameter FixedExposure"},{"location":"Parameters/#parameter-imagequality","text":"Default Value: 12 Warning This is an Expert Parameter ! Only change it if you understand what it does! Quality index for pictures: 8 (highest quality) ... 63 (lowest quality) Warning Value below 12 could result in system instabilities!","title":"Parameter ImageQuality"},{"location":"Parameters/#parameter-imagesize","text":"Default Value: VGA Warning This is an Expert Parameter ! Only change it if you understand what it does! Size of the camera picture. Available options: VGA (640 x 480 pixel) QVGA (320 x 240 pixel)","title":"Parameter ImageSize"},{"location":"Parameters/#parameter-ledintensity","text":"Default Value: 50 Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can also be set on the Reference Image configuration. Set the Flash LED Intensity: ( 0 .. 100 )","title":"Parameter LEDIntensity"},{"location":"Parameters/#parameter-rawimageslocation","text":"Default Value: /log/source Location on the SD-Card to store the raw images. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter RawImagesLocation"},{"location":"Parameters/#parameter-rawimagesretention","text":"Default Value: 15 Unit: Days Number of days to keep the raw images ( 0 = forever)","title":"Parameter RawImagesRetention"},{"location":"Parameters/#parameter-saturation","text":"Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Saturation ( -2 .. 2 )","title":"Parameter Saturation"},{"location":"Parameters/#parameter-waitbeforetakingpicture","text":"Default Value: 5 Unit: seconds Warning This is an Expert Parameter ! Only change it if you understand what it does! Waiting time between switching illumination on and taking the picture.","title":"Parameter WaitBeforeTakingPicture"},{"location":"Parameters/#section-alignment","text":"","title":"Section Alignment"},{"location":"Parameters/#parameter-alignmentalgo","text":"Default Value: Default Warning This is an Expert Parameter ! Only change it if you understand what it does! Algorithm used for the alignment step. Available options: Default : Use only red color channel HighAccuracy : Use all 3 color channels (3x slower) Fast : First time use HighAccuracy , then only check if the image is shifted Off : Disable alignment algorithm","title":"Parameter AlignmentAlgo"},{"location":"Parameters/#parameter-flipimagesize","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. This parameter can be used to rotate the viewport together with the alignment rotation:","title":"Parameter FlipImageSize"},{"location":"Parameters/#parameter-initialmirror","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Option for initially mirroring the image on the original x-axis.","title":"Parameter InitialMirror"},{"location":"Parameters/#parameter-initialrotate","text":"Default Value: 179 Unit: Degrees Initial rotation of image before alignment in degree (0 .. 359) Note This parameter is accessible on the Reference Image Page but not on the Config page!","title":"Parameter InitialRotate"},{"location":"Parameters/#parameter-searchfieldx","text":"Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! X-size (width) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size.","title":"Parameter SearchFieldX"},{"location":"Parameters/#parameter-searchfieldy","text":"Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! Y-size (height) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size.","title":"Parameter SearchFieldY"},{"location":"Parameters/#section-digits","text":"","title":"Section Digits"},{"location":"Parameters/#parameter-cnngoodthreshold","text":"Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the dig-class100 models!","title":"Parameter CNNGoodThreshold"},{"location":"Parameters/#parameter-model","text":"Default Value: /config/dig-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details.","title":"Parameter Model"},{"location":"Parameters/#parameter-roiimageslocation","text":"Default Value: /log/digit Location to store separated digit images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter ROIImagesLocation"},{"location":"Parameters/#parameter-roiimagesretention","text":"Default Value: 3 Unit: Days Days to keep the separated digit images ( 0 = forever).","title":"Parameter ROIImagesRetention"},{"location":"Parameters/#section-analog","text":"","title":"Section Analog"},{"location":"Parameters/#parameter-cnngoodthreshold_1","text":"Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the ana-class100 models!","title":"Parameter CNNGoodThreshold"},{"location":"Parameters/#parameter-extendedresolution","text":"Warning This parameter is unused! Use NUMBER.ExtendedResolution instead!","title":"Parameter ExtendedResolution"},{"location":"Parameters/#parameter-model_1","text":"Default Value: /config/ana-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details.","title":"Parameter Model"},{"location":"Parameters/#parameter-roiimageslocation_1","text":"Default Value: /log/analog Location to store separated analog images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter ROIImagesLocation"},{"location":"Parameters/#parameter-roiimagesretention_1","text":"Default Value: 3 Unit: Days Days to keep the separated analog images ( 0 = forever).","title":"Parameter ROIImagesRetention"},{"location":"Parameters/#section-postprocessing","text":"","title":"Section PostProcessing"},{"location":"Parameters/#parameter-allownegativerates","text":"Warning This parameter is unused! Use NUMBER.AllowNegativeRates instead!","title":"Parameter AllowNegativeRates"},{"location":"Parameters/#parameter-checkdigitincreaseconsistency","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! An additional consistency check. It especially improves the zero crossing check between digits.","title":"Parameter CheckDigitIncreaseConsistency"},{"location":"Parameters/#parameter-errormessage","text":"Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Do not show error message in return value. In an error case, the last valid number will be used for the various transmission protocols (MQTT, InfluxDB, REST, ...).","title":"Parameter ErrorMessage"},{"location":"Parameters/#parameter-numbersallownegativerates","text":"Default Value: false Allow a meter to count backwards (decreasing values). Note This is unusual (it means there is a negative rate) and not wanted in most cases!","title":"Parameter <NUMBERS>.AllowNegativeRates"},{"location":"Parameters/#parameter-numberanalogdigitaltransitionstart","text":"Default Value: 9.2 This can be used if you have wrong values, but the recognition of the individual ROIs are correct. Look for the start of changing of the first digit and note the analog pointer value behind. Set it here. Only used on combination of digits and analog pointers. See here for details.","title":"Parameter <NUMBER>.AnalogDigitalTransitionStart"},{"location":"Parameters/#parameter-numberdecimalshift","text":"Default Value: 0 Shift the decimal separator (positiv or negativ). Eg. to move from m\u00b3 to liter ( 1 m\u00b3 equals 1000 liters ), you need to set it to +3 .","title":"Parameter <NUMBER>.DecimalShift"},{"location":"Parameters/#parameter-numberextendedresolution","text":"Default Value: false Use the decimal place of the last analog counter for increased accuracy. Note This parameter is only supported on the *-class* and *-const models! See Choosing-the-Model for details.","title":"Parameter <NUMBER>.ExtendedResolution"},{"location":"Parameters/#parameter-numberignoreleadingnan","text":"Default Value: true Leading N 's will be deleted before further processing. This is only relevant for models which use N ! See here for details.","title":"Parameter <NUMBER>.IgnoreLeadingNaN"},{"location":"Parameters/#parameter-numbermaxratetype","text":"Default Value: AbsoluteChange Defines if the Change Rate compared to the previous value is calculated as absolute change ( AbsoluteChange ) or as rate normalized to the interval ( RateChange = change/minute).","title":"Parameter <NUMBER>.MaxRateType"},{"location":"Parameters/#parameter-numbermaxratevalue","text":"Default Value: 0.05 Maximum change of a reading. Depending on the settings of .MaxRateType it is either treated as absolute or relative !","title":"Parameter <NUMBER>.MaxRateValue"},{"location":"Parameters/#parameter-prevalueagestartup","text":"Default Value: 720 Warning This is an Expert Parameter ! Only change it if you understand what it does! Time in minutes, how long a previous read value is valid after reboot.","title":"Parameter PreValueAgeStartup"},{"location":"Parameters/#parameter-prevalueuse","text":"Default Value: true Use the previous value (value from previous round) for consistency checks. This also works through a reboot of the device!","title":"Parameter PreValueUse"},{"location":"Parameters/#section-mqtt","text":"","title":"Section MQTT"},{"location":"Parameters/#parameter-clientid","text":"Default Value: watermeter Client ID used to connect to the MQTT broker. If disabled, the hostname will be used.","title":"Parameter ClientID"},{"location":"Parameters/#parameter-homeassistantdiscovery","text":"Default Value: true Enable or disable the Homeassistant Discovery. See here for details about the discovery.","title":"Parameter HomeassistantDiscovery"},{"location":"Parameters/#parameter-maintopic","text":"Default Value: watermeter MQTT main topic, under which the counters are published. The single value will be published with the following key: MAINTOPIC/NUMBER/RESULT_TOPIC With: NUMBER : The name of the value (a meter might have more than one value). The names get defined in the analog and digital ROI configuration (defaults to main ). RESULT_TOPIC : Automatically filled with the right name, eg. value , rate , timestamp , error , .... The general connection status can be found in MAINTOPIC/CONNECTION . See MQTT Result Topics for a full list of topics.","title":"Parameter MainTopic"},{"location":"Parameters/#parameter-metertype","text":"Default Value: other Select the Meter Type so the sensors have the right units in Homeassistant. Note For Watermeter you need to have Homeassistant 2022.11 or newer! Please also make sure that the selected Meter Type matches the dimension of the value provided by the meter! Eg. if your meter provides m\u00b3 , you need to also set it to m\u00b3 . Alternatively you can set the parameter DecimalShift to 3 so the value is converted to liters !","title":"Parameter MeterType"},{"location":"Parameters/#parameter-retainmessages","text":"Default Value: true Enable or disable the Retain Flag for all MQTT entries.","title":"Parameter RetainMessages"},{"location":"Parameters/#parameter-uri","text":"Default Value: mqtt://IP-ADRESS:1883 URI to the MQTT broker including the port. E.g. mqtt://192.168.1.1:1883 .","title":"Parameter Uri"},{"location":"Parameters/#parameter-password","text":"Default Value: PASSWORD Password for MQTT authentication.","title":"Parameter password"},{"location":"Parameters/#parameter-user","text":"Default Value: USERNAME Username for MQTT authentication.","title":"Parameter user"},{"location":"Parameters/#section-influxdb","text":"","title":"Section InfluxDB"},{"location":"Parameters/#parameter-database","text":"Default Value: '' Name of the InfluxDB v1 Database into which to publish the values. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter Database"},{"location":"Parameters/#parameter-measurement","text":"Default Value: undefined Name of the InfluxDB v1 Measurement to use to publish the value. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter Measurement"},{"location":"Parameters/#parameter-uri_1","text":"Default Value: undefined URI of the HTTP interface to InfluxDB v1, without trailing slash, e.g. http://192.168.1.1:8086 . Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter Uri"},{"location":"Parameters/#parameter-password_1","text":"Default Value: undefined Password for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter password"},{"location":"Parameters/#parameter-user_1","text":"Default Value: undefined Username for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter user"},{"location":"Parameters/#section-influxdbv2","text":"","title":"Section InfluxDBv2"},{"location":"Parameters/#parameter-database_1","text":"Default Value: '' Name of the InfluxDB v2 Database into which to publish the values.","title":"Parameter Database"},{"location":"Parameters/#parameter-measurement_1","text":"Default Value: undefined Name of the InfluxDB v2 Measurement to use to publish the value.","title":"Parameter Measurement"},{"location":"Parameters/#parameter-numberfieldname","text":"Default Value: undefined Fieldname for InfluxDB v2 to use for saving.","title":"Parameter <NUMBER>.fieldname"},{"location":"Parameters/#parameter-org","text":"Default Value: undefined Organisation (Org) for InfluxDB v2 authentication","title":"Parameter Org"},{"location":"Parameters/#parameter-token","text":"Default Value: undefined Token for InfluxDB v2 authentication","title":"Parameter Token"},{"location":"Parameters/#parameter-uri_2","text":"Default Value: undefined URI of the HTTP interface to InfluxDB v2, without trailing slash, e.g. http://192.168.1.1:8086 .","title":"Parameter Uri"},{"location":"Parameters/#section-gpio","text":"","title":"Section GPIO"},{"location":"Parameters/#parameter-io0","text":"Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO0 pin. Warning This pin is only usable with restrictions! It must be disabled when the camera is used. Additionally, it is used to activate Bootloader mode and must therefore be HIGH after a reset! Parameters: GPIO 0 state : One of input , input pullup , input pulldown or output . GPIO 0 use interrupt : Enable interrupt trigger GPIO 0 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 0 enable MQTT : Enable MQTT publishing/subscribing GPIO 0 enable HTTP : Enable HTTP write/read GPIO 0 name : MQTT topic name (empty = GPIO0 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO0"},{"location":"Parameters/#parameter-io1","text":"Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO1 pin. Warning This pin is by default used for the serial communication as TX pin (USB logging)! Parameters: GPIO 1 state : One of input , input pullup , input pulldown or output . GPIO 1 use interrupt : Enable interrupt trigger GPIO 1 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 1 enable MQTT : Enable MQTT publishing/subscribing GPIO 1 enable HTTP : Enable HTTP write/read GPIO 1 name : MQTT topic name (empty = GPIO1 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO1"},{"location":"Parameters/#parameter-io12","text":"Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO12 pin. Note This pin is usable without known restrictions! Parameters: GPIO 12 state : One of external-flash-ws281x , input , input pullup , input pulldown or output . GPIO 12 use interrupt : Enable interrupt trigger GPIO 12 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 12 enable MQTT : Enable MQTT publishing/subscribing GPIO 12 enable HTTP : Enable HTTP write/read GPIO 12 name : MQTT topic name (empty = GPIO12 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO12"},{"location":"Parameters/#parameter-io13","text":"Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO13 pin. Note This pin is usable without known restrictions! Parameters: GPIO 13 state : One of input , input pullup , input pulldown or output . GPIO 13 use interrupt : Enable interrupt trigger GPIO 13 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 13 enable MQTT : Enable MQTT publishing/subscribing GPIO 13 enable HTTP : Enable HTTP write/read GPIO 13 name : MQTT topic name (empty = GPIO13 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO13"},{"location":"Parameters/#parameter-io3","text":"Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO3 pin. Warning This pin is by default used for the serial communication as RX pin (USB logging)! Parameters: GPIO 3 state : One of input , input pullup , input pulldown or output . GPIO 3 use interrupt : Enable interrupt trigger GPIO 3 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 3 enable MQTT : Enable MQTT publishing/subscribing GPIO 3 enable HTTP : Enable HTTP write/read GPIO 3 name : MQTT topic name (empty = GPIO3 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO3"},{"location":"Parameters/#parameter-io4","text":"Default Value: built-in-led disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO4 pin. Warning This pin is only usable with restrictions! By default, it is used for build-in flash light (onboard LED). Parameters: GPIO 4 state : One of built-in-led , input , input pullup , input pulldown or output . GPIO 4 use interrupt : Enable interrupt trigger GPIO 4 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 4 enable MQTT : Enable MQTT publishing/subscribing GPIO 4 enable HTTP : Enable HTTP write/read GPIO 4 name : MQTT topic name (empty = GPIO4 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO4"},{"location":"Parameters/#parameter-ledcolor","text":"Default Value: 150 150 150 Color of the attached LEDs to GPIO12 in R ed, G reen B lue from 0 (full off) .. 255 (full on) (See IO12 parameter).","title":"Parameter LEDColor"},{"location":"Parameters/#parameter-lednumbers","text":"Default Value: 2 Number of LEDs on the external LED-stripe attached to GPIO12 (See IO12 parameter).","title":"Parameter LEDNumbers"},{"location":"Parameters/#parameter-ledtype","text":"Default Value: WS2812 Type of the WS2812x which is connected to GPIO12 (See IO12 parameter).","title":"Parameter LEDType"},{"location":"Parameters/#parameter-maintopicmqtt","text":"Default Value: wasserzaehler/GPIO Note This parameter is not accessible through the Web Interface Configuration Page! The GPIO Interface is prepared to report it's status and status changes as a MQTT topic. With this parameter you configure the MQTT main topic, under which the status is published. As this parameter is still experimental it can only be set manually in the config.ini itself and has not been tested in detail so far.","title":"Parameter MainTopicMQTT"},{"location":"Parameters/#section-autotimer","text":"","title":"Section AutoTimer"},{"location":"Parameters/#parameter-autostart","text":"Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Automatically start the Flow (Digitization Rounds) immediately after power up. Note Typically this is set to true . The main reasons to set it to false is when you want to trigger it manually using the REST API or MQTT-API or for debugging.","title":"Parameter AutoStart"},{"location":"Parameters/#parameter-interval","text":"Default Value: 5 Unit: Minutes Interval in which the Flow (Digitization Round) is run. If a round takes longer than this interval, the next round gets postponed until the current round completes.","title":"Parameter Interval"},{"location":"Parameters/#section-datalogging","text":"","title":"Section DataLogging"},{"location":"Parameters/#parameter-datafilesretention","text":"Default Value: 3 Unit: Days Number of days to keep the data files ( 0 = forever).","title":"Parameter DataFilesRetention"},{"location":"Parameters/#parameter-datalogactive","text":"Default Value: true Activate data logging to the SD-Card. The files will be stored in /log/data/data_YYYY-MM-DD.csv . See Data Logging for details. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter DataLogActive"},{"location":"Parameters/#section-debug","text":"","title":"Section Debug"},{"location":"Parameters/#parameter-loglevel","text":"Default Value: 1 ( ERROR ) Define the log level for the logging to the SD-Card. Available options: 1 : ERROR 2 : WARNING 3 : INFO 4 : DEBUG As higher the level, as more log messages get written to the SD-Card. Warning DEBUG or INFO might damage the SD-Card if enabled long term due to excessive writes to the SD-Card! A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter LogLevel"},{"location":"Parameters/#parameter-logfilesretention","text":"Default Value: 3 Unit: Days Number of days to keep the log files ( 0 = forever).","title":"Parameter LogfilesRetention"},{"location":"Parameters/#section-system","text":"","title":"Section System"},{"location":"Parameters/#parameter-hostname","text":"Default Value: undefined Warning This is an Expert Parameter ! Only change it if you understand what it does! Hostname for the device. It gets automatically transferred to /wlan.ini on the SD-Card at the next startup.","title":"Parameter Hostname"},{"location":"Parameters/#parameter-rssithreshold","text":"Default Value: '' WLAN Mesh Parameter: Threshold for the RSSI value to check for start switching access point in a mesh system. Possible values: -100 .. 0 ( 0 = disabled). It gets automatically transferred to /wlan.ini on the SD-Card at next startup.","title":"Parameter RSSIThreshold"},{"location":"Parameters/#parameter-setupmode","text":"Default Value: true Note This parameter is not accessible through the Web Interface Configuration Page! Set this parameter to true to stay in the Setup Mode after the next start of the device.","title":"Parameter SetupMode"},{"location":"Parameters/#parameter-timeserver","text":"Default Value: pool.ntp.org Warning This is an Expert Parameter ! Only change it if you understand what it does! Time server to synchronize system time. If it is disabled or undefined , pool.ntp.org will be used. You can also set it to the IP of your router. Many routers like Fritzboxes can act as a local NTP server. To disable NTP, you need to activate it but set the TimeServer config to be empty ( \"\" ). In such case the time always starts at 01.01.1970 after each power cycle!","title":"Parameter TimeServer"},{"location":"Parameters/#parameter-timezone","text":"Default Value: CET-1CEST,M3.5.0,M10.5.0/3 Time zone in POSIX syntax (Europe/Berlin = CET-1CEST,M3.5.0,M10.5.0/3 - incl. daylight saving) Check the table on http:///timezones.html to find the settings for your region.","title":"Parameter TimeZone"},{"location":"REST-API/","text":"REST API Various information is directly accessible over specific REST calls. To use it, just append them to the IP, separated with a / , e.g. http://192.168.1.1/json Note: For more detailed information to the REST handler, have a look to the code in the repository: registered handlers Control flow_start Trigger a flow start (if not running) Set Pre Value Set the Previous Value /setPreValue?value=1234&numbers=main where 1234 is the new value and main the name of the number to be adjusted. GPIO Control a GPIO output The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber}&Status=high /GPIO?GPIO={PinNumber}&Status=low Example: /GPIO?GPIO=12&Status=high Read a GPIO input The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber} Example: /GPIO?GPIO=12 ota ota_page.html Opens the Over-The-Air update html page reboot Trigger a reboot of the device Results json Show result in JSON syntax Example: { \"main\": { \"value\": \"521.17108\", \"raw\": \"521.17108\", \"pre\": \"521.17108\", \"error\": \"no error\", \"rate\": \"0.023780\", \"timestamp\": \"2023-01-13T16:00:42+0100\" } } value Show single result values The value entrypoint also support parameters: http:///value?all=true&type=value http:///value?all=true&type=raw http:///value?all=true&type=error http:///value?all=true&type=prevalue img_tmp/raw.jpg Capture and show a new raw image img_tmp/alg.jpg Show last aligned image img_tmp/alg_roi.jpg Show last aligned image including ROI overlay Status statusflow Show the actual step of the flow incl. timestamp Example: Take Image (15:56:34) rssi Show the WIFI signal strength (Unit: dBm) Example: -51 cpu_temperature Show the CPU temperature (Unit: \u00b0C) Example: 38 sysinfo Show system infos in JSON syntax Example: [{\"firmware\": \"\",\"buildtime\": \"2023-01-25 12:41\",\"gitbranch\": \"HEAD\",\"gittag\": \"\",\"gitrevision\": \"af13c68+\",\"html\": \"Development-Branch: HEAD (Commit: af13c68+)\",\"cputemp\": \"64\",\"hostname\": \"WaterMeterTest\",\"IPv4\": \"192.168.xxx.xxx\",\"freeHeapMem\": \"2818330\"}] starttime Show starttime Example: 20230113-154634 uptime Show uptime Example: 0d 00h 15m 50s Camera lighton Switch the camera flashlight on lightoff Switch the camera flashlight off capture Capture a new image (without flashlight) capture_with_flashlight Capture a new image with flashlight save Save a new image to SD card The save entrypoint also support parameters: http:///save?filename=test.jpg&delay=1 Logs log Last part of todays log (last 80 kBytes)) logfileact Full log of today log.html Opens the log html page Diagnostics heap print relevant memory (heap) information Example: Heap info: Heap Total: 1888926 | SPI Free: 1827431 | SPI Larg Block: 1802240 | SPI Min Free: 758155 | Int Free: 61495 | Int Larg Block: 55296 | Int Min Free: 36427","title":"REST API"},{"location":"REST-API/#rest-api","text":"Various information is directly accessible over specific REST calls. To use it, just append them to the IP, separated with a / , e.g. http://192.168.1.1/json Note: For more detailed information to the REST handler, have a look to the code in the repository: registered handlers","title":"REST API"},{"location":"REST-API/#control","text":"","title":"Control"},{"location":"REST-API/#flow_start","text":"Trigger a flow start (if not running)","title":"flow_start"},{"location":"REST-API/#set-pre-value","text":"Set the Previous Value /setPreValue?value=1234&numbers=main where 1234 is the new value and main the name of the number to be adjusted.","title":"Set Pre Value"},{"location":"REST-API/#gpio","text":"Control a GPIO output The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber}&Status=high /GPIO?GPIO={PinNumber}&Status=low Example: /GPIO?GPIO=12&Status=high Read a GPIO input The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber} Example: /GPIO?GPIO=12","title":"GPIO"},{"location":"REST-API/#ota","text":"","title":"ota"},{"location":"REST-API/#ota_pagehtml","text":"Opens the Over-The-Air update html page","title":"ota_page.html"},{"location":"REST-API/#reboot","text":"Trigger a reboot of the device","title":"reboot"},{"location":"REST-API/#results","text":"","title":"Results"},{"location":"REST-API/#json","text":"Show result in JSON syntax Example: { \"main\": { \"value\": \"521.17108\", \"raw\": \"521.17108\", \"pre\": \"521.17108\", \"error\": \"no error\", \"rate\": \"0.023780\", \"timestamp\": \"2023-01-13T16:00:42+0100\" } }","title":"json"},{"location":"REST-API/#value","text":"Show single result values The value entrypoint also support parameters: http:///value?all=true&type=value http:///value?all=true&type=raw http:///value?all=true&type=error http:///value?all=true&type=prevalue","title":"value"},{"location":"REST-API/#img_tmprawjpg","text":"Capture and show a new raw image","title":"img_tmp/raw.jpg"},{"location":"REST-API/#img_tmpalgjpg","text":"Show last aligned image","title":"img_tmp/alg.jpg"},{"location":"REST-API/#img_tmpalg_roijpg","text":"Show last aligned image including ROI overlay","title":"img_tmp/alg_roi.jpg"},{"location":"REST-API/#status","text":"","title":"Status"},{"location":"REST-API/#statusflow","text":"Show the actual step of the flow incl. timestamp Example: Take Image (15:56:34)","title":"statusflow"},{"location":"REST-API/#rssi","text":"Show the WIFI signal strength (Unit: dBm) Example: -51","title":"rssi"},{"location":"REST-API/#cpu_temperature","text":"Show the CPU temperature (Unit: \u00b0C) Example: 38","title":"cpu_temperature"},{"location":"REST-API/#sysinfo","text":"Show system infos in JSON syntax Example: [{\"firmware\": \"\",\"buildtime\": \"2023-01-25 12:41\",\"gitbranch\": \"HEAD\",\"gittag\": \"\",\"gitrevision\": \"af13c68+\",\"html\": \"Development-Branch: HEAD (Commit: af13c68+)\",\"cputemp\": \"64\",\"hostname\": \"WaterMeterTest\",\"IPv4\": \"192.168.xxx.xxx\",\"freeHeapMem\": \"2818330\"}]","title":"sysinfo"},{"location":"REST-API/#starttime","text":"Show starttime Example: 20230113-154634","title":"starttime"},{"location":"REST-API/#uptime","text":"Show uptime Example: 0d 00h 15m 50s","title":"uptime"},{"location":"REST-API/#camera","text":"","title":"Camera"},{"location":"REST-API/#lighton","text":"Switch the camera flashlight on","title":"lighton"},{"location":"REST-API/#lightoff","text":"Switch the camera flashlight off","title":"lightoff"},{"location":"REST-API/#capture","text":"Capture a new image (without flashlight)","title":"capture"},{"location":"REST-API/#capture_with_flashlight","text":"Capture a new image with flashlight","title":"capture_with_flashlight"},{"location":"REST-API/#save","text":"Save a new image to SD card The save entrypoint also support parameters: http:///save?filename=test.jpg&delay=1","title":"save"},{"location":"REST-API/#logs","text":"","title":"Logs"},{"location":"REST-API/#log","text":"Last part of todays log (last 80 kBytes))","title":"log"},{"location":"REST-API/#logfileact","text":"Full log of today","title":"logfileact"},{"location":"REST-API/#loghtml","text":"Opens the log html page","title":"log.html"},{"location":"REST-API/#diagnostics","text":"","title":"Diagnostics"},{"location":"REST-API/#heap","text":"print relevant memory (heap) information Example: Heap info: Heap Total: 1888926 | SPI Free: 1827431 | SPI Larg Block: 1802240 | SPI Min Free: 758155 | Int Free: 61495 | Int Larg Block: 55296 | Int Min Free: 36427","title":"heap"},{"location":"ROI-Configuration/","text":"ROIs (Regions of Interest) Notes You are using a neural network approach which is trained to fit as many different type of meters as possible. The accuracy will never be 100%. It is normal to see a missing reading once in a while. There are several precautions to detect this. For details see the section PostProcessing on the configuration page. The most critical components for an accurate detection are: Correct setting of the R egions O f I nterest (ROIs) for detection of the image. This must be done manually for each device/installation! Using a well trained Model. Have a look on the Digital Counters resp. Analog Needles to check if your types are contained. If your number types are not contained, you should take the effort to record them so we can add them to the training data. See Collect images to improve the models on how to collect new training data. Precondition Please make sure to have: Setup your camera properly and taken a good Reference Image . Selected good Alignment References . Define the ROIs For each digit or analog pointer, a ROI must be defined. You can even have multiple independent Numbers (eg. electerical meters mostly have 2 numbers for the high and low tariff). Depending if you have only one of those types, you can enable/disable (1) it on the top left corner: You can switch between the individual ROIs with the Drop down box (2) . If you need additional ROIs or delete them you can do this with the control at (3) . Like for the Alignment References , you can change the position, size and name of a ROI in the text fields or define them via drag and drop through the mouse button. Make sure the ROIs are in the right order, matching the significance of a digit/analog counter! Warning The order of the ROIs defines how the individual digits are combined to the total number. The first ROI is the digit with the highest order (left side), then the second and so on. You can control the order in the selector tab and change it with the buttons \"move Next\" or \"move Previous\" . In most cases digits are ordered equidistantly (have the same distance between each other) and have the same size. Bcause of this the Web Interface keeps their sises and distance the same. If you need individual sizes or distances, untick the settings (4) . In almost all cases the sizes and y values should be identical! The ratio between x and y might need adjustment. But make sure it is the same for all digits. Same for the analog counters , the sizes should be identical and the x and y as well. Note Don't forget to save the settings with \"Save\" and do not reboot at this stage. Analog Counters For analog counters the ROI setting is rather straight forward as the meter is usually quadratic with a clear center. The circle should exactly fit to the outer size of the meter and the cross should be in the middle of the pointer. Here is an example with the details for the ROI ana1 : Digits For the Digital Meters it is a little bit more complicated, as there are different options of digital models which can be choosen. Correct Size for ROI First of all, choose the right size of the ROI. The configuration of ROIs differs a bit on the selected model (see below). If you are in the initial setup, the model will be selectable in the next step. By default it is a dig-cont resp. ana-cont model. In Model Selection you find the differences between the different available models. Pick the one you think fits best your purpose. If you don't get to good result, try another model. Here we only show the different configuration of the ROIs. Digital Meters with only recognized full digits ( 0, 1, 2, 3, ... 9 ) Suggested Model: dig-class11-*.tfl Advantage: broad variety of types included in the training. Disadvantage: partially rotated numbers cannot be detected. Digital Meters with sub-digit resolution ( 0.0, 0.1, 0.2, .... 9.8, 9.9 ) Suggested Model: dig-cont-*.tfl or dig-class100-*.tfl Advantage: partial numbers can be detected and a better post processing is possible. Disadvantage: only limited types of meter types are trained due to the high effort for the training data. How to setup the digit ROIs perfectly Details and the corresponding \"perfect\" setting is explained below. For a first run you can choose the following general settings: There is an inner and an outer frame for the ROIs. Make the inner frame exactly the size of the number. Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay Setup using dig-class11 models dig-class11 - Models recognize the complete digit only . Here it is not relevant if the ROI fits the Border of the digit window. For this model, there should be a border of 20% of the image size around the number itself. This border is shown in the ROI setup image by the inner thinner rectangle. This rectangle should fit perfectly around the number when the number has not started to rotate to the next position: Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay If you have perfect alignment and still are not getting satisfying results, most probably your numbers are not part of the training data yet. See Collect images to improve the models on how to collect new training data. Setup using dig-class100 or dig-cont Models These models recognize the tenths (fractions) between the numbers. Those models require a different ROI setup; the height must be set differently and more accurately . First, the width can be set like for a dig-class11 model, i.e. 20% margin left and right. The height of the outer rectangle should be set to the upper and lower edge of the number window. To achieve this, you might need to unlock the aspect ratio: Here an example: Example 1 \u2714\ufe0f Okay \u274c Not Okay Saving Once you are done, push Save to persist your setup. A reboot is required to apply the changed configuration!","title":"ROIs (Regions of Interest)"},{"location":"ROI-Configuration/#rois-regions-of-interest","text":"Notes You are using a neural network approach which is trained to fit as many different type of meters as possible. The accuracy will never be 100%. It is normal to see a missing reading once in a while. There are several precautions to detect this. For details see the section PostProcessing on the configuration page. The most critical components for an accurate detection are: Correct setting of the R egions O f I nterest (ROIs) for detection of the image. This must be done manually for each device/installation! Using a well trained Model. Have a look on the Digital Counters resp. Analog Needles to check if your types are contained. If your number types are not contained, you should take the effort to record them so we can add them to the training data. See Collect images to improve the models on how to collect new training data.","title":"ROIs (Regions of Interest)"},{"location":"ROI-Configuration/#precondition","text":"Please make sure to have: Setup your camera properly and taken a good Reference Image . Selected good Alignment References .","title":"Precondition"},{"location":"ROI-Configuration/#define-the-rois","text":"For each digit or analog pointer, a ROI must be defined. You can even have multiple independent Numbers (eg. electerical meters mostly have 2 numbers for the high and low tariff). Depending if you have only one of those types, you can enable/disable (1) it on the top left corner: You can switch between the individual ROIs with the Drop down box (2) . If you need additional ROIs or delete them you can do this with the control at (3) . Like for the Alignment References , you can change the position, size and name of a ROI in the text fields or define them via drag and drop through the mouse button. Make sure the ROIs are in the right order, matching the significance of a digit/analog counter! Warning The order of the ROIs defines how the individual digits are combined to the total number. The first ROI is the digit with the highest order (left side), then the second and so on. You can control the order in the selector tab and change it with the buttons \"move Next\" or \"move Previous\" . In most cases digits are ordered equidistantly (have the same distance between each other) and have the same size. Bcause of this the Web Interface keeps their sises and distance the same. If you need individual sizes or distances, untick the settings (4) . In almost all cases the sizes and y values should be identical! The ratio between x and y might need adjustment. But make sure it is the same for all digits. Same for the analog counters , the sizes should be identical and the x and y as well. Note Don't forget to save the settings with \"Save\" and do not reboot at this stage.","title":"Define the ROIs"},{"location":"ROI-Configuration/#analog-counters","text":"For analog counters the ROI setting is rather straight forward as the meter is usually quadratic with a clear center. The circle should exactly fit to the outer size of the meter and the cross should be in the middle of the pointer. Here is an example with the details for the ROI ana1 :","title":"Analog Counters"},{"location":"ROI-Configuration/#digits","text":"For the Digital Meters it is a little bit more complicated, as there are different options of digital models which can be choosen.","title":"Digits"},{"location":"ROI-Configuration/#correct-size-for-roi","text":"First of all, choose the right size of the ROI. The configuration of ROIs differs a bit on the selected model (see below). If you are in the initial setup, the model will be selectable in the next step. By default it is a dig-cont resp. ana-cont model. In Model Selection you find the differences between the different available models. Pick the one you think fits best your purpose. If you don't get to good result, try another model. Here we only show the different configuration of the ROIs. Digital Meters with only recognized full digits ( 0, 1, 2, 3, ... 9 ) Suggested Model: dig-class11-*.tfl Advantage: broad variety of types included in the training. Disadvantage: partially rotated numbers cannot be detected. Digital Meters with sub-digit resolution ( 0.0, 0.1, 0.2, .... 9.8, 9.9 ) Suggested Model: dig-cont-*.tfl or dig-class100-*.tfl Advantage: partial numbers can be detected and a better post processing is possible. Disadvantage: only limited types of meter types are trained due to the high effort for the training data.","title":"Correct Size for ROI"},{"location":"ROI-Configuration/#how-to-setup-the-digit-rois-perfectly","text":"Details and the corresponding \"perfect\" setting is explained below. For a first run you can choose the following general settings: There is an inner and an outer frame for the ROIs. Make the inner frame exactly the size of the number. Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay","title":"How to setup the digit ROIs perfectly"},{"location":"ROI-Configuration/#setup-using-dig-class11-models","text":"dig-class11 - Models recognize the complete digit only . Here it is not relevant if the ROI fits the Border of the digit window. For this model, there should be a border of 20% of the image size around the number itself. This border is shown in the ROI setup image by the inner thinner rectangle. This rectangle should fit perfectly around the number when the number has not started to rotate to the next position: Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay If you have perfect alignment and still are not getting satisfying results, most probably your numbers are not part of the training data yet. See Collect images to improve the models on how to collect new training data.","title":"Setup using dig-class11 models"},{"location":"ROI-Configuration/#setup-using-dig-class100-or-dig-cont-models","text":"These models recognize the tenths (fractions) between the numbers. Those models require a different ROI setup; the height must be set differently and more accurately . First, the width can be set like for a dig-class11 model, i.e. 20% margin left and right. The height of the outer rectangle should be set to the upper and lower edge of the number window. To achieve this, you might need to unlock the aspect ratio: Here an example: Example 1 \u2714\ufe0f Okay \u274c Not Okay","title":"Setup using dig-class100 or dig-cont Models"},{"location":"ROI-Configuration/#saving","text":"Once you are done, push Save to persist your setup. A reboot is required to apply the changed configuration!","title":"Saving"},{"location":"Reference-Image/","text":"Reference Image Note The Reference Image is the basis for the coordinate system of the ROIs. Therefore it is very important, to have a well aligned image, that is not rotated. At first an example image is shown. To define a new reference image push the button \"Create new Reference\" (2) and afterwards \"Take Image\" (2) . It might take some seconds for processing, then your actual camera image should be shown. Then play with the provided parameters to get a good result. Focus This is the first time, where you have access to the camera image. It most likely is out of focus and not sharp! Ensure a sharp image of the camera by adjusting the focal length of the ESP OV2640 camera. Note Try to adjust the focus for the clearest possible image! In order to use it for reading a meter, the focal-length of the OV2640 camera has to be manipulated. By default it only results in sharp image for distance bigger than around ~40cm which is not ideal for our purpose. Therefore you need to remove the fixing glue of the OV2640 lens with a sharp knife. After this you can rotate the lens in and out. Rotating it by about a quarter of a turn counterclockwise results in a focus plane shift of about 10cm. You need to figure out your best setting with a little bit of trial and error for your specific environment. Error Be very carefully when rotating the lens. Best is to held the camera itself with one hand or a plier and rotate the lens with the other hand. Make sure not to rotate the whole camera as this can damage the ribbon cable! Warning This modification will void any warranty, as the sealing of the lens objective is broken! Warning This modification will render the camera unsuitable for general, web-cam type applications unless the focal length is changed back to the original setting. Correct Horizontal Alignment Ensure an exact horizontal alignment of the number: \u2714\ufe0f Okay \u274c Not Okay Warning Updating the reference image also means that all alignment images and ROIs needs to be configured again. Therefore do this step later only with caution. If everything is done, you can save the result with \"Update Reference Image\" (4) . Note A reboot is not required at this point of time. As next you should update the Alignment References . Dealing with Reflections Reflections can be caused by the flash LED and make it hard to provide a reliable detection. There are various ways to deal with them: Attach a diffusor in front of the LED, eg. a filt (Filz) or parchment paper. Also white paper can do the job. Rotate the ESP-CAM so the LED is on another place. Reduce the LED intensity. Use external LED stripes, eg WS2812x .","title":"Reference Image"},{"location":"Reference-Image/#reference-image","text":"Note The Reference Image is the basis for the coordinate system of the ROIs. Therefore it is very important, to have a well aligned image, that is not rotated. At first an example image is shown. To define a new reference image push the button \"Create new Reference\" (2) and afterwards \"Take Image\" (2) . It might take some seconds for processing, then your actual camera image should be shown. Then play with the provided parameters to get a good result.","title":"Reference Image"},{"location":"Reference-Image/#focus","text":"This is the first time, where you have access to the camera image. It most likely is out of focus and not sharp! Ensure a sharp image of the camera by adjusting the focal length of the ESP OV2640 camera. Note Try to adjust the focus for the clearest possible image! In order to use it for reading a meter, the focal-length of the OV2640 camera has to be manipulated. By default it only results in sharp image for distance bigger than around ~40cm which is not ideal for our purpose. Therefore you need to remove the fixing glue of the OV2640 lens with a sharp knife. After this you can rotate the lens in and out. Rotating it by about a quarter of a turn counterclockwise results in a focus plane shift of about 10cm. You need to figure out your best setting with a little bit of trial and error for your specific environment. Error Be very carefully when rotating the lens. Best is to held the camera itself with one hand or a plier and rotate the lens with the other hand. Make sure not to rotate the whole camera as this can damage the ribbon cable! Warning This modification will void any warranty, as the sealing of the lens objective is broken! Warning This modification will render the camera unsuitable for general, web-cam type applications unless the focal length is changed back to the original setting.","title":"Focus"},{"location":"Reference-Image/#correct-horizontal-alignment","text":"Ensure an exact horizontal alignment of the number: \u2714\ufe0f Okay \u274c Not Okay Warning Updating the reference image also means that all alignment images and ROIs needs to be configured again. Therefore do this step later only with caution. If everything is done, you can save the result with \"Update Reference Image\" (4) . Note A reboot is not required at this point of time. As next you should update the Alignment References .","title":"Correct Horizontal Alignment"},{"location":"Reference-Image/#dealing-with-reflections","text":"Reflections can be caused by the flash LED and make it hard to provide a reliable detection. There are various ways to deal with them: Attach a diffusor in front of the LED, eg. a filt (Filz) or parchment paper. Also white paper can do the job. Rotate the ESP-CAM so the LED is on another place. Reduce the LED intensity. Use external LED stripes, eg WS2812x .","title":"Dealing with Reflections"},{"location":"Release-creation/","text":"Preparing for Release Changelog is merged back from master branch to rolling branch (should be the last step of the previous release creation) All changes are documented in the Changelog in rolling branch Release creation steps Merge rolling into master branch Best to wait for the GitHub action to run successfully On master branch tag the version like v11.3.1 and don't forget to push it: git checkout master git pull git tag v14.0.0 git push --tags Wait for the GitHub-Action of release creation. After all is done: the release should be created the artifacts are downloadable from release The documented changes were applied to the release Merge master back in rolling Check that the Web Installer shows the right version","title":"Preparing for Release"},{"location":"Release-creation/#preparing-for-release","text":"Changelog is merged back from master branch to rolling branch (should be the last step of the previous release creation) All changes are documented in the Changelog in rolling branch","title":"Preparing for Release"},{"location":"Release-creation/#release-creation-steps","text":"Merge rolling into master branch Best to wait for the GitHub action to run successfully On master branch tag the version like v11.3.1 and don't forget to push it: git checkout master git pull git tag v14.0.0 git push --tags Wait for the GitHub-Action of release creation. After all is done: the release should be created the artifacts are downloadable from release The documented changes were applied to the release Merge master back in rolling Check that the Web Installer shows the right version","title":"Release creation steps"},{"location":"StatusLED_BlinkCodes/","text":"This page lists possible blink codes of the red LED located on the ESP32-CAM board, their meaning and possible solutions. The effective error codes can be found here . TODO!!! Error Those errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue! 0x00000001 PSRAM bad Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM! Status Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it. 0x00000100 Cam Framebuffer bad The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help. 0x00000200 NTP failed The firmware failed to get the world time from an NTP server. The firmware will continue to work, but has a wrong time.","title":"StatusLED BlinkCodes"},{"location":"StatusLED_BlinkCodes/#error","text":"Those errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue!","title":"Error"},{"location":"StatusLED_BlinkCodes/#0x00000001-psram-bad","text":"Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM!","title":"0x00000001 PSRAM bad"},{"location":"StatusLED_BlinkCodes/#status","text":"Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it.","title":"Status"},{"location":"StatusLED_BlinkCodes/#0x00000100-cam-framebuffer-bad","text":"The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help.","title":"0x00000100 Cam Framebuffer bad"},{"location":"StatusLED_BlinkCodes/#0x00000200-ntp-failed","text":"The firmware failed to get the world time from an NTP server. The firmware will continue to work, but has a wrong time.","title":"0x00000200 NTP failed"},{"location":"Testing/","text":"Testing Option for VSCode You can test your functions directly on the device. Structure All tests are under directory \"test\" in the project and not compiled with default build option of platformio. The main function is in file test_suite_controlflow.cpp . In method app_main() you can add your own tests. Include my my own test In method app_main() of test_suite_controlflow.cpp you can add your own tests. Include your test-file in the top like #include \"components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp\" components is a subfolder of tests here. Not the components directory of root source. In the bottom add your test function. RUN_TEST(testNegative); Your test function should have a TEST_ASSERT_EQUAL_* . For more information look at unity-testing . Run tests You will need a testing device. best with usb adapter. Before you upload your tests you will need to setup the device with initial setup procedure described in [[Installation]] Now you can use Visual Studio Code or a standard console to upload the test code. In VS Code (tab platformio) open Advanced and select Test . Alternatively you can run it in console/terminal with platformio test --environment esp32cam . In my environment the serial terminal not opens. I have to do it for myself. You will see much logging. If any test fails it logs it out. Else it logs all test passed in the end. Troubleshooting If you test very much cases in one function, the device runs in Stack Overflow and an endless boot. Reduce the count of test cases or split the test function in multiple functions.","title":"Testing"},{"location":"Testing/#testing-option-for-vscode","text":"You can test your functions directly on the device.","title":"Testing Option for VSCode"},{"location":"Testing/#structure","text":"All tests are under directory \"test\" in the project and not compiled with default build option of platformio. The main function is in file test_suite_controlflow.cpp . In method app_main() you can add your own tests.","title":"Structure"},{"location":"Testing/#include-my-my-own-test","text":"In method app_main() of test_suite_controlflow.cpp you can add your own tests. Include your test-file in the top like #include \"components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp\" components is a subfolder of tests here. Not the components directory of root source. In the bottom add your test function. RUN_TEST(testNegative); Your test function should have a TEST_ASSERT_EQUAL_* . For more information look at unity-testing .","title":"Include my my own test"},{"location":"Testing/#run-tests","text":"You will need a testing device. best with usb adapter. Before you upload your tests you will need to setup the device with initial setup procedure described in [[Installation]] Now you can use Visual Studio Code or a standard console to upload the test code. In VS Code (tab platformio) open Advanced and select Test . Alternatively you can run it in console/terminal with platformio test --environment esp32cam . In my environment the serial terminal not opens. I have to do it for myself. You will see much logging. If any test fails it logs it out. Else it logs all test passed in the end.","title":"Run tests"},{"location":"Testing/#troubleshooting","text":"If you test very much cases in one function, the device runs in Stack Overflow and an endless boot. Reduce the count of test cases or split the test function in multiple functions.","title":"Troubleshooting"},{"location":"Upload-files-by-script/","text":"Scripted File Upload To upload a file e.g. using curl , you first have to delete it and then upload it: curl -d '' http://192.168.1.153/delete/html/index.html curl --data-binary @ota_page.html http://192.168.1.153/upload/html/index.html","title":"Scripted File Upload"},{"location":"Upload-files-by-script/#scripted-file-upload","text":"To upload a file e.g. using curl , you first have to delete it and then upload it: curl -d '' http://192.168.1.153/delete/html/index.html curl --data-binary @ota_page.html http://192.168.1.153/upload/html/index.html","title":"Scripted File Upload"},{"location":"Watermeter-specific-analog---digital-transition/","text":"Analog/Digital Transition on Water Meters At first, for the most water meters the default configuration should be work. But the digit, especially the last digit differs in some devices. \"Normal\" transition In most cases, the transition of the last digit starts when the analogue pointer is > 9. Often the last digit \"hangs\" a bit on this devices and comes not over zero. So it is not easy to see which digit is correct. In the first example 4 or still 3? (3 is correct). Early transition Some units start the transition very early or run with the analogue pointer. In the third example, is it a 3 or a 2? Inaccuracies in image recognition The models for image recognition are good, but have inaccuracies in the range +/- 0.2. In order to obtain as many correct results as possible, a treatment is carried out in the post process in the range of 9.8-0.2 for the analogue pointer, which must start differently depending on the type of counter. How to configure for my meter type If you have a devices with \"normal\" transition you should not have any issues. On devices with \"early\" transition, you can set the option AnalogDigitalTransitionStart to a value between 6 and 8.","title":"Analog/Digital Transition on Water Meters"},{"location":"Watermeter-specific-analog---digital-transition/#analogdigital-transition-on-water-meters","text":"At first, for the most water meters the default configuration should be work. But the digit, especially the last digit differs in some devices.","title":"Analog/Digital Transition on Water Meters"},{"location":"Watermeter-specific-analog---digital-transition/#normal-transition","text":"In most cases, the transition of the last digit starts when the analogue pointer is > 9. Often the last digit \"hangs\" a bit on this devices and comes not over zero. So it is not easy to see which digit is correct. In the first example 4 or still 3? (3 is correct).","title":"\"Normal\" transition"},{"location":"Watermeter-specific-analog---digital-transition/#early-transition","text":"Some units start the transition very early or run with the analogue pointer. In the third example, is it a 3 or a 2?","title":"Early transition"},{"location":"Watermeter-specific-analog---digital-transition/#inaccuracies-in-image-recognition","text":"The models for image recognition are good, but have inaccuracies in the range +/- 0.2. In order to obtain as many correct results as possible, a treatment is carried out in the post process in the range of 9.8-0.2 for the analogue pointer, which must start differently depending on the type of counter.","title":"Inaccuracies in image recognition"},{"location":"Watermeter-specific-analog---digital-transition/#how-to-configure-for-my-meter-type","text":"If you have a devices with \"normal\" transition you should not have any issues. On devices with \"early\" transition, you can set the option AnalogDigitalTransitionStart to a value between 6 and 8.","title":"How to configure for my meter type"},{"location":"collect-new-images/","text":"Collect images to improve the models If your device has new, different digits or pointers it might be that the existing models don't recognize them well. In such case you can collect your images and so we can train the model better. This helps you and also others as the models get more accurate. Adding more images also helps if you have a model that is already known, but the neural models do not produce good results. Experienced users can do the training also by themselves, see Learn a model with your own images . Before you start Before you go ahead, please check if your digits/pointers are not yet contained in the training data. A visual overview is available at digits resp. pointers . Poor recognition is often caused by blurred images, low contrast or incorrect setting of the ROIs. Therefore, check these possibilities first, as additional training will bring little improvement here. See ROI Configuration for details. Collecting images The neural network is trained based on a set of images that have already been collected over time. If your digits are included or at least very similar to included images, the chance is very high that the neural network is working fine for you as well. The neural network configuration is stored in the TensorFlow Lite format as *.tfl or *.tflite in the /config directory on the SD card. A model can be updated (or a new one added) by uploading the new file and activating it on the configuration page or in the config file /config/config.ini . In order to incorporate new digits a training set of images is required. The training images needs to be collected in the final setup with the help of the Digits or Analog log settings (not to be confused with the Data or Debug log). Enable the logging of the images on the configuration page or in the config file /config/config.ini : Now be patient! You have to wait until it has collected an image of each digit of every type. They wil lbe placed on the SD card in the folder /log/digit/ resp. /log/analog/ . After some days, there will be a lot of images, many of them very similar. Because of this, it is important to select only a subset of them for the model training. The tools shown below can help you with that. Collecting images for dig-class100/dig-cont/ana-class100 For digits use Collectmeterdigits resp. for pointers use collectmeteranalog to fetch the images from the device and select a subset of them. Please read the detailed instructions on the mentioned links for details! If the fetching of the images is too slow for you, a faster way to get the images to your PC is to remove the SD-card from the ESP32 module and insert it into the card reader of yur PC. Then search for two..three images of each digit ( not more! :-) ). You will have to make sure to label the images yourself matching the effective value they are supposed to show. Share your images In most cases we will integrate your images in the training dataset of the models. Only if we fear a degradation of the models or you need a different behavior, we might not include the data in the standard models (see at bottom of page for reasons). To provide your images to us for training the model, open an Github Issue and append the zipped images ito it. Images can be rejected if You provide too many images. More than 1000 images of your device are really to much. Images which are not good enough (see ROI Configuration ) will be rejected. It would reduce the accuracy of the networks. Images with too little focus will be rejected. Images with too much blur are rejected. Our models are to small to recognize everything in any quality. So we use only images of medium or good quality.","title":"Collect images to improve the models"},{"location":"collect-new-images/#collect-images-to-improve-the-models","text":"If your device has new, different digits or pointers it might be that the existing models don't recognize them well. In such case you can collect your images and so we can train the model better. This helps you and also others as the models get more accurate. Adding more images also helps if you have a model that is already known, but the neural models do not produce good results. Experienced users can do the training also by themselves, see Learn a model with your own images .","title":"Collect images to improve the models"},{"location":"collect-new-images/#before-you-start","text":"Before you go ahead, please check if your digits/pointers are not yet contained in the training data. A visual overview is available at digits resp. pointers . Poor recognition is often caused by blurred images, low contrast or incorrect setting of the ROIs. Therefore, check these possibilities first, as additional training will bring little improvement here. See ROI Configuration for details.","title":"Before you start"},{"location":"collect-new-images/#collecting-images","text":"The neural network is trained based on a set of images that have already been collected over time. If your digits are included or at least very similar to included images, the chance is very high that the neural network is working fine for you as well. The neural network configuration is stored in the TensorFlow Lite format as *.tfl or *.tflite in the /config directory on the SD card. A model can be updated (or a new one added) by uploading the new file and activating it on the configuration page or in the config file /config/config.ini . In order to incorporate new digits a training set of images is required. The training images needs to be collected in the final setup with the help of the Digits or Analog log settings (not to be confused with the Data or Debug log). Enable the logging of the images on the configuration page or in the config file /config/config.ini : Now be patient! You have to wait until it has collected an image of each digit of every type. They wil lbe placed on the SD card in the folder /log/digit/ resp. /log/analog/ . After some days, there will be a lot of images, many of them very similar. Because of this, it is important to select only a subset of them for the model training. The tools shown below can help you with that.","title":"Collecting images"},{"location":"collect-new-images/#collecting-images-for-dig-class100dig-contana-class100","text":"For digits use Collectmeterdigits resp. for pointers use collectmeteranalog to fetch the images from the device and select a subset of them. Please read the detailed instructions on the mentioned links for details! If the fetching of the images is too slow for you, a faster way to get the images to your PC is to remove the SD-card from the ESP32 module and insert it into the card reader of yur PC. Then search for two..three images of each digit ( not more! :-) ). You will have to make sure to label the images yourself matching the effective value they are supposed to show.","title":"Collecting images for dig-class100/dig-cont/ana-class100"},{"location":"collect-new-images/#share-your-images","text":"In most cases we will integrate your images in the training dataset of the models. Only if we fear a degradation of the models or you need a different behavior, we might not include the data in the standard models (see at bottom of page for reasons). To provide your images to us for training the model, open an Github Issue and append the zipped images ito it.","title":"Share your images"},{"location":"collect-new-images/#images-can-be-rejected-if","text":"You provide too many images. More than 1000 images of your device are really to much. Images which are not good enough (see ROI Configuration ) will be rejected. It would reduce the accuracy of the networks. Images with too little focus will be rejected. Images with too much blur are rejected. Our models are to small to recognize everything in any quality. So we use only images of medium or good quality.","title":"Images can be rejected if"},{"location":"data-logging/","text":"Data Logging When Data Logging is enabled (See parameter DataLogActive ), the results of every round gets written to the SD-Card. The data files are stored in /log/data on the SD-Card. Data Format The data is stored as CSV with the following columns: time , name-of-number , raw-value , return-value , pre-value , change-rate , change-absolute , error-text , cnn-digital , cnn-analog","title":"Data Logging"},{"location":"data-logging/#data-logging","text":"When Data Logging is enabled (See parameter DataLogActive ), the results of every round gets written to the SD-Card. The data files are stored in /log/data on the SD-Card.","title":"Data Logging"},{"location":"data-logging/#data-format","text":"The data is stored as CSV with the following columns: time , name-of-number , raw-value , return-value , pre-value , change-rate , change-absolute , error-text , cnn-digital , cnn-analog","title":"Data Format"},{"location":"initial-setup/","text":"Initial Setup After setting up the device (firmware, SD card, WLAN) the device will connect to the wifi access point and start in an initial setup configuration: With the buttons on the top you can navigate through 5 steps which guide you through the necessary setup: Create the Reference Image . It is the base for the position referencing and the identification of the digits and counters. Define two unique Reference Marks . They is used to align the individual camera images and identify the absolut positions. Define ROIs for the Digits. They will be used to digitize the digit part of your meter. If your meter has no digits, this step can be skipped. Define ROIs for the Analog Counters. (Only required in case your meter has analoge counters) General Settings . Further configuration of your device. All settings can be accessed also later in the normal operation mode. Note Don' t forget to save each step with \"Save\" and do not reboot at this stage. Finish the Setup and change to the Normal Operation mode With the last step (1) you leave the Setup Mode and reboot to the Normal Operation mode . Access to the Setup Pages in the Normal Operation mode You always can access all the settings during the normal operation mode via the Settings menu: (1) Access to the General Settings . (2) Update of the Reference Image . (3) Update of the Alignment Marks . (4)/(5) Update of the ROIs .","title":"Initial Setup"},{"location":"initial-setup/#initial-setup","text":"After setting up the device (firmware, SD card, WLAN) the device will connect to the wifi access point and start in an initial setup configuration: With the buttons on the top you can navigate through 5 steps which guide you through the necessary setup: Create the Reference Image . It is the base for the position referencing and the identification of the digits and counters. Define two unique Reference Marks . They is used to align the individual camera images and identify the absolut positions. Define ROIs for the Digits. They will be used to digitize the digit part of your meter. If your meter has no digits, this step can be skipped. Define ROIs for the Analog Counters. (Only required in case your meter has analoge counters) General Settings . Further configuration of your device. All settings can be accessed also later in the normal operation mode. Note Don' t forget to save each step with \"Save\" and do not reboot at this stage.","title":"Initial Setup"},{"location":"initial-setup/#finish-the-setup-and-change-to-the-normal-operation-mode","text":"With the last step (1) you leave the Setup Mode and reboot to the Normal Operation mode .","title":"Finish the Setup and change to the Normal Operation mode"},{"location":"initial-setup/#access-to-the-setup-pages-in-the-normal-operation-mode","text":"You always can access all the settings during the normal operation mode via the Settings menu: (1) Access to the General Settings . (2) Update of the Reference Image . (3) Update of the Alignment Marks . (4)/(5) Update of the ROIs .","title":"Access to the Setup Pages in the Normal Operation mode"},{"location":"ota/","text":"Over-The-Air (OTA) Update You can do an OTA (over-the-air) update via the Web Interface. Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please inform yourself on Living on the Edge first! Update Procedure Create a backup of your configuration. Either use the Backup/Restore function of your device for this (menu System > Backup/Restore ) or back the files manually up using the File Server (menu File Server , folder config ). It is recommended to at least save the config file config.ini ! Head to the menu System > OTA Update and follow the instructions there. If you do an update between major versions, it might be needed to modify the config file config.ini as it's syntax or context has changed. To do so, go to the menu Settings > Configuration (after the update completed and the device restarted) and check if it warns you about an unset parameter. Update from version v12.0.0 or newer You can use the over the air update mechanism, which uploads the update via a ZIP files. The update file is located on the release page . Please choose the zip file with the following naming: AI-on-the-edge-device__update__*.zip Go to the menu System --> OTA Update and follow the instructions there. After a final automatic reboot you should have the new version running. Update from version older than v12.0.0 If you update from an version older than 12.0.1, you should firstly update to version 12.0.1. Background are not fully backward compatible changes in the config.ini , that are taken care of in this version. \u203c\ufe0f Make sure to read the instructions below carefully! Backup your configuration (use the System -> Backup/Restore page)! Upload and update the update-*.zip file from the release 12.0.1 see here . Let it restart and check on the System -> Info page that the Firmware as well as the Web UI got updated. If only one got updated, redo the update. If it fails several times, you also can update the Firmware and the Web UI separately. Safe way: Update first the firmware.bin (extract it from one of the provided zip files) and do the Reboot Update with the full zip file ( update-*.zip , ignore the version warning after the reboot) Please go to Settings -> Configuration and address the changed parameters: DataLogging (storing the values for data graph) Debug (extended by different debug reporting levels) Make sure it starts to do the digitalization (check the Error field on the overview page). If it does not start a round within a minute, restart the device. \u203c\ufe0f If the system is working now without any issues, please open the configuration editor once and save the config.ini . This will update the file to the newest content \u203c\ufe0f Now you can safely update to the newest version.","title":"Over-The-Air (OTA) Update"},{"location":"ota/#over-the-air-ota-update","text":"You can do an OTA (over-the-air) update via the Web Interface. Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please inform yourself on Living on the Edge first!","title":"Over-The-Air (OTA) Update"},{"location":"ota/#update-procedure","text":"Create a backup of your configuration. Either use the Backup/Restore function of your device for this (menu System > Backup/Restore ) or back the files manually up using the File Server (menu File Server , folder config ). It is recommended to at least save the config file config.ini ! Head to the menu System > OTA Update and follow the instructions there. If you do an update between major versions, it might be needed to modify the config file config.ini as it's syntax or context has changed. To do so, go to the menu Settings > Configuration (after the update completed and the device restarted) and check if it warns you about an unset parameter.","title":"Update Procedure"},{"location":"ota/#update-from-version-v1200-or-newer","text":"You can use the over the air update mechanism, which uploads the update via a ZIP files. The update file is located on the release page . Please choose the zip file with the following naming: AI-on-the-edge-device__update__*.zip Go to the menu System --> OTA Update and follow the instructions there. After a final automatic reboot you should have the new version running.","title":"Update from version v12.0.0 or newer"},{"location":"ota/#update-from-version-older-than-v1200","text":"If you update from an version older than 12.0.1, you should firstly update to version 12.0.1. Background are not fully backward compatible changes in the config.ini , that are taken care of in this version. \u203c\ufe0f Make sure to read the instructions below carefully! Backup your configuration (use the System -> Backup/Restore page)! Upload and update the update-*.zip file from the release 12.0.1 see here . Let it restart and check on the System -> Info page that the Firmware as well as the Web UI got updated. If only one got updated, redo the update. If it fails several times, you also can update the Firmware and the Web UI separately. Safe way: Update first the firmware.bin (extract it from one of the provided zip files) and do the Reboot Update with the full zip file ( update-*.zip , ignore the version warning after the reboot) Please go to Settings -> Configuration and address the changed parameters: DataLogging (storing the values for data graph) Debug (extended by different debug reporting levels) Make sure it starts to do the digitalization (check the Error field on the overview page). If it does not start a round within a minute, restart the device. \u203c\ufe0f If the system is working now without any issues, please open the configuration editor once and save the config.ini . This will update the file to the newest content \u203c\ufe0f Now you can safely update to the newest version.","title":"Update from version older than v12.0.0"},{"location":"outdated--Integrated-Functions/","text":"Integrated Functions Warning This page no longer is maintained! wasserzaehler http://IP-ESP32/wasserzaehler.html This is the main purpose of this device. It returns the converted image as a number with different option. The output can be modified either by the configuration parameters or by HTML parameters. Details can be found here: tbd Picture Server http://IP-ESP32/capture http://IP-ESP32/capture_with_flashlight This is a implementation of the camera interface of https://github.com/jomjol/water-meter-picture-provider It is fully compatible including the parameters ( quality =..., size=... ) . This allows to use this ESP32 system in parallel to the corresponding docker system: https://github.com/jomjol/water-meter-system-complete, from which this project is basically the successor. File server Access: http://IP-ESP32/fileserver/ Simple file server, that allows viewing, upload, download and deleting of single files of the SD-card content. The usage is self explaining. The file path or file can directly be accessed by the URL after file server. Example for config.ini : http://IP-ESP/fileserver/config/config.ini OTA-Update http://IP-ESP32/ota?file=firmware.bin Here an over the air update can be triggered. The firmware file is expected to be located in the sub directory /firmware/ and can be uploaded with the file server. By the parameter file the name of the firmware file needs to be given. Reboot http://IP-ESP32/reboot A reboot with a delay of 5 seconds is initiated, e.g. after firmware update. ATTENTION : currently this is not working properly - hardware power off is needed instead. Work in progress! Simple Web Server If none of the above URLs are fitting, a very simple web server checks, if there is a fitting file from the sub directory /html This can be used for a very simple web server for information or simple web pages.","title":"Integrated Functions"},{"location":"outdated--Integrated-Functions/#integrated-functions","text":"Warning This page no longer is maintained!","title":"Integrated Functions"},{"location":"outdated--Integrated-Functions/#wasserzaehler","text":"http://IP-ESP32/wasserzaehler.html This is the main purpose of this device. It returns the converted image as a number with different option. The output can be modified either by the configuration parameters or by HTML parameters. Details can be found here: tbd","title":"wasserzaehler"},{"location":"outdated--Integrated-Functions/#picture-server","text":"http://IP-ESP32/capture http://IP-ESP32/capture_with_flashlight This is a implementation of the camera interface of https://github.com/jomjol/water-meter-picture-provider It is fully compatible including the parameters ( quality =..., size=... ) . This allows to use this ESP32 system in parallel to the corresponding docker system: https://github.com/jomjol/water-meter-system-complete, from which this project is basically the successor.","title":"Picture Server"},{"location":"outdated--Integrated-Functions/#file-server","text":"Access: http://IP-ESP32/fileserver/ Simple file server, that allows viewing, upload, download and deleting of single files of the SD-card content. The usage is self explaining. The file path or file can directly be accessed by the URL after file server. Example for config.ini : http://IP-ESP/fileserver/config/config.ini","title":"File server"},{"location":"outdated--Integrated-Functions/#ota-update","text":"http://IP-ESP32/ota?file=firmware.bin Here an over the air update can be triggered. The firmware file is expected to be located in the sub directory /firmware/ and can be uploaded with the file server. By the parameter file the name of the firmware file needs to be given.","title":"OTA-Update"},{"location":"outdated--Integrated-Functions/#reboot","text":"http://IP-ESP32/reboot A reboot with a delay of 5 seconds is initiated, e.g. after firmware update. ATTENTION : currently this is not working properly - hardware power off is needed instead. Work in progress!","title":"Reboot"},{"location":"outdated--Integrated-Functions/#simple-web-server","text":"If none of the above URLs are fitting, a very simple web server checks, if there is a fitting file from the sub directory /html This can be used for a very simple web server for information or simple web pages.","title":"Simple Web Server"},{"location":"rolling-installation/","text":"Living on the Edge The Github repository contains multiple branches: The master branch contains the same firmware version as provided on the release page . The rolling branch contains the latest version of the Firmware and the Web Interface. It might already contain a fix for your issue. But it is work in progress, don't expect it to work stable or be an improvement for your AI-on-the-edge-device! Also it might break the OTA Update and thus require manual flashing over USB! Any other branch is used to develop a feature or fix, only use them when you know what it is about! I still want to try it Ok, then grab the latest rolling build from Github Actions Page and proceed as following: Pick the most top successful (green) build: Scroll down and download the AI-on-the-edge-device__update__*.zip : Flash the zip file using the OTA Update page of your device.","title":"Living on the Edge"},{"location":"rolling-installation/#living-on-the-edge","text":"The Github repository contains multiple branches: The master branch contains the same firmware version as provided on the release page . The rolling branch contains the latest version of the Firmware and the Web Interface. It might already contain a fix for your issue. But it is work in progress, don't expect it to work stable or be an improvement for your AI-on-the-edge-device! Also it might break the OTA Update and thus require manual flashing over USB! Any other branch is used to develop a feature or fix, only use them when you know what it is about!","title":"Living on the Edge"},{"location":"rolling-installation/#i-still-want-to-try-it","text":"Ok, then grab the latest rolling build from Github Actions Page and proceed as following: Pick the most top successful (green) build: Scroll down and download the AI-on-the-edge-device__update__*.zip : Flash the zip file using the OTA Update page of your device.","title":"I still want to try it"}]}
\ No newline at end of file
+{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome Welcome to the AI-on-the-edge-device project! This is the documentation. For the source code, please head to github.com/jomjol/AI-on-the-edge-device . Artificial intelligence based systems have been established in our everyday lives. Just think of speech or image recognition. Most of the systems rely on either powerful processors or a direct connection to the cloud for doing the calculations up there. With the increasing power of modern processors the AI systems are coming closer to the end user - which is usually called edge computing . Here this edge computing is brought into a practice-oriented example, where a AI network is implemented on a ESP32 device so: AI on the edge . Key features Tensorflow Lite (TFlite) integration - including easy to use wrapper Inline image processing (feature detection, alignment, ROI extraction) Small and cheap device (3x4.5x2 cm\u00b3, < 10 EUR) Camera and illumination integrated Web surface to administrate and control OTA-Interface to update directly through the web interface Full integration into Home Assistant Support for Influx DB 1 MQTT REST API Idea Hardware Web interface Configuration Interface Have fun in studying the new possibilities and ideas This is about image recognition and digitalization, done totally on a cheap ESP32 board using artificial intelligence in form of convolutional neural networks (CNN). Everything, from image capture (OV2640), image preprocessing (auto alignment, ROI identification) all the way down to the image recognition (CNN structure) and result plausibility is done on a cheap 10 EUR device. This all is integrated in an easy to do setup and use environment, taking care for all the background processing and handling, including regular job scheduler. The user interface is an integrated web server, that can be easily adjusted and offers the data as an API in different options. The task to be demonstrated here is an automated readout of an analog water meter. The water consumption is to be recorded within a house automatization and the water meter is totally analog without any electronic interface. Therefore, the task is solved by regularly taking an image of the water meter and digitizing the reading. There are two types of CNN implemented, a classification network for reading the digital numbers and a single output network for digitalize the analog pointers for the sub digit readings. This project is an evolution of the water-meter-system-complete , which uses ESP32-CAM just for taking the image and a 1GB-Docker image to run the neural network's backbone. Here everything is integrated in an ESP32-CAM module with 8MB of RAM and a SD card as data storage.","title":"Welcome"},{"location":"#welcome","text":"Welcome to the AI-on-the-edge-device project! This is the documentation. For the source code, please head to github.com/jomjol/AI-on-the-edge-device . Artificial intelligence based systems have been established in our everyday lives. Just think of speech or image recognition. Most of the systems rely on either powerful processors or a direct connection to the cloud for doing the calculations up there. With the increasing power of modern processors the AI systems are coming closer to the end user - which is usually called edge computing . Here this edge computing is brought into a practice-oriented example, where a AI network is implemented on a ESP32 device so: AI on the edge .","title":"Welcome"},{"location":"#key-features","text":"Tensorflow Lite (TFlite) integration - including easy to use wrapper Inline image processing (feature detection, alignment, ROI extraction) Small and cheap device (3x4.5x2 cm\u00b3, < 10 EUR) Camera and illumination integrated Web surface to administrate and control OTA-Interface to update directly through the web interface Full integration into Home Assistant Support for Influx DB 1 MQTT REST API","title":"Key features"},{"location":"#idea","text":"","title":"Idea"},{"location":"#hardware","text":"","title":"Hardware"},{"location":"#web-interface","text":"","title":"Web interface"},{"location":"#configuration-interface","text":"Have fun in studying the new possibilities and ideas This is about image recognition and digitalization, done totally on a cheap ESP32 board using artificial intelligence in form of convolutional neural networks (CNN). Everything, from image capture (OV2640), image preprocessing (auto alignment, ROI identification) all the way down to the image recognition (CNN structure) and result plausibility is done on a cheap 10 EUR device. This all is integrated in an easy to do setup and use environment, taking care for all the background processing and handling, including regular job scheduler. The user interface is an integrated web server, that can be easily adjusted and offers the data as an API in different options. The task to be demonstrated here is an automated readout of an analog water meter. The water consumption is to be recorded within a house automatization and the water meter is totally analog without any electronic interface. Therefore, the task is solved by regularly taking an image of the water meter and digitizing the reading. There are two types of CNN implemented, a classification network for reading the digital numbers and a single output network for digitalize the analog pointers for the sub digit readings. This project is an evolution of the water-meter-system-complete , which uses ESP32-CAM just for taking the image and a 1GB-Docker image to run the neural network's backbone. Here everything is integrated in an ESP32-CAM module with 8MB of RAM and a SD card as data storage.","title":"Configuration Interface"},{"location":"Additional-Information/","text":"The following links point to additional information in other repos: Digits Training and using a neural network to readout the value of a digital counter Training the CNN neural network Analog Training and using a neural network to read out the value of an analog display Training the CNN neural network","title":"Additional Information"},{"location":"Additional-Information/#digits","text":"Training and using a neural network to readout the value of a digital counter Training the CNN neural network","title":"Digits"},{"location":"Additional-Information/#analog","text":"Training and using a neural network to read out the value of an analog display Training the CNN neural network","title":"Analog"},{"location":"Alignment/","text":"Alignment References The alignment references are used in every round to re-align the taken image to the reference coordinates. Two alignment structures must be defined and the taken image then in each round is shifted and rotated according to their position with the target to be in exactly the same position as the reference image. Note The alignment structures needs to be unique and have a good contrast. It is advised to have them as far apart as possible. Precondition Please make sure to have setup your camera properly and taken a good Reference Image . Define two Reference Images You can switch between this two marks with (1) . Then define the reference area in the image by either directly drag and drop with the mouse or use the input boxes below. To apply the currently marked image part you need to push \"Update Reference\" (2) . In some cases it might be useful to use a reference with a higher contrast. This can be achieved by pushing Enhance Contrast\" (3) . The result will be calculated on the ESP32 - so be a bit patient, before you see it active. To save push \"Save to config.ini\" (4) . Note A reboot is not required at this point of time. As next you should define the Digit and Analog ROIs .","title":"Alignment References"},{"location":"Alignment/#alignment-references","text":"The alignment references are used in every round to re-align the taken image to the reference coordinates. Two alignment structures must be defined and the taken image then in each round is shifted and rotated according to their position with the target to be in exactly the same position as the reference image. Note The alignment structures needs to be unique and have a good contrast. It is advised to have them as far apart as possible.","title":"Alignment References"},{"location":"Alignment/#precondition","text":"Please make sure to have setup your camera properly and taken a good Reference Image .","title":"Precondition"},{"location":"Alignment/#define-two-reference-images","text":"You can switch between this two marks with (1) . Then define the reference area in the image by either directly drag and drop with the mouse or use the input boxes below. To apply the currently marked image part you need to push \"Update Reference\" (2) . In some cases it might be useful to use a reference with a higher contrast. This can be achieved by pushing Enhance Contrast\" (3) . The result will be calculated on the ESP32 - so be a bit patient, before you see it active. To save push \"Save to config.ini\" (4) . Note A reboot is not required at this point of time. As next you should define the Digit and Analog ROIs .","title":"Define two Reference Images"},{"location":"Best-Practice/","text":"Best Practice This page shows some best practices: Camera Placement Move the Camera as close as possible (~4cm), this will help get rid of reflections. -> focus can be adjusted by turning the outer black ring of the camera. If the LED reflections are too strong, put tape over the LED to diffuse the light Change the ImageSize to QVGA under \"Expert mode\" configuration when close enough, this will be faster and is often good enough for digital recognition. Reflections Try to get rid of the reflections by rotating the camera, so that the reflections are at positions, where no number is. By using the external LED option, you can place WS2812 LEDs freely away from the main axis. Users report, that a handy cover foil could also help Post-processing Filter out the Number \"9\", as \"3\" will often be misread for a \"9\" and void every number between 3 and 9 due to it being negative flow. Split the readings into two, while the decimal numbers might move to fast to be recognized, at least the slower moving part will produce a correct reading. -> keep in mind that the offset needs to be adjusted, a.e if you have a comma reading of \"3\", it needs to become \"0.3\". This can be done wherever the data ends up being sent, like home assistant using sensor templates. If you are using a low resolution and only digital mode, processing can often be done in <1 minute. Check the logs to confirm how fast it is and then set the interval accordingly under \"Expert mode\" in configuration, as the normal mode will lock you to 3+ minutes.","title":"Best Practice"},{"location":"Best-Practice/#best-practice","text":"This page shows some best practices:","title":"Best Practice"},{"location":"Best-Practice/#camera-placement","text":"Move the Camera as close as possible (~4cm), this will help get rid of reflections. -> focus can be adjusted by turning the outer black ring of the camera. If the LED reflections are too strong, put tape over the LED to diffuse the light Change the ImageSize to QVGA under \"Expert mode\" configuration when close enough, this will be faster and is often good enough for digital recognition.","title":"Camera Placement"},{"location":"Best-Practice/#reflections","text":"Try to get rid of the reflections by rotating the camera, so that the reflections are at positions, where no number is. By using the external LED option, you can place WS2812 LEDs freely away from the main axis. Users report, that a handy cover foil could also help","title":"Reflections"},{"location":"Best-Practice/#post-processing","text":"Filter out the Number \"9\", as \"3\" will often be misread for a \"9\" and void every number between 3 and 9 due to it being negative flow. Split the readings into two, while the decimal numbers might move to fast to be recognized, at least the slower moving part will produce a correct reading. -> keep in mind that the offset needs to be adjusted, a.e if you have a comma reading of \"3\", it needs to become \"0.3\". This can be done wherever the data ends up being sent, like home assistant using sensor templates. If you are using a low resolution and only digital mode, processing can often be done in <1 minute. Check the logs to confirm how fast it is and then set the interval accordingly under \"Expert mode\" in configuration, as the normal mode will lock you to 3+ minutes.","title":"Post-processing"},{"location":"Build-Instructions/","text":"Build the Project See README.md","title":"Build the Project"},{"location":"Build-Instructions/#build-the-project","text":"See README.md","title":"Build the Project"},{"location":"Choosing-the-Model/","text":"Model Selection Notes See Neural Network Types for additional details. In the Graphical Configuration Page , you can choose different models depending on your needs. This page tries to help you on which model to select. For more technical/deeper explanations have a look on Neural-Network-Types . Digit Models For digits on water meters, gas-meters or power meters you can select between two main types of models. dig-class11 This model can recognize full digits. All intermediate states shown a \"N\" for not a number. But in post process it uses older values to fill up the \"N\" values if possible. Main features well suited for LCD digits with the ExtendedResolution option is not supported. (Only in conjunction with ana-class100 / ana-cont) dig-class100 / dig-cont These models are used to get a continuous reading with intermediate states. To see what the models are doing, you can go to the Recognition page. Main features suitable for all digit displays. Advantage over dig-class11 that results continue to be calculated in the transition between digits. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of digit images used for the training dig-class100 vs. dig-cont The difference is in the internal processing. Take the one that gives you the best results. Analog pointer models ana-class100 / ana-cont For pointers on water meters use the analog models. You can only choose between ana-class100 and ana-cont. Both do mainly the same. Main features for all analogue pointers, especially for water meters. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of pointer images used for the training ana-class100 vs. ana-cont The difference is in the internal processing. Take the one that gives you the best results. Both models learn from the same data. Different types of models (normal vs. quantized) The normally trained network is calculating with internal floating point numbers. The saving of floating point numbers naturally takes more space than an integer type. Often the increased accuracy is not needed. Therefore there is the option, to \"quantize\" a neural network. In this case the internal values are rescaled to integer values, which is called \"quantization\". The stored tflite files are usually much smaller. Usually the models are distrusted therefore in both versions. They can be distinguished by a \"-q\" at the end of the logfile. Example: Type Name Normal dig-cont_0610_s3.tflite Quantized dig-cont_0610_s3-q.tflite","title":"Model Selection"},{"location":"Choosing-the-Model/#model-selection","text":"Notes See Neural Network Types for additional details. In the Graphical Configuration Page , you can choose different models depending on your needs. This page tries to help you on which model to select. For more technical/deeper explanations have a look on Neural-Network-Types .","title":"Model Selection"},{"location":"Choosing-the-Model/#digit-models","text":"For digits on water meters, gas-meters or power meters you can select between two main types of models.","title":"Digit Models"},{"location":"Choosing-the-Model/#dig-class11","text":"This model can recognize full digits. All intermediate states shown a \"N\" for not a number. But in post process it uses older values to fill up the \"N\" values if possible.","title":"dig-class11"},{"location":"Choosing-the-Model/#main-features","text":"well suited for LCD digits with the ExtendedResolution option is not supported. (Only in conjunction with ana-class100 / ana-cont)","title":"Main features"},{"location":"Choosing-the-Model/#dig-class100-dig-cont","text":"These models are used to get a continuous reading with intermediate states. To see what the models are doing, you can go to the Recognition page.","title":"dig-class100 / dig-cont"},{"location":"Choosing-the-Model/#main-features_1","text":"suitable for all digit displays. Advantage over dig-class11 that results continue to be calculated in the transition between digits. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of digit images used for the training","title":"Main features"},{"location":"Choosing-the-Model/#dig-class100-vs-dig-cont","text":"The difference is in the internal processing. Take the one that gives you the best results.","title":"dig-class100 vs. dig-cont"},{"location":"Choosing-the-Model/#analog-pointer-models","text":"","title":"Analog pointer models"},{"location":"Choosing-the-Model/#ana-class100-ana-cont","text":"For pointers on water meters use the analog models. You can only choose between ana-class100 and ana-cont. Both do mainly the same.","title":"ana-class100 / ana-cont"},{"location":"Choosing-the-Model/#main-features_2","text":"for all analogue pointers, especially for water meters. With the ExtendedResolution option, higher accuracy is possible by adding another digit. Look here for a list of pointer images used for the training","title":"Main features"},{"location":"Choosing-the-Model/#ana-class100-vs-ana-cont","text":"The difference is in the internal processing. Take the one that gives you the best results. Both models learn from the same data.","title":"ana-class100 vs. ana-cont"},{"location":"Choosing-the-Model/#different-types-of-models-normal-vs-quantized","text":"The normally trained network is calculating with internal floating point numbers. The saving of floating point numbers naturally takes more space than an integer type. Often the increased accuracy is not needed. Therefore there is the option, to \"quantize\" a neural network. In this case the internal values are rescaled to integer values, which is called \"quantization\". The stored tflite files are usually much smaller. Usually the models are distrusted therefore in both versions. They can be distinguished by a \"-q\" at the end of the logfile.","title":"Different types of models (normal vs. quantized)"},{"location":"Choosing-the-Model/#example","text":"Type Name Normal dig-cont_0610_s3.tflite Quantized dig-cont_0610_s3-q.tflite","title":"Example:"},{"location":"Configuration/","text":"Graphical Configuration Most of the settings can be modified on the Settings page: It can be reached via the menu Settings > Configuration . Note To activate the changes, the device needs to be restarted after saving the changes. Most of the commands need processing on the ESP32 device. This is not very fast - so please be patient. All parameters are documented on the Parameters page and as tooltips on the config page. Expert Parameters Some parameters are treated as Expert Parameters and are hidden by default. Tick the checkbox in the top left corner to enable them: The Expert Parameters then will be shown with a red background: Manual Editing of the Config File Even more configuration parameters can be edited manually in the config.ini : To edit the config.ini file directly, click on the Edit Config.ini directly button. Background Information Note You do not need to understand this! But you might be interested in it. The principle is very simple and can most easily be described as a flow of processing steps. Each step has a dedicated parameter description in the config.ini , which is indicated by brackets [name_of_step] . The steps are processed in the order written in the config file. That means, that you first have to describe the image taking, then the aligning and cutting and only after that you can start to config a neural network. The last step is the post processing. Processing steps - Overview In the following you get a short overview over the available steps. This order is also the suggested order for the processing flow. Single steps can be left out, if not needed (e.g. omit the analog part, if only digits are present) 1. [TakeImage] This steps parametrises the taking of the image by the ESP32-CAM. Size, quality and storage for logging and debugging can be set. 2. [Alignment] Image preprocessing, including image alignment with reference images 3. [Digits] Neural network evaluation of an image for digits. The neural network is defined by a tflite formatted file and the output is a number between 0 .. 9 or NaN (if image is not unique enough) 4. [Analog] Neural network evaluation of analog counter. The neural network is defined by a tflite formatted file and the output is a number between 0.0 .. 9.9, representing the position of the pointer. 5. [PostProcessing] Summarized the individually converted pictures to the overall result. It also implements some error corrections and consistency checks to filter wrong reading. 6. [MQTT] Transfer of the readings to a MQTT server. 7. [AutoTimer] Configuration of the automated flow start at the start up of the ESP32. 8. [Debug] Configuration for debugging details","title":"Graphical Configuration"},{"location":"Configuration/#graphical-configuration","text":"Most of the settings can be modified on the Settings page: It can be reached via the menu Settings > Configuration . Note To activate the changes, the device needs to be restarted after saving the changes. Most of the commands need processing on the ESP32 device. This is not very fast - so please be patient. All parameters are documented on the Parameters page and as tooltips on the config page.","title":"Graphical Configuration"},{"location":"Configuration/#expert-parameters","text":"Some parameters are treated as Expert Parameters and are hidden by default. Tick the checkbox in the top left corner to enable them: The Expert Parameters then will be shown with a red background:","title":"Expert Parameters"},{"location":"Configuration/#manual-editing-of-the-config-file","text":"Even more configuration parameters can be edited manually in the config.ini : To edit the config.ini file directly, click on the Edit Config.ini directly button.","title":"Manual Editing of the Config File"},{"location":"Configuration/#background-information","text":"Note You do not need to understand this! But you might be interested in it. The principle is very simple and can most easily be described as a flow of processing steps. Each step has a dedicated parameter description in the config.ini , which is indicated by brackets [name_of_step] . The steps are processed in the order written in the config file. That means, that you first have to describe the image taking, then the aligning and cutting and only after that you can start to config a neural network. The last step is the post processing.","title":"Background Information"},{"location":"Configuration/#processing-steps-overview","text":"In the following you get a short overview over the available steps. This order is also the suggested order for the processing flow. Single steps can be left out, if not needed (e.g. omit the analog part, if only digits are present)","title":"Processing steps - Overview"},{"location":"Configuration/#1-takeimage","text":"This steps parametrises the taking of the image by the ESP32-CAM. Size, quality and storage for logging and debugging can be set.","title":"1. [TakeImage]"},{"location":"Configuration/#2-alignment","text":"Image preprocessing, including image alignment with reference images","title":"2. [Alignment]"},{"location":"Configuration/#3-digits","text":"Neural network evaluation of an image for digits. The neural network is defined by a tflite formatted file and the output is a number between 0 .. 9 or NaN (if image is not unique enough)","title":"3. [Digits]"},{"location":"Configuration/#4-analog","text":"Neural network evaluation of analog counter. The neural network is defined by a tflite formatted file and the output is a number between 0.0 .. 9.9, representing the position of the pointer.","title":"4. [Analog]"},{"location":"Configuration/#5-postprocessing","text":"Summarized the individually converted pictures to the overall result. It also implements some error corrections and consistency checks to filter wrong reading.","title":"5. [PostProcessing]"},{"location":"Configuration/#6-mqtt","text":"Transfer of the readings to a MQTT server.","title":"6. [MQTT]"},{"location":"Configuration/#7-autotimer","text":"Configuration of the automated flow start at the start up of the ESP32.","title":"7. [AutoTimer]"},{"location":"Configuration/#8-debug","text":"Configuration for debugging details","title":"8. [Debug]"},{"location":"Correction%20Algorithm/","text":"Correction Algorithm After the digitization of the images and the composition to a number a checking and correction algorithm is applied. This is explained here. There are several reasons, that a check might be necessary: In case of digits there is the output of \"N\" (=NaN = Not-a-Number) in case the digit cannot be detected correctly. This happens for example if the image shows a digit between to states The replacement of the \"N\" with a previous value could be not sufficient, due to the fact, that it might have changed. There is a misreading of one one of the numbers. This can always happen in case of neural network processing. Terms and definitions PreValue The last correct read value. Either from a previous correctly identified value or manual setting by the user. This is used to replace \"N\"s and make a check for the absolute change. Digits Value that are digitized from a digital number. There are 11 allowed values for this: Digits: 0, 1, 2, ... 9 N = Not-a-Number - representing a not unique state between two numbers Analogs This are value derived from a pointer like meter. This never has the state \"N\". CheckDigitIncreaseConsistency If this is enabled an \"intelligent\" algorithm is used to derive from zero-crossing of discrete digit positions, if the number should have been increased. This is relevant because in some of the digit meters, the increase of a digit to the next number can be seen, before the sub-digit has gone through zero. For example: 16.6 --> 16.7 --> 1N.8 --> 17.9 corrected to 16.9 --> 17.0 --> 17.1 As you can see, the 17.9 is a false reading as the 7 is assumed to be already readable, although the sub-digit has not crossed the zero. In this case the CheckDigitIncreaseConsistency algorithm will correct this to 16.9 A detailed description of the algorithm can be found below (not yet ready!) Negative Rate allowed Most of the meters only have increasing numbers and do not count backwards. Therefore a negative rate (= negative change compared to the PreValue) is surely a false value. This can be checked an flagged as false reading MaxRateValue / MaxRateType Here the maximum change from one to the next reading can be limited. If a false reading of the neural network results in a change larger than this, the reading is flagged as false. There a two types of comparisons possible 1) AbsolutChange : Here the difference between the PreValue and the current reading is compared directly, independent how much time has passed since the last reading. 2) RelativeRate : in this case a change rate in the unit of change/minute is calculated, taking the time between the last and the current reading into account. Be careful, that with increasing time, the absolute allowed change increases. Example: relative rate of 0.05 m\u00b3/minute --> after 20 minutes a maximum change of 20 minutes * 0.05 m\u00b3/minute = 1 m\u00b3 is possible. That means that a false reading of 1 m\u00b3 cannot be detected false after about 20 minutes in this case Assume, that there might me no change in the meter for hours (e.g. during the night) a much bigger change could also be accepted. Flow Chart CheckDigitIncreaseConsistency Algorithm The check digit increase consistency algorithm is functional for the digits only. Due to the fact, that the rotation might be a little bit earlier or later compared to the zero crossing of the digit before, errors during the reading before and after a zero crossing can be wrong. Therefore a simple algorithm can be applied, checking the consistency of zero crossing and changes in the following digit. This is applied to one after the other digit, starting with the lowest priority digits.","title":"Correction Algorithm"},{"location":"Correction%20Algorithm/#correction-algorithm","text":"After the digitization of the images and the composition to a number a checking and correction algorithm is applied. This is explained here. There are several reasons, that a check might be necessary: In case of digits there is the output of \"N\" (=NaN = Not-a-Number) in case the digit cannot be detected correctly. This happens for example if the image shows a digit between to states The replacement of the \"N\" with a previous value could be not sufficient, due to the fact, that it might have changed. There is a misreading of one one of the numbers. This can always happen in case of neural network processing.","title":"Correction Algorithm"},{"location":"Correction%20Algorithm/#terms-and-definitions","text":"","title":"Terms and definitions"},{"location":"Correction%20Algorithm/#prevalue","text":"The last correct read value. Either from a previous correctly identified value or manual setting by the user. This is used to replace \"N\"s and make a check for the absolute change.","title":"PreValue"},{"location":"Correction%20Algorithm/#digits","text":"Value that are digitized from a digital number. There are 11 allowed values for this: Digits: 0, 1, 2, ... 9 N = Not-a-Number - representing a not unique state between two numbers","title":"Digits"},{"location":"Correction%20Algorithm/#analogs","text":"This are value derived from a pointer like meter. This never has the state \"N\".","title":"Analogs"},{"location":"Correction%20Algorithm/#checkdigitincreaseconsistency","text":"If this is enabled an \"intelligent\" algorithm is used to derive from zero-crossing of discrete digit positions, if the number should have been increased. This is relevant because in some of the digit meters, the increase of a digit to the next number can be seen, before the sub-digit has gone through zero. For example: 16.6 --> 16.7 --> 1N.8 --> 17.9 corrected to 16.9 --> 17.0 --> 17.1 As you can see, the 17.9 is a false reading as the 7 is assumed to be already readable, although the sub-digit has not crossed the zero. In this case the CheckDigitIncreaseConsistency algorithm will correct this to 16.9 A detailed description of the algorithm can be found below (not yet ready!)","title":"CheckDigitIncreaseConsistency"},{"location":"Correction%20Algorithm/#negative-rate-allowed","text":"Most of the meters only have increasing numbers and do not count backwards. Therefore a negative rate (= negative change compared to the PreValue) is surely a false value. This can be checked an flagged as false reading","title":"Negative Rate allowed"},{"location":"Correction%20Algorithm/#maxratevalue-maxratetype","text":"Here the maximum change from one to the next reading can be limited. If a false reading of the neural network results in a change larger than this, the reading is flagged as false. There a two types of comparisons possible 1) AbsolutChange : Here the difference between the PreValue and the current reading is compared directly, independent how much time has passed since the last reading. 2) RelativeRate : in this case a change rate in the unit of change/minute is calculated, taking the time between the last and the current reading into account. Be careful, that with increasing time, the absolute allowed change increases. Example: relative rate of 0.05 m\u00b3/minute --> after 20 minutes a maximum change of 20 minutes * 0.05 m\u00b3/minute = 1 m\u00b3 is possible. That means that a false reading of 1 m\u00b3 cannot be detected false after about 20 minutes in this case Assume, that there might me no change in the meter for hours (e.g. during the night) a much bigger change could also be accepted.","title":"MaxRateValue / MaxRateType"},{"location":"Correction%20Algorithm/#flow-chart","text":"","title":"Flow Chart"},{"location":"Correction%20Algorithm/#checkdigitincreaseconsistency-algorithm","text":"The check digit increase consistency algorithm is functional for the digits only. Due to the fact, that the rotation might be a little bit earlier or later compared to the zero crossing of the digit before, errors during the reading before and after a zero crossing can be wrong. Therefore a simple algorithm can be applied, checking the consistency of zero crossing and changes in the following digit. This is applied to one after the other digit, starting with the lowest priority digits.","title":"CheckDigitIncreaseConsistency Algorithm"},{"location":"Demo-Mode/","text":"Demo Mode For Demo and Testing Purpose, the device can use pre-recorded images. You need to enable it in the configuration ( TakeImage > Demo ) and also provide the needed files on the SD card. For each round one image gets used, starting with the first image for the first round. For the reference image and the alignment also the first image gets used. Once the last image got reached, it starts again with the first one. SD Card Structure demo/ \u251c\u2500\u2500 520.8983.jpg \u251c\u2500\u2500 520.9086.jpg \u251c\u2500\u2500 520.9351.jpg \u251c\u2500\u2500 ... \u2514\u2500\u2500 files.txt The jpg files can have any name The jpg files must be smaller than 30'000 bytes The files.txt must contains a list of those files, eg: 520.8983.jpg 520.9086.jpg 520.9351.jpg Recording To record real images of a meter, you have to periodically fetch http:///img_tmp/raw.jpg . To automate this, you can use the following shell script (Linux only): #!/bin/bash while [[ true ]]; do echo \"fetching value...\" wget -q http://192.168.1.151/value -O value.txt value=`cat value.txt` echo \"Value: $value\" diff=`diff value.txt value_previous.txt` changed=$? #echo \"Diff: $diff\" if [[ $changed -ne 0 ]]; then echo \"Value changed:\" echo $diff echo \"fetching image...\" wget -q http://192.168.1.151/img_tmp/raw.jpg -O $value.jpg else echo \"Value did not change, skipping image fetching!\" fi cp value.txt value_previous.txt echo \"waiting 60s...\" sleep 60 done Installation Just install the zip file using the OTA Update functionality. How does it work The Demo Mode tries to interfere as less as possible with the normal behavior. Whenever a Cam framebuffer gets taken ( esp_camera_fb_get() ), it replaces the framebuffer with the image from the SD card. Example Data of a Water Meter You can use the following demo images if you want: It covers a meter range from 530.00688 to 531.85882 . Animation Animation of the watermeter (77 MB!) All images (843 images) Demo_Images_Watermeter_530.00688-532.08243_843_images.zip Animation of it (186 MB!) Selection of 84 images Demo_Images_Watermeter_530.00688-532.08243_84_images.zip Selection of 42 images Demo_Images_Watermeter_530.00688-532.08243_42_images.zip","title":"Demo Mode"},{"location":"Demo-Mode/#demo-mode","text":"For Demo and Testing Purpose, the device can use pre-recorded images. You need to enable it in the configuration ( TakeImage > Demo ) and also provide the needed files on the SD card. For each round one image gets used, starting with the first image for the first round. For the reference image and the alignment also the first image gets used. Once the last image got reached, it starts again with the first one.","title":"Demo Mode"},{"location":"Demo-Mode/#sd-card-structure","text":"demo/ \u251c\u2500\u2500 520.8983.jpg \u251c\u2500\u2500 520.9086.jpg \u251c\u2500\u2500 520.9351.jpg \u251c\u2500\u2500 ... \u2514\u2500\u2500 files.txt The jpg files can have any name The jpg files must be smaller than 30'000 bytes The files.txt must contains a list of those files, eg: 520.8983.jpg 520.9086.jpg 520.9351.jpg","title":"SD Card Structure"},{"location":"Demo-Mode/#recording","text":"To record real images of a meter, you have to periodically fetch http:///img_tmp/raw.jpg . To automate this, you can use the following shell script (Linux only): #!/bin/bash while [[ true ]]; do echo \"fetching value...\" wget -q http://192.168.1.151/value -O value.txt value=`cat value.txt` echo \"Value: $value\" diff=`diff value.txt value_previous.txt` changed=$? #echo \"Diff: $diff\" if [[ $changed -ne 0 ]]; then echo \"Value changed:\" echo $diff echo \"fetching image...\" wget -q http://192.168.1.151/img_tmp/raw.jpg -O $value.jpg else echo \"Value did not change, skipping image fetching!\" fi cp value.txt value_previous.txt echo \"waiting 60s...\" sleep 60 done","title":"Recording"},{"location":"Demo-Mode/#installation","text":"Just install the zip file using the OTA Update functionality.","title":"Installation"},{"location":"Demo-Mode/#how-does-it-work","text":"The Demo Mode tries to interfere as less as possible with the normal behavior. Whenever a Cam framebuffer gets taken ( esp_camera_fb_get() ), it replaces the framebuffer with the image from the SD card.","title":"How does it work"},{"location":"Demo-Mode/#example-data-of-a-water-meter","text":"You can use the following demo images if you want: It covers a meter range from 530.00688 to 531.85882 .","title":"Example Data of a Water Meter"},{"location":"Demo-Mode/#animation","text":"Animation of the watermeter (77 MB!)","title":"Animation"},{"location":"Demo-Mode/#all-images-843-images","text":"Demo_Images_Watermeter_530.00688-532.08243_843_images.zip Animation of it (186 MB!)","title":"All images (843 images)"},{"location":"Demo-Mode/#selection-of-84-images","text":"Demo_Images_Watermeter_530.00688-532.08243_84_images.zip","title":"Selection of 84 images"},{"location":"Demo-Mode/#selection-of-42-images","text":"Demo_Images_Watermeter_530.00688-532.08243_42_images.zip","title":"Selection of 42 images"},{"location":"Error-Codes/","text":"This page lists the possible error codes, their meaning and possible solutions. The effective error codes can be found here . Critical Errors Those Errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue! 0x00000001 PSRAM bad Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM! 0x00000002 Heap too small The firmware failed to allocate enough memory. This most likely is a consequential error of a bad PSRAM! 0x00000004 Cam bad The attached camera can not be initialized. This usually is because on of the following reasons: The camera is not supported, see Hardware Compatibility The camera is not attached properly -> Try to remove and attach it again. Make sure you move the black part enough into the socket! The camera or the camera cable is damaged 0x00000008 SD card basic check failed One or more basic SD card checks failed. The following checks are performed during boot sequence: Write a file (sdcard/sdcheck.txt) to SD card with some generic text Read the written file back CRC verification Delete the file Detailed error indication (write, rerad or delete error) can be derived from blinking code of red board status LED. Please have a look to !!!TODO!!! Recommendation: Reformat SD card and check again or try another SD card 0x00000010 SD folder or file presence check failed One or more mandatory folders and/or files are missing on SD card. To have early indication that SD card is potentially ready for operation, some folder and files, which are mandatory are presence checked. This is not a 100% check and a successful test does not mean everthing is OK. The following folders / files get checked during boot sequence: /sdcard/config /sdcard/html /sdcard/demo --> created automatically in firmware /sdcard/firmware --> created automatically in firmware /sdcard/img_tmp --> created automatically in firmware /sdcard/log --> created automatically in firmware /sdcard/wlan.ini /sdcard/config/config.ini /sdcard/html/index.html /sdcard/html/ota_page.html /sdcard/html/log.html /sdcard/html/common.js /sdcard/html/gethost.js /sdcard/html/version.txt Recommendation: Check logs and / or redo a Over-The-Air Update (OTA Update) to ensure proper SD card structure Non-Critical Errors Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it. 0x00000100 Cam Framebuffer bad The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help. 0x00000200 NTP failed The firmware failed to get the world time from an NTP server. The firmware will continue to work, but has a wrong time.","title":"Error Codes"},{"location":"Error-Codes/#critical-errors","text":"Those Errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue!","title":"Critical Errors"},{"location":"Error-Codes/#0x00000001-psram-bad","text":"Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM!","title":"0x00000001 PSRAM bad"},{"location":"Error-Codes/#0x00000002-heap-too-small","text":"The firmware failed to allocate enough memory. This most likely is a consequential error of a bad PSRAM!","title":"0x00000002 Heap too small"},{"location":"Error-Codes/#0x00000004-cam-bad","text":"The attached camera can not be initialized. This usually is because on of the following reasons: The camera is not supported, see Hardware Compatibility The camera is not attached properly -> Try to remove and attach it again. Make sure you move the black part enough into the socket! The camera or the camera cable is damaged","title":"0x00000004 Cam bad"},{"location":"Error-Codes/#0x00000008-sd-card-basic-check-failed","text":"One or more basic SD card checks failed. The following checks are performed during boot sequence: Write a file (sdcard/sdcheck.txt) to SD card with some generic text Read the written file back CRC verification Delete the file Detailed error indication (write, rerad or delete error) can be derived from blinking code of red board status LED. Please have a look to !!!TODO!!! Recommendation: Reformat SD card and check again or try another SD card","title":"0x00000008 SD card basic check failed"},{"location":"Error-Codes/#0x00000010-sd-folder-or-file-presence-check-failed","text":"One or more mandatory folders and/or files are missing on SD card. To have early indication that SD card is potentially ready for operation, some folder and files, which are mandatory are presence checked. This is not a 100% check and a successful test does not mean everthing is OK. The following folders / files get checked during boot sequence: /sdcard/config /sdcard/html /sdcard/demo --> created automatically in firmware /sdcard/firmware --> created automatically in firmware /sdcard/img_tmp --> created automatically in firmware /sdcard/log --> created automatically in firmware /sdcard/wlan.ini /sdcard/config/config.ini /sdcard/html/index.html /sdcard/html/ota_page.html /sdcard/html/log.html /sdcard/html/common.js /sdcard/html/gethost.js /sdcard/html/version.txt Recommendation: Check logs and / or redo a Over-The-Air Update (OTA Update) to ensure proper SD card structure","title":"0x00000010 SD folder or file presence check failed"},{"location":"Error-Codes/#non-critical-errors","text":"Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it.","title":"Non-Critical Errors"},{"location":"Error-Codes/#0x00000100-cam-framebuffer-bad","text":"The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help.","title":"0x00000100 Cam Framebuffer bad"},{"location":"Error-Codes/#0x00000200-ntp-failed","text":"The firmware failed to get the world time from an NTP server. The firmware will continue to work, but has a wrong time.","title":"0x00000200 NTP failed"},{"location":"Error-Debugging/","text":"Error Debugging Rebooting General Remark Due to the rather complex code with a lot of external libraries and the limited availability of memory a reboot of the device from time to time is \"normal\". Background are memory leakages and therefore running out of free memory. The hardware of the ESP32CAM has a varying quality. I have one and the same hardware with a reboot range from every 5 detection runs to up to 250 detection runs. Getting deeper inside Have a look into the log file ( /log/message/... ). If the log file is very short you need to enable a enhanced logging in the config.ini (Debug --> logfile = true ) . Analyze the debugging output of the serial interface Connect a serial to USB interface (like for flashing) and make a logging of the serial communication There are a lot more intermediate information and the lines before the reboot tell you, where the firmware fails If you make an issue about this, please post these two information additionally Don't forget to remove your WLAN password in the serial log Often observed problems Hardware failure Camera not working --> check the interface, test another module Low cost module with only 2MB of PSRAM instead of 4MB --> image taking will fail first. This will never work due to too low memory ROI misaligned This typically happens if you have suboptimal \"Alignment Marks\". A very simple and working solution is to put put higly contrasted stickers on your meter and put \"Alignment Marks\" on it (see picture below) If after those adjustment you still have some issues, you can try to adjust your alignment settings in expert mode: My Analog Meter are recognized as Digital Counter or vice versa First, check that your ROI are correctly defined (yey!) Second, verify that the name of your ROI analog and digital ROIs are different Recognition is working well, but number aren't sorted correctly You have to sort your ROI correctly (Bigger to smaller). Select your ROI and click either \"move next\" or \"move previous\". Repeat until your ROI are correctly sorted","title":"Error Debugging"},{"location":"Error-Debugging/#error-debugging","text":"","title":"Error Debugging"},{"location":"Error-Debugging/#rebooting","text":"","title":"Rebooting"},{"location":"Error-Debugging/#general-remark","text":"Due to the rather complex code with a lot of external libraries and the limited availability of memory a reboot of the device from time to time is \"normal\". Background are memory leakages and therefore running out of free memory. The hardware of the ESP32CAM has a varying quality. I have one and the same hardware with a reboot range from every 5 detection runs to up to 250 detection runs.","title":"General Remark"},{"location":"Error-Debugging/#getting-deeper-inside","text":"Have a look into the log file ( /log/message/... ). If the log file is very short you need to enable a enhanced logging in the config.ini (Debug --> logfile = true ) . Analyze the debugging output of the serial interface Connect a serial to USB interface (like for flashing) and make a logging of the serial communication There are a lot more intermediate information and the lines before the reboot tell you, where the firmware fails If you make an issue about this, please post these two information additionally Don't forget to remove your WLAN password in the serial log","title":"Getting deeper inside"},{"location":"Error-Debugging/#often-observed-problems","text":"","title":"Often observed problems"},{"location":"Error-Debugging/#hardware-failure","text":"Camera not working --> check the interface, test another module Low cost module with only 2MB of PSRAM instead of 4MB --> image taking will fail first. This will never work due to too low memory","title":"Hardware failure"},{"location":"Error-Debugging/#roi-misaligned","text":"This typically happens if you have suboptimal \"Alignment Marks\". A very simple and working solution is to put put higly contrasted stickers on your meter and put \"Alignment Marks\" on it (see picture below) If after those adjustment you still have some issues, you can try to adjust your alignment settings in expert mode:","title":"ROI misaligned"},{"location":"Error-Debugging/#my-analog-meter-are-recognized-as-digital-counter-or-vice-versa","text":"First, check that your ROI are correctly defined (yey!) Second, verify that the name of your ROI analog and digital ROIs are different","title":"My Analog Meter are recognized as Digital Counter or vice versa"},{"location":"Error-Debugging/#recognition-is-working-well-but-number-arent-sorted-correctly","text":"You have to sort your ROI correctly (Bigger to smaller). Select your ROI and click either \"move next\" or \"move previous\". Repeat until your ROI are correctly sorted","title":"Recognition is working well, but number aren't sorted correctly"},{"location":"External-LED/","text":"External LED The internal flash LED is very close to the camera axis. This results in reflection, especially in case of flat glass surfaces such as for power meters. To circumvent this problem, it is now possible to control external LEDs, which than can be places somewhere else in the setup. As not simples LEDs are used, but RGB LEDs with a digital interface like WS2812 not only the position, but also the color and intensity of the illumination can now be adjusted. The following image shows a direct comparison of the \"old\" internal flash LED and two off axis LEDs. There is also a new meter adapter available. This has two features: designed for small clearings in front of the meter and prepared for WS2812 LEDs . 1. Hardware installation of the LED stripe The control line of the LED stripe is connected with a 470 Ohm resistor to the GPIO12. For power supply stabilization a capacitor between 5V and ground is recommended. Here a 470\u00b5F polymer capacitor is used. As a power supply a 5V from the ESP32 is used like in the following wiring. 2. Software configuration The handling of the WS2812 LED controller needs some other libraries, therefore it is controlled within a dedicated section called GPIO Settings . The external LED stripe is connected to GPIO12. After activating the \"GPIO Settings\" section, the internal flash is per default disabled. In order to activate the external LED, you need to activate GPIO 12 state and select \"extern flash light ws281x ...\" . Parameter Meaning LED-Type There are several types of controller implemented: WS2812(B), WS2813, SK6812 Numbers of LED Number of LEDs on the LED stripe LED Color The color and intensity can be controlled directly by a red/green/blue value, each within the range from 0 (off) to 255 (full) Enabling the GPIO settings automatically disables the flash LED. Therefore you can enable it here manually by checking GPIO4 and choose \"build-in led flash light\" . It is not recommended to use both illumination parallel.","title":"External LED"},{"location":"External-LED/#external-led","text":"The internal flash LED is very close to the camera axis. This results in reflection, especially in case of flat glass surfaces such as for power meters. To circumvent this problem, it is now possible to control external LEDs, which than can be places somewhere else in the setup. As not simples LEDs are used, but RGB LEDs with a digital interface like WS2812 not only the position, but also the color and intensity of the illumination can now be adjusted. The following image shows a direct comparison of the \"old\" internal flash LED and two off axis LEDs. There is also a new meter adapter available. This has two features: designed for small clearings in front of the meter and prepared for WS2812 LEDs .","title":"External LED"},{"location":"External-LED/#1-hardware-installation-of-the-led-stripe","text":"The control line of the LED stripe is connected with a 470 Ohm resistor to the GPIO12. For power supply stabilization a capacitor between 5V and ground is recommended. Here a 470\u00b5F polymer capacitor is used. As a power supply a 5V from the ESP32 is used like in the following wiring.","title":"1. Hardware installation of the LED stripe"},{"location":"External-LED/#2-software-configuration","text":"The handling of the WS2812 LED controller needs some other libraries, therefore it is controlled within a dedicated section called GPIO Settings . The external LED stripe is connected to GPIO12. After activating the \"GPIO Settings\" section, the internal flash is per default disabled. In order to activate the external LED, you need to activate GPIO 12 state and select \"extern flash light ws281x ...\" . Parameter Meaning LED-Type There are several types of controller implemented: WS2812(B), WS2813, SK6812 Numbers of LED Number of LEDs on the LED stripe LED Color The color and intensity can be controlled directly by a red/green/blue value, each within the range from 0 (off) to 255 (full) Enabling the GPIO settings automatically disables the flash LED. Therefore you can enable it here manually by checking GPIO4 and choose \"build-in led flash light\" . It is not recommended to use both illumination parallel.","title":"2. Software configuration"},{"location":"FAQs/","text":"Frequently Asked Questions My device is reboot frequently. What can I do? There are several reasons for the reboot: Frequent HTML requests Wrong configuration, missing configuration files Unstable hardware - see Hardware Compatibility . There is a dedicated page about this: Frequent Reboots . How accurate are the detections? It is hard to give a specific accuracy number. It depends on many factors, e.g. How in-focus is your camera? How sturdy is the camera mount? Does it slightly move over extended periods of time? What type of meter are you reading? Is the meter already in the training data set? Are you trying to read digits, an analog dial, or both? etc. Anecdotally, the authors of this page have great success with the meter. While the AI algorithm itself is not perfect and sometimes returns NaN or incorrect values, other post-processing / prevalue / sanity checks help ensure such invalid values are filtered out. With the correct settings, one author has been running this device for 1 month without any incorrect values reported. See the FAQs below for more details and configuration hints. My numbers are not corrected detected. What can I do? There is a dedicated page about the correct setting ROI Configuration . This page also includes the instructions for gathering new images for the training. How can I ensure invalid numbers are never reported? As mentioned above, the AI algorithm is not perfect. Sometimes it may read an incorrect value. We can tune the software to almost never report an incorrect value. There is a tradeoff though: the software may report stale values - i.e. it will drop incorrect values for a potentially long period of time, resulting in the meter reading being outdated by hours. If never receiving an incorrect value is important to you, consider tolerating this tradeoff. You can change the following settings to reduce incorrect readings (but potentially increase staleness of data): Set a prevalue via the UI, then change PostProcessing configuration option PreValueAgeStartup to a much larger number (e.g. 43200 = 30 days). Change PostProcessing configuration option MaxRateType to be time based instead of absolute. Set MaxRateValue to something realistic (e.g. 5 gal/min). You can often find the max flow rate your meter supports directly on the cover. Reduce AutoTimer configuration option Interval to the lowest it can be (e.g. 3 min). The more often you take readings, the less likely for data staleness to occur. Even after I have setup everything perfect there is a false reading - especially around the zero crossing (roll over to next number) The roll over behavior is different for the different meters. E.g.: Rolling over start with different previous position (e.g. at 7, 8 or 9) The neutral position (no rolling) is not perfectly at zero, but rather at something like 7.9 or 8.1, even if it should be exactly 8 The \"PostProcessingAlgo\" is trying to judge out of the individual readings, what number it should be. For example if the previous number is a \"1\", but the next number seems to be a \"8.9\", most probably there was a \"zero crossing\" and the number is a \"9\" and not still an \"8\" Currently the setting of the algorithm is set to fit most of the meters and cases. But the parameters do not fit perfectly for all situations. Therefore there might be intermediate states, where the reading is false. This is especially the case, at the positions, where the roll over (zero crossing) is just starting. To prevent a sending of false parameters, there is the possibility to limit the maximum allowed change (MaxRateChange). Usually after some time and movement of the counters a bit further, the reading is getting back to a stable reading. To handle this, a parametrized setting would be needed. This is rather complicated to implement as subtle changes make a relevant difference. Currently this is not implemented. So please be a bit patient with your meter :-)","title":"Frequently Asked Questions"},{"location":"FAQs/#frequently-asked-questions","text":"","title":"Frequently Asked Questions"},{"location":"FAQs/#my-device-is-reboot-frequently-what-can-i-do","text":"There are several reasons for the reboot: Frequent HTML requests Wrong configuration, missing configuration files Unstable hardware - see Hardware Compatibility . There is a dedicated page about this: Frequent Reboots .","title":"My device is reboot frequently. What can I do?"},{"location":"FAQs/#how-accurate-are-the-detections","text":"It is hard to give a specific accuracy number. It depends on many factors, e.g. How in-focus is your camera? How sturdy is the camera mount? Does it slightly move over extended periods of time? What type of meter are you reading? Is the meter already in the training data set? Are you trying to read digits, an analog dial, or both? etc. Anecdotally, the authors of this page have great success with the meter. While the AI algorithm itself is not perfect and sometimes returns NaN or incorrect values, other post-processing / prevalue / sanity checks help ensure such invalid values are filtered out. With the correct settings, one author has been running this device for 1 month without any incorrect values reported. See the FAQs below for more details and configuration hints.","title":"How accurate are the detections?"},{"location":"FAQs/#my-numbers-are-not-corrected-detected-what-can-i-do","text":"There is a dedicated page about the correct setting ROI Configuration . This page also includes the instructions for gathering new images for the training.","title":"My numbers are not corrected detected. What can I do?"},{"location":"FAQs/#how-can-i-ensure-invalid-numbers-are-never-reported","text":"As mentioned above, the AI algorithm is not perfect. Sometimes it may read an incorrect value. We can tune the software to almost never report an incorrect value. There is a tradeoff though: the software may report stale values - i.e. it will drop incorrect values for a potentially long period of time, resulting in the meter reading being outdated by hours. If never receiving an incorrect value is important to you, consider tolerating this tradeoff. You can change the following settings to reduce incorrect readings (but potentially increase staleness of data): Set a prevalue via the UI, then change PostProcessing configuration option PreValueAgeStartup to a much larger number (e.g. 43200 = 30 days). Change PostProcessing configuration option MaxRateType to be time based instead of absolute. Set MaxRateValue to something realistic (e.g. 5 gal/min). You can often find the max flow rate your meter supports directly on the cover. Reduce AutoTimer configuration option Interval to the lowest it can be (e.g. 3 min). The more often you take readings, the less likely for data staleness to occur.","title":"How can I ensure invalid numbers are never reported?"},{"location":"FAQs/#even-after-i-have-setup-everything-perfect-there-is-a-false-reading-especially-around-the-zero-crossing-roll-over-to-next-number","text":"The roll over behavior is different for the different meters. E.g.: Rolling over start with different previous position (e.g. at 7, 8 or 9) The neutral position (no rolling) is not perfectly at zero, but rather at something like 7.9 or 8.1, even if it should be exactly 8 The \"PostProcessingAlgo\" is trying to judge out of the individual readings, what number it should be. For example if the previous number is a \"1\", but the next number seems to be a \"8.9\", most probably there was a \"zero crossing\" and the number is a \"9\" and not still an \"8\" Currently the setting of the algorithm is set to fit most of the meters and cases. But the parameters do not fit perfectly for all situations. Therefore there might be intermediate states, where the reading is false. This is especially the case, at the positions, where the roll over (zero crossing) is just starting. To prevent a sending of false parameters, there is the possibility to limit the maximum allowed change (MaxRateChange). Usually after some time and movement of the counters a bit further, the reading is getting back to a stable reading. To handle this, a parametrized setting would be needed. This is rather complicated to implement as subtle changes make a relevant difference. Currently this is not implemented. So please be a bit patient with your meter :-)","title":"Even after I have setup everything perfect there is a false reading - especially around the zero crossing (roll over to next number)"},{"location":"Frequent-Reboots/","text":"Frequent Reboots There are several types of reboots. To get a deeper insight turn on the logging: Internal logging ( config.ini ) Serial log of the UART interface (same as for flashing the firmware) There are two principle types of reboots Random reboots (always different timing and situation) Permanent Reboots always at the same time Random reboots Random reboots have two reasons: overload during HTML access and unstable system In general: there are several mechanisms in the firmware (like saving previous values), to have a \"smooth\" reboot without too many notable disturbance. Overload during HTML access If you frequently access the web server over HTML requests, the firmware tends to reboot. This especially happens during the first run and when the ESP32 is busy with the digitization flow. The reason for this are running out of memory during a flow, minor memory leakage in combination with missing error handling. There is noting you can do about this kind of reboot, beside two thing: Support the firmware development with improved and tested part of code Be patient :-) Unstable system If your system is sometimes running smoothly over several runs and sometimes reboots obviously randomly, you have an partially unstable device. You can check this in the standard log file on the SD card: 2021-12-26T06:34:09: task_autodoFlow - round done 2021-12-26T06:34:09: CPU Temperature: 56.1 2021-12-26T06:38:00: task_autodoFlow - next round - Round #23 Here you see, that the round #23 is starting, so obviously there were no reboots in the last 22 rounds. There is hardware (ESP32CAM), where only 2-3 stable rounds are possible and others, where way more than 100 rounds without any reboots is possible. There is noting you can do about it, beside testing different hardware. Permanent reboots Permanent reboots at the same situation during the flow has a systematic problem either in the hardware or the configuration. It usually happens during the first run as there all needed parts of the firmware have been loaded for the first time. To find the reason mostly the serial log of the UART interface from the startup until the reboots is very helpful. It can be stored using the USB / UART interface - the same as for flashing the firmware - and logging the serial output of the ESP32. Possible problems: SD card PSRAM too low Configuration missing SD card problems The ESP32CAM is a little bit \"picky\" with the supported SD cards. Due to the limited availability of GPIOs the SD card can only be accessed via 1-wire mode. Therefore not all SD cards are supported. Several error cases can happen: No SD card Easy to detect: fast blinking red LED directly after startup, no reaction of the web server etc. at all SD card not supported at all Error message of no detectable SC card in the log file. Normal looking log for a 16GB SD card is like this: 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.138 -> Name: SC16G 09:38:25.138 -> Type: SDHC/SDXC 09:38:25.138 -> Speed: 20 MHz 09:38:25.138 -> Size: 15193MB Otherwise there is some error message. SD card recognized but not supported This is the most annoying error. The SD card is detected, but the files cannot be read. Most probably this results in a problem with the WLAN connection, as the first file needed is the wlan.ini in the root directory. PSRAM too low In order to work, there are 4 MB of PSRAM necessary. Normally the ESP32CAM is equipped with 8 MB, whereof only 4 MB can be used effectively. Sometimes, there is hardware, where only 2 MB of PSRAM is present - even if you have bought a 8 MB module You can identify the amount of PSRAM in the serial log file: 09:38:21.224 -> \u001b[0;32mI (881) psram: This chip is ESP32-D0WD\u001b[0m 09:38:21.224 -> \u001b[0;32mI (885) spiram: Found 64MBit SPI RAM device\u001b[0m 09:38:21.224 -> \u001b[0;32mI (890) spiram: SPI RAM mode: flash 40m sram 40m\u001b[0m 09:38:21.224 -> \u001b[0;32mI (895) spiram: PSRAM initialized, cache is in low/high (2-core) mode.\u001b[0m Here you see 64MBit (= 8MByte) - which is okay. False reading would be: 16MBit The error in the SD log file is typically related with the taking of the image (tbd) as the first time, the system is running out of memory is usually, when it tries to transfer an image from the camera to the PSRAM. There is nothing to do, than to buy a new ESP32CAM with really 64MBit of PSRAM. Configuration missing There are several files needed during on run cycle. If one of this is missing, the firmware is missing information and tends to reboot due to missing error management: /wlan.ini /config/config.ini /config/XXXXX.tflite (1 time for analog and 1 time for digital) where XXXXX is the file name, that is written in the config.ini","title":"Frequent Reboots"},{"location":"Frequent-Reboots/#frequent-reboots","text":"There are several types of reboots. To get a deeper insight turn on the logging: Internal logging ( config.ini ) Serial log of the UART interface (same as for flashing the firmware) There are two principle types of reboots Random reboots (always different timing and situation) Permanent Reboots always at the same time","title":"Frequent Reboots"},{"location":"Frequent-Reboots/#random-reboots","text":"Random reboots have two reasons: overload during HTML access and unstable system In general: there are several mechanisms in the firmware (like saving previous values), to have a \"smooth\" reboot without too many notable disturbance.","title":"Random reboots"},{"location":"Frequent-Reboots/#overload-during-html-access","text":"If you frequently access the web server over HTML requests, the firmware tends to reboot. This especially happens during the first run and when the ESP32 is busy with the digitization flow. The reason for this are running out of memory during a flow, minor memory leakage in combination with missing error handling. There is noting you can do about this kind of reboot, beside two thing: Support the firmware development with improved and tested part of code Be patient :-)","title":"Overload during HTML access"},{"location":"Frequent-Reboots/#unstable-system","text":"If your system is sometimes running smoothly over several runs and sometimes reboots obviously randomly, you have an partially unstable device. You can check this in the standard log file on the SD card: 2021-12-26T06:34:09: task_autodoFlow - round done 2021-12-26T06:34:09: CPU Temperature: 56.1 2021-12-26T06:38:00: task_autodoFlow - next round - Round #23 Here you see, that the round #23 is starting, so obviously there were no reboots in the last 22 rounds. There is hardware (ESP32CAM), where only 2-3 stable rounds are possible and others, where way more than 100 rounds without any reboots is possible. There is noting you can do about it, beside testing different hardware.","title":"Unstable system"},{"location":"Frequent-Reboots/#permanent-reboots","text":"Permanent reboots at the same situation during the flow has a systematic problem either in the hardware or the configuration. It usually happens during the first run as there all needed parts of the firmware have been loaded for the first time. To find the reason mostly the serial log of the UART interface from the startup until the reboots is very helpful. It can be stored using the USB / UART interface - the same as for flashing the firmware - and logging the serial output of the ESP32. Possible problems: SD card PSRAM too low Configuration missing","title":"Permanent reboots"},{"location":"Frequent-Reboots/#sd-card-problems","text":"The ESP32CAM is a little bit \"picky\" with the supported SD cards. Due to the limited availability of GPIOs the SD card can only be accessed via 1-wire mode. Therefore not all SD cards are supported. Several error cases can happen:","title":"SD card problems"},{"location":"Frequent-Reboots/#no-sd-card","text":"Easy to detect: fast blinking red LED directly after startup, no reaction of the web server etc. at all","title":"No SD card"},{"location":"Frequent-Reboots/#sd-card-not-supported-at-all","text":"Error message of no detectable SC card in the log file. Normal looking log for a 16GB SD card is like this: 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.037 -> \u001b[0;32mI (4789) main: Using SDMMC peripheral\u001b[0m 09:38:25.138 -> Name: SC16G 09:38:25.138 -> Type: SDHC/SDXC 09:38:25.138 -> Speed: 20 MHz 09:38:25.138 -> Size: 15193MB Otherwise there is some error message.","title":"SD card not supported at all"},{"location":"Frequent-Reboots/#sd-card-recognized-but-not-supported","text":"This is the most annoying error. The SD card is detected, but the files cannot be read. Most probably this results in a problem with the WLAN connection, as the first file needed is the wlan.ini in the root directory.","title":"SD card recognized but not supported"},{"location":"Frequent-Reboots/#psram-too-low","text":"In order to work, there are 4 MB of PSRAM necessary. Normally the ESP32CAM is equipped with 8 MB, whereof only 4 MB can be used effectively. Sometimes, there is hardware, where only 2 MB of PSRAM is present - even if you have bought a 8 MB module You can identify the amount of PSRAM in the serial log file: 09:38:21.224 -> \u001b[0;32mI (881) psram: This chip is ESP32-D0WD\u001b[0m 09:38:21.224 -> \u001b[0;32mI (885) spiram: Found 64MBit SPI RAM device\u001b[0m 09:38:21.224 -> \u001b[0;32mI (890) spiram: SPI RAM mode: flash 40m sram 40m\u001b[0m 09:38:21.224 -> \u001b[0;32mI (895) spiram: PSRAM initialized, cache is in low/high (2-core) mode.\u001b[0m Here you see 64MBit (= 8MByte) - which is okay. False reading would be: 16MBit The error in the SD log file is typically related with the taking of the image (tbd) as the first time, the system is running out of memory is usually, when it tries to transfer an image from the camera to the PSRAM. There is nothing to do, than to buy a new ESP32CAM with really 64MBit of PSRAM.","title":"PSRAM too low"},{"location":"Frequent-Reboots/#configuration-missing","text":"There are several files needed during on run cycle. If one of this is missing, the firmware is missing information and tends to reboot due to missing error management: /wlan.ini /config/config.ini /config/XXXXX.tflite (1 time for analog and 1 time for digital) where XXXXX is the file name, that is written in the config.ini","title":"Configuration missing"},{"location":"Hardware-Compatibility/","text":"Hardware Compatibility General Remark Although a board looks similar, it can have major differences, e.g.: Processor Ram (Size! & Type) -> this Project needs at least 4MB RAM! Flashrom Camera Modules Onboard/External Antenna Quality of Components Manufacture Quality of the PCB and soldering Different Components \"Clone\" Components -> ESPxx etc. This can cause different Power Consumption, Power Requirements, compatibility issues, etc. Most manufacturers and sellers buy what's cheap today on the Asian markets. In the end, it looks like it is sometimes a trial and error approach which ESP32-CAM Module works reliably. Below you find some remarks and experiences from the community: ESP32 core itself Chip Version Image Status ESP32-D0WDQ6 (revision 1) \u2714\ufe0f PSRAM There seems to be a lot of \"fake\" chips, or maybe wrongly configured ESP32 Boards. For AP MEMORY, all \"real\" APS 64 04*3SQR chips should work. For ESP PSRAM, all \"real\" PSRAM 64 * should work. 64Mbit density = 8Mbyte PSRAM This Table is just a snapshot of chips which worked Labeling on PSRAM module Image Status IPUS / IPS640LS0 / 1815XBGN \u2714\ufe0f AP MEMORY / 64 04L-3SOR / 1040H / 110089G \u2714\ufe0f AP MEMORY / 64 04L-3SQR / 12205 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 12208 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-350R / 1120A / 130027G \u274c PSRAM not accessible AP MEMORY / 64 04L-35QR / 11208 / 130025G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 13100 / 180026G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 11207 / 130024G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 1120A / 130027G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 1120B / 130028G \u2714\ufe0f 8MB AP MEMORY / 1604M-3SQR / 0280A / 070036G \u274c 2MB only! ESP PSRAM 64 H 462021 / 1B00286 \u2714\ufe0f ESP PSRAM 64 H 412021 / 1A0039G \u2714\ufe0f 8MB ESP PSRAM 64 H 402021 / 1A0017N \u274c PSRAM not accessible ESP PSRAM16M 302020 \u274c 2MB only! ESP PSRAM16H 202020 / 050022G \u274c 2MB only! OV2640 - Camera The experience with the camera only is based on single modules. It is well possible, that this module had a damage overall and other modules of the same type will work. Give it a try and report to me! Labeling on Flex-Connector Image Status TY-OV2 / 640-V2.0 \u2714\ufe0f DCX-OV2 / 640-V2 \u2714\ufe0f DC-26 / 40-V3 \u2714\ufe0f 3x \u274c 1x ESP32 Modules Module Image Status ESP32CAM / Different versions on the market! Especially the PSRAM is sometimes labeled wrong (Label: 4MB, Real: only 2 MB --> will not work!) \u2714\ufe0f with >=4 MB PSRAM! ESP32-S3-EYE No Flash LED, pins different used (e.g. LCD display) NOT OKAY SD Cards Due to the limited free available GPIOs (due to all the extensions needed like: camera, SD card, LED-flash, ...) the SD card is connected in 1-wire mode. There are some cards, that are compatible with the esp32cam module for unknown reasons. It is observed, that smaller cards (up to 4 GB) tend to be more stable and larger cards have more problems. But quite some exceptions in the forums (4 GB cards not working, 16 GB cards working like a charm). Devices known to work Modules (Old list, not up-to-date anymore): See https://github.com/jomjol/AI-on-the-edge-device/discussions/1732 for a more recent list. https://arduino-projekte.info/produkt/esp32-cam-v2-integriertem-ch340-mit-ov2640-kamera-modul/ (see https://github.com/jomjol/AI-on-the-edge-device/discussions/1041 ) https://www.amazon.de/-/en/gp/product/B0B51CQ13R https://www.reichelt.de/entwicklerboards-esp32-kamera-2mp-25--debo-cam-esp32-p266036.html?PROVID=2788&gclid=CjwKCAiAqaWdBhAvEiwAGAQlttJnV4azXWDYeaFUuNioMICh-jvxKp6Cifmcep9vvtoT2JRCDqBczRoC7Q0QAvD_BwE (27.12.2022) SD Card Sandisk 2GB Micro SD Class 2 Sandisk 2GB AITRIP ESP32 and CAM ESP-32/CAM Amazon US - Aideepen ESP32-CAM W BT Board ESP32-CAM-MB Micro USB to Serial Port CH-340G with OV2640 2MP Camera Module Dual Mode with Amazon US - Cloudisk 5Pack 4GB Micro SD Card 4 GB MicroSD Memory Card Class6 Weak Wifi The ESP32-CAM supports an external antenna. It requires some soldering skills but can improve the connection quality. See https://randomnerdtutorials.com/esp32-cam-connect-external-antenna/","title":"Hardware Compatibility"},{"location":"Hardware-Compatibility/#hardware-compatibility","text":"","title":"Hardware Compatibility"},{"location":"Hardware-Compatibility/#general-remark","text":"Although a board looks similar, it can have major differences, e.g.: Processor Ram (Size! & Type) -> this Project needs at least 4MB RAM! Flashrom Camera Modules Onboard/External Antenna Quality of Components Manufacture Quality of the PCB and soldering Different Components \"Clone\" Components -> ESPxx etc. This can cause different Power Consumption, Power Requirements, compatibility issues, etc. Most manufacturers and sellers buy what's cheap today on the Asian markets. In the end, it looks like it is sometimes a trial and error approach which ESP32-CAM Module works reliably. Below you find some remarks and experiences from the community:","title":"General Remark"},{"location":"Hardware-Compatibility/#esp32-core-itself","text":"Chip Version Image Status ESP32-D0WDQ6 (revision 1) \u2714\ufe0f","title":"ESP32 core itself"},{"location":"Hardware-Compatibility/#psram","text":"There seems to be a lot of \"fake\" chips, or maybe wrongly configured ESP32 Boards. For AP MEMORY, all \"real\" APS 64 04*3SQR chips should work. For ESP PSRAM, all \"real\" PSRAM 64 * should work. 64Mbit density = 8Mbyte PSRAM This Table is just a snapshot of chips which worked Labeling on PSRAM module Image Status IPUS / IPS640LS0 / 1815XBGN \u2714\ufe0f AP MEMORY / 64 04L-3SOR / 1040H / 110089G \u2714\ufe0f AP MEMORY / 64 04L-3SQR / 12205 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 12208 / 150047G \u2714\ufe0f 8MB AP MEMORY / 64 04L-350R / 1120A / 130027G \u274c PSRAM not accessible AP MEMORY / 64 04L-35QR / 11208 / 130025G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 13100 / 180026G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 11207 / 130024G \u274c PSRAM not accessible AP MEMORY / 64 04L-3SQR / 1120A / 130027G \u2714\ufe0f 8MB AP MEMORY / 64 04L-3SQR / 1120B / 130028G \u2714\ufe0f 8MB AP MEMORY / 1604M-3SQR / 0280A / 070036G \u274c 2MB only! ESP PSRAM 64 H 462021 / 1B00286 \u2714\ufe0f ESP PSRAM 64 H 412021 / 1A0039G \u2714\ufe0f 8MB ESP PSRAM 64 H 402021 / 1A0017N \u274c PSRAM not accessible ESP PSRAM16M 302020 \u274c 2MB only! ESP PSRAM16H 202020 / 050022G \u274c 2MB only!","title":"PSRAM"},{"location":"Hardware-Compatibility/#ov2640-camera","text":"The experience with the camera only is based on single modules. It is well possible, that this module had a damage overall and other modules of the same type will work. Give it a try and report to me! Labeling on Flex-Connector Image Status TY-OV2 / 640-V2.0 \u2714\ufe0f DCX-OV2 / 640-V2 \u2714\ufe0f DC-26 / 40-V3 \u2714\ufe0f 3x \u274c 1x","title":"OV2640 - Camera"},{"location":"Hardware-Compatibility/#esp32-modules","text":"Module Image Status ESP32CAM / Different versions on the market! Especially the PSRAM is sometimes labeled wrong (Label: 4MB, Real: only 2 MB --> will not work!) \u2714\ufe0f with >=4 MB PSRAM! ESP32-S3-EYE No Flash LED, pins different used (e.g. LCD display) NOT OKAY","title":"ESP32 Modules"},{"location":"Hardware-Compatibility/#sd-cards","text":"Due to the limited free available GPIOs (due to all the extensions needed like: camera, SD card, LED-flash, ...) the SD card is connected in 1-wire mode. There are some cards, that are compatible with the esp32cam module for unknown reasons. It is observed, that smaller cards (up to 4 GB) tend to be more stable and larger cards have more problems. But quite some exceptions in the forums (4 GB cards not working, 16 GB cards working like a charm).","title":"SD Cards"},{"location":"Hardware-Compatibility/#devices-known-to-work","text":"","title":"Devices known to work"},{"location":"Hardware-Compatibility/#modules-old-list-not-up-to-date-anymore","text":"See https://github.com/jomjol/AI-on-the-edge-device/discussions/1732 for a more recent list. https://arduino-projekte.info/produkt/esp32-cam-v2-integriertem-ch340-mit-ov2640-kamera-modul/ (see https://github.com/jomjol/AI-on-the-edge-device/discussions/1041 ) https://www.amazon.de/-/en/gp/product/B0B51CQ13R https://www.reichelt.de/entwicklerboards-esp32-kamera-2mp-25--debo-cam-esp32-p266036.html?PROVID=2788&gclid=CjwKCAiAqaWdBhAvEiwAGAQlttJnV4azXWDYeaFUuNioMICh-jvxKp6Cifmcep9vvtoT2JRCDqBczRoC7Q0QAvD_BwE (27.12.2022)","title":"Modules (Old list, not up-to-date anymore):"},{"location":"Hardware-Compatibility/#sd-card","text":"Sandisk 2GB Micro SD Class 2 Sandisk 2GB AITRIP ESP32 and CAM ESP-32/CAM Amazon US - Aideepen ESP32-CAM W BT Board ESP32-CAM-MB Micro USB to Serial Port CH-340G with OV2640 2MP Camera Module Dual Mode with Amazon US - Cloudisk 5Pack 4GB Micro SD Card 4 GB MicroSD Memory Card Class6","title":"SD Card"},{"location":"Hardware-Compatibility/#weak-wifi","text":"The ESP32-CAM supports an external antenna. It requires some soldering skills but can improve the connection quality. See https://randomnerdtutorials.com/esp32-cam-connect-external-antenna/","title":"Weak Wifi"},{"location":"Influx-DB/","text":"Influx DB The device also supports direct sending of data to an Influx DB. \u203c\ufe0f Only Influx DB 1 is supported!","title":"Influx DB"},{"location":"Influx-DB/#influx-db","text":"The device also supports direct sending of data to an Influx DB. \u203c\ufe0f Only Influx DB 1 is supported!","title":"Influx DB"},{"location":"Installation/","text":"Installation The installation requires multiple steps: Get the right hardware and wire it up Flash the firmware onto the ESP32 Write the data to the SD card Start it For point 2 and 3 we provide multiple ways to do it. Pick the one that looks the easiest for you! 1. Hardware ESP32-CAM OV2640 camera module Micro SD card slot 4 or 8 MB PSRAM. It can be easily found on the typical internet stores, searching for ESP32-CAM for less than 10 EUR. How ever since the hardware is cheap and coming from China, you unluckily could pick a malfunctioning device. See Hardware Compatibility for further advice! USB->UART interface For first time flashing the firmware a USB -> UART connector is needed. Later firmware upgrades than can be flashed via OTA. Power supply For power supply a 5V source is needed. Most easily this can be done via a USB power supply. The power supply should support minimum 500mA. For buffering current peaks some users reported to use a large electrolytic capacitor like a 2200uF between ground and VCC. \u203c\ufe0f Attention: in several internet forums there are problems reported, in case the ESP32-CAM is only supplied with 3.3V. Housing A small 3D-printable example for a very small case can be found in Thingiverse here: https://www.thingiverse.com/thing:4571627 \u203c\ufe0f Attention : the focus of the OV2640 needs to be adjusted, as it is normally set from ~40cm to infinity. In order to get an image that is big enough, it needs to be changed to about 10cm. Therefore the sealing glue on the objective ring needs to be removed with a scalpel or sharp knife. Afterwards the objective can be rotated clockwise until the image is sharp again. Wiring Beside the 5V power supply, only for the first flashing a connection to the USB-UART connector, including a short cut of GPIO0 to GND for bootloader start. A example for wiring can be found here: It is also possible to use external LEDs for the illumination instead of the internal flash LED. This is described here 2. Firmware Web Installer There is a Web Installer available which will work right out of the web browser Edge and Chrome. You can access it with the following link: Web Installer This is the preferred way for beginners as it also allows access to the USB Log: Manual Flashing Files Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please have a look on Living on the Edge first! You need: partitions.bin bootloader.bin firmware.bin Flashing using the Flash Tool from Espressif (GUI) Get the Flash Download Tool from Espressif. Download and extract the Flash tool, after starting choose \"Developer Mode\", then \"ESP32-DownloadTool\" and you are in the setup of the flashing tool. Connect the ESP32-CAM with the USB-UART connection and identify the COM-Port. \u203c\ufe0f Attention : if you are re-flashing the code again, it is strongly recommended to erase the flash memory before flashing the firmware. Especially if you used OTA in between, which might cause remaining information on the flash, to still boot from an old image in the OTA-area, which is not erased by a normal flash. But your ESP32 in bootloader mode and push start, then it will identify the board and you can configure the bin-configuration according to the following table: Filename Offset bootloader.bin 0x1000 partitions.bin 0x8000 firmware.bin 0x10000 Flashing using the Python based esptool (Console) For this you need a python environment (e.g. Anaconda in Win10). Here you need to install the esptool: pip install esptool Then connect the ESP32 with the USB-UART connector to the system, put it in boot mode and with the following command you can erase the flash and flash bootloader, partitions and firmware in two steps: esptool erase_flash esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin Maybe you need to specify the COM-port if it is not detected by default. If the erase command throws the error A fatal error occurred: ESP32 ROM does not support function erase_flash. , your esptool might be too old, see https://techoverflow.net/2022/02/08/how-to-fix-esp32-a-fatal-error-occurred-esp32-rom-does-not-support-function-erase_flash/ With some Python installations this may not work and you\u2019ll receive an error, try python -m pip install esptool or pip3 install esptool . Further recommendations can be found on the espressif webpage . 3. SD Card The software expects an SD card prepared with certain directory and file structure in order to work properly. SD card most top directory should look like this: This initial setup needs only to be done once as further updates (Firmware as well as SD card content) are possible with the Over-The-Air Update mechanism. Notes Due to the limited availability of GPIOs (OV2640, Flash-Light, PSRAM & SD card) the communication mode to the SD card is limited to 1-line SD-Mode. It showed up, that this results in problems with very large SD-Cards (64GB, sometimes 32 GB) and some no name low cost SD-cards. There must be no partition table on the SD-card (no GPT, but only MBR for the single partition) Following setting are necessary for formatting the SD-card: SINGLE PARTITION, MBR, FAT32 - 32K. NOT exFAT Some ESP32 devices share their SD-card and/or camera GPIOs with the pins for TX and RX. If you see errors like \u201cFailed to connect\u201d then your chip is probably not entering the bootloader properly. Remove the respective modules temporarily to free the GPIOs for flashing. You may find more information about troubleshooting on the homepage of Espressif . The ESP32 indicates problems with the SD card during startup with a fast, endless blinking. In this case, please try another SD card. Manual Setup with an SD Card Reader on a PC Take the AI-on-the-edge-device__manual-setup__*.zip from the Release page. Open it and extract the sd-card.zip . Open it and extract all files onto onto your SD card. On the SD card, open the wlan.ini file and configure it as needed: Set the corresponding SSID and password The other parameters are optional Note: The device provides a File Server which can be used to show, edit or delete the files on the SD card. For security reasons, the wlan.ini file is excluded from this and is hidden from external access to protect the password. After this, you can insert the SD card into the ESP32 board and start it. Remote Setup using the built-in Access Point On startup of the ESP32, it checks if the wlan.ini or the config/config.ini are available on the SD card. If not, the ESP32 switches to a special mode. In this mode, it provides a Wifi Access Point which can be used to add the missing wlan.ini or the config/config.ini file. Take the AI-on-the-edge-device__remote-setup__*.zip from the Release page. Connect to Access Point of the device. The SSID is \"AI-on-the-Edge\" and you can access it without any password: The device has the following fixed IP: http://192.168.4.1 . Upload initial configuration to SD card Use the select file and upload button to start the upload. A warning will show up if you have chosen a possible wrong file (without default configuration). Store WLAN access information. After the upload, a new page will be shown: Enter your SSID and password. Note: Only basic settings are supported. If you need advanced configuration (fixed ip, ...), you need to use the manual setup as documented above. \u203c\ufe0f Attention: Carefully check your wifi settings. To change them later on, you need to take out the SD card and edit the wlan.ini manually (or delete it and start again). The information is transferred without encryption! Finish the step by pushing Write wlan.ini Reboot The final step is the reboot: \u203c\ufe0f Warning: It will take up to 3 minutes. Afterwards you can find your device in the local network. Check your router for the IP. You can find it also in the USB Console output. 4. Initial Startup After the firmware is flashed and the SD card is setup properly, you can start it. After power on the connection status is indicated by 3x blinking of the red on board LED. WLAN-Status indication: 5 x fast blinking (< 1 second): connection still pending 3 x slow blinking (1 second on/off): WLAN connection established Note: It is normal that at first one or two times a pending connection is indicated.","title":"Installation"},{"location":"Installation/#installation","text":"The installation requires multiple steps: Get the right hardware and wire it up Flash the firmware onto the ESP32 Write the data to the SD card Start it For point 2 and 3 we provide multiple ways to do it. Pick the one that looks the easiest for you!","title":"Installation"},{"location":"Installation/#1-hardware","text":"","title":"1. Hardware"},{"location":"Installation/#esp32-cam","text":"OV2640 camera module Micro SD card slot 4 or 8 MB PSRAM. It can be easily found on the typical internet stores, searching for ESP32-CAM for less than 10 EUR. How ever since the hardware is cheap and coming from China, you unluckily could pick a malfunctioning device. See Hardware Compatibility for further advice!","title":"ESP32-CAM"},{"location":"Installation/#usb-uart-interface","text":"For first time flashing the firmware a USB -> UART connector is needed. Later firmware upgrades than can be flashed via OTA.","title":"USB->UART interface"},{"location":"Installation/#power-supply","text":"For power supply a 5V source is needed. Most easily this can be done via a USB power supply. The power supply should support minimum 500mA. For buffering current peaks some users reported to use a large electrolytic capacitor like a 2200uF between ground and VCC. \u203c\ufe0f Attention: in several internet forums there are problems reported, in case the ESP32-CAM is only supplied with 3.3V.","title":"Power supply"},{"location":"Installation/#housing","text":"A small 3D-printable example for a very small case can be found in Thingiverse here: https://www.thingiverse.com/thing:4571627 \u203c\ufe0f Attention : the focus of the OV2640 needs to be adjusted, as it is normally set from ~40cm to infinity. In order to get an image that is big enough, it needs to be changed to about 10cm. Therefore the sealing glue on the objective ring needs to be removed with a scalpel or sharp knife. Afterwards the objective can be rotated clockwise until the image is sharp again.","title":"Housing"},{"location":"Installation/#wiring","text":"Beside the 5V power supply, only for the first flashing a connection to the USB-UART connector, including a short cut of GPIO0 to GND for bootloader start. A example for wiring can be found here: It is also possible to use external LEDs for the illumination instead of the internal flash LED. This is described here","title":"Wiring"},{"location":"Installation/#2-firmware","text":"","title":"2. Firmware"},{"location":"Installation/#web-installer","text":"There is a Web Installer available which will work right out of the web browser Edge and Chrome. You can access it with the following link: Web Installer This is the preferred way for beginners as it also allows access to the USB Log:","title":"Web Installer"},{"location":"Installation/#manual-flashing","text":"","title":"Manual Flashing"},{"location":"Installation/#files","text":"Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please have a look on Living on the Edge first! You need: partitions.bin bootloader.bin firmware.bin","title":"Files"},{"location":"Installation/#flashing-using-the-flash-tool-from-espressif-gui","text":"Get the Flash Download Tool from Espressif. Download and extract the Flash tool, after starting choose \"Developer Mode\", then \"ESP32-DownloadTool\" and you are in the setup of the flashing tool. Connect the ESP32-CAM with the USB-UART connection and identify the COM-Port. \u203c\ufe0f Attention : if you are re-flashing the code again, it is strongly recommended to erase the flash memory before flashing the firmware. Especially if you used OTA in between, which might cause remaining information on the flash, to still boot from an old image in the OTA-area, which is not erased by a normal flash. But your ESP32 in bootloader mode and push start, then it will identify the board and you can configure the bin-configuration according to the following table: Filename Offset bootloader.bin 0x1000 partitions.bin 0x8000 firmware.bin 0x10000","title":"Flashing using the Flash Tool from Espressif (GUI)"},{"location":"Installation/#flashing-using-the-python-based-esptool-console","text":"For this you need a python environment (e.g. Anaconda in Win10). Here you need to install the esptool: pip install esptool Then connect the ESP32 with the USB-UART connector to the system, put it in boot mode and with the following command you can erase the flash and flash bootloader, partitions and firmware in two steps: esptool erase_flash esptool write_flash 0x01000 bootloader.bin 0x08000 partitions.bin 0x10000 firmware.bin Maybe you need to specify the COM-port if it is not detected by default. If the erase command throws the error A fatal error occurred: ESP32 ROM does not support function erase_flash. , your esptool might be too old, see https://techoverflow.net/2022/02/08/how-to-fix-esp32-a-fatal-error-occurred-esp32-rom-does-not-support-function-erase_flash/ With some Python installations this may not work and you\u2019ll receive an error, try python -m pip install esptool or pip3 install esptool . Further recommendations can be found on the espressif webpage .","title":"Flashing using the Python based esptool (Console)"},{"location":"Installation/#3-sd-card","text":"The software expects an SD card prepared with certain directory and file structure in order to work properly. SD card most top directory should look like this: This initial setup needs only to be done once as further updates (Firmware as well as SD card content) are possible with the Over-The-Air Update mechanism.","title":"3. SD Card"},{"location":"Installation/#notes","text":"Due to the limited availability of GPIOs (OV2640, Flash-Light, PSRAM & SD card) the communication mode to the SD card is limited to 1-line SD-Mode. It showed up, that this results in problems with very large SD-Cards (64GB, sometimes 32 GB) and some no name low cost SD-cards. There must be no partition table on the SD-card (no GPT, but only MBR for the single partition) Following setting are necessary for formatting the SD-card: SINGLE PARTITION, MBR, FAT32 - 32K. NOT exFAT Some ESP32 devices share their SD-card and/or camera GPIOs with the pins for TX and RX. If you see errors like \u201cFailed to connect\u201d then your chip is probably not entering the bootloader properly. Remove the respective modules temporarily to free the GPIOs for flashing. You may find more information about troubleshooting on the homepage of Espressif . The ESP32 indicates problems with the SD card during startup with a fast, endless blinking. In this case, please try another SD card.","title":"Notes"},{"location":"Installation/#manual-setup-with-an-sd-card-reader-on-a-pc","text":"Take the AI-on-the-edge-device__manual-setup__*.zip from the Release page. Open it and extract the sd-card.zip . Open it and extract all files onto onto your SD card. On the SD card, open the wlan.ini file and configure it as needed: Set the corresponding SSID and password The other parameters are optional Note: The device provides a File Server which can be used to show, edit or delete the files on the SD card. For security reasons, the wlan.ini file is excluded from this and is hidden from external access to protect the password. After this, you can insert the SD card into the ESP32 board and start it.","title":"Manual Setup with an SD Card Reader on a PC"},{"location":"Installation/#remote-setup-using-the-built-in-access-point","text":"On startup of the ESP32, it checks if the wlan.ini or the config/config.ini are available on the SD card. If not, the ESP32 switches to a special mode. In this mode, it provides a Wifi Access Point which can be used to add the missing wlan.ini or the config/config.ini file. Take the AI-on-the-edge-device__remote-setup__*.zip from the Release page. Connect to Access Point of the device. The SSID is \"AI-on-the-Edge\" and you can access it without any password: The device has the following fixed IP: http://192.168.4.1 . Upload initial configuration to SD card Use the select file and upload button to start the upload. A warning will show up if you have chosen a possible wrong file (without default configuration). Store WLAN access information. After the upload, a new page will be shown: Enter your SSID and password. Note: Only basic settings are supported. If you need advanced configuration (fixed ip, ...), you need to use the manual setup as documented above. \u203c\ufe0f Attention: Carefully check your wifi settings. To change them later on, you need to take out the SD card and edit the wlan.ini manually (or delete it and start again). The information is transferred without encryption! Finish the step by pushing Write wlan.ini Reboot The final step is the reboot: \u203c\ufe0f Warning: It will take up to 3 minutes. Afterwards you can find your device in the local network. Check your router for the IP. You can find it also in the USB Console output.","title":"Remote Setup using the built-in Access Point"},{"location":"Installation/#4-initial-startup","text":"After the firmware is flashed and the SD card is setup properly, you can start it. After power on the connection status is indicated by 3x blinking of the red on board LED. WLAN-Status indication: 5 x fast blinking (< 1 second): connection still pending 3 x slow blinking (1 second on/off): WLAN connection established Note: It is normal that at first one or two times a pending connection is indicated.","title":"4. Initial Startup"},{"location":"Integration-Home-Assistant/","text":"Integration into Home Assistant There are 3 ways to get the data into your Home Assistant: Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery) Using MQTT (Manually Setup Entities) Using REST calls The first one is the easier way if you already have MQTT in use. Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery) \u203c\ufe0f This feature will be available with the next release! Starting with Version >12.0.1 , AI-on-the-edge-devices support Home Assistant Discovery. Check here to learn more about it and how to enable it in Homeassistant. You also have to enable it in the MQTT settings of your device: Make sure to select the right Meter Type to get the right units! On the next start of the device, it will send discovery topics and Home Assistant should pick them up and show them under Settings > Integrations > MQTT : Using MQTT (Manually Setup Entities) First make sure with an MQTT client (for example MQTT Explorer ) that MQTT works as expected and to get a list of the available topics! Then add a sensor for each property: mqtt: sensor: - state_topic: \"wasserzaehler/main/value\" name: \"Watermeter Value\" unique_id: watermeter_value unit_of_measurement: 'm\u00b3' state_class: total_increasing device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/rate\" name: \"Watermeter Rate\" unique_id: watermeter_rate unit_of_measurement: 'm\u00b3/min' state_class: measurement device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/error\" name: \"Watermeter Error\" unique_id: watermeter_error icon: \"mdi:water-alert\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/uptime\" name: \"Watermeter Uptime\" unique_id: watermeter_uptime unit_of_measurement: 's' state_class: measurement device_class: duration entity_category: diagnostic icon: \"mdi:timer-outline\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you run the discovery once, you can also extract the information from there (MQTT Info, untested): mqtt: # Extracted form the Discovery but untested! sensor: - name: Value unique_id: wasserzaehler-main_value icon: mdi:gauge state_topic: wasserzaehler/main/value unit_of_measurement: m\u00b3 device_class: water state_class: total_increasing availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you want to convert the m\u00b3 to l , use a template sensor: template: - sensor: - name: \"Watermeter in l\" unique_id: watermeter_in_l icon: \"mdi:gauge\" state: \"{{ states('sensor.watermeter_value')|float(default=0) * 1000 }}\" # Convert 1 m3 => 1000 l unit_of_measurement: l availability: \"{{ states('sensor.watermeter_value') not in ['unknown', 'unavailable', 'none'] }}\" If you you want to have the consumption per day, you can use an Utility Meter . it is a helper and can be used to reset the total increasing values once a day utility_meter: utility_meter_gas_per_day: source: sensor.gasmeter_value cycle: daily utility_meter_water_per_day: source: sensor.watermeter_value cycle: daily Note that you also can add it using the UI. Examples Statistics Graph Creating Statistics Graphs (e.g. usage per day) is easy using the Energy Dashboard : Note that there seems to be a bug in the graph, see https://github.com/home-assistant/frontend/issues/13995 ! InfluxDb Graphs See also Influx-DB . If you have setup InfluxDB already, it is also possible to fetch statistics from there, e.g. daily usage: from(bucket: \"HomeAssistant\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r[\"entity_id\"] == \"wasserverbrauch_tag\") |> filter(fn: (r) => r[\"_field\"] == \"value\") |> timeShift(duration: -1d) |> aggregateWindow(every: 1d, fn: max, createEmpty: false) |> yield(name: \"mean\") Using REST When using REST, Home Assistant has to periodically call an URL on the ESP32 which in return provides the requested data. See REST API for a list of available URLs. The most practical one is the json entrypoint which provides the most relevant data JSON formatted: http:///json This would return: { \"main\": { \"value\": \"512.3020\", \"raw\": \"0512.3020\", \"error\": \"no error\", \"rate\": 0.000000, \"timestamp\": \"2022-10-02T20:32:06\" [..] } } To do such a REST call, you need to create a REST sensor: sensor: - platform: rest name: \"Gasmeter JSON\" resource: http:///json json_attributes: - main value_template: '{{ value_json.value }}' headers: Content-Type: application/json scan_interval: 60 template: sensor: - name: \"Gasmeter Value from JSON\" unique_id: gas_meter_value_from_json state: \"{{ state_attr('sensor.gasmeter_json','main')['value'] }}\" unit_of_measurement: 'm\u00b3' - name: \"Watermeter Value from JSON\" unique_id: water_meter_value_from_json state: >- {{ state_attr('sensor.watermeter_json','main')['value'] | float }} unit_of_measurement: 'm\u00b3' device_class: water state_class: total_increasing icon: mdi:gauge See also https://community.home-assistant.io/t/rest-sensor-nested-json/243420/9 Photo REST can also be used to show the photo of the last round: To access it, use http:///img_tmp/alg_roi.jpg resp http:///img_tmp/raw.jpg .","title":"Integration into Home Assistant"},{"location":"Integration-Home-Assistant/#integration-into-home-assistant","text":"There are 3 ways to get the data into your Home Assistant: Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery) Using MQTT (Manually Setup Entities) Using REST calls The first one is the easier way if you already have MQTT in use.","title":"Integration into Home Assistant"},{"location":"Integration-Home-Assistant/#using-mqtt-automatically-setup-entities-using-home-assistant-mqtt-discovery","text":"\u203c\ufe0f This feature will be available with the next release! Starting with Version >12.0.1 , AI-on-the-edge-devices support Home Assistant Discovery. Check here to learn more about it and how to enable it in Homeassistant. You also have to enable it in the MQTT settings of your device: Make sure to select the right Meter Type to get the right units! On the next start of the device, it will send discovery topics and Home Assistant should pick them up and show them under Settings > Integrations > MQTT :","title":"Using MQTT (Automatically Setup Entities using Home Assistant MQTT Discovery)"},{"location":"Integration-Home-Assistant/#using-mqtt-manually-setup-entities","text":"First make sure with an MQTT client (for example MQTT Explorer ) that MQTT works as expected and to get a list of the available topics! Then add a sensor for each property: mqtt: sensor: - state_topic: \"wasserzaehler/main/value\" name: \"Watermeter Value\" unique_id: watermeter_value unit_of_measurement: 'm\u00b3' state_class: total_increasing device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/rate\" name: \"Watermeter Rate\" unique_id: watermeter_rate unit_of_measurement: 'm\u00b3/min' state_class: measurement device_class: water # Needs Home Assistant 2022.11! icon: 'mdi:water-pump' availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/main/error\" name: \"Watermeter Error\" unique_id: watermeter_error icon: \"mdi:water-alert\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost - state_topic: \"wasserzaehler/uptime\" name: \"Watermeter Uptime\" unique_id: watermeter_uptime unit_of_measurement: 's' state_class: measurement device_class: duration entity_category: diagnostic icon: \"mdi:timer-outline\" availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you run the discovery once, you can also extract the information from there (MQTT Info, untested): mqtt: # Extracted form the Discovery but untested! sensor: - name: Value unique_id: wasserzaehler-main_value icon: mdi:gauge state_topic: wasserzaehler/main/value unit_of_measurement: m\u00b3 device_class: water state_class: total_increasing availability_topic: wasserzaehler/connection payload_available: connected payload_not_available: connection lost If you want to convert the m\u00b3 to l , use a template sensor: template: - sensor: - name: \"Watermeter in l\" unique_id: watermeter_in_l icon: \"mdi:gauge\" state: \"{{ states('sensor.watermeter_value')|float(default=0) * 1000 }}\" # Convert 1 m3 => 1000 l unit_of_measurement: l availability: \"{{ states('sensor.watermeter_value') not in ['unknown', 'unavailable', 'none'] }}\" If you you want to have the consumption per day, you can use an Utility Meter . it is a helper and can be used to reset the total increasing values once a day utility_meter: utility_meter_gas_per_day: source: sensor.gasmeter_value cycle: daily utility_meter_water_per_day: source: sensor.watermeter_value cycle: daily Note that you also can add it using the UI.","title":"Using MQTT (Manually Setup Entities)"},{"location":"Integration-Home-Assistant/#examples","text":"","title":"Examples"},{"location":"Integration-Home-Assistant/#statistics-graph","text":"Creating Statistics Graphs (e.g. usage per day) is easy using the Energy Dashboard : Note that there seems to be a bug in the graph, see https://github.com/home-assistant/frontend/issues/13995 !","title":"Statistics Graph"},{"location":"Integration-Home-Assistant/#influxdb-graphs","text":"See also Influx-DB . If you have setup InfluxDB already, it is also possible to fetch statistics from there, e.g. daily usage: from(bucket: \"HomeAssistant\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r[\"entity_id\"] == \"wasserverbrauch_tag\") |> filter(fn: (r) => r[\"_field\"] == \"value\") |> timeShift(duration: -1d) |> aggregateWindow(every: 1d, fn: max, createEmpty: false) |> yield(name: \"mean\")","title":"InfluxDb Graphs"},{"location":"Integration-Home-Assistant/#using-rest","text":"When using REST, Home Assistant has to periodically call an URL on the ESP32 which in return provides the requested data. See REST API for a list of available URLs. The most practical one is the json entrypoint which provides the most relevant data JSON formatted: http:///json This would return: { \"main\": { \"value\": \"512.3020\", \"raw\": \"0512.3020\", \"error\": \"no error\", \"rate\": 0.000000, \"timestamp\": \"2022-10-02T20:32:06\" [..] } } To do such a REST call, you need to create a REST sensor: sensor: - platform: rest name: \"Gasmeter JSON\" resource: http:///json json_attributes: - main value_template: '{{ value_json.value }}' headers: Content-Type: application/json scan_interval: 60 template: sensor: - name: \"Gasmeter Value from JSON\" unique_id: gas_meter_value_from_json state: \"{{ state_attr('sensor.gasmeter_json','main')['value'] }}\" unit_of_measurement: 'm\u00b3' - name: \"Watermeter Value from JSON\" unique_id: water_meter_value_from_json state: >- {{ state_attr('sensor.watermeter_json','main')['value'] | float }} unit_of_measurement: 'm\u00b3' device_class: water state_class: total_increasing icon: mdi:gauge See also https://community.home-assistant.io/t/rest-sensor-nested-json/243420/9","title":"Using REST"},{"location":"Integration-Home-Assistant/#photo","text":"REST can also be used to show the photo of the last round: To access it, use http:///img_tmp/alg_roi.jpg resp http:///img_tmp/raw.jpg .","title":"Photo"},{"location":"Learn-models-with-your-own-images/","text":"Learn a model with your own images Once you have collected and selected your own images (see Collect images to improve the models ), you can train your very own model with them. This is an optional step and only suggested for advances users! For training the model you will need a python and Jupyter installation. All current labeled images you can find under ziffer_sortiert_raw dig-class11 models (digits) Fork and checkout neural-network-digital-counter-readout . Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into /ziffer_sortiert_raw folder and run Image_Preparation.ipynb Train_CNN_Digital-Readout-Small-v2.ipynb It creates a dig-class11_xxxx_s2.tflite model, you can upload to the config folder on your device and test it. dig-class100 / dig-cont models (digits) Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under Images Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// Run dig-class100-s2.ipynb . The model to upload to your device you can find under '/output'. ana-class100/ana-cont models (analog pointers) Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under data_raw_all Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// After every adding of images you need to run Image_Preparation.ipynb before you train the models. Run Train_CNN_Analog-Readout_100-Small1_Dropout.ipynb and/or Train_CNN_Analog-Readout_Version-Small2.ipynb . The model to upload to your device you can find in the project folder. Share your images If the results are good you can share the images as pull-request. Please images only! See Share your images for details.","title":"Learn a model with your own images"},{"location":"Learn-models-with-your-own-images/#learn-a-model-with-your-own-images","text":"Once you have collected and selected your own images (see Collect images to improve the models ), you can train your very own model with them. This is an optional step and only suggested for advances users! For training the model you will need a python and Jupyter installation. All current labeled images you can find under ziffer_sortiert_raw","title":"Learn a model with your own images"},{"location":"Learn-models-with-your-own-images/#dig-class11-models-digits","text":"Fork and checkout neural-network-digital-counter-readout . Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into /ziffer_sortiert_raw folder and run Image_Preparation.ipynb Train_CNN_Digital-Readout-Small-v2.ipynb It creates a dig-class11_xxxx_s2.tflite model, you can upload to the config folder on your device and test it.","title":"dig-class11 models (digits)"},{"location":"Learn-models-with-your-own-images/#dig-class100-dig-cont-models-digits","text":"Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under Images Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// Run dig-class100-s2.ipynb . The model to upload to your device you can find under '/output'.","title":"dig-class100 / dig-cont models (digits)"},{"location":"Learn-models-with-your-own-images/#ana-class100ana-cont-models-analog-pointers","text":"Fork and checkout neural-network-analog-needle-readout . All labeled images you can find under data_raw_all Install all requirements for running the notebooks. pip install -r requirements.txt Put your labeled images into images/collected/// After every adding of images you need to run Image_Preparation.ipynb before you train the models. Run Train_CNN_Analog-Readout_100-Small1_Dropout.ipynb and/or Train_CNN_Analog-Readout_Version-Small2.ipynb . The model to upload to your device you can find in the project folder.","title":"ana-class100/ana-cont models (analog pointers)"},{"location":"Learn-models-with-your-own-images/#share-your-images","text":"If the results are good you can share the images as pull-request. Please images only! See Share your images for details.","title":"Share your images"},{"location":"MQTT-API/","text":"MQTT API The device is capable to register to a MQTT broker to publish data and subscribe to specific topics. The MQTT service has to be enabled and configured properly in the device configuration via web interface ( Settings -> Configuration -> section MQTT ) The following parameters have to be defined: * URI * MainTopic (optional, if not set, the hostname is used) * ClientID (optional, if not set, AIOTED- + the MAC address gets used to make sure the ID is unique) * User (optional) * Password (optional) * RetainFlag (optional) Published topics Status MainTopic /{status topic}, e.g. watermeter/status Connection Interval MAC IP Hostname Uptime FreeMem WifiRSSI CPUTemp Status Result MainTopic /{NumberName}/{result topic}, e.g. watermeter/main/value Value Raw Error JSON Rate Rate_per_time_unit The time Unit gets set with the Home Assistant Discovery, e.g. h or m (minutes) Rate_per_digitalization_round The interval defines when the next round gets triggered Changeabsolut Timestamp JSON All relevant results in JSON syntax GPIO MainTopic /{GPIO topic}, e.g. watermeter/GPIO/GPIO12 GPIO/GPIO{PinNumber} Depending on device configuration ( Settings --> Configuration --> Chapter GPIO ) Subscibed topics MainTopic /{subscribed topic}, e.g. watermeter/ctrl/flow_start Control ctrl/flow_start Trigger a flow start by publishing to this topic (any character, length > 0) GPIO/GPIO{PinNumber} Depending on device configuration ( Settings --> Configuration --> Chapter GPIO )","title":"MQTT API"},{"location":"MQTT-API/#mqtt-api","text":"The device is capable to register to a MQTT broker to publish data and subscribe to specific topics. The MQTT service has to be enabled and configured properly in the device configuration via web interface ( Settings -> Configuration -> section MQTT ) The following parameters have to be defined: * URI * MainTopic (optional, if not set, the hostname is used) * ClientID (optional, if not set, AIOTED- + the MAC address gets used to make sure the ID is unique) * User (optional) * Password (optional) * RetainFlag (optional)","title":"MQTT API"},{"location":"MQTT-API/#published-topics","text":"","title":"Published topics"},{"location":"MQTT-API/#status","text":"MainTopic /{status topic}, e.g. watermeter/status","title":"Status"},{"location":"MQTT-API/#connection","text":"","title":"Connection"},{"location":"MQTT-API/#interval","text":"","title":"Interval"},{"location":"MQTT-API/#mac","text":"","title":"MAC"},{"location":"MQTT-API/#ip","text":"","title":"IP"},{"location":"MQTT-API/#hostname","text":"","title":"Hostname"},{"location":"MQTT-API/#uptime","text":"","title":"Uptime"},{"location":"MQTT-API/#freemem","text":"","title":"FreeMem"},{"location":"MQTT-API/#wifirssi","text":"","title":"WifiRSSI"},{"location":"MQTT-API/#cputemp","text":"","title":"CPUTemp"},{"location":"MQTT-API/#status_1","text":"","title":"Status"},{"location":"MQTT-API/#result","text":"MainTopic /{NumberName}/{result topic}, e.g. watermeter/main/value","title":"Result"},{"location":"MQTT-API/#value","text":"","title":"Value"},{"location":"MQTT-API/#raw","text":"","title":"Raw"},{"location":"MQTT-API/#error","text":"","title":"Error"},{"location":"MQTT-API/#json","text":"","title":"JSON"},{"location":"MQTT-API/#rate","text":"","title":"Rate"},{"location":"MQTT-API/#rate_per_time_unit","text":"The time Unit gets set with the Home Assistant Discovery, e.g. h or m (minutes)","title":"Rate_per_time_unit"},{"location":"MQTT-API/#rate_per_digitalization_round","text":"The interval defines when the next round gets triggered","title":"Rate_per_digitalization_round"},{"location":"MQTT-API/#changeabsolut","text":"","title":"Changeabsolut"},{"location":"MQTT-API/#timestamp","text":"","title":"Timestamp"},{"location":"MQTT-API/#json_1","text":"All relevant results in JSON syntax","title":"JSON"},{"location":"MQTT-API/#gpio","text":"MainTopic /{GPIO topic}, e.g. watermeter/GPIO/GPIO12","title":"GPIO"},{"location":"MQTT-API/#gpiogpiopinnumber","text":"Depending on device configuration ( Settings --> Configuration --> Chapter GPIO )","title":"GPIO/GPIO{PinNumber}"},{"location":"MQTT-API/#subscibed-topics","text":"MainTopic /{subscribed topic}, e.g. watermeter/ctrl/flow_start","title":"Subscibed topics"},{"location":"MQTT-API/#control","text":"","title":"Control"},{"location":"MQTT-API/#ctrlflow_start","text":"Trigger a flow start by publishing to this topic (any character, length > 0)","title":"ctrl/flow_start"},{"location":"MQTT-API/#gpiogpiopinnumber_1","text":"Depending on device configuration ( Settings --> Configuration --> Chapter GPIO )","title":"GPIO/GPIO{PinNumber}"},{"location":"Neural-Network-Types/","text":"Neural Network Types Note For an overview, see Choosing the Model . This section is describing the different types of neural networks, that are used with the AI-on-the-edge approach and gives an introduction on how and where to use them. Overview neural network type There are two types of input : digits with rolling number (top town) analog pointers (clockwise rotating pointer) There are two types of neural networks : classification networks with discrete output neurons for each result class: 11 classes for digits (0, 1, ... 8, 9 + \"Not-A-Number\") 100 classes for digits or analog pointers (0.1, 0.2, 0.3, ... , 9.7, 9.8, 9.9) continuous output networks with a continuous output in the interval [0, 10[ No setting of the type in the firmware is necessary. The type can detect by the output structure automatically. \u203c\ufe0f Attention: It is very important to choose the right network type (digits or analog pointers). Technically a wrong network will work and create output, but that would be totally arbitrary Not all type of pointers are trained in all networks. For the 11 classes digits network there many different types of digits trained. The reason is, that you 1) only need 20-30 training images and 2) the data collection is ongoing much longer For the continuous and 100 classes network especially for the digits, there are only a few types of digits trained up to now Therefore sometimes for the digits it is more effective to choose the simpler 11 classes network type (= default). Naming convention Classification 11 classes 0, 1, ... 9 + \"N\" Classification 100 classes 0.0, 0.1, ... 9.9 Continuous Interval [0, 10[ Digits dig-class11 _XXX.tflite dig-class100 _XXX.tflite dig-cont _XXX.tflite Analog Pointers ana-class100 _XXX.tflite ana-cont _XXX.tflite XXX contains the versioning and a parameter for different sizes with the following naming: XXX = versioning_sY versioning = version or in newer networks the training data Y = Neural network size (typically s1, s2, ..., s4). Whereas s1 is the maximum sized neural network and s4 is the smallest. Optional the naming ends with an \"_q\" to signal, that the tflite file has been quantized (size reduction with minimum accuracy loss). Example: dig-class11_1410_s2_q.tflite Classification network for digits with 11 classes (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, N) Version 1410 = 14.1.0 s2 = Size 2 (Medium) q = Quantized Version Overview of trained types and details Analog Pointer (\"ana-cont_XXX.tflite\" & \"ana-class100_XXX.tflite\") This is to transfer the direction of a pointer into a continuous number between 0 and 1, whereas 0 (=1) is the upwards position (12 o'clock), 0.25 corresponds to the 3 o'clock positions and so on. This network is a envelop for all different types of pointers. Currently there are no dedicated network trainings for specific types of pointers. There are two types of network structure, currently both are supported. The \"class100\" is a pure classification network, that might need a bit more accuracy in the labeling. \"cont\" is a no classic approach with a continuous output off only 2 neurons (details see below). Types of counters trained: Training data needs Quadratic images, minimum size: 32x32 pixel Typically 100 - 200 images with a resolution of 1/100 of the full rotation (every 0.1 value or 3.6\u00b0) Naming: x.y_ARBITRARY.jpg, where x.y = value 0.0 ... 9.9 CNN Technical details: Input 32 x 32 RGB images Output ana-cont _XXX.tflite: 2 neurons with output in range [-1, 1] - representing a sinus / cosine encoding of the angle needs to be converted to angle with arctan-hyperbolic function ana-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9 Digits with 11 classes (\"dig-class11_XXX.tflite\") The digit type is a classical classification network, with 11 classes representing the numbers 0, 1, ... 9 and the special class \"N\". It is trained for the rolling ring of gas and electric meters. As there is sometime a status between two images, the special class \"N\" is representing Not-A-Number for the case, that the image cannot be unique classified to one number e.g. because it is between two digits. For this type the lowest amount of training data per type is needed, resulting in a large variety of type being already part of the training set. Types of counters trained: Training data needs RGB images, with minimum size: 20x32 pixel Typically 10 - 20 images (1-2 for each digit and an arbitrary number for the \"N\" class Naming: x_ARBITRARY.jpg, where x = value 0 ... 9 + N CNN Technical details: Input 20 x 32 RGB images Output 11 neurons for image classification (last layer normalized to 1) Neuron 0 to 9 represent the corresponding numbers \"0\" to \"9\" Neuron 10 represents the \"Not-A-Number\" class, telling, that the image is not uniquely classified Digits with rolling results (\"dig-class100_XXX.tflite\" & \"dig-cont_XXX.tflite\") This type of network tries to overcome the problem, that there are intermediate values, when a rolling digit is between two numbers. Previous this was the \"N\" class. In this network type, there are also sub-digit values trained, so that the intermediate state can be used as additional information for the algorithms. Types of counters trained: [[images/dig-cont/dig-cont_1.jpg) [[images/dig-cont/dig-cont_2a.jpg) [[images/dig-cont/dig-cont_2b.jpg) [[images/dig-cont/dig-cont_3a.jpg) [[images/dig-cont/dig-cont_3b.jpg) [[images/dig-cont/dig-cont_3c.jpg) Training data needs RGB images, with minimum size: 20x32 pixel Typically 100 - 200 images (1-2 for each possible position) Naming: x.y_ARBITRARY.jpg, where x.y = 0.0, 0.1, ... 9.9 representing the intermediate state CNN Technical details: Input 20 x 32 RGB images Output dig-cont _XXX.tflite: 10 neurons representing the digits 0, 1, ... 9. The intermediate values are represented by weighted normalized values of two neighboring output neurons needs to be converted to angle with arctan-hyperbolic function dig-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9","title":"Neural Network Types"},{"location":"Neural-Network-Types/#neural-network-types","text":"Note For an overview, see Choosing the Model . This section is describing the different types of neural networks, that are used with the AI-on-the-edge approach and gives an introduction on how and where to use them.","title":"Neural Network Types"},{"location":"Neural-Network-Types/#overview-neural-network-type","text":"There are two types of input : digits with rolling number (top town) analog pointers (clockwise rotating pointer) There are two types of neural networks : classification networks with discrete output neurons for each result class: 11 classes for digits (0, 1, ... 8, 9 + \"Not-A-Number\") 100 classes for digits or analog pointers (0.1, 0.2, 0.3, ... , 9.7, 9.8, 9.9) continuous output networks with a continuous output in the interval [0, 10[ No setting of the type in the firmware is necessary. The type can detect by the output structure automatically. \u203c\ufe0f Attention: It is very important to choose the right network type (digits or analog pointers). Technically a wrong network will work and create output, but that would be totally arbitrary Not all type of pointers are trained in all networks. For the 11 classes digits network there many different types of digits trained. The reason is, that you 1) only need 20-30 training images and 2) the data collection is ongoing much longer For the continuous and 100 classes network especially for the digits, there are only a few types of digits trained up to now Therefore sometimes for the digits it is more effective to choose the simpler 11 classes network type (= default).","title":"Overview neural network type"},{"location":"Neural-Network-Types/#naming-convention","text":"Classification 11 classes 0, 1, ... 9 + \"N\" Classification 100 classes 0.0, 0.1, ... 9.9 Continuous Interval [0, 10[ Digits dig-class11 _XXX.tflite dig-class100 _XXX.tflite dig-cont _XXX.tflite Analog Pointers ana-class100 _XXX.tflite ana-cont _XXX.tflite XXX contains the versioning and a parameter for different sizes with the following naming: XXX = versioning_sY versioning = version or in newer networks the training data Y = Neural network size (typically s1, s2, ..., s4). Whereas s1 is the maximum sized neural network and s4 is the smallest. Optional the naming ends with an \"_q\" to signal, that the tflite file has been quantized (size reduction with minimum accuracy loss). Example: dig-class11_1410_s2_q.tflite Classification network for digits with 11 classes (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, N) Version 1410 = 14.1.0 s2 = Size 2 (Medium) q = Quantized Version","title":"Naming convention"},{"location":"Neural-Network-Types/#overview-of-trained-types-and-details","text":"","title":"Overview of trained types and details"},{"location":"Neural-Network-Types/#analog-pointer-ana-cont_xxxtflite-ana-class100_xxxtflite","text":"This is to transfer the direction of a pointer into a continuous number between 0 and 1, whereas 0 (=1) is the upwards position (12 o'clock), 0.25 corresponds to the 3 o'clock positions and so on. This network is a envelop for all different types of pointers. Currently there are no dedicated network trainings for specific types of pointers. There are two types of network structure, currently both are supported. The \"class100\" is a pure classification network, that might need a bit more accuracy in the labeling. \"cont\" is a no classic approach with a continuous output off only 2 neurons (details see below).","title":"Analog Pointer (\"ana-cont_XXX.tflite\" & \"ana-class100_XXX.tflite\")"},{"location":"Neural-Network-Types/#types-of-counters-trained","text":"","title":"Types of counters trained:"},{"location":"Neural-Network-Types/#training-data-needs","text":"Quadratic images, minimum size: 32x32 pixel Typically 100 - 200 images with a resolution of 1/100 of the full rotation (every 0.1 value or 3.6\u00b0) Naming: x.y_ARBITRARY.jpg, where x.y = value 0.0 ... 9.9","title":"Training data needs"},{"location":"Neural-Network-Types/#cnn-technical-details","text":"","title":"CNN Technical details:"},{"location":"Neural-Network-Types/#input","text":"32 x 32 RGB images","title":"Input"},{"location":"Neural-Network-Types/#output","text":"ana-cont _XXX.tflite: 2 neurons with output in range [-1, 1] - representing a sinus / cosine encoding of the angle needs to be converted to angle with arctan-hyperbolic function ana-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9","title":"Output"},{"location":"Neural-Network-Types/#digits-with-11-classes-dig-class11_xxxtflite","text":"The digit type is a classical classification network, with 11 classes representing the numbers 0, 1, ... 9 and the special class \"N\". It is trained for the rolling ring of gas and electric meters. As there is sometime a status between two images, the special class \"N\" is representing Not-A-Number for the case, that the image cannot be unique classified to one number e.g. because it is between two digits. For this type the lowest amount of training data per type is needed, resulting in a large variety of type being already part of the training set.","title":"Digits with 11 classes (\"dig-class11_XXX.tflite\")"},{"location":"Neural-Network-Types/#types-of-counters-trained_1","text":"","title":"Types of counters trained:"},{"location":"Neural-Network-Types/#training-data-needs_1","text":"RGB images, with minimum size: 20x32 pixel Typically 10 - 20 images (1-2 for each digit and an arbitrary number for the \"N\" class Naming: x_ARBITRARY.jpg, where x = value 0 ... 9 + N","title":"Training data needs"},{"location":"Neural-Network-Types/#cnn-technical-details_1","text":"","title":"CNN Technical details:"},{"location":"Neural-Network-Types/#input_1","text":"20 x 32 RGB images","title":"Input"},{"location":"Neural-Network-Types/#output_1","text":"11 neurons for image classification (last layer normalized to 1) Neuron 0 to 9 represent the corresponding numbers \"0\" to \"9\" Neuron 10 represents the \"Not-A-Number\" class, telling, that the image is not uniquely classified","title":"Output"},{"location":"Neural-Network-Types/#digits-with-rolling-results-dig-class100_xxxtflite-dig-cont_xxxtflite","text":"This type of network tries to overcome the problem, that there are intermediate values, when a rolling digit is between two numbers. Previous this was the \"N\" class. In this network type, there are also sub-digit values trained, so that the intermediate state can be used as additional information for the algorithms.","title":"Digits with rolling results (\"dig-class100_XXX.tflite\" & \"dig-cont_XXX.tflite\")"},{"location":"Neural-Network-Types/#types-of-counters-trained_2","text":"[[images/dig-cont/dig-cont_1.jpg) [[images/dig-cont/dig-cont_2a.jpg) [[images/dig-cont/dig-cont_2b.jpg) [[images/dig-cont/dig-cont_3a.jpg) [[images/dig-cont/dig-cont_3b.jpg) [[images/dig-cont/dig-cont_3c.jpg)","title":"Types of counters trained:"},{"location":"Neural-Network-Types/#training-data-needs_2","text":"RGB images, with minimum size: 20x32 pixel Typically 100 - 200 images (1-2 for each possible position) Naming: x.y_ARBITRARY.jpg, where x.y = 0.0, 0.1, ... 9.9 representing the intermediate state","title":"Training data needs"},{"location":"Neural-Network-Types/#cnn-technical-details_2","text":"","title":"CNN Technical details:"},{"location":"Neural-Network-Types/#input_2","text":"20 x 32 RGB images","title":"Input"},{"location":"Neural-Network-Types/#output_2","text":"dig-cont _XXX.tflite: 10 neurons representing the digits 0, 1, ... 9. The intermediate values are represented by weighted normalized values of two neighboring output neurons needs to be converted to angle with arctan-hyperbolic function dig-class100 _XXX.tflite 100 neurons representing the classes from 0.0, 0.1, ... 9.8, 9.9","title":"Output"},{"location":"New-Releases-Notification/","text":"Notification about new Releases Do you want to get notified about a new release? There are several ways for it: Github Notifications You will need a Github Account for this! Log into your Github account on Github . Go to AI-on-the-edge-device . On the top right side, click onto Watch and select Custom : Select Releases . You will get an email when a new release gets created. See also Github Documentation . CodeRelease.io Alternatively or if you do not want to create a Github account, CodeRelease.io can be an alternative. You also have to subscribe with an email address but no account is required.","title":"Notification about new Releases"},{"location":"New-Releases-Notification/#notification-about-new-releases","text":"Do you want to get notified about a new release? There are several ways for it:","title":"Notification about new Releases"},{"location":"New-Releases-Notification/#github-notifications","text":"You will need a Github Account for this! Log into your Github account on Github . Go to AI-on-the-edge-device . On the top right side, click onto Watch and select Custom : Select Releases . You will get an email when a new release gets created. See also Github Documentation .","title":"Github Notifications"},{"location":"New-Releases-Notification/#codereleaseio","text":"Alternatively or if you do not want to create a Github account, CodeRelease.io can be an alternative. You also have to subscribe with an email address but no account is required.","title":"CodeRelease.io"},{"location":"Parameters/","text":"Parameters This page lists all available Configuration Parameters. If a parameter or section has a tick box on its left side, you can disable it. In such case the functionality gets disabled respectively the default values will be used. Note This is an auto-generated page! See the README for details! Section TakeImage Parameter Brightness Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Brightness ( -2 .. 2 ) Parameter Contrast Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Contrast ( -2 .. 2 ) Parameter Demo Default Value: false Enable to use demo images instead of the real camera images. Make sure to have a /demo folder on your SD-Card and it contains the expected files! Check here for details. Parameter FixedExposure Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Fixes the illumination setting of camera at the startup and uses this later -> Individual round is faster. Parameter ImageQuality Default Value: 12 Warning This is an Expert Parameter ! Only change it if you understand what it does! Quality index for pictures: 8 (highest quality) ... 63 (lowest quality) Warning Value below 12 could result in system instabilities! Parameter ImageSize Default Value: VGA Warning This is an Expert Parameter ! Only change it if you understand what it does! Size of the camera picture. Available options: VGA (640 x 480 pixel) QVGA (320 x 240 pixel) Parameter LEDIntensity Default Value: 50 Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can also be set on the Reference Image configuration. Set the Flash LED Intensity: ( 0 .. 100 ) Parameter RawImagesLocation Default Value: /log/source Location on the SD-Card to store the raw images. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter RawImagesRetention Default Value: 15 Unit: Days Number of days to keep the raw images ( 0 = forever) Parameter Saturation Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Saturation ( -2 .. 2 ) Parameter WaitBeforeTakingPicture Default Value: 5 Unit: seconds Warning This is an Expert Parameter ! Only change it if you understand what it does! Waiting time between switching illumination on and taking the picture. Section Alignment Parameter AlignmentAlgo Default Value: Default Warning This is an Expert Parameter ! Only change it if you understand what it does! Algorithm used for the alignment step. Available options: Default : Use only red color channel HighAccuracy : Use all 3 color channels (3x slower) Fast : First time use HighAccuracy , then only check if the image is shifted Off : Disable alignment algorithm Parameter FlipImageSize Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. This parameter can be used to rotate the viewport together with the alignment rotation: Parameter InitialMirror Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Option for initially mirroring the image on the original x-axis. Parameter InitialRotate Default Value: 179 Unit: Degrees Initial rotation of image before alignment in degree (0 .. 359) Note This parameter is accessible on the Reference Image Page but not on the Config page! Parameter SearchFieldX Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! X-size (width) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size. Parameter SearchFieldY Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! Y-size (height) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size. Section Digits Parameter CNNGoodThreshold Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the dig-class100 models! Parameter Model Default Value: /config/dig-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details. Parameter ROIImagesLocation Default Value: /log/digit Location to store separated digit images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter ROIImagesRetention Default Value: 3 Unit: Days Days to keep the separated digit images ( 0 = forever). Section Analog Parameter CNNGoodThreshold Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the ana-class100 models! Parameter ExtendedResolution Warning This parameter is unused! Use NUMBER.ExtendedResolution instead! Parameter Model Default Value: /config/ana-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details. Parameter ROIImagesLocation Default Value: /log/analog Location to store separated analog images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter ROIImagesRetention Default Value: 3 Unit: Days Days to keep the separated analog images ( 0 = forever). Section PostProcessing Parameter AllowNegativeRates Warning This parameter is unused! Use NUMBER.AllowNegativeRates instead! Parameter CheckDigitIncreaseConsistency Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! An additional consistency check. It especially improves the zero crossing check between digits. Parameter ErrorMessage Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Do not show error message in return value. In an error case, the last valid number will be used for the various transmission protocols (MQTT, InfluxDB, REST, ...). Parameter .AllowNegativeRates Default Value: false Allow a meter to count backwards (decreasing values). Note This is unusual (it means there is a negative rate) and not wanted in most cases! Parameter .AnalogDigitalTransitionStart Default Value: 9.2 This can be used if you have wrong values, but the recognition of the individual ROIs are correct. Look for the start of changing of the first digit and note the analog pointer value behind. Set it here. Only used on combination of digits and analog pointers. See here for details. Parameter .DecimalShift Default Value: 0 Shift the decimal separator (positiv or negativ). Eg. to move from m\u00b3 to liter ( 1 m\u00b3 equals 1000 liters ), you need to set it to +3 . Parameter .ExtendedResolution Default Value: false Use the decimal place of the last analog counter for increased accuracy. Note This parameter is only supported on the *-class* and *-const models! See Choosing-the-Model for details. Parameter .IgnoreLeadingNaN Default Value: true Leading N 's will be deleted before further processing. This is only relevant for models which use N ! See here for details. Parameter .MaxRateType Default Value: AbsoluteChange Defines if the Change Rate compared to the previous value is calculated as absolute change ( AbsoluteChange ) or as rate normalized to the interval ( RateChange = change/minute). Parameter .MaxRateValue Default Value: 0.05 Maximum change of a reading. Depending on the settings of .MaxRateType it is either treated as absolute or relative ! Parameter PreValueAgeStartup Default Value: 720 Warning This is an Expert Parameter ! Only change it if you understand what it does! Time in minutes, how long a previous read value is valid after reboot. Parameter PreValueUse Default Value: true Use the previous value (value from previous round) for consistency checks. This also works through a reboot of the device! Section MQTT Parameter ClientID Default Value: watermeter Client ID used to connect to the MQTT broker. If disabled, the hostname will be used. Parameter HomeassistantDiscovery Default Value: true Enable or disable the Homeassistant Discovery. See here for details about the discovery. Parameter MainTopic Default Value: watermeter MQTT main topic, under which the counters are published. The single value will be published with the following key: MAINTOPIC/NUMBER/RESULT_TOPIC With: NUMBER : The name of the value (a meter might have more than one value). The names get defined in the analog and digital ROI configuration (defaults to main ). RESULT_TOPIC : Automatically filled with the right name, eg. value , rate , timestamp , error , .... The general connection status can be found in MAINTOPIC/CONNECTION . See MQTT Result Topics for a full list of topics. Parameter MeterType Default Value: other Select the Meter Type so the sensors have the right units in Homeassistant. Note For Watermeter you need to have Homeassistant 2022.11 or newer! Please also make sure that the selected Meter Type matches the dimension of the value provided by the meter! Eg. if your meter provides m\u00b3 , you need to also set it to m\u00b3 . Alternatively you can set the parameter DecimalShift to 3 so the value is converted to liters ! Parameter RetainMessages Default Value: true Enable or disable the Retain Flag for all MQTT entries. Parameter Uri Default Value: mqtt://IP-ADRESS:1883 URI to the MQTT broker including the port. E.g. mqtt://192.168.1.1:1883 . Parameter password Default Value: PASSWORD Password for MQTT authentication. Parameter user Default Value: USERNAME Username for MQTT authentication. Section InfluxDB Parameter Database Default Value: '' Name of the InfluxDB v1 Database into which to publish the values. Note See section InfluxDBv2 for InfluxDB v2 support! Parameter Measurement Default Value: undefined Name of the InfluxDB v1 Measurement to use to publish the value. Note See section InfluxDBv2 for InfluxDB v2 support! Parameter Uri Default Value: undefined URI of the HTTP interface to InfluxDB v1, without trailing slash, e.g. http://192.168.1.1:8086 . Note See section InfluxDBv2 for InfluxDB v2 support! Parameter password Default Value: undefined Password for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support! Parameter user Default Value: undefined Username for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support! Section InfluxDBv2 Parameter Database Default Value: '' Name of the InfluxDB v2 Database into which to publish the values. Parameter Measurement Default Value: undefined Name of the InfluxDB v2 Measurement to use to publish the value. Parameter .fieldname Default Value: undefined Fieldname for InfluxDB v2 to use for saving. Parameter Org Default Value: undefined Organisation (Org) for InfluxDB v2 authentication Parameter Token Default Value: undefined Token for InfluxDB v2 authentication Parameter Uri Default Value: undefined URI of the HTTP interface to InfluxDB v2, without trailing slash, e.g. http://192.168.1.1:8086 . Section GPIO Parameter IO0 Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO0 pin. Warning This pin is only usable with restrictions! It must be disabled when the camera is used. Additionally, it is used to activate Bootloader mode and must therefore be HIGH after a reset! Parameters: GPIO 0 state : One of input , input pullup , input pulldown or output . GPIO 0 use interrupt : Enable interrupt trigger GPIO 0 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 0 enable MQTT : Enable MQTT publishing/subscribing GPIO 0 enable HTTP : Enable HTTP write/read GPIO 0 name : MQTT topic name (empty = GPIO0 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO1 Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO1 pin. Warning This pin is by default used for the serial communication as TX pin (USB logging)! Parameters: GPIO 1 state : One of input , input pullup , input pulldown or output . GPIO 1 use interrupt : Enable interrupt trigger GPIO 1 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 1 enable MQTT : Enable MQTT publishing/subscribing GPIO 1 enable HTTP : Enable HTTP write/read GPIO 1 name : MQTT topic name (empty = GPIO1 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO12 Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO12 pin. Note This pin is usable without known restrictions! Parameters: GPIO 12 state : One of external-flash-ws281x , input , input pullup , input pulldown or output . GPIO 12 use interrupt : Enable interrupt trigger GPIO 12 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 12 enable MQTT : Enable MQTT publishing/subscribing GPIO 12 enable HTTP : Enable HTTP write/read GPIO 12 name : MQTT topic name (empty = GPIO12 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO13 Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO13 pin. Note This pin is usable without known restrictions! Parameters: GPIO 13 state : One of input , input pullup , input pulldown or output . GPIO 13 use interrupt : Enable interrupt trigger GPIO 13 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 13 enable MQTT : Enable MQTT publishing/subscribing GPIO 13 enable HTTP : Enable HTTP write/read GPIO 13 name : MQTT topic name (empty = GPIO13 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO3 Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO3 pin. Warning This pin is by default used for the serial communication as RX pin (USB logging)! Parameters: GPIO 3 state : One of input , input pullup , input pulldown or output . GPIO 3 use interrupt : Enable interrupt trigger GPIO 3 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 3 enable MQTT : Enable MQTT publishing/subscribing GPIO 3 enable HTTP : Enable HTTP write/read GPIO 3 name : MQTT topic name (empty = GPIO3 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter IO4 Default Value: built-in-led disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO4 pin. Warning This pin is only usable with restrictions! By default, it is used for build-in flash light (onboard LED). Parameters: GPIO 4 state : One of built-in-led , input , input pullup , input pulldown or output . GPIO 4 use interrupt : Enable interrupt trigger GPIO 4 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 4 enable MQTT : Enable MQTT publishing/subscribing GPIO 4 enable HTTP : Enable HTTP write/read GPIO 4 name : MQTT topic name (empty = GPIO4 ). Allowed characters: a-z, A-Z, 0-9, _, - . Parameter LEDColor Default Value: 150 150 150 Color of the attached LEDs to GPIO12 in R ed, G reen B lue from 0 (full off) .. 255 (full on) (See IO12 parameter). Parameter LEDNumbers Default Value: 2 Number of LEDs on the external LED-stripe attached to GPIO12 (See IO12 parameter). Parameter LEDType Default Value: WS2812 Type of the WS2812x which is connected to GPIO12 (See IO12 parameter). Parameter MainTopicMQTT Default Value: wasserzaehler/GPIO Note This parameter is not accessible through the Web Interface Configuration Page! The GPIO Interface is prepared to report it's status and status changes as a MQTT topic. With this parameter you configure the MQTT main topic, under which the status is published. As this parameter is still experimental it can only be set manually in the config.ini itself and has not been tested in detail so far. Section AutoTimer Parameter AutoStart Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Automatically start the Flow (Digitization Rounds) immediately after power up. Note Typically this is set to true . The main reasons to set it to false is when you want to trigger it manually using the REST API or MQTT-API or for debugging. Parameter Interval Default Value: 5 Unit: Minutes Interval in which the Flow (Digitization Round) is run. If a round takes longer than this interval, the next round gets postponed until the current round completes. Section DataLogging Parameter DataFilesRetention Default Value: 3 Unit: Days Number of days to keep the data files ( 0 = forever). Parameter DataLogActive Default Value: true Activate data logging to the SD-Card. The files will be stored in /log/data/data_YYYY-MM-DD.csv . See Data Logging for details. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Section Debug Parameter LogLevel Default Value: 1 ( ERROR ) Define the log level for the logging to the SD-Card. Available options: 1 : ERROR 2 : WARNING 3 : INFO 4 : DEBUG As higher the level, as more log messages get written to the SD-Card. Warning DEBUG or INFO might damage the SD-Card if enabled long term due to excessive writes to the SD-Card! A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card! Parameter LogfilesRetention Default Value: 3 Unit: Days Number of days to keep the log files ( 0 = forever). Section System Parameter Hostname Default Value: undefined Warning This is an Expert Parameter ! Only change it if you understand what it does! Hostname for the device. It gets automatically transferred to /wlan.ini on the SD-Card at the next startup. Parameter RSSIThreshold Default Value: '' WLAN Mesh Parameter: Threshold for the RSSI value to check for start switching access point in a mesh system. Possible values: -100 .. 0 ( 0 = disabled). It gets automatically transferred to /wlan.ini on the SD-Card at next startup. Parameter SetupMode Default Value: true Note This parameter is not accessible through the Web Interface Configuration Page! Set this parameter to true to stay in the Setup Mode after the next start of the device. Parameter TimeServer Default Value: pool.ntp.org Warning This is an Expert Parameter ! Only change it if you understand what it does! Time server to synchronize system time. If it is disabled or undefined , pool.ntp.org will be used. You can also set it to the IP of your router. Many routers like Fritzboxes can act as a local NTP server. To disable NTP, you need to activate it but set the TimeServer config to be empty ( \"\" ). In such case the time always starts at 01.01.1970 after each power cycle! Parameter TimeZone Default Value: CET-1CEST,M3.5.0,M10.5.0/3 Time zone in POSIX syntax (Europe/Berlin = CET-1CEST,M3.5.0,M10.5.0/3 - incl. daylight saving) Check the table on http:///timezones.html to find the settings for your region.","title":"Parameters"},{"location":"Parameters/#parameters","text":"This page lists all available Configuration Parameters. If a parameter or section has a tick box on its left side, you can disable it. In such case the functionality gets disabled respectively the default values will be used. Note This is an auto-generated page! See the README for details!","title":"Parameters"},{"location":"Parameters/#section-takeimage","text":"","title":"Section TakeImage"},{"location":"Parameters/#parameter-brightness","text":"Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Brightness ( -2 .. 2 )","title":"Parameter Brightness"},{"location":"Parameters/#parameter-contrast","text":"Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Contrast ( -2 .. 2 )","title":"Parameter Contrast"},{"location":"Parameters/#parameter-demo","text":"Default Value: false Enable to use demo images instead of the real camera images. Make sure to have a /demo folder on your SD-Card and it contains the expected files! Check here for details.","title":"Parameter Demo"},{"location":"Parameters/#parameter-fixedexposure","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Fixes the illumination setting of camera at the startup and uses this later -> Individual round is faster.","title":"Parameter FixedExposure"},{"location":"Parameters/#parameter-imagequality","text":"Default Value: 12 Warning This is an Expert Parameter ! Only change it if you understand what it does! Quality index for pictures: 8 (highest quality) ... 63 (lowest quality) Warning Value below 12 could result in system instabilities!","title":"Parameter ImageQuality"},{"location":"Parameters/#parameter-imagesize","text":"Default Value: VGA Warning This is an Expert Parameter ! Only change it if you understand what it does! Size of the camera picture. Available options: VGA (640 x 480 pixel) QVGA (320 x 240 pixel)","title":"Parameter ImageSize"},{"location":"Parameters/#parameter-ledintensity","text":"Default Value: 50 Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can also be set on the Reference Image configuration. Set the Flash LED Intensity: ( 0 .. 100 )","title":"Parameter LEDIntensity"},{"location":"Parameters/#parameter-rawimageslocation","text":"Default Value: /log/source Location on the SD-Card to store the raw images. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter RawImagesLocation"},{"location":"Parameters/#parameter-rawimagesretention","text":"Default Value: 15 Unit: Days Number of days to keep the raw images ( 0 = forever)","title":"Parameter RawImagesRetention"},{"location":"Parameters/#parameter-saturation","text":"Default Value: 0 Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Image Saturation ( -2 .. 2 )","title":"Parameter Saturation"},{"location":"Parameters/#parameter-waitbeforetakingpicture","text":"Default Value: 5 Unit: seconds Warning This is an Expert Parameter ! Only change it if you understand what it does! Waiting time between switching illumination on and taking the picture.","title":"Parameter WaitBeforeTakingPicture"},{"location":"Parameters/#section-alignment","text":"","title":"Section Alignment"},{"location":"Parameters/#parameter-alignmentalgo","text":"Default Value: Default Warning This is an Expert Parameter ! Only change it if you understand what it does! Algorithm used for the alignment step. Available options: Default : Use only red color channel HighAccuracy : Use all 3 color channels (3x slower) Fast : First time use HighAccuracy , then only check if the image is shifted Off : Disable alignment algorithm","title":"Parameter AlignmentAlgo"},{"location":"Parameters/#parameter-flipimagesize","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. This parameter can be used to rotate the viewport together with the alignment rotation:","title":"Parameter FlipImageSize"},{"location":"Parameters/#parameter-initialmirror","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! Note This parameter can also be set on the Reference Image configuration. Option for initially mirroring the image on the original x-axis.","title":"Parameter InitialMirror"},{"location":"Parameters/#parameter-initialrotate","text":"Default Value: 179 Unit: Degrees Initial rotation of image before alignment in degree (0 .. 359) Note This parameter is accessible on the Reference Image Page but not on the Config page!","title":"Parameter InitialRotate"},{"location":"Parameters/#parameter-searchfieldx","text":"Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! X-size (width) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size.","title":"Parameter SearchFieldX"},{"location":"Parameters/#parameter-searchfieldy","text":"Default Value: 20 Unit: Pixels Warning This is an Expert Parameter ! Only change it if you understand what it does! Y-size (height) in which the reference is searched. Note Since the alignment is one of the steps using a lot of computation time, the search field should be as small as possible. The calculation time goes quadratic with the search field size.","title":"Parameter SearchFieldY"},{"location":"Parameters/#section-digits","text":"","title":"Section Digits"},{"location":"Parameters/#parameter-cnngoodthreshold","text":"Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the dig-class100 models!","title":"Parameter CNNGoodThreshold"},{"location":"Parameters/#parameter-model","text":"Default Value: /config/dig-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details.","title":"Parameter Model"},{"location":"Parameters/#parameter-roiimageslocation","text":"Default Value: /log/digit Location to store separated digit images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter ROIImagesLocation"},{"location":"Parameters/#parameter-roiimagesretention","text":"Default Value: 3 Unit: Days Days to keep the separated digit images ( 0 = forever).","title":"Parameter ROIImagesRetention"},{"location":"Parameters/#section-analog","text":"","title":"Section Analog"},{"location":"Parameters/#parameter-cnngoodthreshold_1","text":"Default Value: 0.5 Warning This is an Expert Parameter ! Only change it if you understand what it does! Threshold above which the classification should be to accept the value (only meaningful for digits). Warning This is only supported for the ana-class100 models!","title":"Parameter CNNGoodThreshold"},{"location":"Parameters/#parameter-extendedresolution","text":"Warning This parameter is unused! Use NUMBER.ExtendedResolution instead!","title":"Parameter ExtendedResolution"},{"location":"Parameters/#parameter-model_1","text":"Default Value: /config/ana-cont_*.tflite (See /config/config.ini ) Path to CNN model file for image recognition. See here for details.","title":"Parameter Model"},{"location":"Parameters/#parameter-roiimageslocation_1","text":"Default Value: /log/analog Location to store separated analog images on the SD-Card. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter ROIImagesLocation"},{"location":"Parameters/#parameter-roiimagesretention_1","text":"Default Value: 3 Unit: Days Days to keep the separated analog images ( 0 = forever).","title":"Parameter ROIImagesRetention"},{"location":"Parameters/#section-postprocessing","text":"","title":"Section PostProcessing"},{"location":"Parameters/#parameter-allownegativerates","text":"Warning This parameter is unused! Use NUMBER.AllowNegativeRates instead!","title":"Parameter AllowNegativeRates"},{"location":"Parameters/#parameter-checkdigitincreaseconsistency","text":"Default Value: false Warning This is an Expert Parameter ! Only change it if you understand what it does! An additional consistency check. It especially improves the zero crossing check between digits.","title":"Parameter CheckDigitIncreaseConsistency"},{"location":"Parameters/#parameter-errormessage","text":"Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Do not show error message in return value. In an error case, the last valid number will be used for the various transmission protocols (MQTT, InfluxDB, REST, ...).","title":"Parameter ErrorMessage"},{"location":"Parameters/#parameter-numbersallownegativerates","text":"Default Value: false Allow a meter to count backwards (decreasing values). Note This is unusual (it means there is a negative rate) and not wanted in most cases!","title":"Parameter <NUMBERS>.AllowNegativeRates"},{"location":"Parameters/#parameter-numberanalogdigitaltransitionstart","text":"Default Value: 9.2 This can be used if you have wrong values, but the recognition of the individual ROIs are correct. Look for the start of changing of the first digit and note the analog pointer value behind. Set it here. Only used on combination of digits and analog pointers. See here for details.","title":"Parameter <NUMBER>.AnalogDigitalTransitionStart"},{"location":"Parameters/#parameter-numberdecimalshift","text":"Default Value: 0 Shift the decimal separator (positiv or negativ). Eg. to move from m\u00b3 to liter ( 1 m\u00b3 equals 1000 liters ), you need to set it to +3 .","title":"Parameter <NUMBER>.DecimalShift"},{"location":"Parameters/#parameter-numberextendedresolution","text":"Default Value: false Use the decimal place of the last analog counter for increased accuracy. Note This parameter is only supported on the *-class* and *-const models! See Choosing-the-Model for details.","title":"Parameter <NUMBER>.ExtendedResolution"},{"location":"Parameters/#parameter-numberignoreleadingnan","text":"Default Value: true Leading N 's will be deleted before further processing. This is only relevant for models which use N ! See here for details.","title":"Parameter <NUMBER>.IgnoreLeadingNaN"},{"location":"Parameters/#parameter-numbermaxratetype","text":"Default Value: AbsoluteChange Defines if the Change Rate compared to the previous value is calculated as absolute change ( AbsoluteChange ) or as rate normalized to the interval ( RateChange = change/minute).","title":"Parameter <NUMBER>.MaxRateType"},{"location":"Parameters/#parameter-numbermaxratevalue","text":"Default Value: 0.05 Maximum change of a reading. Depending on the settings of .MaxRateType it is either treated as absolute or relative !","title":"Parameter <NUMBER>.MaxRateValue"},{"location":"Parameters/#parameter-prevalueagestartup","text":"Default Value: 720 Warning This is an Expert Parameter ! Only change it if you understand what it does! Time in minutes, how long a previous read value is valid after reboot.","title":"Parameter PreValueAgeStartup"},{"location":"Parameters/#parameter-prevalueuse","text":"Default Value: true Use the previous value (value from previous round) for consistency checks. This also works through a reboot of the device!","title":"Parameter PreValueUse"},{"location":"Parameters/#section-mqtt","text":"","title":"Section MQTT"},{"location":"Parameters/#parameter-clientid","text":"Default Value: watermeter Client ID used to connect to the MQTT broker. If disabled, the hostname will be used.","title":"Parameter ClientID"},{"location":"Parameters/#parameter-homeassistantdiscovery","text":"Default Value: true Enable or disable the Homeassistant Discovery. See here for details about the discovery.","title":"Parameter HomeassistantDiscovery"},{"location":"Parameters/#parameter-maintopic","text":"Default Value: watermeter MQTT main topic, under which the counters are published. The single value will be published with the following key: MAINTOPIC/NUMBER/RESULT_TOPIC With: NUMBER : The name of the value (a meter might have more than one value). The names get defined in the analog and digital ROI configuration (defaults to main ). RESULT_TOPIC : Automatically filled with the right name, eg. value , rate , timestamp , error , .... The general connection status can be found in MAINTOPIC/CONNECTION . See MQTT Result Topics for a full list of topics.","title":"Parameter MainTopic"},{"location":"Parameters/#parameter-metertype","text":"Default Value: other Select the Meter Type so the sensors have the right units in Homeassistant. Note For Watermeter you need to have Homeassistant 2022.11 or newer! Please also make sure that the selected Meter Type matches the dimension of the value provided by the meter! Eg. if your meter provides m\u00b3 , you need to also set it to m\u00b3 . Alternatively you can set the parameter DecimalShift to 3 so the value is converted to liters !","title":"Parameter MeterType"},{"location":"Parameters/#parameter-retainmessages","text":"Default Value: true Enable or disable the Retain Flag for all MQTT entries.","title":"Parameter RetainMessages"},{"location":"Parameters/#parameter-uri","text":"Default Value: mqtt://IP-ADRESS:1883 URI to the MQTT broker including the port. E.g. mqtt://192.168.1.1:1883 .","title":"Parameter Uri"},{"location":"Parameters/#parameter-password","text":"Default Value: PASSWORD Password for MQTT authentication.","title":"Parameter password"},{"location":"Parameters/#parameter-user","text":"Default Value: USERNAME Username for MQTT authentication.","title":"Parameter user"},{"location":"Parameters/#section-influxdb","text":"","title":"Section InfluxDB"},{"location":"Parameters/#parameter-database","text":"Default Value: '' Name of the InfluxDB v1 Database into which to publish the values. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter Database"},{"location":"Parameters/#parameter-measurement","text":"Default Value: undefined Name of the InfluxDB v1 Measurement to use to publish the value. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter Measurement"},{"location":"Parameters/#parameter-uri_1","text":"Default Value: undefined URI of the HTTP interface to InfluxDB v1, without trailing slash, e.g. http://192.168.1.1:8086 . Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter Uri"},{"location":"Parameters/#parameter-password_1","text":"Default Value: undefined Password for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter password"},{"location":"Parameters/#parameter-user_1","text":"Default Value: undefined Username for the InfluxDB v1 authentication. Note See section InfluxDBv2 for InfluxDB v2 support!","title":"Parameter user"},{"location":"Parameters/#section-influxdbv2","text":"","title":"Section InfluxDBv2"},{"location":"Parameters/#parameter-database_1","text":"Default Value: '' Name of the InfluxDB v2 Database into which to publish the values.","title":"Parameter Database"},{"location":"Parameters/#parameter-measurement_1","text":"Default Value: undefined Name of the InfluxDB v2 Measurement to use to publish the value.","title":"Parameter Measurement"},{"location":"Parameters/#parameter-numberfieldname","text":"Default Value: undefined Fieldname for InfluxDB v2 to use for saving.","title":"Parameter <NUMBER>.fieldname"},{"location":"Parameters/#parameter-org","text":"Default Value: undefined Organisation (Org) for InfluxDB v2 authentication","title":"Parameter Org"},{"location":"Parameters/#parameter-token","text":"Default Value: undefined Token for InfluxDB v2 authentication","title":"Parameter Token"},{"location":"Parameters/#parameter-uri_2","text":"Default Value: undefined URI of the HTTP interface to InfluxDB v2, without trailing slash, e.g. http://192.168.1.1:8086 .","title":"Parameter Uri"},{"location":"Parameters/#section-gpio","text":"","title":"Section GPIO"},{"location":"Parameters/#parameter-io0","text":"Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO0 pin. Warning This pin is only usable with restrictions! It must be disabled when the camera is used. Additionally, it is used to activate Bootloader mode and must therefore be HIGH after a reset! Parameters: GPIO 0 state : One of input , input pullup , input pulldown or output . GPIO 0 use interrupt : Enable interrupt trigger GPIO 0 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 0 enable MQTT : Enable MQTT publishing/subscribing GPIO 0 enable HTTP : Enable HTTP write/read GPIO 0 name : MQTT topic name (empty = GPIO0 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO0"},{"location":"Parameters/#parameter-io1","text":"Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO1 pin. Warning This pin is by default used for the serial communication as TX pin (USB logging)! Parameters: GPIO 1 state : One of input , input pullup , input pulldown or output . GPIO 1 use interrupt : Enable interrupt trigger GPIO 1 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 1 enable MQTT : Enable MQTT publishing/subscribing GPIO 1 enable HTTP : Enable HTTP write/read GPIO 1 name : MQTT topic name (empty = GPIO1 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO1"},{"location":"Parameters/#parameter-io12","text":"Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO12 pin. Note This pin is usable without known restrictions! Parameters: GPIO 12 state : One of external-flash-ws281x , input , input pullup , input pulldown or output . GPIO 12 use interrupt : Enable interrupt trigger GPIO 12 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 12 enable MQTT : Enable MQTT publishing/subscribing GPIO 12 enable HTTP : Enable HTTP write/read GPIO 12 name : MQTT topic name (empty = GPIO12 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO12"},{"location":"Parameters/#parameter-io13","text":"Default Value: input-pullup disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO13 pin. Note This pin is usable without known restrictions! Parameters: GPIO 13 state : One of input , input pullup , input pulldown or output . GPIO 13 use interrupt : Enable interrupt trigger GPIO 13 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 13 enable MQTT : Enable MQTT publishing/subscribing GPIO 13 enable HTTP : Enable HTTP write/read GPIO 13 name : MQTT topic name (empty = GPIO13 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO13"},{"location":"Parameters/#parameter-io3","text":"Default Value: input disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO3 pin. Warning This pin is by default used for the serial communication as RX pin (USB logging)! Parameters: GPIO 3 state : One of input , input pullup , input pulldown or output . GPIO 3 use interrupt : Enable interrupt trigger GPIO 3 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 3 enable MQTT : Enable MQTT publishing/subscribing GPIO 3 enable HTTP : Enable HTTP write/read GPIO 3 name : MQTT topic name (empty = GPIO3 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO3"},{"location":"Parameters/#parameter-io4","text":"Default Value: built-in-led disabled 10 false false Warning This is an Expert Parameter ! Only change it if you understand what it does! This parameter can be used to configure the GPIO IO4 pin. Warning This pin is only usable with restrictions! By default, it is used for build-in flash light (onboard LED). Parameters: GPIO 4 state : One of built-in-led , input , input pullup , input pulldown or output . GPIO 4 use interrupt : Enable interrupt trigger GPIO 4 PWM duty resolution : LEDC PWM duty resolution in bit GPIO 4 enable MQTT : Enable MQTT publishing/subscribing GPIO 4 enable HTTP : Enable HTTP write/read GPIO 4 name : MQTT topic name (empty = GPIO4 ). Allowed characters: a-z, A-Z, 0-9, _, - .","title":"Parameter IO4"},{"location":"Parameters/#parameter-ledcolor","text":"Default Value: 150 150 150 Color of the attached LEDs to GPIO12 in R ed, G reen B lue from 0 (full off) .. 255 (full on) (See IO12 parameter).","title":"Parameter LEDColor"},{"location":"Parameters/#parameter-lednumbers","text":"Default Value: 2 Number of LEDs on the external LED-stripe attached to GPIO12 (See IO12 parameter).","title":"Parameter LEDNumbers"},{"location":"Parameters/#parameter-ledtype","text":"Default Value: WS2812 Type of the WS2812x which is connected to GPIO12 (See IO12 parameter).","title":"Parameter LEDType"},{"location":"Parameters/#parameter-maintopicmqtt","text":"Default Value: wasserzaehler/GPIO Note This parameter is not accessible through the Web Interface Configuration Page! The GPIO Interface is prepared to report it's status and status changes as a MQTT topic. With this parameter you configure the MQTT main topic, under which the status is published. As this parameter is still experimental it can only be set manually in the config.ini itself and has not been tested in detail so far.","title":"Parameter MainTopicMQTT"},{"location":"Parameters/#section-autotimer","text":"","title":"Section AutoTimer"},{"location":"Parameters/#parameter-autostart","text":"Default Value: true Warning This is an Expert Parameter ! Only change it if you understand what it does! Automatically start the Flow (Digitization Rounds) immediately after power up. Note Typically this is set to true . The main reasons to set it to false is when you want to trigger it manually using the REST API or MQTT-API or for debugging.","title":"Parameter AutoStart"},{"location":"Parameters/#parameter-interval","text":"Default Value: 5 Unit: Minutes Interval in which the Flow (Digitization Round) is run. If a round takes longer than this interval, the next round gets postponed until the current round completes.","title":"Parameter Interval"},{"location":"Parameters/#section-datalogging","text":"","title":"Section DataLogging"},{"location":"Parameters/#parameter-datafilesretention","text":"Default Value: 3 Unit: Days Number of days to keep the data files ( 0 = forever).","title":"Parameter DataFilesRetention"},{"location":"Parameters/#parameter-datalogactive","text":"Default Value: true Activate data logging to the SD-Card. The files will be stored in /log/data/data_YYYY-MM-DD.csv . See Data Logging for details. Warning A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter DataLogActive"},{"location":"Parameters/#section-debug","text":"","title":"Section Debug"},{"location":"Parameters/#parameter-loglevel","text":"Default Value: 1 ( ERROR ) Define the log level for the logging to the SD-Card. Available options: 1 : ERROR 2 : WARNING 3 : INFO 4 : DEBUG As higher the level, as more log messages get written to the SD-Card. Warning DEBUG or INFO might damage the SD-Card if enabled long term due to excessive writes to the SD-Card! A SD-Card has limited write cycles. Since the device does not do Wear Leveling , this can wear out your SD-Card!","title":"Parameter LogLevel"},{"location":"Parameters/#parameter-logfilesretention","text":"Default Value: 3 Unit: Days Number of days to keep the log files ( 0 = forever).","title":"Parameter LogfilesRetention"},{"location":"Parameters/#section-system","text":"","title":"Section System"},{"location":"Parameters/#parameter-hostname","text":"Default Value: undefined Warning This is an Expert Parameter ! Only change it if you understand what it does! Hostname for the device. It gets automatically transferred to /wlan.ini on the SD-Card at the next startup.","title":"Parameter Hostname"},{"location":"Parameters/#parameter-rssithreshold","text":"Default Value: '' WLAN Mesh Parameter: Threshold for the RSSI value to check for start switching access point in a mesh system. Possible values: -100 .. 0 ( 0 = disabled). It gets automatically transferred to /wlan.ini on the SD-Card at next startup.","title":"Parameter RSSIThreshold"},{"location":"Parameters/#parameter-setupmode","text":"Default Value: true Note This parameter is not accessible through the Web Interface Configuration Page! Set this parameter to true to stay in the Setup Mode after the next start of the device.","title":"Parameter SetupMode"},{"location":"Parameters/#parameter-timeserver","text":"Default Value: pool.ntp.org Warning This is an Expert Parameter ! Only change it if you understand what it does! Time server to synchronize system time. If it is disabled or undefined , pool.ntp.org will be used. You can also set it to the IP of your router. Many routers like Fritzboxes can act as a local NTP server. To disable NTP, you need to activate it but set the TimeServer config to be empty ( \"\" ). In such case the time always starts at 01.01.1970 after each power cycle!","title":"Parameter TimeServer"},{"location":"Parameters/#parameter-timezone","text":"Default Value: CET-1CEST,M3.5.0,M10.5.0/3 Time zone in POSIX syntax (Europe/Berlin = CET-1CEST,M3.5.0,M10.5.0/3 - incl. daylight saving) Check the table on http:///timezones.html to find the settings for your region.","title":"Parameter TimeZone"},{"location":"REST-API/","text":"REST API Various information is directly accessible over specific REST calls. To use it, just append them to the IP, separated with a / , e.g. http://192.168.1.1/json Note: For more detailed information to the REST handler, have a look to the code in the repository: registered handlers Control flow_start Trigger a flow start (if not running) Set Pre Value Set the Previous Value /setPreValue?value=1234&numbers=main where 1234 is the new value and main the name of the number to be adjusted. GPIO Control a GPIO output The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber}&Status=high /GPIO?GPIO={PinNumber}&Status=low Example: /GPIO?GPIO=12&Status=high Read a GPIO input The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber} Example: /GPIO?GPIO=12 ota ota_page.html Opens the Over-The-Air update html page reboot Trigger a reboot of the device Results json Show result in JSON syntax Example: { \"main\": { \"value\": \"521.17108\", \"raw\": \"521.17108\", \"pre\": \"521.17108\", \"error\": \"no error\", \"rate\": \"0.023780\", \"timestamp\": \"2023-01-13T16:00:42+0100\" } } value Show single result values The value entrypoint also support parameters: http:///value?all=true&type=value http:///value?all=true&type=raw http:///value?all=true&type=error http:///value?all=true&type=prevalue img_tmp/raw.jpg Capture and show a new raw image img_tmp/alg.jpg Show last aligned image img_tmp/alg_roi.jpg Show last aligned image including ROI overlay Status statusflow Show the actual step of the flow incl. timestamp Example: Take Image (15:56:34) rssi Show the WIFI signal strength (Unit: dBm) Example: -51 cpu_temperature Show the CPU temperature (Unit: \u00b0C) Example: 38 sysinfo Show system infos in JSON syntax Example: [{\"firmware\": \"\",\"buildtime\": \"2023-01-25 12:41\",\"gitbranch\": \"HEAD\",\"gittag\": \"\",\"gitrevision\": \"af13c68+\",\"html\": \"Development-Branch: HEAD (Commit: af13c68+)\",\"cputemp\": \"64\",\"hostname\": \"WaterMeterTest\",\"IPv4\": \"192.168.xxx.xxx\",\"freeHeapMem\": \"2818330\"}] starttime Show starttime Example: 20230113-154634 uptime Show uptime Example: 0d 00h 15m 50s Camera lighton Switch the camera flashlight on lightoff Switch the camera flashlight off capture Capture a new image (without flashlight) capture_with_flashlight Capture a new image with flashlight save Save a new image to SD card The save entrypoint also support parameters: http:///save?filename=test.jpg&delay=1 Logs log Last part of todays log (last 80 kBytes)) logfileact Full log of today log.html Opens the log html page Diagnostics heap print relevant memory (heap) information Example: Heap info: Heap Total: 1888926 | SPI Free: 1827431 | SPI Larg Block: 1802240 | SPI Min Free: 758155 | Int Free: 61495 | Int Larg Block: 55296 | Int Min Free: 36427","title":"REST API"},{"location":"REST-API/#rest-api","text":"Various information is directly accessible over specific REST calls. To use it, just append them to the IP, separated with a / , e.g. http://192.168.1.1/json Note: For more detailed information to the REST handler, have a look to the code in the repository: registered handlers","title":"REST API"},{"location":"REST-API/#control","text":"","title":"Control"},{"location":"REST-API/#flow_start","text":"Trigger a flow start (if not running)","title":"flow_start"},{"location":"REST-API/#set-pre-value","text":"Set the Previous Value /setPreValue?value=1234&numbers=main where 1234 is the new value and main the name of the number to be adjusted.","title":"Set Pre Value"},{"location":"REST-API/#gpio","text":"Control a GPIO output The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber}&Status=high /GPIO?GPIO={PinNumber}&Status=low Example: /GPIO?GPIO=12&Status=high Read a GPIO input The GPIO entrypoint also support parameters: /GPIO?GPIO={PinNumber} Example: /GPIO?GPIO=12","title":"GPIO"},{"location":"REST-API/#ota","text":"","title":"ota"},{"location":"REST-API/#ota_pagehtml","text":"Opens the Over-The-Air update html page","title":"ota_page.html"},{"location":"REST-API/#reboot","text":"Trigger a reboot of the device","title":"reboot"},{"location":"REST-API/#results","text":"","title":"Results"},{"location":"REST-API/#json","text":"Show result in JSON syntax Example: { \"main\": { \"value\": \"521.17108\", \"raw\": \"521.17108\", \"pre\": \"521.17108\", \"error\": \"no error\", \"rate\": \"0.023780\", \"timestamp\": \"2023-01-13T16:00:42+0100\" } }","title":"json"},{"location":"REST-API/#value","text":"Show single result values The value entrypoint also support parameters: http:///value?all=true&type=value http:///value?all=true&type=raw http:///value?all=true&type=error http:///value?all=true&type=prevalue","title":"value"},{"location":"REST-API/#img_tmprawjpg","text":"Capture and show a new raw image","title":"img_tmp/raw.jpg"},{"location":"REST-API/#img_tmpalgjpg","text":"Show last aligned image","title":"img_tmp/alg.jpg"},{"location":"REST-API/#img_tmpalg_roijpg","text":"Show last aligned image including ROI overlay","title":"img_tmp/alg_roi.jpg"},{"location":"REST-API/#status","text":"","title":"Status"},{"location":"REST-API/#statusflow","text":"Show the actual step of the flow incl. timestamp Example: Take Image (15:56:34)","title":"statusflow"},{"location":"REST-API/#rssi","text":"Show the WIFI signal strength (Unit: dBm) Example: -51","title":"rssi"},{"location":"REST-API/#cpu_temperature","text":"Show the CPU temperature (Unit: \u00b0C) Example: 38","title":"cpu_temperature"},{"location":"REST-API/#sysinfo","text":"Show system infos in JSON syntax Example: [{\"firmware\": \"\",\"buildtime\": \"2023-01-25 12:41\",\"gitbranch\": \"HEAD\",\"gittag\": \"\",\"gitrevision\": \"af13c68+\",\"html\": \"Development-Branch: HEAD (Commit: af13c68+)\",\"cputemp\": \"64\",\"hostname\": \"WaterMeterTest\",\"IPv4\": \"192.168.xxx.xxx\",\"freeHeapMem\": \"2818330\"}]","title":"sysinfo"},{"location":"REST-API/#starttime","text":"Show starttime Example: 20230113-154634","title":"starttime"},{"location":"REST-API/#uptime","text":"Show uptime Example: 0d 00h 15m 50s","title":"uptime"},{"location":"REST-API/#camera","text":"","title":"Camera"},{"location":"REST-API/#lighton","text":"Switch the camera flashlight on","title":"lighton"},{"location":"REST-API/#lightoff","text":"Switch the camera flashlight off","title":"lightoff"},{"location":"REST-API/#capture","text":"Capture a new image (without flashlight)","title":"capture"},{"location":"REST-API/#capture_with_flashlight","text":"Capture a new image with flashlight","title":"capture_with_flashlight"},{"location":"REST-API/#save","text":"Save a new image to SD card The save entrypoint also support parameters: http:///save?filename=test.jpg&delay=1","title":"save"},{"location":"REST-API/#logs","text":"","title":"Logs"},{"location":"REST-API/#log","text":"Last part of todays log (last 80 kBytes))","title":"log"},{"location":"REST-API/#logfileact","text":"Full log of today","title":"logfileact"},{"location":"REST-API/#loghtml","text":"Opens the log html page","title":"log.html"},{"location":"REST-API/#diagnostics","text":"","title":"Diagnostics"},{"location":"REST-API/#heap","text":"print relevant memory (heap) information Example: Heap info: Heap Total: 1888926 | SPI Free: 1827431 | SPI Larg Block: 1802240 | SPI Min Free: 758155 | Int Free: 61495 | Int Larg Block: 55296 | Int Min Free: 36427","title":"heap"},{"location":"ROI-Configuration/","text":"ROIs (Regions of Interest) Notes You are using a neural network approach which is trained to fit as many different type of meters as possible. The accuracy will never be 100%. It is normal to see a missing reading once in a while. There are several precautions to detect this. For details see the section PostProcessing on the configuration page. The most critical components for an accurate detection are: Correct setting of the R egions O f I nterest (ROIs) for detection of the image. This must be done manually for each device/installation! Using a well trained Model. Have a look on the Digital Counters resp. Analog Needles to check if your types are contained. If your number types are not contained, you should take the effort to record them so we can add them to the training data. See Collect images to improve the models on how to collect new training data. Precondition Please make sure to have: Setup your camera properly and taken a good Reference Image . Selected good Alignment References . Define the ROIs For each digit or analog pointer, a ROI must be defined. You can even have multiple independent Numbers (eg. electerical meters mostly have 2 numbers for the high and low tariff). Depending if you have only one of those types, you can enable/disable (1) it on the top left corner: You can switch between the individual ROIs with the Drop down box (2) . If you need additional ROIs or delete them you can do this with the control at (3) . Like for the Alignment References , you can change the position, size and name of a ROI in the text fields or define them via drag and drop through the mouse button. Make sure the ROIs are in the right order, matching the significance of a digit/analog counter! Warning The order of the ROIs defines how the individual digits are combined to the total number. The first ROI is the digit with the highest order (left side), then the second and so on. You can control the order in the selector tab and change it with the buttons \"move Next\" or \"move Previous\" . In most cases digits are ordered equidistantly (have the same distance between each other) and have the same size. Bcause of this the Web Interface keeps their sises and distance the same. If you need individual sizes or distances, untick the settings (4) . In almost all cases the sizes and y values should be identical! The ratio between x and y might need adjustment. But make sure it is the same for all digits. Same for the analog counters , the sizes should be identical and the x and y as well. Note Don't forget to save the settings with \"Save\" and do not reboot at this stage. Analog Counters For analog counters the ROI setting is rather straight forward as the meter is usually quadratic with a clear center. The circle should exactly fit to the outer size of the meter and the cross should be in the middle of the pointer. Here is an example with the details for the ROI ana1 : Digits For the Digital Meters it is a little bit more complicated, as there are different options of digital models which can be choosen. Correct Size for ROI First of all, choose the right size of the ROI. The configuration of ROIs differs a bit on the selected model (see below). If you are in the initial setup, the model will be selectable in the next step. By default it is a dig-cont resp. ana-cont model. In Model Selection you find the differences between the different available models. Pick the one you think fits best your purpose. If you don't get to good result, try another model. Here we only show the different configuration of the ROIs. Digital Meters with only recognized full digits ( 0, 1, 2, 3, ... 9 ) Suggested Model: dig-class11-*.tfl Advantage: broad variety of types included in the training. Disadvantage: partially rotated numbers cannot be detected. Digital Meters with sub-digit resolution ( 0.0, 0.1, 0.2, .... 9.8, 9.9 ) Suggested Model: dig-cont-*.tfl or dig-class100-*.tfl Advantage: partial numbers can be detected and a better post processing is possible. Disadvantage: only limited types of meter types are trained due to the high effort for the training data. How to setup the digit ROIs perfectly Details and the corresponding \"perfect\" setting is explained below. For a first run you can choose the following general settings: There is an inner and an outer frame for the ROIs. Make the inner frame exactly the size of the number. Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay Setup using dig-class11 models dig-class11 - Models recognize the complete digit only . Here it is not relevant if the ROI fits the Border of the digit window. For this model, there should be a border of 20% of the image size around the number itself. This border is shown in the ROI setup image by the inner thinner rectangle. This rectangle should fit perfectly around the number when the number has not started to rotate to the next position: Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay If you have perfect alignment and still are not getting satisfying results, most probably your numbers are not part of the training data yet. See Collect images to improve the models on how to collect new training data. Setup using dig-class100 or dig-cont Models These models recognize the tenths (fractions) between the numbers. Those models require a different ROI setup; the height must be set differently and more accurately . First, the width can be set like for a dig-class11 model, i.e. 20% margin left and right. The height of the outer rectangle should be set to the upper and lower edge of the number window. To achieve this, you might need to unlock the aspect ratio: Here an example: Example 1 \u2714\ufe0f Okay \u274c Not Okay Saving Once you are done, push Save to persist your setup. A reboot is required to apply the changed configuration!","title":"ROIs (Regions of Interest)"},{"location":"ROI-Configuration/#rois-regions-of-interest","text":"Notes You are using a neural network approach which is trained to fit as many different type of meters as possible. The accuracy will never be 100%. It is normal to see a missing reading once in a while. There are several precautions to detect this. For details see the section PostProcessing on the configuration page. The most critical components for an accurate detection are: Correct setting of the R egions O f I nterest (ROIs) for detection of the image. This must be done manually for each device/installation! Using a well trained Model. Have a look on the Digital Counters resp. Analog Needles to check if your types are contained. If your number types are not contained, you should take the effort to record them so we can add them to the training data. See Collect images to improve the models on how to collect new training data.","title":"ROIs (Regions of Interest)"},{"location":"ROI-Configuration/#precondition","text":"Please make sure to have: Setup your camera properly and taken a good Reference Image . Selected good Alignment References .","title":"Precondition"},{"location":"ROI-Configuration/#define-the-rois","text":"For each digit or analog pointer, a ROI must be defined. You can even have multiple independent Numbers (eg. electerical meters mostly have 2 numbers for the high and low tariff). Depending if you have only one of those types, you can enable/disable (1) it on the top left corner: You can switch between the individual ROIs with the Drop down box (2) . If you need additional ROIs or delete them you can do this with the control at (3) . Like for the Alignment References , you can change the position, size and name of a ROI in the text fields or define them via drag and drop through the mouse button. Make sure the ROIs are in the right order, matching the significance of a digit/analog counter! Warning The order of the ROIs defines how the individual digits are combined to the total number. The first ROI is the digit with the highest order (left side), then the second and so on. You can control the order in the selector tab and change it with the buttons \"move Next\" or \"move Previous\" . In most cases digits are ordered equidistantly (have the same distance between each other) and have the same size. Bcause of this the Web Interface keeps their sises and distance the same. If you need individual sizes or distances, untick the settings (4) . In almost all cases the sizes and y values should be identical! The ratio between x and y might need adjustment. But make sure it is the same for all digits. Same for the analog counters , the sizes should be identical and the x and y as well. Note Don't forget to save the settings with \"Save\" and do not reboot at this stage.","title":"Define the ROIs"},{"location":"ROI-Configuration/#analog-counters","text":"For analog counters the ROI setting is rather straight forward as the meter is usually quadratic with a clear center. The circle should exactly fit to the outer size of the meter and the cross should be in the middle of the pointer. Here is an example with the details for the ROI ana1 :","title":"Analog Counters"},{"location":"ROI-Configuration/#digits","text":"For the Digital Meters it is a little bit more complicated, as there are different options of digital models which can be choosen.","title":"Digits"},{"location":"ROI-Configuration/#correct-size-for-roi","text":"First of all, choose the right size of the ROI. The configuration of ROIs differs a bit on the selected model (see below). If you are in the initial setup, the model will be selectable in the next step. By default it is a dig-cont resp. ana-cont model. In Model Selection you find the differences between the different available models. Pick the one you think fits best your purpose. If you don't get to good result, try another model. Here we only show the different configuration of the ROIs. Digital Meters with only recognized full digits ( 0, 1, 2, 3, ... 9 ) Suggested Model: dig-class11-*.tfl Advantage: broad variety of types included in the training. Disadvantage: partially rotated numbers cannot be detected. Digital Meters with sub-digit resolution ( 0.0, 0.1, 0.2, .... 9.8, 9.9 ) Suggested Model: dig-cont-*.tfl or dig-class100-*.tfl Advantage: partial numbers can be detected and a better post processing is possible. Disadvantage: only limited types of meter types are trained due to the high effort for the training data.","title":"Correct Size for ROI"},{"location":"ROI-Configuration/#how-to-setup-the-digit-rois-perfectly","text":"Details and the corresponding \"perfect\" setting is explained below. For a first run you can choose the following general settings: There is an inner and an outer frame for the ROIs. Make the inner frame exactly the size of the number. Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay","title":"How to setup the digit ROIs perfectly"},{"location":"ROI-Configuration/#setup-using-dig-class11-models","text":"dig-class11 - Models recognize the complete digit only . Here it is not relevant if the ROI fits the Border of the digit window. For this model, there should be a border of 20% of the image size around the number itself. This border is shown in the ROI setup image by the inner thinner rectangle. This rectangle should fit perfectly around the number when the number has not started to rotate to the next position: Example 1 Example 2 \u2714\ufe0f Okay \u274c Not Okay \u274c Not Okay If you have perfect alignment and still are not getting satisfying results, most probably your numbers are not part of the training data yet. See Collect images to improve the models on how to collect new training data.","title":"Setup using dig-class11 models"},{"location":"ROI-Configuration/#setup-using-dig-class100-or-dig-cont-models","text":"These models recognize the tenths (fractions) between the numbers. Those models require a different ROI setup; the height must be set differently and more accurately . First, the width can be set like for a dig-class11 model, i.e. 20% margin left and right. The height of the outer rectangle should be set to the upper and lower edge of the number window. To achieve this, you might need to unlock the aspect ratio: Here an example: Example 1 \u2714\ufe0f Okay \u274c Not Okay","title":"Setup using dig-class100 or dig-cont Models"},{"location":"ROI-Configuration/#saving","text":"Once you are done, push Save to persist your setup. A reboot is required to apply the changed configuration!","title":"Saving"},{"location":"Reference-Image/","text":"Reference Image Note The Reference Image is the basis for the coordinate system of the ROIs. Therefore it is very important, to have a well aligned image, that is not rotated. At first an example image is shown. To define a new reference image push the button \"Create new Reference\" (2) and afterwards \"Take Image\" (2) . It might take some seconds for processing, then your actual camera image should be shown. Then play with the provided parameters to get a good result. Focus This is the first time, where you have access to the camera image. It most likely is out of focus and not sharp! Ensure a sharp image of the camera by adjusting the focal length of the ESP OV2640 camera. Note Try to adjust the focus for the clearest possible image! In order to use it for reading a meter, the focal-length of the OV2640 camera has to be manipulated. By default it only results in sharp image for distance bigger than around ~40cm which is not ideal for our purpose. Therefore you need to remove the fixing glue of the OV2640 lens with a sharp knife. After this you can rotate the lens in and out. Rotating it by about a quarter of a turn counterclockwise results in a focus plane shift of about 10cm. You need to figure out your best setting with a little bit of trial and error for your specific environment. Error Be very carefully when rotating the lens. Best is to held the camera itself with one hand or a plier and rotate the lens with the other hand. Make sure not to rotate the whole camera as this can damage the ribbon cable! Warning This modification will void any warranty, as the sealing of the lens objective is broken! Warning This modification will render the camera unsuitable for general, web-cam type applications unless the focal length is changed back to the original setting. Correct Horizontal Alignment Ensure an exact horizontal alignment of the number: \u2714\ufe0f Okay \u274c Not Okay Warning Updating the reference image also means that all alignment images and ROIs needs to be configured again. Therefore do this step later only with caution. If everything is done, you can save the result with \"Update Reference Image\" (4) . Note A reboot is not required at this point of time. As next you should update the Alignment References . Dealing with Reflections Reflections can be caused by the flash LED and make it hard to provide a reliable detection. There are various ways to deal with them: Attach a diffusor in front of the LED, eg. a filt (Filz) or parchment paper. Also white paper can do the job. Rotate the ESP-CAM so the LED is on another place. Reduce the LED intensity. Use external LED stripes, eg WS2812x .","title":"Reference Image"},{"location":"Reference-Image/#reference-image","text":"Note The Reference Image is the basis for the coordinate system of the ROIs. Therefore it is very important, to have a well aligned image, that is not rotated. At first an example image is shown. To define a new reference image push the button \"Create new Reference\" (2) and afterwards \"Take Image\" (2) . It might take some seconds for processing, then your actual camera image should be shown. Then play with the provided parameters to get a good result.","title":"Reference Image"},{"location":"Reference-Image/#focus","text":"This is the first time, where you have access to the camera image. It most likely is out of focus and not sharp! Ensure a sharp image of the camera by adjusting the focal length of the ESP OV2640 camera. Note Try to adjust the focus for the clearest possible image! In order to use it for reading a meter, the focal-length of the OV2640 camera has to be manipulated. By default it only results in sharp image for distance bigger than around ~40cm which is not ideal for our purpose. Therefore you need to remove the fixing glue of the OV2640 lens with a sharp knife. After this you can rotate the lens in and out. Rotating it by about a quarter of a turn counterclockwise results in a focus plane shift of about 10cm. You need to figure out your best setting with a little bit of trial and error for your specific environment. Error Be very carefully when rotating the lens. Best is to held the camera itself with one hand or a plier and rotate the lens with the other hand. Make sure not to rotate the whole camera as this can damage the ribbon cable! Warning This modification will void any warranty, as the sealing of the lens objective is broken! Warning This modification will render the camera unsuitable for general, web-cam type applications unless the focal length is changed back to the original setting.","title":"Focus"},{"location":"Reference-Image/#correct-horizontal-alignment","text":"Ensure an exact horizontal alignment of the number: \u2714\ufe0f Okay \u274c Not Okay Warning Updating the reference image also means that all alignment images and ROIs needs to be configured again. Therefore do this step later only with caution. If everything is done, you can save the result with \"Update Reference Image\" (4) . Note A reboot is not required at this point of time. As next you should update the Alignment References .","title":"Correct Horizontal Alignment"},{"location":"Reference-Image/#dealing-with-reflections","text":"Reflections can be caused by the flash LED and make it hard to provide a reliable detection. There are various ways to deal with them: Attach a diffusor in front of the LED, eg. a filt (Filz) or parchment paper. Also white paper can do the job. Rotate the ESP-CAM so the LED is on another place. Reduce the LED intensity. Use external LED stripes, eg WS2812x .","title":"Dealing with Reflections"},{"location":"Release-creation/","text":"Preparing for Release Changelog is merged back from master branch to rolling branch (should be the last step of the previous release creation) All changes are documented in the Changelog in rolling branch Release creation steps Merge rolling into master branch Best to wait for the GitHub action to run successfully On master branch tag the version like v11.3.1 and don't forget to push it: git checkout master git pull git tag v14.0.0 git push --tags Wait for the GitHub-Action of release creation. After all is done: the release should be created the artifacts are downloadable from release The documented changes were applied to the release Merge master back in rolling Check that the Web Installer shows the right version","title":"Preparing for Release"},{"location":"Release-creation/#preparing-for-release","text":"Changelog is merged back from master branch to rolling branch (should be the last step of the previous release creation) All changes are documented in the Changelog in rolling branch","title":"Preparing for Release"},{"location":"Release-creation/#release-creation-steps","text":"Merge rolling into master branch Best to wait for the GitHub action to run successfully On master branch tag the version like v11.3.1 and don't forget to push it: git checkout master git pull git tag v14.0.0 git push --tags Wait for the GitHub-Action of release creation. After all is done: the release should be created the artifacts are downloadable from release The documented changes were applied to the release Merge master back in rolling Check that the Web Installer shows the right version","title":"Release creation steps"},{"location":"StatusLED-BlinkCodes/","text":"This page lists possible blink codes of the red LED located on the ESP32-CAM board, their meaning and possible solutions. The effective error codes can be found here . TODO!!! Error Those errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue! 0x00000001 PSRAM bad Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM! Status Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it. 0x00000100 Cam Framebuffer bad The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help.","title":"StatusLED BlinkCodes"},{"location":"StatusLED-BlinkCodes/#error","text":"Those errors make the normal operation of the device impossible. Most likely they are caused by a hardware issue!","title":"Error"},{"location":"StatusLED-BlinkCodes/#0x00000001-psram-bad","text":"Your device most likely has no PSRAM at all or it is too small (needs to have at least 4 MBytes)! See Hardware Compatibility . Usually the log shows something like this: psram: PSRAM ID read error: 0xffffffff cpu_start: Failed to init external RAM!","title":"0x00000001 PSRAM bad"},{"location":"StatusLED-BlinkCodes/#status","text":"Those Errors can be caused by an error during initialization. It is possible that the error has no impact at all or that a reboot solves it.","title":"Status"},{"location":"StatusLED-BlinkCodes/#0x00000100-cam-framebuffer-bad","text":"The firmware was unable to initialize the Camera Framebuffer. The firmware will continue to work, but other consequential error might arise. A reboot of the device might help.","title":"0x00000100 Cam Framebuffer bad"},{"location":"Testing/","text":"Testing Option for VSCode You can test your functions directly on the device. Structure All tests are under directory \"test\" in the project and not compiled with default build option of platformio. The main function is in file test_suite_controlflow.cpp . In method app_main() you can add your own tests. Include my my own test In method app_main() of test_suite_controlflow.cpp you can add your own tests. Include your test-file in the top like #include \"components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp\" components is a subfolder of tests here. Not the components directory of root source. In the bottom add your test function. RUN_TEST(testNegative); Your test function should have a TEST_ASSERT_EQUAL_* . For more information look at unity-testing . Run tests You will need a testing device. best with usb adapter. Before you upload your tests you will need to setup the device with initial setup procedure described in [[Installation]] Now you can use Visual Studio Code or a standard console to upload the test code. In VS Code (tab platformio) open Advanced and select Test . Alternatively you can run it in console/terminal with platformio test --environment esp32cam . In my environment the serial terminal not opens. I have to do it for myself. You will see much logging. If any test fails it logs it out. Else it logs all test passed in the end. Troubleshooting If you test very much cases in one function, the device runs in Stack Overflow and an endless boot. Reduce the count of test cases or split the test function in multiple functions.","title":"Testing"},{"location":"Testing/#testing-option-for-vscode","text":"You can test your functions directly on the device.","title":"Testing Option for VSCode"},{"location":"Testing/#structure","text":"All tests are under directory \"test\" in the project and not compiled with default build option of platformio. The main function is in file test_suite_controlflow.cpp . In method app_main() you can add your own tests.","title":"Structure"},{"location":"Testing/#include-my-my-own-test","text":"In method app_main() of test_suite_controlflow.cpp you can add your own tests. Include your test-file in the top like #include \"components/jomjol-flowcontroll/test_flow_postrocess_helper.cpp\" components is a subfolder of tests here. Not the components directory of root source. In the bottom add your test function. RUN_TEST(testNegative); Your test function should have a TEST_ASSERT_EQUAL_* . For more information look at unity-testing .","title":"Include my my own test"},{"location":"Testing/#run-tests","text":"You will need a testing device. best with usb adapter. Before you upload your tests you will need to setup the device with initial setup procedure described in [[Installation]] Now you can use Visual Studio Code or a standard console to upload the test code. In VS Code (tab platformio) open Advanced and select Test . Alternatively you can run it in console/terminal with platformio test --environment esp32cam . In my environment the serial terminal not opens. I have to do it for myself. You will see much logging. If any test fails it logs it out. Else it logs all test passed in the end.","title":"Run tests"},{"location":"Testing/#troubleshooting","text":"If you test very much cases in one function, the device runs in Stack Overflow and an endless boot. Reduce the count of test cases or split the test function in multiple functions.","title":"Troubleshooting"},{"location":"Upload-files-by-script/","text":"Scripted File Upload To upload a file e.g. using curl , you first have to delete it and then upload it: curl -d '' http://192.168.1.153/delete/html/index.html curl --data-binary @ota_page.html http://192.168.1.153/upload/html/index.html","title":"Scripted File Upload"},{"location":"Upload-files-by-script/#scripted-file-upload","text":"To upload a file e.g. using curl , you first have to delete it and then upload it: curl -d '' http://192.168.1.153/delete/html/index.html curl --data-binary @ota_page.html http://192.168.1.153/upload/html/index.html","title":"Scripted File Upload"},{"location":"Watermeter-specific-analog---digital-transition/","text":"Analog/Digital Transition on Water Meters At first, for the most water meters the default configuration should be work. But the digit, especially the last digit differs in some devices. \"Normal\" transition In most cases, the transition of the last digit starts when the analogue pointer is > 9. Often the last digit \"hangs\" a bit on this devices and comes not over zero. So it is not easy to see which digit is correct. In the first example 4 or still 3? (3 is correct). Early transition Some units start the transition very early or run with the analogue pointer. In the third example, is it a 3 or a 2? Inaccuracies in image recognition The models for image recognition are good, but have inaccuracies in the range +/- 0.2. In order to obtain as many correct results as possible, a treatment is carried out in the post process in the range of 9.8-0.2 for the analogue pointer, which must start differently depending on the type of counter. How to configure for my meter type If you have a devices with \"normal\" transition you should not have any issues. On devices with \"early\" transition, you can set the option AnalogDigitalTransitionStart to a value between 6 and 8.","title":"Analog/Digital Transition on Water Meters"},{"location":"Watermeter-specific-analog---digital-transition/#analogdigital-transition-on-water-meters","text":"At first, for the most water meters the default configuration should be work. But the digit, especially the last digit differs in some devices.","title":"Analog/Digital Transition on Water Meters"},{"location":"Watermeter-specific-analog---digital-transition/#normal-transition","text":"In most cases, the transition of the last digit starts when the analogue pointer is > 9. Often the last digit \"hangs\" a bit on this devices and comes not over zero. So it is not easy to see which digit is correct. In the first example 4 or still 3? (3 is correct).","title":"\"Normal\" transition"},{"location":"Watermeter-specific-analog---digital-transition/#early-transition","text":"Some units start the transition very early or run with the analogue pointer. In the third example, is it a 3 or a 2?","title":"Early transition"},{"location":"Watermeter-specific-analog---digital-transition/#inaccuracies-in-image-recognition","text":"The models for image recognition are good, but have inaccuracies in the range +/- 0.2. In order to obtain as many correct results as possible, a treatment is carried out in the post process in the range of 9.8-0.2 for the analogue pointer, which must start differently depending on the type of counter.","title":"Inaccuracies in image recognition"},{"location":"Watermeter-specific-analog---digital-transition/#how-to-configure-for-my-meter-type","text":"If you have a devices with \"normal\" transition you should not have any issues. On devices with \"early\" transition, you can set the option AnalogDigitalTransitionStart to a value between 6 and 8.","title":"How to configure for my meter type"},{"location":"collect-new-images/","text":"Collect images to improve the models If your device has new, different digits or pointers it might be that the existing models don't recognize them well. In such case you can collect your images and so we can train the model better. This helps you and also others as the models get more accurate. Adding more images also helps if you have a model that is already known, but the neural models do not produce good results. Experienced users can do the training also by themselves, see Learn a model with your own images . Before you start Before you go ahead, please check if your digits/pointers are not yet contained in the training data. A visual overview is available at digits resp. pointers . Poor recognition is often caused by blurred images, low contrast or incorrect setting of the ROIs. Therefore, check these possibilities first, as additional training will bring little improvement here. See ROI Configuration for details. Collecting images The neural network is trained based on a set of images that have already been collected over time. If your digits are included or at least very similar to included images, the chance is very high that the neural network is working fine for you as well. The neural network configuration is stored in the TensorFlow Lite format as *.tfl or *.tflite in the /config directory on the SD card. A model can be updated (or a new one added) by uploading the new file and activating it on the configuration page or in the config file /config/config.ini . In order to incorporate new digits a training set of images is required. The training images needs to be collected in the final setup with the help of the Digits or Analog log settings (not to be confused with the Data or Debug log). Enable the logging of the images on the configuration page or in the config file /config/config.ini : Now be patient! You have to wait until it has collected an image of each digit of every type. They wil lbe placed on the SD card in the folder /log/digit/ resp. /log/analog/ . After some days, there will be a lot of images, many of them very similar. Because of this, it is important to select only a subset of them for the model training. The tools shown below can help you with that. Collecting images for dig-class100/dig-cont/ana-class100 For digits use Collectmeterdigits resp. for pointers use collectmeteranalog to fetch the images from the device and select a subset of them. Please read the detailed instructions on the mentioned links for details! If the fetching of the images is too slow for you, a faster way to get the images to your PC is to remove the SD-card from the ESP32 module and insert it into the card reader of yur PC. Then search for two..three images of each digit ( not more! :-) ). You will have to make sure to label the images yourself matching the effective value they are supposed to show. Share your images In most cases we will integrate your images in the training dataset of the models. Only if we fear a degradation of the models or you need a different behavior, we might not include the data in the standard models (see at bottom of page for reasons). To provide your images to us for training the model, open an Github Issue and append the zipped images ito it. Images can be rejected if You provide too many images. More than 1000 images of your device are really to much. Images which are not good enough (see ROI Configuration ) will be rejected. It would reduce the accuracy of the networks. Images with too little focus will be rejected. Images with too much blur are rejected. Our models are to small to recognize everything in any quality. So we use only images of medium or good quality.","title":"Collect images to improve the models"},{"location":"collect-new-images/#collect-images-to-improve-the-models","text":"If your device has new, different digits or pointers it might be that the existing models don't recognize them well. In such case you can collect your images and so we can train the model better. This helps you and also others as the models get more accurate. Adding more images also helps if you have a model that is already known, but the neural models do not produce good results. Experienced users can do the training also by themselves, see Learn a model with your own images .","title":"Collect images to improve the models"},{"location":"collect-new-images/#before-you-start","text":"Before you go ahead, please check if your digits/pointers are not yet contained in the training data. A visual overview is available at digits resp. pointers . Poor recognition is often caused by blurred images, low contrast or incorrect setting of the ROIs. Therefore, check these possibilities first, as additional training will bring little improvement here. See ROI Configuration for details.","title":"Before you start"},{"location":"collect-new-images/#collecting-images","text":"The neural network is trained based on a set of images that have already been collected over time. If your digits are included or at least very similar to included images, the chance is very high that the neural network is working fine for you as well. The neural network configuration is stored in the TensorFlow Lite format as *.tfl or *.tflite in the /config directory on the SD card. A model can be updated (or a new one added) by uploading the new file and activating it on the configuration page or in the config file /config/config.ini . In order to incorporate new digits a training set of images is required. The training images needs to be collected in the final setup with the help of the Digits or Analog log settings (not to be confused with the Data or Debug log). Enable the logging of the images on the configuration page or in the config file /config/config.ini : Now be patient! You have to wait until it has collected an image of each digit of every type. They wil lbe placed on the SD card in the folder /log/digit/ resp. /log/analog/ . After some days, there will be a lot of images, many of them very similar. Because of this, it is important to select only a subset of them for the model training. The tools shown below can help you with that.","title":"Collecting images"},{"location":"collect-new-images/#collecting-images-for-dig-class100dig-contana-class100","text":"For digits use Collectmeterdigits resp. for pointers use collectmeteranalog to fetch the images from the device and select a subset of them. Please read the detailed instructions on the mentioned links for details! If the fetching of the images is too slow for you, a faster way to get the images to your PC is to remove the SD-card from the ESP32 module and insert it into the card reader of yur PC. Then search for two..three images of each digit ( not more! :-) ). You will have to make sure to label the images yourself matching the effective value they are supposed to show.","title":"Collecting images for dig-class100/dig-cont/ana-class100"},{"location":"collect-new-images/#share-your-images","text":"In most cases we will integrate your images in the training dataset of the models. Only if we fear a degradation of the models or you need a different behavior, we might not include the data in the standard models (see at bottom of page for reasons). To provide your images to us for training the model, open an Github Issue and append the zipped images ito it.","title":"Share your images"},{"location":"collect-new-images/#images-can-be-rejected-if","text":"You provide too many images. More than 1000 images of your device are really to much. Images which are not good enough (see ROI Configuration ) will be rejected. It would reduce the accuracy of the networks. Images with too little focus will be rejected. Images with too much blur are rejected. Our models are to small to recognize everything in any quality. So we use only images of medium or good quality.","title":"Images can be rejected if"},{"location":"data-logging/","text":"Data Logging When Data Logging is enabled (See parameter DataLogActive ), the results of every round gets written to the SD-Card. The data files are stored in /log/data on the SD-Card. Data Format The data is stored as CSV with the following columns: time , name-of-number , raw-value , return-value , pre-value , change-rate , change-absolute , error-text , cnn-digital , cnn-analog","title":"Data Logging"},{"location":"data-logging/#data-logging","text":"When Data Logging is enabled (See parameter DataLogActive ), the results of every round gets written to the SD-Card. The data files are stored in /log/data on the SD-Card.","title":"Data Logging"},{"location":"data-logging/#data-format","text":"The data is stored as CSV with the following columns: time , name-of-number , raw-value , return-value , pre-value , change-rate , change-absolute , error-text , cnn-digital , cnn-analog","title":"Data Format"},{"location":"initial-setup/","text":"Initial Setup After setting up the device (firmware, SD card, WLAN) the device will connect to the wifi access point and start in an initial setup configuration: With the buttons on the top you can navigate through 5 steps which guide you through the necessary setup: Create the Reference Image . It is the base for the position referencing and the identification of the digits and counters. Define two unique Reference Marks . They is used to align the individual camera images and identify the absolut positions. Define ROIs for the Digits. They will be used to digitize the digit part of your meter. If your meter has no digits, this step can be skipped. Define ROIs for the Analog Counters. (Only required in case your meter has analoge counters) General Settings . Further configuration of your device. All settings can be accessed also later in the normal operation mode. Note Don' t forget to save each step with \"Save\" and do not reboot at this stage. Finish the Setup and change to the Normal Operation mode With the last step (1) you leave the Setup Mode and reboot to the Normal Operation mode . Access to the Setup Pages in the Normal Operation mode You always can access all the settings during the normal operation mode via the Settings menu: (1) Access to the General Settings . (2) Update of the Reference Image . (3) Update of the Alignment Marks . (4)/(5) Update of the ROIs .","title":"Initial Setup"},{"location":"initial-setup/#initial-setup","text":"After setting up the device (firmware, SD card, WLAN) the device will connect to the wifi access point and start in an initial setup configuration: With the buttons on the top you can navigate through 5 steps which guide you through the necessary setup: Create the Reference Image . It is the base for the position referencing and the identification of the digits and counters. Define two unique Reference Marks . They is used to align the individual camera images and identify the absolut positions. Define ROIs for the Digits. They will be used to digitize the digit part of your meter. If your meter has no digits, this step can be skipped. Define ROIs for the Analog Counters. (Only required in case your meter has analoge counters) General Settings . Further configuration of your device. All settings can be accessed also later in the normal operation mode. Note Don' t forget to save each step with \"Save\" and do not reboot at this stage.","title":"Initial Setup"},{"location":"initial-setup/#finish-the-setup-and-change-to-the-normal-operation-mode","text":"With the last step (1) you leave the Setup Mode and reboot to the Normal Operation mode .","title":"Finish the Setup and change to the Normal Operation mode"},{"location":"initial-setup/#access-to-the-setup-pages-in-the-normal-operation-mode","text":"You always can access all the settings during the normal operation mode via the Settings menu: (1) Access to the General Settings . (2) Update of the Reference Image . (3) Update of the Alignment Marks . (4)/(5) Update of the ROIs .","title":"Access to the Setup Pages in the Normal Operation mode"},{"location":"ota/","text":"Over-The-Air (OTA) Update You can do an OTA (over-the-air) update via the Web Interface. Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please inform yourself on Living on the Edge first! Update Procedure Create a backup of your configuration. Either use the Backup/Restore function of your device for this (menu System > Backup/Restore ) or back the files manually up using the File Server (menu File Server , folder config ). It is recommended to at least save the config file config.ini ! Head to the menu System > OTA Update and follow the instructions there. If you do an update between major versions, it might be needed to modify the config file config.ini as it's syntax or context has changed. To do so, go to the menu Settings > Configuration (after the update completed and the device restarted) and check if it warns you about an unset parameter. Update from version v12.0.0 or newer You can use the over the air update mechanism, which uploads the update via a ZIP files. The update file is located on the release page . Please choose the zip file with the following naming: AI-on-the-edge-device__update__*.zip Go to the menu System --> OTA Update and follow the instructions there. After a final automatic reboot you should have the new version running. Update from version older than v12.0.0 If you update from an version older than 12.0.1, you should firstly update to version 12.0.1. Background are not fully backward compatible changes in the config.ini , that are taken care of in this version. \u203c\ufe0f Make sure to read the instructions below carefully! Backup your configuration (use the System -> Backup/Restore page)! Upload and update the update-*.zip file from the release 12.0.1 see here . Let it restart and check on the System -> Info page that the Firmware as well as the Web UI got updated. If only one got updated, redo the update. If it fails several times, you also can update the Firmware and the Web UI separately. Safe way: Update first the firmware.bin (extract it from one of the provided zip files) and do the Reboot Update with the full zip file ( update-*.zip , ignore the version warning after the reboot) Please go to Settings -> Configuration and address the changed parameters: DataLogging (storing the values for data graph) Debug (extended by different debug reporting levels) Make sure it starts to do the digitalization (check the Error field on the overview page). If it does not start a round within a minute, restart the device. \u203c\ufe0f If the system is working now without any issues, please open the configuration editor once and save the config.ini . This will update the file to the newest content \u203c\ufe0f Now you can safely update to the newest version.","title":"Over-The-Air (OTA) Update"},{"location":"ota/#over-the-air-ota-update","text":"You can do an OTA (over-the-air) update via the Web Interface. Grab the firmware from the Releases page (Stable, tested versions), or the Automatically build development branch (experimental, untested versions). Please inform yourself on Living on the Edge first!","title":"Over-The-Air (OTA) Update"},{"location":"ota/#update-procedure","text":"Create a backup of your configuration. Either use the Backup/Restore function of your device for this (menu System > Backup/Restore ) or back the files manually up using the File Server (menu File Server , folder config ). It is recommended to at least save the config file config.ini ! Head to the menu System > OTA Update and follow the instructions there. If you do an update between major versions, it might be needed to modify the config file config.ini as it's syntax or context has changed. To do so, go to the menu Settings > Configuration (after the update completed and the device restarted) and check if it warns you about an unset parameter.","title":"Update Procedure"},{"location":"ota/#update-from-version-v1200-or-newer","text":"You can use the over the air update mechanism, which uploads the update via a ZIP files. The update file is located on the release page . Please choose the zip file with the following naming: AI-on-the-edge-device__update__*.zip Go to the menu System --> OTA Update and follow the instructions there. After a final automatic reboot you should have the new version running.","title":"Update from version v12.0.0 or newer"},{"location":"ota/#update-from-version-older-than-v1200","text":"If you update from an version older than 12.0.1, you should firstly update to version 12.0.1. Background are not fully backward compatible changes in the config.ini , that are taken care of in this version. \u203c\ufe0f Make sure to read the instructions below carefully! Backup your configuration (use the System -> Backup/Restore page)! Upload and update the update-*.zip file from the release 12.0.1 see here . Let it restart and check on the System -> Info page that the Firmware as well as the Web UI got updated. If only one got updated, redo the update. If it fails several times, you also can update the Firmware and the Web UI separately. Safe way: Update first the firmware.bin (extract it from one of the provided zip files) and do the Reboot Update with the full zip file ( update-*.zip , ignore the version warning after the reboot) Please go to Settings -> Configuration and address the changed parameters: DataLogging (storing the values for data graph) Debug (extended by different debug reporting levels) Make sure it starts to do the digitalization (check the Error field on the overview page). If it does not start a round within a minute, restart the device. \u203c\ufe0f If the system is working now without any issues, please open the configuration editor once and save the config.ini . This will update the file to the newest content \u203c\ufe0f Now you can safely update to the newest version.","title":"Update from version older than v12.0.0"},{"location":"outdated--Integrated-Functions/","text":"Integrated Functions Warning This page no longer is maintained! wasserzaehler http://IP-ESP32/wasserzaehler.html This is the main purpose of this device. It returns the converted image as a number with different option. The output can be modified either by the configuration parameters or by HTML parameters. Details can be found here: tbd Picture Server http://IP-ESP32/capture http://IP-ESP32/capture_with_flashlight This is a implementation of the camera interface of https://github.com/jomjol/water-meter-picture-provider It is fully compatible including the parameters ( quality =..., size=... ) . This allows to use this ESP32 system in parallel to the corresponding docker system: https://github.com/jomjol/water-meter-system-complete, from which this project is basically the successor. File server Access: http://IP-ESP32/fileserver/ Simple file server, that allows viewing, upload, download and deleting of single files of the SD-card content. The usage is self explaining. The file path or file can directly be accessed by the URL after file server. Example for config.ini : http://IP-ESP/fileserver/config/config.ini OTA-Update http://IP-ESP32/ota?file=firmware.bin Here an over the air update can be triggered. The firmware file is expected to be located in the sub directory /firmware/ and can be uploaded with the file server. By the parameter file the name of the firmware file needs to be given. Reboot http://IP-ESP32/reboot A reboot with a delay of 5 seconds is initiated, e.g. after firmware update. ATTENTION : currently this is not working properly - hardware power off is needed instead. Work in progress! Simple Web Server If none of the above URLs are fitting, a very simple web server checks, if there is a fitting file from the sub directory /html This can be used for a very simple web server for information or simple web pages.","title":"Integrated Functions"},{"location":"outdated--Integrated-Functions/#integrated-functions","text":"Warning This page no longer is maintained!","title":"Integrated Functions"},{"location":"outdated--Integrated-Functions/#wasserzaehler","text":"http://IP-ESP32/wasserzaehler.html This is the main purpose of this device. It returns the converted image as a number with different option. The output can be modified either by the configuration parameters or by HTML parameters. Details can be found here: tbd","title":"wasserzaehler"},{"location":"outdated--Integrated-Functions/#picture-server","text":"http://IP-ESP32/capture http://IP-ESP32/capture_with_flashlight This is a implementation of the camera interface of https://github.com/jomjol/water-meter-picture-provider It is fully compatible including the parameters ( quality =..., size=... ) . This allows to use this ESP32 system in parallel to the corresponding docker system: https://github.com/jomjol/water-meter-system-complete, from which this project is basically the successor.","title":"Picture Server"},{"location":"outdated--Integrated-Functions/#file-server","text":"Access: http://IP-ESP32/fileserver/ Simple file server, that allows viewing, upload, download and deleting of single files of the SD-card content. The usage is self explaining. The file path or file can directly be accessed by the URL after file server. Example for config.ini : http://IP-ESP/fileserver/config/config.ini","title":"File server"},{"location":"outdated--Integrated-Functions/#ota-update","text":"http://IP-ESP32/ota?file=firmware.bin Here an over the air update can be triggered. The firmware file is expected to be located in the sub directory /firmware/ and can be uploaded with the file server. By the parameter file the name of the firmware file needs to be given.","title":"OTA-Update"},{"location":"outdated--Integrated-Functions/#reboot","text":"http://IP-ESP32/reboot A reboot with a delay of 5 seconds is initiated, e.g. after firmware update. ATTENTION : currently this is not working properly - hardware power off is needed instead. Work in progress!","title":"Reboot"},{"location":"outdated--Integrated-Functions/#simple-web-server","text":"If none of the above URLs are fitting, a very simple web server checks, if there is a fitting file from the sub directory /html This can be used for a very simple web server for information or simple web pages.","title":"Simple Web Server"},{"location":"rolling-installation/","text":"Living on the Edge The Github repository contains multiple branches: The master branch contains the same firmware version as provided on the release page . The rolling branch contains the latest version of the Firmware and the Web Interface. It might already contain a fix for your issue. But it is work in progress, don't expect it to work stable or be an improvement for your AI-on-the-edge-device! Also it might break the OTA Update and thus require manual flashing over USB! Any other branch is used to develop a feature or fix, only use them when you know what it is about! I still want to try it Ok, then grab the latest rolling build from Github Actions Page and proceed as following: Pick the most top successful (green) build: Scroll down and download the AI-on-the-edge-device__update__*.zip : Flash the zip file using the OTA Update page of your device.","title":"Living on the Edge"},{"location":"rolling-installation/#living-on-the-edge","text":"The Github repository contains multiple branches: The master branch contains the same firmware version as provided on the release page . The rolling branch contains the latest version of the Firmware and the Web Interface. It might already contain a fix for your issue. But it is work in progress, don't expect it to work stable or be an improvement for your AI-on-the-edge-device! Also it might break the OTA Update and thus require manual flashing over USB! Any other branch is used to develop a feature or fix, only use them when you know what it is about!","title":"Living on the Edge"},{"location":"rolling-installation/#i-still-want-to-try-it","text":"Ok, then grab the latest rolling build from Github Actions Page and proceed as following: Pick the most top successful (green) build: Scroll down and download the AI-on-the-edge-device__update__*.zip : Flash the zip file using the OTA Update page of your device.","title":"I still want to try it"}]}
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
index d502866..75d4757 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -136,7 +136,7 @@
daily
- https://jomjol.github.io/AI-on-the-edge-device-docs/StatusLED_BlinkCodes/
+ https://jomjol.github.io/AI-on-the-edge-device-docs/StatusLED-BlinkCodes/
2023-03-02
daily
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index ffeb757..d61494b 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ