Skip to content

UMQTT - mqtt stops publishing after 5 minutes #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TanCans opened this issue Jan 27, 2021 · 0 comments
Open

UMQTT - mqtt stops publishing after 5 minutes #410

TanCans opened this issue Jan 27, 2021 · 0 comments

Comments

@TanCans
Copy link

TanCans commented Jan 27, 2021

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant