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.
2 years, 11 months ago.
MQTT connection get lost, client.isConnected() method always return true.
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.