This document has information on the MQTTspB Simulator configuration and Runtime Behavior. Below you will find more information on the requirements and supported features.


Application Requirements

This simulator application comes with the default installation of product version 9.2. The executable file can be found under the ../9.2/MQTTspBSimulator.exe directory.

Make sure to execute the file from inside this folder, to guarantee all dependencies are satisfied.

Supported Features

The following features are supported:

  • Connection to Brokers (local and Remote) that may (or not) require a Username and Password.
  • Customization of Topic parameters - GroupID, NodeID and DeviceID.
  • Create Multiple NodeIds in the same GroupID, each with its own DeviceID’s.
  • Create Multiple DeviceIDs in the same NodeID.
  • Change the DeviceIds attributes using a config file.
  • Publish NBIRTH, DBIRTH, DDATA, NDEATH and DDEATH messages.


The Simulator is Write-Only! You will not be able to subscribe to any topic, only publishing is allowed.



Configuration File

The DeviceID attributes can be customized using the configuration file, MQTTspBSimulator.exe.config. This file uses an XML syntax that is parsed during the application initialization.

This means that any change that is made requires the application to be restarted in order to be applied. 

The file syntax is illustrated below.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Name" value="Type=string;Sampling=constant;range=;defaultValue=Barcelona" />
<add key="State" value="Type=int;Sampling=variable;range=0,10;defaultValue=" />
<add key="Longitude" value="Type=double;Sampling=constant;range=1.56,2.49;defaultValue=" />
<add key="Latitude" value="Type=double;Sampling=constant;range=41.34,41.71;defaultValue=" />
<add key="PanelPower" value="Type=double;Sampling=variable;range=200,500;defaultValue=" />
<add key="PanelVoltage" value="Type=double;Sampling=variable;range=-220,220;defaultValue=" />
<add key="PanelCurrent" value="Type=double;Sampling=variable;range=-10,10;defaultValue=" />
<add key="TemperaturePort" value="Type=double;Sampling=variable;range=15,35;defaultValue=" />
</appSettings>
</configuration>


Each AppSetting entry have two parameters, Key and Value.

  • Key: Attribute Name that will be added to the DeviceID payload.
  • Value: Attribute customization parameters (Type, Sampling, Range and DefaultValue). The parameters are detailed below:
    • Type: Variable DataType - It can be string, int or double
    • Sampling: Defines if attribute will have its value changed on each iteration
      • Variable: Data changes on every DDATA message sent
      • Constant: Attribute is sent only in DBIRTH message
    • Range: Min and Max range For int and double types only.
    • DefaultValue: Default value for For string type the value will be a concatenation of ”Default- Value - DeviceID”.


The file name must be the same as the executable file. If one is changed, the other must be as well.




Application Settings

The Simulator is divided in 3 tabs, Connection String Parameters, Simulation Settings and Runtime Simulation Settings. More information on each one is available below.


Connection String Parameters

  • Broker URL: MQTT Broker (Server) Default value is loopback (local) ip (127.0.0.1).
  • Port Number: MQTT Broker listening port Default value is 1883.
  • Username: Username defined on the This will be requested if the Broker needs this configuration (optional).
  • Password: Password defined on the This will be requested if the Broker needs this configuration (optional).
  • Connect: Connect to Broker.
  • Disconnect: End connection.

 

The Simulator does not support Ssl Protocols.


Simulation Settings

  • Base GroupID Name: GroupID name that will be used in the payload
  • Base NodeID Name: NodeID name that will be used in the payload. When there are more than one node, the names will be a concatenation the base name and index.

E.g.: NodeId 1, NodeId 2 ... NodeId N.

  • Number of Nodes: Amount of Nodes that will be created
  • Base DeviceID Name: DeviceID name that will be used in the payload. When there are more than one device, the names will be a concatenation the base name and index.

E.g.: DeviceID 1, DeviceID 2 ... DeviceID N.

  • Number of Devices per Node: Amount of Devices that will be created.
  • Apply: Apply new settings.




Runtime Simulation Settings

  • Send one Data Sample: Send one DDATA message for each Device created in the session.
  • Send Continuous Data: Send continuous DDATA messages with a time rate of 1 second.
  • Show Log: Shows log window with diagnostics messages. You can also see log messages in the status bar at the bottom of the application.
  • No labels