-->
Page 1 of 2

MQTT connection timeout too short

PostPosted: Tue Sep 20, 2016 9:03 pm
by jbro
I consistently get the error:

-2 "mqtt.CONN_FAIL_TIMEOUT_RECEIVING" "Timeout waiting for a CONNACK from the broker".

As far as I can tell, the mqtt module has a default CONNACK time out of less than 6 seconds or so. I was unable to find a way to change the timeout period in the Docs. I am using the cloud custom build service, esptool.py and esp8266-12E. I wrote a barebones mqtt broker with a variable connection delay and I am able to connect to the broker if the delay is less than 6 seconds or so. This is a problem for my system.

Am I missing something? Is this fixable somehow? I did not have this issue with 0.9.6 firmware.

Thanks,
Jeff

Re: MQTT connection timeout too short

PostPosted: Fri Sep 23, 2016 3:37 am
by jbro
I know nobody has to give me an answer, but if there is something wrong with my question that is preventing you all from answering me, could someone kindly tell me what I am doing wrong that my question is not being answered? Is it a dumb question?

Re: MQTT connection timeout too short

PostPosted: Fri Sep 23, 2016 2:21 pm
by stenry
I also get several timeouts with remote broker, but eventually the client connects. I would also like to know how and where to change the timeout value.

Re: MQTT connection timeout too short

PostPosted: Sun Sep 25, 2016 4:34 pm
by devsaurus
Just a quick guess...

There's MQTT_CONNECT_TIMEOUT in https://github.com/nodemcu/nodemcu-firm ... mqtt.c#L26. You could try to increase it, maybe this fixes your issue.
Requires local compilation of the firmware though (see http://nodemcu.readthedocs.io/en/dev/en ... cker-image).