This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MQTT Socket error after 4 consecutive MQTT connect/disconnect

Hi,

we are using MQTT to push the sensor and GPS data with 1 hour interval. After 4 consecutive connect and disconnect, MQTT is returning socket error. It requires the device reboot to connect again, so rebooting the device after every 4 MQTT connections. Because of reboot the device is taking longer time to get GPS fix for first time.

It is 100% reproducible. we are using our own MQTT broker and also tried the other brokers as well and behavior is same.

Error log returned by MQTT is "ERROR: mqtt_connect -12".

Please help us to resolve the issue.

Related