MQTT Pub


The MQTT Pub node establishes an MQTT client that pushes data to a third-party MQTT server.

Node Type

Action.

Input and Output Ability

This node has 1 entry point and can have 0 or 1 exit point. Both the input and the output can be any format.

Node Properties

../../_images/mqtt_pub.png


Node Name

Required.

The name for this node.


Host

Required.

The URL of the MQTT server.


Port

Required.

The port of the MQTT server.


Authentication Method

Required.

The method by which the request made by this node is authenticated. Values include the below.

  • Anonymous: Make an anonymous request by using a different IP address every time.

  • Username/Password: Pass the username/password in the request for authentication. If selected, the following fields are required.

    • User Name: The user name the client uses to log in to the server.

    • Password: The password the client uses to log in to the server.

  • Uni-directional: Use encrypted communication where the MQTT client authenticates the credential obtained from the server. If selected, the following is required.

    • Certificate: The certificate from the server that the MQTT authenticates.

  • Bi-directional: Use encrypcted communication where the MQTT client and server both authenticate each other’s credentials. If selected, the following is required.

    • Certificate: The certificate from the server that the MQTT authenticates.

    • Client Certificate: The client certificate to be authenticated by the MQTT server.

    • Client Certificate Key: The client certificate key to be authenticated.

    • Client Password: The client password to be authenticated.


Topic

Required.

The topic of the MQTT server to which the MQTT client subscribes. You can specify only 1 topic.


Clear Previous Sessions

Optional.

Clear the previous sessions between the client and server whenever the client reconnects to the server.


Description

Optional.

The description for this node.


Test Connection

You can click the Test Connection button to test the MQTT connectivity.

Limitations

  • Number of connections: 1

  • Maximum number of topics: 1

  • As the MQTT server is not managed by EnOS, connection problems could occur due to server downtime or other instances that are not within our control.

Samples

Input Sample

Example of a JSON object as input:

{
   "externalId":"externalId",
   "timestamp":24214324324,
   "measurepoints":{
     "speed":32,
     "heat":40
   }
 }

Output Sample

Example of a JSON object response retrieved from the MQTT server. Its topic information is stored in the metadata.

{
    "externalId":"externalId",
    "timestamp":24214324324,
    "measurepoints":{
        "speed":32,
        "heat":40
    }
}