mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-19 05:58:21 +03:00
MQTT improvements (#1302)
* Update server_mqtt.cpp * Update server_mqtt.cpp * skipp all MQTT publishing until the next round if an error occures * improve logging * only use group for uid and topic if there is more than one number * . * .
This commit is contained in:
@@ -790,8 +790,7 @@ bool ClassFlowCNNGeneral::doNeuralNetwork(string time)
|
||||
string zw = "_num (p, m): " + to_string(_num) + " " + to_string(_numplus) + " " + to_string(_numminus);
|
||||
zw = zw + " _val (p, m): " + to_string(_val) + " " + to_string(_valplus) + " " + to_string(_valminus);
|
||||
zw = zw + " result: " + to_string(result) + " _fit: " + to_string(_fit);
|
||||
ESP_LOGD(TAG, "details cnn: %s", zw.c_str());
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, zw);
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, zw);
|
||||
|
||||
|
||||
_result_save_file = result;
|
||||
|
||||
@@ -129,7 +129,7 @@ void ClassFlowImage::RemoveOldLogs()
|
||||
}
|
||||
}
|
||||
}
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Image folder deleted: " + std::to_string(deleted) + ". Image folder not deleted: " + std::to_string(notDeleted));
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "Image folder deleted: " + std::to_string(deleted) + ". Image folder not deleted: " + std::to_string(notDeleted));
|
||||
closedir(dir);
|
||||
}
|
||||
|
||||
|
||||
@@ -230,6 +230,8 @@ bool ClassFlowMQTT::doFlow(string zwtime)
|
||||
{
|
||||
std::vector<NumberPost*>* NUMBERS = flowpostprocessing->GetNumbers();
|
||||
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Publishing MQTT topics...");
|
||||
|
||||
for (int i = 0; i < (*NUMBERS).size(); ++i)
|
||||
{
|
||||
result = (*NUMBERS)[i]->ReturnValue;
|
||||
@@ -245,7 +247,6 @@ bool ClassFlowMQTT::doFlow(string zwtime)
|
||||
else
|
||||
namenumber = maintopic + "/" + namenumber + "/";
|
||||
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Publishing MQTT topics...");
|
||||
|
||||
if (result.length() > 0)
|
||||
MQTTPublish(namenumber + "value", result, SetRetainFlag);
|
||||
|
||||
Reference in New Issue
Block a user