From 5d9dab9340d5eadbb58c5b0942c314d435909ab2 Mon Sep 17 00:00:00 2001 From: arendst Date: Mon, 25 Sep 2017 12:35:02 +0200 Subject: [PATCH] Add esp8266 de-blocking Solve possible PubSubClient timeout due to esp8266 blocking (#790) --- lib/PubSubClient/src/PubSubClient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PubSubClient/src/PubSubClient.cpp b/lib/PubSubClient/src/PubSubClient.cpp index 5932bdbee..11e1c874a 100644 --- a/lib/PubSubClient/src/PubSubClient.cpp +++ b/lib/PubSubClient/src/PubSubClient.cpp @@ -209,6 +209,7 @@ boolean PubSubClient::connect(const char *id, const char *user, const char *pass boolean PubSubClient::readByte(uint8_t * result) { uint32_t previousMillis = millis(); while(!_client->available()) { + delay(1); // Add esp8266 de-blocking (Tasmota #790) uint32_t currentMillis = millis(); if(currentMillis - previousMillis >= ((int32_t) MQTT_SOCKET_TIMEOUT * 1000)){ return false;