MQTT_CONFIG  Index, Config_string (only available on Wx PLC firmware >= F94.2)
Purpose To config the MQTT parameters that enables the PLC to connect to the MQTT broker(server)
 
Index DescriptionDefault Config_stringLimit
1
Use Persistent Connection Session"0"  - Connect with a clean session "0" or "1"
2
Username""Max. 32 ascii characters
3
Password""Max. 32 ascii characters
4
LWT Topic""Max. 70 ascii characters
5
LWT Data""Max. 70 ascii characters
6
LWT QoS"0"  - default QoS = 0 for Last Will & Testament "0","1", or "2"
7
Client ID"Wxnnnnnn"
where nnnnnn are hex digits of the lower 24-bit of its WiFi MACID
Max. 32 ascii characters
8
Disable auto re-connect"0"  - auto-reconnect enabled "0" or "1"
9
Broker's CA Cert filename""  - not used Max. 32 ascii characters
10
Enable broker's common name verify"0"  - ignore common name "0" or "1"
11
Client (i.e. PLC) cert filename""  - not used Max. 32 ascii characters
12
Client (i.e. PLC) private key filename""  -not used Max. 32 ascii characters
Examples
	
	MQTT_CONFIG 2, "MyName"	  ' username needed to connect to MQTT broker. 
	MQTT_CONFIG 3, "MyPassword"   ' password needed to connect to MQTT broker. 
	
Comments: With this command you can define the parameters necessary for the PLC to successfuly connect to the MQTT broker. Not all indices are needed. E.g. if you are not using SSL connection, then you do not need to define the certs and key filenames (index = 9,10,11, and 12)

If the PLC is using SSL for connection, then the cert files must be uploaded into the PLC's file system via FTP.

If you are connecting using the simulator, then the cert and key files should be copied to the folder C:\TRiLOGI\certs\

 

See Also MQTT_CONNECT

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual