mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
removed redundant log entries (some now are DEBUG isntread of INFO or ERROR)
This commit is contained in:
@@ -494,7 +494,6 @@ void task_reboot(void *pvParameter)
|
|||||||
void doReboot(){
|
void doReboot(){
|
||||||
LogFile.SwitchOnOff(true);
|
LogFile.SwitchOnOff(true);
|
||||||
LogFile.WriteToFile("Reboot triggered by Software (5s).");
|
LogFile.WriteToFile("Reboot triggered by Software (5s).");
|
||||||
ESP_LOGI(TAGPARTOTA, "Reboot in 5sec");
|
|
||||||
LogFile.WriteToFile("Reboot in 5sec");
|
LogFile.WriteToFile("Reboot in 5sec");
|
||||||
xTaskCreate(&task_reboot, "reboot", configMINIMAL_STACK_SIZE * 64, NULL, 10, NULL);
|
xTaskCreate(&task_reboot, "reboot", configMINIMAL_STACK_SIZE * 64, NULL, 10, NULL);
|
||||||
// KillTFliteTasks(); // kills itself
|
// KillTFliteTasks(); // kills itself
|
||||||
|
|||||||
@@ -548,8 +548,7 @@ bool ClassFlowCNNGeneral::getNetworkParameter()
|
|||||||
zwcnn = FormatFileName(zwcnn);
|
zwcnn = FormatFileName(zwcnn);
|
||||||
ESP_LOGD(TAG, "%s", zwcnn.c_str());
|
ESP_LOGD(TAG, "%s", zwcnn.c_str());
|
||||||
if (!tflite->LoadModel(zwcnn)) {
|
if (!tflite->LoadModel(zwcnn)) {
|
||||||
ESP_LOGD(TAG, "Can't read model file /sdcard%s", cnnmodelfile.c_str());
|
LogFile.WriteToFile("Can't read model file /sdcard%s", cnnmodelfile.c_str());
|
||||||
LogFile.WriteToFile("Cannot load model");
|
|
||||||
delete tflite;
|
delete tflite;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -617,8 +616,7 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
|
|||||||
zwcnn = FormatFileName(zwcnn);
|
zwcnn = FormatFileName(zwcnn);
|
||||||
ESP_LOGD(TAG, "%s", zwcnn.c_str());
|
ESP_LOGD(TAG, "%s", zwcnn.c_str());
|
||||||
if (!tflite->LoadModel(zwcnn)) {
|
if (!tflite->LoadModel(zwcnn)) {
|
||||||
ESP_LOGD(TAG, "Can't read model file /sdcard%s", cnnmodelfile.c_str());
|
LogFile.WriteToFile("Can't read model file /sdcard%s", cnnmodelfile.c_str());
|
||||||
LogFile.WriteToFile("Cannot load model");
|
|
||||||
|
|
||||||
delete tflite;
|
delete tflite;
|
||||||
return false;
|
return false;
|
||||||
@@ -804,8 +802,7 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
|
|||||||
GENERAL[_ana]->ROI[i]->isReject = true;
|
GENERAL[_ana]->ROI[i]->isReject = true;
|
||||||
result = -1;
|
result = -1;
|
||||||
_result_save_file+= 100; // Für den Fall, dass fit nicht ausreichend, soll trotzdem das Ergebnis mit "-10x.y" abgespeichert werden.
|
_result_save_file+= 100; // Für den Fall, dass fit nicht ausreichend, soll trotzdem das Ergebnis mit "-10x.y" abgespeichert werden.
|
||||||
string zw = "Value Rejected due to Threshold (Fit: " + to_string(_fit) + "Threshold: " + to_string(CNNGoodThreshold);
|
string zw = "Value Rejected due to Threshold (Fit: " + to_string(_fit) + "Threshold: " + to_string(CNNGoodThreshold) + ")";
|
||||||
ESP_LOGD(TAG, "Value Rejected due to Threshold (Fit: %f, Threshold: %f", _fit, CNNGoodThreshold);
|
|
||||||
LogFile.WriteToFile(zw);
|
LogFile.WriteToFile(zw);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -493,9 +493,8 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
|
|||||||
{
|
{
|
||||||
// reboot notwendig damit die neue wlan.ini auch benutzt wird !!!
|
// reboot notwendig damit die neue wlan.ini auch benutzt wird !!!
|
||||||
fclose(pfile);
|
fclose(pfile);
|
||||||
ESP_LOGD(TAG, "do reboot");
|
|
||||||
LogFile.SwitchOnOff(true);
|
LogFile.SwitchOnOff(true);
|
||||||
LogFile.WriteToFile("Reboot to activate new HOSTNAME.");
|
LogFile.WriteToFile("Rebooting to activate new HOSTNAME...");
|
||||||
esp_restart();
|
esp_restart();
|
||||||
hard_restart();
|
hard_restart();
|
||||||
doReboot();
|
doReboot();
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ string ClassFlowImage::CreateLogFolder(string time) {
|
|||||||
string logPath = LogImageLocation + "/" + time.LOGFILE_TIME_FORMAT_DATE_EXTR + "/" + time.LOGFILE_TIME_FORMAT_HOUR_EXTR;
|
string logPath = LogImageLocation + "/" + time.LOGFILE_TIME_FORMAT_DATE_EXTR + "/" + time.LOGFILE_TIME_FORMAT_HOUR_EXTR;
|
||||||
isLogImage = mkdir_r(logPath.c_str(), S_IRWXU) == 0;
|
isLogImage = mkdir_r(logPath.c_str(), S_IRWXU) == 0;
|
||||||
if (!isLogImage) {
|
if (!isLogImage) {
|
||||||
ESP_LOGW(logTag, "Can't create log folder for analog images. Path %s", logPath.c_str());
|
|
||||||
LogFile.WriteToFile("Can't create log folder for analog images. Path " + logPath);
|
LogFile.WriteToFile("Can't create log folder for analog images. Path " + logPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +128,6 @@ void ClassFlowImage::RemoveOldLogs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGI(logTag, "%d image folder deleted. %d image folder not deleted.", deleted, notDeleted);
|
|
||||||
LogFile.WriteToFile("Image folder deleted: " + std::to_string(deleted) + ". Image folder not deleted: " + std::to_string(notDeleted));
|
LogFile.WriteToFile("Image folder deleted: " + std::to_string(deleted) + ". Image folder not deleted: " + std::to_string(notDeleted));
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,8 +108,7 @@ FILE* OpenFileAndWait(const char* nm, const char* _mode, int _waitsec)
|
|||||||
TickType_t xDelay;
|
TickType_t xDelay;
|
||||||
xDelay = _waitsec * 1000 / portTICK_PERIOD_MS;
|
xDelay = _waitsec * 1000 / portTICK_PERIOD_MS;
|
||||||
std::string zw = "File is locked: " + std::string(nm) + " - wait for " + std::to_string(_waitsec) + " seconds";
|
std::string zw = "File is locked: " + std::string(nm) + " - wait for " + std::to_string(_waitsec) + " seconds";
|
||||||
ESP_LOGD(TAG, "%s", zw.c_str());
|
LogFile.WriteToFile(zw);
|
||||||
LogFile.WriteToFile(zw);
|
|
||||||
vTaskDelay( xDelay );
|
vTaskDelay( xDelay );
|
||||||
pfile = fopen(nm, _mode);
|
pfile = fopen(nm, _mode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,7 +248,6 @@ void ClassLogFile::RemoveOld()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGI(TAG, "%d logfiles deleted. %d files not deleted (incl. leer.txt).", deleted, notDeleted);
|
|
||||||
LogFile.WriteToFile("logfiles deleted: " + std::to_string(deleted) + " files not deleted (incl. leer.txt): " + std::to_string(notDeleted));
|
LogFile.WriteToFile("logfiles deleted: " + std::to_string(deleted) + " files not deleted (incl. leer.txt): " + std::to_string(notDeleted));
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ bool MQTTPublish(std::string _key, std::string _content, int retained_flag){
|
|||||||
}
|
}
|
||||||
zw = "MQTT - sent publish successful in MQTTPublish, msg_id=" + std::to_string(msg_id) + ", " + _key + ", " + _content;
|
zw = "MQTT - sent publish successful in MQTTPublish, msg_id=" + std::to_string(msg_id) + ", " + _key + ", " + _content;
|
||||||
if (debugdetail) LogFile.WriteToFile(zw);
|
if (debugdetail) LogFile.WriteToFile(zw);
|
||||||
ESP_LOGD(TAG_INTERFACEMQTT, "sent publish successful in MQTTPublish, msg_id=%d, %s, %s", msg_id, _key.c_str(), _content.c_str());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +222,6 @@ void MQTTconnected(){
|
|||||||
if (subscribeFunktionMap != NULL) {
|
if (subscribeFunktionMap != NULL) {
|
||||||
for(std::map<std::string, std::function<bool(std::string, char*, int)>>::iterator it = subscribeFunktionMap->begin(); it != subscribeFunktionMap->end(); ++it) {
|
for(std::map<std::string, std::function<bool(std::string, char*, int)>>::iterator it = subscribeFunktionMap->begin(); it != subscribeFunktionMap->end(); ++it) {
|
||||||
int msg_id = esp_mqtt_client_subscribe(client, it->first.c_str(), 0);
|
int msg_id = esp_mqtt_client_subscribe(client, it->first.c_str(), 0);
|
||||||
ESP_LOGD(TAG_INTERFACEMQTT, "topic %s subscribe successful, msg_id=%d", it->first.c_str(), msg_id);
|
|
||||||
LogFile.WriteToFile("MQTT - topic " + it->first + " subscribe successful, msg_id=" + std::to_string(msg_id));
|
LogFile.WriteToFile("MQTT - topic " + it->first + " subscribe successful, msg_id=" + std::to_string(msg_id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -718,7 +718,6 @@ void task_autodoFlow(void *pvParameter)
|
|||||||
{
|
{
|
||||||
std::string _zw = "task_autodoFlow - next round - Round #" + std::to_string(++countRounds);
|
std::string _zw = "task_autodoFlow - next round - Round #" + std::to_string(++countRounds);
|
||||||
LogFile.WriteToFile(_zw);
|
LogFile.WriteToFile(_zw);
|
||||||
ESP_LOGD(TAGTFLITE, "Autoflow: start");
|
|
||||||
fr_start = esp_timer_get_time();
|
fr_start = esp_timer_get_time();
|
||||||
|
|
||||||
if (flowisrunning)
|
if (flowisrunning)
|
||||||
@@ -747,7 +746,6 @@ void task_autodoFlow(void *pvParameter)
|
|||||||
stream << std::fixed << std::setprecision(1) << cputmp;
|
stream << std::fixed << std::setprecision(1) << cputmp;
|
||||||
string zwtemp = "CPU Temperature: " + stream.str();
|
string zwtemp = "CPU Temperature: " + stream.str();
|
||||||
LogFile.WriteToFile(zwtemp);
|
LogFile.WriteToFile(zwtemp);
|
||||||
ESP_LOGD(TAGTFLITE, "CPU Temperature: %.2f", cputmp);
|
|
||||||
fr_delta_ms = (esp_timer_get_time() - fr_start) / 1000;
|
fr_delta_ms = (esp_timer_get_time() - fr_start) / 1000;
|
||||||
if (auto_intervall > fr_delta_ms)
|
if (auto_intervall > fr_delta_ms)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ void setTimeZone(std::string _tzstring)
|
|||||||
{
|
{
|
||||||
setenv("TZ", _tzstring.c_str(), 1);
|
setenv("TZ", _tzstring.c_str(), 1);
|
||||||
tzset();
|
tzset();
|
||||||
ESP_LOGD(TAG, "TimeZone set to %s", _tzstring.c_str());
|
|
||||||
_tzstring = "Time zone set to " + _tzstring;
|
_tzstring = "Time zone set to " + _tzstring;
|
||||||
LogFile.WriteToFile(_tzstring);
|
LogFile.WriteToFile(_tzstring);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,15 +212,11 @@ extern "C" void app_main(void)
|
|||||||
{
|
{
|
||||||
std::string _zws = "Not enough PSRAM available. Expected 4.194.304 MByte - available: " + std::to_string(_hsize);
|
std::string _zws = "Not enough PSRAM available. Expected 4.194.304 MByte - available: " + std::to_string(_hsize);
|
||||||
_zws = _zws + "\nEither not initialzed, too small (2MByte only) or not present at all. Firmware cannot start!!";
|
_zws = _zws + "\nEither not initialzed, too small (2MByte only) or not present at all. Firmware cannot start!!";
|
||||||
ESP_LOGD(TAGMAIN, "%s", _zws.c_str());
|
|
||||||
LogFile.SwitchOnOff(true);
|
LogFile.SwitchOnOff(true);
|
||||||
LogFile.WriteToFile(_zws);
|
LogFile.WriteToFile(_zws);
|
||||||
LogFile.SwitchOnOff(false);
|
LogFile.SwitchOnOff(false);
|
||||||
} else {
|
} else {
|
||||||
if (cam != ESP_OK) {
|
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.SwitchOnOff(true);
|
||||||
LogFile.WriteToFile("Failed to initialize camera module. "
|
LogFile.WriteToFile("Failed to initialize camera module. "
|
||||||
"Check that your camera module is working and connected properly.");
|
"Check that your camera module is working and connected properly.");
|
||||||
@@ -229,7 +225,6 @@ extern "C" void app_main(void)
|
|||||||
// Test Camera
|
// Test Camera
|
||||||
camera_fb_t * fb = esp_camera_fb_get();
|
camera_fb_t * fb = esp_camera_fb_get();
|
||||||
if (!fb) {
|
if (!fb) {
|
||||||
ESP_LOGE(TAGMAIN, "esp_camera_fb_get: Camera Capture Failed");
|
|
||||||
LogFile.SwitchOnOff(true);
|
LogFile.SwitchOnOff(true);
|
||||||
LogFile.WriteToFile("Camera cannot be initialzed. "
|
LogFile.WriteToFile("Camera cannot be initialzed. "
|
||||||
"System will reboot.");
|
"System will reboot.");
|
||||||
|
|||||||
Reference in New Issue
Block a user