QuickStart Guide
...
Industrial Systems Connection ...
MQTT
Sparkplug B Client
9min
you can set up a sparkplug b client through devicehub note you can't connect the mqtt client to the devicehub industrial ot server docid\ pz 1x7hzilfyz i3yxpwu if they are using the same litmus edge instance this includes connecting through the flows manager or an integration connector if they are using different litmus edge instances, they can connect step 1 add sparkplug b client to devicehub to add the sparkplug b client to device hub in litmus edge, navigate to devicehub click the connect a device box the connect device dialog box appears for driver type , select mqtt then, for driver name , select sparkplug b client enter a name for the client optionally, add a description and client id for broker address , enter the broker ip address or host name for port , enter the port of the broker for namespace , enter the sparkplug topic namespace configure the client with the following options client authentication select one of the following client authentication methods anonymous certificate (only for ssl mode) username/password username/password & certificate update the default username and password values as needed tls support if you enable tls, upload or paste the certificate in the certificate authority field trigger rebirth if you enable trigger rebirth, our driver will always be up to date with details on all nodes and devices advanced if you show these options, configure the following as needed protocol version select the mqtt protocol version v3 (3 1), v4 (3 1 1), v5 (5 0) keep alive period configure the keep alive period in seconds write timeout configure the write timeout in seconds connect timeout configure the connect timeout in seconds additional options see the connect a device docid\ ish7bqhzxswtdx8vbnszb section to learn more about additional options when done configuring the device, click add device step 2 add tags to add tags from sparkplug b mqtt broker to litmus edge, use the browse tags docid\ ml 1dnqkd6d zhzbe7qmw functionality browse parameters trigger rebirth if you enable the rebirth trigger, it will issue a 'node rebirth' ncmd before browsing to obtain all node and device metrics, including aliases and details display birth death if you enable display birth death, it will display birth/death topics for each device and node subscribe wildcard if you enable subscribe wildcard, you can subscribe to all ndata/ddata messages data window enter the duration to wait for data messages after subscribing to wildcard json types if you enable json type it will display all result datatypes as metric objects instead of metric value specific types when you add tags docid\ xgwokqbtpevii7or82ll0 to the connected device without using the browse functionality, refer to the following tag parameters tag parameters name enter the case sensitive topic name in the server without any wildcard symbols the name must be unique for the driver value type select string tag name enter a name for the tag description (optional) enter a description for the tag qos select a quality of service 0 at most once (fire and forget) 1 at least once (acknowledged delivery) 2 exactly once (assured delivery) retain select a message policy don't retain retain last publish tag formula enter a formula for the tag to process the generated data two variables are permitted value (current tag value) and timestamp (current tag unix time in milliseconds) the following math functions are available sin cos sqrt tan power power( x ) performs the operation 10^x log log( x ) is the natural logarithm (the logarithm is in base e ) exp exp( x ) performs the operation e^x only publish on change of value select the checkbox to customize nats messages to be published only when the value parameter changes from a previous value to a new one change of value only applies to boolean, numeric (such as int or float), and simple string data types it does not apply to complex types, such as json or array poll once topics will not be affected by change of value settings these topics will still only see a single message meta data metadata summarizes basic information about data this feature allows you to define key value pair data for the device output payload later on it can then be used to find, use, and reuse particular instances of data note if you use special characters in meta data key names, the special characters are replaced with underscore characters in the payload this can cause two key names to be combined into one for example, configuring the key names a b and a&\&b will cause only one key name to be created (a b) step 3 verify data in mqtt server once the client is connected in litmus edge with tags, you can connect it to an mqtt server and view the data in litmus edge note you can't connect the mqtt client to the devicehub industrial ot server docid\ pz 1x7hzilfyz i3yxpwu , if they are using the same litmus edge instance if they are using different litmus edge instances, they can connect