Skip to content
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

support LWT (Last Will and Testament) #17

Closed
CWempe opened this issue Jul 26, 2017 · 5 comments
Closed

support LWT (Last Will and Testament) #17

CWempe opened this issue Jul 26, 2017 · 5 comments
Assignees

Comments

@CWempe
Copy link

CWempe commented Jul 26, 2017

It would be great if the program would support LWT messages.

see: http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament

and also this comment: http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament/#comment-44936

@flyte
Copy link
Owner

flyte commented Jul 26, 2017

Sure, that's a good idea. Does it have to be configurable, or will the following suffice:

  • Status topic at <prefix>/status
  • Publish (retained) on start up: running
  • Publish (retained) when exiting: stopped
  • Last will in case of unclean disconnection: dead

@flyte
Copy link
Owner

flyte commented Jul 26, 2017

I guess it's not a big deal to make it configurable, so I'll do that.

@flyte
Copy link
Owner

flyte commented Jul 28, 2017

@CWempe I've added this functionality, so please test with version 0.1.0. Cheers!

PS. Check the bottom of the readme for config values.

@flyte flyte closed this as completed Jul 28, 2017
@flyte flyte self-assigned this Nov 26, 2017
@vontrapp
Copy link

vontrapp commented Sep 2, 2018

Can LWT be used to set many topics on death? It would be great if I could use that to clear any retained inputs when it is disconnected.

Or maybe there's another mqtt feature that does the same?

@flyte
Copy link
Owner

flyte commented Sep 4, 2018

@vontrapp I don't think so. This is a good article on the subject:
https://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament

If you want to clear retained messages when it's disconnected, would just setting retain = false work?

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

No branches or pull requests

3 participants