Open hatfieldr opened 7 years ago
I get the same problem. and I cannot receive MQTTPINGRESP after send MQTTPINGREQ so it cause to disconnect when the time is beyond keep alive time
hey did you find any solution to that. My code blocks at mqtt.loop() function . Probably in the readPacket() function.
Same issue here too. Was doing some work with a PMS5003 interfaced via serial and took awhile to figure out it was client loop that was causing my problems.
my code stuck at _client->read() in readByte() function. It happens after 2-3 hours of operation
I am using an ESP-01(AT command set) connected to an arduino Meg2560 using hardware serial at 115200 baud. It was fairly easy to get it to connect to WiFi using WiFiEsp.h & to an MQTT broker but I have been tearing my hair out for the last week as no messages were received! The problem was solved by calling: if (!client.connected()) reconnect(); & client.loop(); every 100ms (non blocking) instead of every loop. I presume there is no problem if sketches are flashed to the ESP (no serial connection); I also presume that if the ESP is connected via a serial port & the functions are called every loop the serial connection is overwhelmed with status messages, blocking incoming data. Is this correct? I am a newbie using ESP & MQTT Is there any disadvantage calling these functions every 100 ms?