Rolling 20220320

This commit is contained in:
jomjol
2022-03-20 21:36:44 +01:00
parent ebcfc16f63
commit 0e90bcb2ef
16 changed files with 84 additions and 46 deletions

View File

@@ -11,6 +11,14 @@
____
#### #25 Trigger Measurement via MQTT
* https://github.com/jomjol/AI-on-the-edge-device/issues/727
#### #24 Show Mqtt state directly in Webserver
* Show MQTT log in Web page. E.g. connection established or failed to connect...
@@ -48,9 +56,9 @@ ____
#### #18 Document WLAN-strength in web page
#### ~~#18 Document WLAN-strength in web page~~
* https://github.com/jomjol/AI-on-the-edge-device/issues/563
* ~~https://github.com/jomjol/AI-on-the-edge-device/issues/563~~
@@ -101,9 +109,9 @@ ____
#### #12 Less reboots due to memory leakage
#### ~~#12 Less reboots due to memory leakage~~
* Issue: #414 & #425 #430
* ~~Issue: #414 & #425 #430~~

View File

@@ -4,11 +4,10 @@ This is an example of Artificial Intelligence (AI) calculations on a very cheap
### Details on **function**, **installation** and **configuration** can be found on the **[Wiki Page](https://github.com/jomjol/AI-on-the-edge-device/wiki)**
A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4573481
or here https://www.thingiverse.com/thing:5028229
respectively ESP32-Cam housing only: https://www.thingiverse.com/thing:4571627
A 3d-printable housing can be found here:
- https://www.thingiverse.com/thing:4573481 (Water Meter)
- https://www.thingiverse.com/thing:5028229 (Power Meter)
- https://www.thingiverse.com/thing:4571627 (ESP32-Cam housing only)
<img src="https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/master/images/watermeter_all.jpg" width="200"><img src="https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/master/images/main.jpg" width="200"><img src="https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/master/images/size.png" width="200">
@@ -45,17 +44,21 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
## Change log
### Known Issues
* slow response of web server during picture analysis
* Slow response of web server during picture analysis
**General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated!
**General remark:** Besides the file `firmware.bin`, typically the content of `/html` will need to be updated!
------
##### Rolling (2022-03-20)
- MQTT: implemented "Retain Flag" - not tested in detail yet
##### 10.5.2 - Stability Increase (2022-02-22)
- **NEW 10.5.2:** Bug Fix: wrong `firmware.bin` (no rate update)
- NEW 10.5.2: Bug Fix: wrong `firmware.bin` (no rate update)
- NEW 10.5.1: Bug Fix: wrong return value, rate value & PreValue status, HTML: SSID & IP were not displayed
- MQTT: changed wifi naming to "wifiRSSI"
- HTML: check selectable values for consistency
@@ -67,8 +70,8 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
##### 10.4.0 - Stability Increase (2022-02-12)
- Graphical configuration: select available neural network files (*.tfl, *.tflite) from drop down menu
- OTA-update: add option to upload tfl / tflite files to the correct locatioin (`/config/`)
- in future the new files will also be copied to the `firmware` directory of the repository
- OTA-update: add option to upload tfl / tflite files to the correct location (`/config/`)
- In the future the new files will also be copied to the `firmware` directory of the repository
- Added Wifi RSSI to MQTT information
- Updated analog neural network file (`ana-s3-q-20220105.tflite`)
- Updated digital neural network file (`dig-s1-q-20220102.tflite`)
@@ -81,10 +84,9 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
- Implemented LED flash dimming (`LEDIntensity`).
Remark: as auto illumination in the camera is used, this is rather for energy saving. It will not help reducing reflections
- Additional camera parameters: saturation, contrast (although not too much impact yet)
- Readings with not automatically removable "N"s are handled like "error" --> no return value in the field "value" anymore
(still reported back via field "raw value")
- Some readings will have removable "N"s that can not be removed automatically and are handled with an "error" --> no return value in the field "value" anymore (still reported back via field "raw value")
- Updated esp32 camera hardware driver
- Bug fix: MQTT, html improvements
- Bug fix: MQTT, HTML improvements
**ATTENTION: The new ESP32 camera hardware driver is much more stable on newer OV2640 versions (no or much less reboots) but seems to be not fully compatible with older versions.**
@@ -95,8 +97,7 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
##### 10.2.0 - Stability Increase (2022-01-14)
- Due to the update camera driver, the image looks different and a new setup might be needed
- Due to the updated camera driver, the image looks different and a new setup might be needed
- Update reference image
- Update Alignment marks
@@ -110,7 +111,7 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
- Bug Fix MQTT problem
- Issue:
- Changing from v9.x to 10.x the MQTT-paramter "Topic" was renamed into "MainTopic" to address multiple number meters This renaming should have been done automatically in the background within the graphical configuration, but was not working. Instead the parameter "Topic" was deleted and "MainTopic" was set to disabled and "undefined".
- Changing from v9.x to 10.x the MQTT-parameter "Topic" was renamed into "MainTopic" to address multiple number meters. This renaming should have been done automatically in the background within the graphical configuration, but was not working. Instead the parameter "Topic" was deleted and "MainTopic" was set to disabled and "undefined".
- ToDo
- Update the `html.zip`
- If old `config.ini` available: copy it to `/config`, open the graphical configuration and save it again.
@@ -167,7 +168,7 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
##### 9.0.0 - External Illumination (2021-10-23)
* Implementation of external illumination to adjust positioning, brightness and color of the illumination now individually
* Implementation of external illumination to adjust positioning, brightness and color of the illumination now set individually
* Technical details can be found in the wiki: https://github.com/jomjol/AI-on-the-edge-device/wiki/External-LED
<img src="https://raw.githubusercontent.com/jomjol/ai-on-the-edge-device/master/images/intern_vs_external.jpg" width="500">
* New housing published for external LEDs and small clearing: https://www.thingiverse.com/thing:5028229
@@ -177,9 +178,9 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
## Additional ideas
## Additional Ideas
There are some ideas and feature request, which are not followed currently - mainly due to capacity reasons on side of the developer. They are collected here: [FeatureRequest.md](FeatureRequest.md)
There are some ideas and feature requests which are not followed currently - mainly due to capacity reasons on side of the developer. They are collected here: [FeatureRequest.md](FeatureRequest.md)
@@ -187,7 +188,7 @@ There are some ideas and feature request, which are not followed currently - mai
## History
##### 8.5.0 - Multi Meter Support (2021-10-07)
##### 8.5.0 Multi Meter Support (2021-10-07)
##### 7.1.2 MQTT-Update - (2021-06-17)

View File

@@ -26,6 +26,7 @@ void ClassFlowMQTT::SetInitialParameter(void)
flowpostprocessing = NULL;
user = "";
password = "";
SetRetainFlag = 0;
previousElement = NULL;
ListFlowControll = NULL;
disabled = false;
@@ -99,6 +100,12 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
{
this->uri = zerlegt[1];
}
if ((toUpper(zerlegt[0]) == "SETRETAINFLAG") && (zerlegt.size() > 1))
{
if (toUpper(zerlegt[1]) == "TRUE")
SetRetainFlag = 1;
}
if ((toUpper(zerlegt[0]) == "CLIENTID") && (zerlegt.size() > 1))
{
@@ -118,7 +125,7 @@ bool ClassFlowMQTT::ReadParameter(FILE* pfile, string& aktparamgraph)
mainerrortopic = maintopic + "/connection";
printf("Init MQTT with uri: %s, clientname: %s, user: %s, password: %s, maintopic: %s\n", uri.c_str(), clientname.c_str(), user.c_str(), password.c_str(), mainerrortopic.c_str());
MQTTInit(uri, clientname, user, password, mainerrortopic, 60);
MQTTPublish(mainerrortopic, "connected");
MQTTPublish(mainerrortopic, "connected", SetRetainFlag);
MQTTenable = true;
}
@@ -150,17 +157,17 @@ bool ClassFlowMQTT::doFlow(string zwtime)
zw = maintopic + "/" + "uptime";
char uptimeStr[11];
sprintf(uptimeStr, "%ld", (long)getUpTime());
MQTTPublish(zw, uptimeStr);
MQTTPublish(zw, uptimeStr, SetRetainFlag);
zw = maintopic + "/" + "freeMem";
char freeheapmem[11];
sprintf(freeheapmem, "%zu", esp_get_free_heap_size());
MQTTPublish(zw, freeheapmem);
MQTTPublish(zw, freeheapmem, SetRetainFlag);
zw = maintopic + "/" + "wifiRSSI";
char rssi[11];
sprintf(rssi, "%d", get_WIFI_RSSI());
MQTTPublish(zw, rssi);
MQTTPublish(zw, rssi, SetRetainFlag);
if (flowpostprocessing)
@@ -183,23 +190,23 @@ bool ClassFlowMQTT::doFlow(string zwtime)
zw = namenumber + "value";
if (result.length() > 0)
MQTTPublish(zw, result);
MQTTPublish(zw, result, SetRetainFlag);
zw = namenumber + "error";
if (resulterror.length() > 0)
MQTTPublish(zw, resulterror, 1);
MQTTPublish(zw, resulterror, SetRetainFlag);
zw = namenumber + "rate";
if (resultrate.length() > 0)
MQTTPublish(zw, resultrate);
MQTTPublish(zw, resultrate, SetRetainFlag);
zw = namenumber + "raw";
if (resultraw.length() > 0)
MQTTPublish(zw, resultraw);
MQTTPublish(zw, resultraw, SetRetainFlag);
zw = namenumber + "timestamp";
if (resulttimestamp.length() > 0)
MQTTPublish(zw, resulttimestamp);
MQTTPublish(zw, resulttimestamp, SetRetainFlag);
std::string json = "";
@@ -218,7 +225,7 @@ bool ClassFlowMQTT::doFlow(string zwtime)
json += ",\"timestamp\":\""+resulttimestamp+"\"}";
zw = namenumber + "json";
MQTTPublish(zw, json);
MQTTPublish(zw, json, SetRetainFlag);
}
}
else
@@ -234,7 +241,7 @@ bool ClassFlowMQTT::doFlow(string zwtime)
result = result + "\t" + zw;
}
}
MQTTPublish(topic, result);
MQTTPublish(topic, result, SetRetainFlag);
}
OldValue = result;

View File

@@ -13,6 +13,7 @@ protected:
std::string OldValue;
ClassFlowPostProcessing* flowpostprocessing;
std::string user, password;
int SetRetainFlag;
bool MQTTenable;
std::string maintopic, mainerrortopic;

View File

@@ -10,7 +10,7 @@ void MQTTdestroy();
//void MQTTInit(std::string _mqttURI, std::string _clientid, std::string _user = "", std::string _password = "");
void MQTTPublish(std::string _key, std::string _content, int retained_flag = 0);
void MQTTPublish(std::string _key, std::string _content, int retained_flag = 1); // retained Flag as Standart
bool MQTTisConnected();

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="7187101";
const char* GIT_REV="ebcfc16";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2022-02-22 19:05";
const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2022-03-20 21:31";

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="7187101";
const char* GIT_REV="ebcfc16";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2022-02-22 19:05";
const char* GIT_BRANCH="rolling";
const char* BUILD_TIME="2022-03-20 21:31";

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -636,6 +636,23 @@ textarea {
Password for MQTT authentication
</td>
</tr>
<tr>
<td width="20px" style="padding-left: 40px;">
<input type="checkbox" id="MQTT_SetRetainFlag_enabled" value="1" onclick = 'InvertEnableItem("MQTT", "SetRetainFlag")' unchecked >
</td>
<td width="200px">
<class id="MQTT_SetRetainFlag_text" style="color:black;">Enable MQTT Retain Flag</class>
</td>
<td>
<select id="MQTT_SetRetainFlag_value1">
<option value="true" selected>true</option>
<option value="false" >false</option>
</select>
</td>
<td style="font-size: 80%;">
Enable or disable the retain flag for all MQTT entries
</td>
</tr>
<tr>
<td colspan="4" style="padding-left: 20px;"><h4>AutoTimer</h4></td>
@@ -1792,6 +1809,7 @@ function UpdateInput() {
WriteParameter(param, category, "MQTT", "ClientID", true);
WriteParameter(param, category, "MQTT", "user", true);
WriteParameter(param, category, "MQTT", "password", true);
WriteParameter(param, category, "MQTT", "SetRetainFlag", true);
WriteParameter(param, category, "GPIO", "IO0", true);
WriteParameter(param, category, "GPIO", "IO1", true);
@@ -1885,6 +1903,7 @@ function ReadParameterAll()
ReadParameter(param, "MQTT", "ClientID", true);
ReadParameter(param, "MQTT", "user", true);
ReadParameter(param, "MQTT", "password", true);
ReadParameter(param, "MQTT", "SetRetainFlag", true);
ReadParameter(param, "GPIO", "IO0", true);
ReadParameter(param, "GPIO", "IO1", true);

View File

@@ -13,7 +13,7 @@ function getbasepath(){
{
// host = "http://192.168.2.219"; // jomjol interner test
// host = "http://192.168.178.46"; // jomjol interner test
host = "http://192.168.178.34"; // jomjol interner Real
host = "http://192.168.178.62"; // jomjol interner Real
// host = "http://192.168.43.191";
// host = "."; // jomjol interner localhost

View File

@@ -124,6 +124,7 @@ function ParseConfig() {
ParamAddValue(param, catname, "ClientID");
ParamAddValue(param, catname, "user");
ParamAddValue(param, catname, "password");
ParamAddValue(param, catname, "SetRetainFlag");
var catname = "GPIO";
category[catname] = new Object();

View File

@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta http-equiv="refresh" content="2"></head><body><tr><td><img src = "/original.jpg"></td></tr><tr><td><img src = "/roi.jpg"></td></tr><tr><td><img src = "/resize.bmp"></td></tr><tr><td><h2>Not-a-Number</h2></td></tr></body></html>