<< Click to Display Table of Contents >> MQTT |
|
To create a new MQTT server select the menu item MQTT. You’ll see the following window:
List of properties:
Property |
ST script field* |
Description |
---|---|---|
Name |
|
Name of the MQTT server. |
URI |
uri |
MQTT server address. |
Username |
username |
Username of the server. |
Password |
password |
Password of the server. |
Client ID |
|
Client ID of the MQTT server. If you left this field empty server will generate it itself. |
Enable TLS/SSL |
enablessl |
Check Enable TLS/SSL if you want to use server certificate for encryption messages. |
Certificate filename |
sslfilename |
File should be placed in /private/ folder in the directory where TeslaSCADA2 installed. |
Enable Client Certificate |
enableclientcert |
Check it if you want to use client certificate for encryption messages. |
Client certificate** |
clientcertname |
File should be placed in /private/ folder in the directory where TeslaSCADA2 installed. |
Client private key** |
clientprivatekey |
File should be placed in /private/ folder in the directory where TeslaSCADA2 installed. |
Private key password** |
privatekeypassword |
Private key password. |
PEM formatted** |
pem |
Check if your certificate and key files are PEM formatted |
Enable subscriptions |
|
Check if you want to add subscription for MQTT client. |
Subscriptions |
|
When you click Collection button you'll see window for adding new subscriptions for MQTT client |
Enable advanced publish |
|
Enable it if you want to use Advanced message to publish (JSON message for example). |
Advances message |
|
Enter advanced message that will send MQTT client. You can use keywords: {taggroup}, {tagsubgroup}, {tagname}, {projectname}, {tagvalue}, {datetime}. |
Enable sparkplug |
|
Check if you want the MQTT client to work using the Sparkplug B specification |
Sparkplug host ID |
|
MQTT client works like Host application. So you need to enter host ID. |
*This field is used in ST scripts. For example: Servers.Server1.username= Admin. In this script command user name of the Server1 will be changed to Admin. For OPC UA server you have to reconnect server. Also for all servers you can use fields:
▪connect - connect to the server.
▪connected - check connection.
▪lostconnection - check lost or not connection.
▪reconnect - when field's value become TRUE server is reconnected.
** If you use this project for iOS (iPhone or iPad) you should use .p12 format for the file of the certificate. To create .p12 file you should in openssl utility use this type of command:
openssl pkcs12 -export -out [your file name].p12 -in [your file name].crt -inkey [your file name].key
For example,
openssl pkcs12 -export -out client.p12 -in client.crt -inkey client.key
The name of your .p12 you should place in the Client certificate field (client.p12 in our example). Client Private Key you can left empty. In the Private key password you should enter password of the .p12 file. PEM formatted you can left unchecked. All .p12 files are PEM formatted.