MQTT Client
Message Queuing Telemetry Transport
MQTT is specified in ISO/IEC 20922 and offers a simple protocol for distributed data sources. It is often selected for IoT applications thanks to its simple and flexible use. Data packets with any content, a size of up to 64 kB and a readable identifier (topic) can be exchanged between distributed devices and a central broker. This enables the distributed devices to be fully independent and only require a communication relation to the broker, so that very flexible networks can be created easily.
The MQTT client is a software module for the M1 controller that is immediately available and does not require any additional hardware. The network connection to the external MQTT broker is created and monitored automatically. The login at the broker can be protected if required with a name and password, and the user data can be encrypted if required with TLS certificates. This also enables sensitive production data to be transferred via the Internet.
The M1-MQTT client can be used both as a publisher as well as a subscriber. Publishing is the typical application for a controller, in which the controller software collects and aggregates the already available process data, and sends it to the broker at defined times (e.g. for each finished workpiece).
In order to receive data, the client can subscribe selected topics from the broker so that it then only receives the new data from the other stations in which it is interested. This is stored in a receive queue and can be fetched and processed by the controller software.
The structure and content of the data can be selected as required by the user software. Both binary as well as also text-based data such as XML or JSON can be transferred up to a maximum size of 64 kB, the content must only be understandable for publishers and subscribers. The broker itself only observes the topics for management purposes. The content of the message is not important for the broker. An external MQTT broker is required for operation. Commercial cloud suppliers are possible here. Solutions for Windows or Linux are available for testing or local operation.
Features
- Automatic connection establishment and monitoring with automatic reconnect and resubscribe
- Publishing of message up to 64 kB
- Parallel subscription of different topics
- Can be used simultaneously by several software modules on the controller
- Application by the user software via PLC function block library or C/C++ header file
- In C/C++ event-driven processing of incoming messages possible
- In PLC detection of new messages via Boolean status indication
- Optional communication to the broker via Websockets for asynchronous transfer in both directions
- Simple commissioning without programming via variable interface
- Last Will and Testament
- Persistence: Data is stored over the reboot until it is acknowledged