Closed cybersmart-eu closed 9 months ago
Hi Uwe,
detailed information about LWT can be found here
Last Will and Testament (LWT) is a powerful feature in MQTT that allows clients to specify a message that will be automatically published by the broker on their behalf, if or when an unexpected disconnection occurs.
The last will is configured in the file mqtt_publisher.py
self.client.will_set(
self.get_topic(mqtt_topics.INTERNAL_LWT, False).decode('utf8'),
payload='offline',
retain=True
)
There is no timeout specified. On the website mentioned above you find the paragraph "When does the MQTT Broker Send the LWT Message?" that states the following:
According to the MQTT 3.1.1 specification, the broker sends a client’s Last Will and Testament (LWT) message in the following situations:
A keep alive period (case 2) is not implemented. The broker should publish the 'offline' message on behalf of the MQTT gateway if one of the other cases occurs.
Hi,
there is an _internal/lwt topic but I did not manage to find out when the broker is requested to trigger it.
To my best understanding the gateway needs to tell the broker it‘s lwt parameters incl. the „timeout“ which will trigger the lwt-topic.
Where is this timeout defined? I shut down the gateway for some time waiting for the broker so send lwt, bit nothing happens even after several minutes?
Maybe someone can give me a hint where this timout is defined. Maybe it can be made „configurable“?
BR Uwe