mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-13 15:06:53 +03:00
Quick Fix for MQTT Init Problem
This commit is contained in:
@@ -146,7 +146,7 @@ bool ClassFlowControll::StartMQTTService() {
|
||||
if (FlowControll[i]->name().compare("ClassFlowMQTT") == 0) {
|
||||
return ((ClassFlowMQTT*) (FlowControll[i]))->Start(AutoIntervall);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,6 +189,15 @@ string ClassFlowMQTT::GetMQTTMainTopic()
|
||||
|
||||
bool ClassFlowMQTT::Start(float AutoIntervall) {
|
||||
|
||||
// printf("URI: %s, MAINTOPIC: %s", uri.c_str(), maintopic.c_str());
|
||||
|
||||
if ((uri.length() == 0) || (maintopic.length() == 0))
|
||||
{
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "MQTT not started because URI or Maintopic is not set. MQTT will be disabled.");
|
||||
MQTTdisable();
|
||||
return false;
|
||||
}
|
||||
|
||||
roundInterval = AutoIntervall; // Minutes
|
||||
keepAlive = roundInterval * 60 * 2.5; // Seconds, make sure it is greater thatn 2 rounds!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user