Replies: 2 comments
-
Sorry for very late answer. I do not ofen enough looking at discussions :-( my bad. No, there is no storing of message in TinyMqtt. See examples, all of them shows how to receive a MqttMessage with payload handling. |
Beta Was this translation helpful? Give feedback.
-
Hello More about your question
Cannot understand ... If you are subscribing, you have the payload and the topic. Maybe you missed the 'setCallback' and onPublish functions. If mosquito publishes a topic, the MqttClient callback will receive it. See there for example: https://github.com/hsaturn/TinyMqtt/blob/main/examples/client-with-wifi/client-with-wifi.ino#L44
But the broker is (very soon released) now capable of retain message (as the Mqtt 3.1 spec asks for). So if you connect your MqttClient to a local broker, then what you are asking becomes possible. retain is still under dev, but it works pretty well. I'm searching for informations on the status of the retain flag for retained publised topic. (Do I need to set it to 1 for retained and 0 for immediate etc..) Spec is hard to read on that point (if ever the information is there). Best regards |
Beta Was this translation helpful? Give feedback.
-
Most (if not all) of the examples show a mqtt.subscribe() command. However, I can not understand if it is possible to get the received payload (from an external mosquitto_pub client).
Is the mqtt_client.loop() polling and storing this information for a "getter" to pick up later?
Regards, M.
Beta Was this translation helpful? Give feedback.
All reactions