Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 3 months ago.
MQTT connection get lost, client.isConnected() method always return true.
Hi everyone,
I'm facing a problem in MQTT library with alive connection issue. I need to publish my MQTT message when i receive something on Serial. When it starts the client get connected to the Mosquitto broker and if i send something on Serial, the message get published on Broker. The problem occurs when the program is in idle state waiting for some messages on Serial to arrive. The MQTT connection get lost from MQTT broker, and if i check the connection status before publishing my message using client.isConnected() method always return true even if the connection is lost. Now when i try to publish the message in lost connection state, the program get stuck it there.
Any help would be really appreciated.
Hello, Is this the same problem as the same question you were asking a week ago in this thread? https://os.mbed.com/questions/81951/MQTT-connection-get-lost-using-it-with-T/. If it is, I just posted a comment. Sorry for the late reply. I have been very the last couple week.
-Peter
posted by Peter Nguyen 14 Aug 2018Hi Peter,
Yes it's the same question, no one replies there so i opened a new thread to get some attention..lol.
I have tried different things to resolve the problem, but it's still there and i'm kinda stuck in that problem.
Any help would be really appreciated.
posted by sohaib qamar 14 Aug 2018