Eclipse Mosquitto is publish-subscribe-based messaging protocol.
Overview
Mosquitto is an open source implementation for version 3.1 and 3.1.1 of the MQTT protocol. It also includes the mosquitto_pub and mosquitto_sub utilities for publishing and subscribing.
Features
The Eclipse Mosquitto module has the following key features:
- Publish message
- Subscribe message
- QoS
Configuration
Build Time Configurations for MQTT
The following build time configurations are defined in eclipse/mqtt_client/mqtt_client_cfg.h:
| Configuration | Options | Default | Description |
| Clean Session Mode |
| Enabled | Set clean session mode. |
| Watchdog Service Support |
| Disabled | Enable when using the Watchdog Service. |
| TLS Mode |
| Disabled | Set TLS mode. |
| Debug Mode |
| Disabled | Set debug mode. |
Clock Configuration
This module has no required clock configurations.
Pin Configuration
This module does not use I/O pins.
Usage Notes
Refer to WIFI (rm_wifi) and MQTT Port (rm_mqtt_port_w).
- This module is not a standalone module - ensure that the WiFi module APIs are invoked first to configure the RAFW module and connect to an Access Point before using the MQTT module where the default buffer size for incoming TLS is 6KB and outgoing TLS is 4KB.
- When the user intends to use secure TLS in their application, they need to provide certificates (root certificate authority, client certificate, and private key) in a header file
- The user must provide certificate macro names in the FSP Configurator properties, as well as the name of the header file (to link the module, certificates, and header together)
- If the user provides these credentials in the Configurator, they must create a new header file in their /src/ folder with the same name as they provided in the Configurator properties. When the code is generated, a build error will occur if the header file is not created
- If only using username and password, these fields can be left blank (default), and a header file does not need to be created
Limitations
Refer to WIFI (rm_wifi) and MQTT Port (rm_mqtt_port_w).
- For publish/subscribe topics, a separate QoS level cannot be set per topic - only one QoS level can be set which applies to all messages
- Currently the module only supports unsecured MQTT with username/password or secure MQTT/TLS with certificates (root CA, client certificate, and private key). The module does not accept username/password with certificates.