You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The retained flag is actually stored correctly within ESPeasy.
Up-to the point where the PubSubClient::publish() is being called, the retained flag is still how it should be.
The bug seems to be in the PubSubClient library.
Ah, found it...
It is actually working just fine :)
The retain bit is just a bit for sending to the broker.
The broker will then keep the last message in that topic with a retain flag. As soon as someone subscribes to that topic, it receives immediately the last retained message.
That's useful when the sender has some large interval for sending values.
So send a MQTT message with 'retain' flag set and a long enough interval to the broker.
Then -before a new message is sent- subscribe to that topic and the first message you'll get is marked 'retained'. All later messages are not marked 'retained', since you get them immediately from the broker.
* [issue #869] Added 'LWT' to last will topic and improved CPU load
See #869 for discussion on Last Will Topic.
Also changed the way it tried to reconnect to make it return a lot faster when connection is not (yet) possible and call the PubSubClient::loop() at a much slower pace to reduce CPU usage. (See #847)
This higher CPU load was probably introduced when fixing #683.
* [MQTT] Fix error reporting success status with longer payloads
Applied PR https://github.com/knolleary/pubsubclient/pull/360/files
* made MQTT_CALLBACK_SIGNATURE for esp32 functional
Applied PR knolleary/pubsubclient#336
NOTE: This is not a support forum! For questions and support go here: https://www.letscontrolit.com/forum/viewforum.php?f=1
Steps to reproduce
Does the problem presist after powering off and on? (just resetting isnt enough sometimes)
yes
Expected behavior
Tell us what should happen?
no
Actual behavior
Tell us what happens instead?
MQTT message sent with flag "retained"
System configuration
Hardware:
Software or git version:
Git Build":"v2.0-20180206", Wemos Mini D1
The text was updated successfully, but these errors were encountered: