removed mqtt check

This commit is contained in:
ishak jmilou.ishak
2025-01-08 14:18:46 +01:00
parent 4bf3cd6d37
commit fa85be2df5

View File

@@ -17,7 +17,6 @@ void parseMQTT(std::string message);
void CapnSend();
void reconnectKobuki();
void monitorKobukiConnection();
void monitorMQTTConnection();
// ip, clientID, username, password
MqttClient client("ws://145.92.224.21/ws/", "KobukiRPI", "rpi",
"rpiwachtwoordofzo"); // create a client object
@@ -34,8 +33,6 @@ void setup() {
client.subscribe("home/commands");
std::thread monitorThread(monitorKobukiConnection);
std::thread mqttMonitorThread(monitorMQTTConnection);
mqttMonitorThread.detach();
monitorThread.detach();
}
@@ -83,17 +80,6 @@ void monitorKobukiConnection() {
}
}
void monitorMQTTConnection() {
while (true) {
if (!client.isConnected()) { // Controleer of de client nog verbonden is
std::cerr << "MQTT verbinding verloren. Probeer opnieuw te verbinden..." << std::endl;
client.connect();
client.subscribe("home/commands");
}
std::this_thread::sleep_for(std::chrono::seconds(5)); // Controleer iedere 5 seconden
}
}
std::string readMQTT() {
static std::string lastMessage;