← index #410Issue #316
Related · high · value 2.832
QUERY · ISSUE

UMQTT - mqtt stops publishing after 5 minutes

openby TanCansopened 2021-01-27updated 2021-01-27

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:

umqtt.txt

Thank you all in advance!

CANDIDATE · ISSUE

umqtt.robust sends the NodeMCU Esp8266 board in some freezing state

closedby JDchauhanopened 2018-10-31updated 2024-08-27

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.

1 comment
jonnor · 2024-08-25

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.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied