NOTE: a), ‘Name’ and ‘Password’ are obtained/set when creating a project on the MQTT server. b) The SSL certificate is issued by a trusted digital certificate authority CA (eg Symantec) after verifying the identity of the server. It has server authentication and data transfer encryption.
c) Check the 'Clean Session' option to clear the session cache. Checked by default.
10.12.2 Publish with MQTT
Description of Function After successfully connecting to the MQTT server, activate this function block to publish the message to a topic in the MQTT server. Connection Description En You enable/disable the block with the signal at input En (1/0). Parameter Retained:
Typically, if a publisher publishes a message to a topic, when no one subscribes to the topic, then the message will be discarded (not retained) by the MQTT server. However, the publisher can tell the MQTT server to keep the last message of the topic by setting a reserved message flag. When a device subscribed to this topic goes online, the MQTT server sends the retained information to the subscriber. You can check this option to implement this ‘information retention’ feature. A powered - down device can receive the last message of its subscribed topic after powering on.
275
Made with FlippingBook - Online magazine maker