UMQTT - mqtt stops publishing after 5 minutes
Hello everyone,
i am using umqtt library to publish some telemetry data to an IoT platform with a pycom microcontroller. But mqtt stops publishing data exact after five minutes even though it is still connected to wlan.
I am sharing the piece of code that calls mqtt client and the library
Connecting wlan:
wlan.connect('my wlan', auth=(None,'my password'), timeout= 50000) #even though i changed this timeout it didnt solve my problem
My credentials (for iot platform)
server = 'my server'
port = 1883
id = 'my id'
pw = ‘acces token’
topic_publish = 'v1/devices/me/telemetry'
dict={}
Creating a client:
Client = MQTTClient(id, server, port, pw, pw)
time.sleep(2)
client.connect()
Publishing in the loop:
While 1
encoded=ujson.dumps(dict)
client.publish(topic_publish, encoded)
time.sleep(1)
Umqtt library:
Thank you all in advance!
umqtt.robust sends the NodeMCU Esp8266 board in some freezing state
I have observed some strange problem in my NodeMCU Esp8266 board after running umqtt.robust that the board will stop silently without any warning or throwing errors after 10-15 minutes of no communication with the broker (i.e, if the client does not publish or receive any message of subscribed topics for 15 minutes approx.).
It seems like the library might be taking the board to some blocking state.
Please check and fix that issue.
Hi. There is unfortunately not enough information here to reproduce or debug this problem.
Multiple issues with mqtt on esp8266 have been fixed over the last 5 years. And some are still open - search the issue tracker for more. Please re-test on the latest versions and if there are still problems which are not described in already open issues, provide details such as a minimal code example for how to reproduce - along with details about the MQTT setup, such as broker version.