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
I am sure I am missing something very obvious here but for the life of me I cannot get locally published messages to retain.
I have setup the broker on a ESP8266 NodeMcu. I have connected to the broker using MQTT explorer . Everything is working great.
However, when I try to publish a retained message locally (from the ESP8266) it is not retained. It will appear in the explorer but if I disconnect and connect again it is gone. Using virtual bool publish(String topic, String data, uint8_t qos=0, uint8_t retain=0);
If I publish a retained message from MQTT explorer (i.e. button2/state: OFF) it will retain and persist disconnection and connection.
I am sure I am missing something very obvious here but for the life of me I cannot get locally published messages to retain.
I have setup the broker on a ESP8266 NodeMcu. I have connected to the broker using MQTT explorer . Everything is working great.
However, when I try to publish a retained message locally (from the ESP8266) it is not retained. It will appear in the explorer but if I disconnect and connect again it is gone. Using
virtual bool publish(String topic, String data, uint8_t qos=0, uint8_t retain=0);
If I publish a retained message from MQTT explorer (i.e. button2/state: OFF) it will retain and persist disconnection and connection.
Am I missing something obvious here?
Below is a cut down of the code.
The text was updated successfully, but these errors were encountered: