Compare commits

...

7 Commits

Author SHA1 Message Date
jomjol
776931c0ad v9.2.0 2021-12-02 21:56:05 +01:00
jomjol
e22b4b6fe1 v9.2.0 2021-12-02 21:52:45 +01:00
jomjol
cad534bffe update wiki 2021-12-02 21:47:37 +01:00
jomjol
3b44adb6fa Rolling 20211128 2021-11-28 09:09:24 +01:00
jomjol
cc0bd1473f Rolling 20211124 2021-11-24 07:32:03 +01:00
jomjol
58124d27bf Rolling 2021-11-23 2021-11-23 17:57:07 +01:00
Sven Rojek
9ad118814a add basic exception handling for the camera module 2021-11-21 19:05:17 +01:00
22 changed files with 118 additions and 26 deletions

View File

@@ -11,6 +11,12 @@
____
#### #12 Less reboots due to memory leakage
* Issue: #414 & #425 #430
#### #11 MQTT - configurable payload
* https://github.com/jomjol/AI-on-the-edge-device/issues/344

View File

@@ -47,7 +47,13 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
**General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated!
##### 9.2.0 - External Illumination (2021-12-02)
- Direct JSON access: ``http://IP-ADRESS/json``
- Error message in log file in case camera error during startup
- Upgrade analog CNN to v9.1.0
- Upgrade digital CNN to v13.3.0 (added new images)
- html: support of different ports
##### 9.1.1 - External Illumination (2021-11-16)

View File

@@ -624,4 +624,30 @@ esp_err_t ClassFlowControll::GetJPGStream(std::string _fn, httpd_req_t *req)
}
return result;
}
}
string ClassFlowControll::getJSON()
{
std::vector<NumberPost*>* NUMBERS = flowpostprocessing->GetNumbers();
std::string json="{\n";
for (int i = 0; i < (*NUMBERS).size(); ++i)
{
json += "\"" + (*NUMBERS)[i]->name + "\":\n";
json += " {\n";
json += " \"value\": " + (*NUMBERS)[i]->ReturnValueNoError + ",\n";
json += " \"raw\": \"" + (*NUMBERS)[i]->ReturnRawValue + "\",\n";
json += " \"error\": \"" + (*NUMBERS)[i]->ErrorMessageText + "\",\n";
json += " \"rate\": " + std::to_string((*NUMBERS)[i]->FlowRateAct) + ",\n";
json += " \"timestamp\": \"" + (*NUMBERS)[i]->timeStamp + "\"\n";
if ((i+1) < (*NUMBERS).size())
json += " },\n";
else
json += " }\n";
}
json += "}";
return json;
}

View File

@@ -48,6 +48,7 @@ public:
string UpdatePrevalue(std::string _newvalue, std::string _numbers, bool _extern);
string GetPrevalue(std::string _number = "");
bool ReadParameter(FILE* pfile, string& aktparamgraph);
string getJSON();
string TranslateAktstatus(std::string _input);

View File

@@ -189,6 +189,36 @@ esp_err_t handler_doflow(httpd_req_t *req)
};
esp_err_t handler_json(httpd_req_t *req)
{
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("handler_json - Start");
#endif
printf("handler_JSON uri:\n"); printf(req->uri); printf("\n");
char _query[100];
char _size[10];
httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");
httpd_resp_set_type(req, "application/json");
std::string zw = tfliteflow.getJSON();
if (zw.length() > 0)
httpd_resp_sendstr_chunk(req, zw.c_str());
string query = std::string(_query);
/* Respond with an empty chunk to signal HTTP response completion */
httpd_resp_sendstr_chunk(req, NULL);
#ifdef DEBUG_DETAIL_ON
LogFile.WriteHeapInfo("handler_JSON - Done");
#endif
return ESP_OK;
};
esp_err_t handler_wasserzaehler(httpd_req_t *req)
@@ -710,4 +740,10 @@ void register_server_tflite_uri(httpd_handle_t server)
camuri.handler = handler_wasserzaehler;
camuri.user_ctx = (void*) "Wasserzaehler";
httpd_register_uri_handler(server, &camuri);
camuri.uri = "/json";
camuri.handler = handler_json;
camuri.user_ctx = (void*) "JSON";
httpd_register_uri_handler(server, &camuri);
}

View File

@@ -142,13 +142,7 @@ void task_NoSDBlink(void *pvParameter)
extern "C" void app_main(void)
{
TickType_t xDelay;
printf("Do Reset Camera\n");
PowerResetCamera();
Camera.InitCam();
Camera.LightOnOff(false);
if (!Init_NVS_SDCard())
{
xTaskCreate(&task_NoSDBlink, "task_NoSDBlink", configMINIMAL_STACK_SIZE * 64, NULL, tskIDLE_PRIORITY+1, NULL);
@@ -176,8 +170,8 @@ extern "C" void app_main(void)
printf("DNS IP: %s\n", dns);
wifi_init_sta(ssid, passwd, hostname, ip, gateway, netmask, dns);
wifi_init_sta(ssid, passwd, hostname, ip, gateway, netmask, dns);
xDelay = 2000 / portTICK_PERIOD_MS;
printf("main: sleep for : %ldms\n", (long) xDelay);
@@ -198,8 +192,8 @@ extern "C" void app_main(void)
printf("time %s\n", zw.c_str());
// Camera.InitCam();
// Camera.LightOnOff(false);
xDelay = 2000 / portTICK_PERIOD_MS;
// Camera.LightOnOff(false);
xDelay = 2000 / portTICK_PERIOD_MS;
printf("main: sleep for : %ldms\n", (long) xDelay);
vTaskDelay( xDelay );
@@ -215,6 +209,22 @@ extern "C" void app_main(void)
register_server_main_uri(server, "/sdcard");
printf("vor dotautostart\n");
TFliteDoAutoStart();
// init camera module
printf("Do Reset Camera\n");
PowerResetCamera();
esp_err_t cam = Camera.InitCam();
if (cam != ESP_OK) {
ESP_LOGE(TAGMAIN, "Failed to initialize camera module. "
"Check that your camera module is working and connected properly.");
LogFile.SwitchOnOff(true);
LogFile.WriteToFile("Failed to initialize camera module. "
"Check that your camera module is working and connected properly.");
LogFile.SwitchOnOff(false);
} else {
Camera.LightOnOff(false);
TFliteDoAutoStart();
}
}

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="fde0ae4";
const char* GIT_REV="e22b4b6";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2021-11-16 07:06";
const char* BUILD_TIME="2021-12-02 21:53";

View File

@@ -13,7 +13,7 @@ extern "C"
#include "Helper.h"
#include <fstream>
const char* GIT_BASE_BRANCH = "master - v9.1.1 - 2021-11-16";
const char* GIT_BASE_BRANCH = "master - v9.2.0 - 2021-12-02";
const char* git_base_branch(void)

View File

@@ -1,4 +1,4 @@
const char* GIT_REV="fde0ae4";
const char* GIT_REV="e22b4b6";
const char* GIT_TAG="";
const char* GIT_BRANCH="master";
const char* BUILD_TIME="2021-11-16 07:05";
const char* BUILD_TIME="2021-12-02 21:53";

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

View File

@@ -20,7 +20,7 @@ FlipImageSize = false
/config/ref1.jpg 442 142
[Digits]
Model = /config/dig1310s3q.tflite
Model = /config/dig1330s1q.tflite
;LogImageLocation = /log/digit
;LogfileRetentionInDays = 3
ModelInputSize = 20 32
@@ -29,7 +29,7 @@ main.dig2 343 126 30 54
main.dig3 391 126 30 54
[Analog]
Model = /config/ana0700s1lq.tflite
Model = /config/ana0910s3_longq.tflite
;LogImageLocation = /log/analog
;LogfileRetentionInDays = 3
ModelInputSize = 32 32
@@ -46,7 +46,7 @@ PreValueAgeStartup = 720
AllowNegativeRates = false
main.MaxRateValue = 0.1
ErrorMessage = true
CheckDigitIncreaseConsistency = true
CheckDigitIncreaseConsistency = false
;[MQTT]
;Uri = mqtt://IP-ADRESS:1883

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,9 +3,12 @@ function gethost_Version(){
return "1.0.0 - 20200910";
}
function getbasepath(){
var host = window.location.hostname;
if ((host == "127.0.0.1") || (host == "localhost") || (host == ""))
if (((host == "127.0.0.1") || (host == "localhost") || (host == ""))
&& ((window.location.port == "80") || (window.location.port == "")))
{
// host = "http://192.168.2.219"; // jomjol interner test
// host = "http://192.168.178.46"; // jomjol interner test
@@ -18,6 +21,10 @@ function getbasepath(){
{
host = "http://" + host;
}
if (window.location.port != "") {
host = host + ":" + window.location.port;
}
return host;
}

View File

@@ -2,9 +2,9 @@ function readconfig_Version(){
return "1.0.0 - 20200910";
}
var config_gesamt;
var config_split;
var param;
var config_gesamt = "";
var config_split = [];
var param = [];
var category;
var ref = new Array(2);
var NUMBERS = new Array(0);

View File

@@ -1 +1 @@
11.0.1
11.1.0