Skip to content

Umqtt.simple re-subscribe issue #387

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

Closed
samf48 opened this issue May 14, 2020 · 2 comments
Closed

Umqtt.simple re-subscribe issue #387

samf48 opened this issue May 14, 2020 · 2 comments

Comments

@samf48
Copy link

samf48 commented May 14, 2020

Hello I have a device in which I am using this library to subscribe and publish. The publish works well an the subscribe works IF my device is actively on and connected. What I mean by this is that if I am subscribed to a topic and I publish to said topic, then all is well. However my device actually powers down in a cyclic fashion and only powers up when it wants to publish. So with that said, how can I get messages from my subscribed topic once my device powers back up and then "re-subscribes" ? I'm pretty sure someone is doing this already but I haven't found a clear way to do it. Or is this something that is dependent on the server side?

@HerbV
Copy link

HerbV commented Jun 8, 2020

hi samf48, I wold just publish a message to be informed about the new start. What do you think?

@jonnor
Copy link

jonnor commented Aug 25, 2024

To get the last message on a subscribe, the "retained message" feature in MQTT must be used. See for example https://www.hivemq.com/blog/mqtt-essentials-part-8-retained-messages/ for an explainer. The client that publishes the message must set the retain flag.

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

4 participants