Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you open the TMQTTBroker.exe.config file, you will find all of the possible configured parameters. The parameters will be in comments between surrounded by (<!−−   −−>). To set a specific parameter, you need to move the whole line of the parameter outside the comments (<!−−    −−>) but keep it in the section <configuration> <appSettings>.

...

  • ListeningPort: Server listening port. Default The default is 1883 if it is not configured 
  • CertificateFile: Certificate file to use in the SSL
  • CertificatePassword: Certificate password to use in the SSL
  • SslProtocols: SSL protocol
  • UserNameAndPassword1: UserName and password required to access the Broker, using the syntax UserName;Password.

...

The password can be a string (with no encryption ) or an encrypted password. To encrypt a password you can use in any coder (ex. Visual Studio), use the following code:

...

  • Backlog: Sets the number of connections to keep a backlog. Default: The default is 100
  • DisableRetainedFile: The broker stores the last retained message and the corresponding QoS for that topic. The valid value is true or false. The default is false.

  • ClientID: This parameter enables limitations for specific MQTT clients. To configure more than one MQTT client, you need to create a whole new line and change the last number to the next sequence number.


    Code Block
    add key="ClientID1" value="<MQTTClientID>; Topic1=<Topic>, Subscribe1=<True or False>, Publish1=<True or False>" />


    There are 4 internal parameters:

  • value: Sets the MQTT Client ID
  • Topic: Specific topic that will set the limitation
  • Subscribe: flag Flag (true or false) that allows the client to subscribe to a topic (can receive messages)
  • Publish: flag Flag (true or false) that allows the client to publish a topic (can write messages) 

    Code Block
    <add  key="ClientID1"  value="MQTTClientTest;Topic1=*,Subscribe1=True,  Publish1=True"/>
    
    <add  key="ClientID2"  value="32443fsa6546fa;Topic1=*,Subscribe1=True,  Publish1=False"/>
    
    <add  key="ClientID3"  value="7323rt304343r4;Topic1=*,Subscribe1=False,Publish1=True"/>


...

  • TServer: The project name and as well as the TServer's IP address and port number. To connect the TMQTTBroker with more than one runtime project, you need to create a whole new line and change the last number to the next sequence. 

...

  • TimeUpdateTSevers: Time between update updates to TServer; Default is 500 milliseconds 
  • GroupId: Alias that will be used in the topic
  • TagProperties: List of tag properties that are sent to the MQTT client when they change values

...

The TMQTTBroker can be implemented in two ways. It can be used as a simple gateway that exchanges data between any MQTT client or through a direct connection with runtime projects by publishing project data for MQTT clients using the SparkplugB specification. 

...

In this scenario, the TMQTTBroker only exchanges data between MQTT clients following the SparkplugB specification or not. Then, the clients are responsible to subscribe and publish topics to the Broker. All topic formats are shown in this scenario.

...

In this scenario, the TMQTTBroker connects with one, and then connects with several to one or more runtime projects through the TServer. It only publishes the project data for topics by following the SparkplugB specification.

...

Code Block
spBv1.0/<Group_Id>/<message_type>/<Project_Name>/<MQTT_Device_Name>


Where the:

  • Group Id: is a the name that is configured in the .config
  • Message Type: The following message type Message Type elements are defined for the Sparkplug specification. For most clients that support SparkplugB, the message type will automatically be set. 
  • NBIRTH – Birth certificate for MQTT EoN
  • NDEATH – Death certificate for MQTT EoN
  • DBIRTH – Birth certificate for devices
  • DDEATH – Death certificate for devices
  • NDATA – Node data
  • DDATA – Device data
  • NCMD – Node command
  • DCMD – Device command
  • STATE – Critical application state
  • Project Name: is the same name configured in the .config
  • MQTT Device Name: it can be a namespace or an object from the runtime project. Individual objects should be avoided and uses the namespaces for performance

...