Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

The protocol is an implementation of the MQTT 3.1.1 standard (October 2014). MQTT protocol is a client/server protocol of subscribe/publish type. It is simple, has little overhead and is easy to implement. It is used for M2M communication (Machine to Machine) and in the IoT context (Internet of Things).
D2000 KOM implements the client part of the protocol. The protocol je implemented on a TCP/IP line. 
For transfer of LoRaWAN data encapsulated within the MQTT protocol, see LoRaWan protocol description.

Each PUBLISH message contains a topic (Topic), data (Payload) and level of confirmation (QoS). PUBLISH messages can be sent both by the client and the server. The clients at the beginning of the communication will use the SUBSCRIBE message to indicate what topics (parameter of Topic Filter protocol) they are interested in. 

Kotva
qos
qos
The protocol defines the following levels of confirmation of PUBLISH messages - QoS (Quality of Service):

...

The MQTT communication starts with the CONNECT message sent by client (D2000 KOM). Message contains User Name, Password and other parameters, from which only Clean Session Flag and Client ID can be modified (parameter Will Flag is not used, as  well as Will QoS and WillRetain Will Retain, parameter Keep Alive is set to 0). Server replies with CONNACK message with a return code that contains information about the success of connect operation.

...

Then follows a phase of communication, during which both the client and the server send PUBLISH messages (the client with any topic, the server with topics relating to the filter of topics of the received SUBSCRIBE message) and confirm them according to the value of the QoS parameter of the received PUBLISH messages.

...

Type of  I/O tagAddressDescription
I/O tags for reading data sent by MQTT server through PUBLISH message.
Note: values of I/O tags are set by D2000 KOM process in the order IN_TOPIC, IN_DATA and IN_ID. It is not necessary for configuration to contain all three I/O tags.
TxtI
Kotva
in_topic
in_topic
IN_TOPIC
Topic (Topic) of received PUBLISH message.
TxtI
Kotva
in_data
in_data
IN_DATA
Data (Payload) of received PUBLISH message.
Ci
Kotva
in_id
in_id
IN_ID
Identifier of packet (Packet Identifier) of PUBLISH message that depends on the level of validation (QoS).
For messages sent with QoS_0, the identifier is zero, for QoS_1 and QoS_2, it is a positive 16-bit number.
Note: if MQTT server sends also messages with the QoS_0 level of validation and the ACK_ID I/O tag is configured, then we recommend to activate the option New value when changing time in the Filter tab, so that repeated writing of the value 0 will cause a new value that differs only with time stamp to be generated.
I/O tag to confirm a received data to MQTT server.
Co
Kotva
ack_id
ack_id
ACK_ID
If an output I/O tag with ACK_ID address is defined, the D2000 KOM expects confirmation of the processing of each message by writing a copy of value of the IN_ID tag. Only after then it sets values from the next received PUBLISH message (if it was received in the meantime) into the IN_TOPIC, IN_DATA and IN_ID I/O tags (in this order). 
In case of the QoS_0 level of confirmation, it is therefore necessary to repeatedly set the value of I/O tag ACK_ID to 0. 
If the I/O tag ACK_ID does not exist, the values are written into the IN_TOPIC, IN_DATA and IN_ID I/O tags immediately after the PUBLISH message is received and processed.
Note: for the messages received with the QoS_0 level of validation, no confirmation is sent to MQTT server, only the values of received PUBLISH message will be published. 
I/O tags for sending values to the MQTT server through PUBLISH message.
Note: in order for the D2000 KOM process to send the PUBLISH messages to the MQTT server, both I/O tags must be defined within one station.
TxtO
Kotva
out_topic
out_topic
OUT_TOPIC
Topic of the PUBLISH message being sent.
TxtO
Kotva
out_data
out_data
OUT_DATA
Data (Payload) of the PUBLISH message being sent.
Note: sending the message is performed out as result of writing to the OUT_DATA I/O tag (i.e. if the Topic does not change then it is sufficient to set the OUT_TOPIC point once - e.g. by using default value).

...