Difference between revisions of "MQTTBROKER"
|Line 129:||Line 129:|
The MQTT Broker is configured to maintain up to 256 clients (with their session info) and up to 256 retain messages.
The MQTT Broker is configured to maintain up to 256 clients (with their session info) and up to 256 retain messages. those values every new item will replace the oldest one
Revision as of 12:34, 2 October 2019
This driver acts as an MQTT broker for Hsyco, it fully supports MQTT version 3.1.1. This broker is also ready to communicate with MQTT version 5.0 although full support to this version will be introduced later.
Add the MQTTBROKER I/O Server in the I/O Servers section of the Settings and set its parameters:
- User: optional default username for clients
- Password: optional default password for clients
If presents, these two fields must be both not empty
Under the hsyco root directory must be present a file named "mqttbroker.ini" which can contain a series of line, each line represents the credentials of a client and can have the following format:
Clientid must be present in each line while username and password are optional; if username and password are not present there will be two cases:
- if default username and password are specified in "hsyco.ini" they will be used by the authentication mechanism
- if default username and password are not specified in "hsyco.ini" the authentication mechanism is disabled
|startupevents||true||true||generate IO events also during the driver’s start-up phase|
|false||start generating events only after HSYCO is aligned with the current status of the system|
|acceptunknown||false||true||accept connection from clients whose id isn't specified in mqttbrokerauth.ini|
|false||doesn't accept connection from clients whose id isn't specified in mqttbrokerauth.ini|
|localport||1883||<portNumber>||local port for incoming client connection|
|maxthreads||64||n > 0||max number of clients connected simultaneously|
Use the MQTTBroker Utility to automatically discover new clients or configure existing ones.
|connection||online||R||the broker is ready to accept connections from clients|
|offline||R||initialization of the driver failed or loop cycle failed|
|client.<clientId>.connected||1||R||clientId is connected to the broker|
|0||R||clientId isn't connected to the broker|
|client.<clientId>.publish.<topicName>||<message>||R||clientId published a message on topicName|
|client.<clientId>.willpublish.<topicName>||<message>||R||MQTTBROKER published the will message of clientId, on topicName, because of connection problems or protocol violations|
|client.<clientdId>.lastseen||<date>||R||timestamp of the last message or ping sent by clientId to the broker. The value has the format "yyyy-mm-dd hh:mm:ss.ms" (e.g. "2012-12-30 16:59:23.523")|
The MQTT Broker is configured to maintain up to 256 clients (with their session info) and up to 256 retain messages. Reached those values every new item will replace the oldest one