Skip to content

umqtt (with tls): check_msg() / wait_msg() - how to know connection is gone? timeout? #334

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
mirko opened this issue Mar 15, 2019 · 3 comments

Comments

@mirko
Copy link

mirko commented Mar 15, 2019

I'm using the umqtt module - on conjunction with ussl_mbedtls - within the UNIX port with mbedtls.
When I re-route the traffic originally going to my MQTT broker to /dev/null (e.g. 127.0.0.1), check_msg() as well as wait_msg() continue behaving as before. No different return value, no exception thrown.
From the umqtt.robust implementation I figure that should be the case though.
I also thought this might be due to an overly long timeout, so I called settimeout(X) on the underlying socket, but then wait_msg() throws an exception right after X seconds - no matter what - which I also appears weird to me.

What's the way to go to catch network issues and potentially reconnect automatically when using umqtt.{simple,robust} with TLS?

@jonnor
Copy link

jonnor commented Aug 25, 2024

Hi. Is this still an issue with the latest MicroPython and mqtt.simple/mqtt.robust versions?

@mirko
Copy link
Author

mirko commented Aug 25, 2024

It's been more than 5 years, I honestly have no idea :)

@prabhu-yu
Copy link
Contributor

prabhu-yu commented Nov 1, 2024

hi @mirko , @jonnor
I have submitted a fix here.
https://github.com/micropython/micropython-lib/pull/890/files

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

3 participants