MQTT / MQTTS
The MQTT / MQTTS library is neXo’s precompiled library nXPicoMQTT — install it first, see Library › Installing the libraries (download). It provides a publish/subscribe client on top of SysSocket, in two modes:
| Mode | Transport | Requires |
|---|---|---|
| MQTT | Plain TCP | — |
| MQTTS | TCP + TLS | Certificates provisioned via the X.509 Certificate Manager |
Typical usage
Section titled “Typical usage”- Configure WiFi — see WiFi Configuration.
- For MQTTS, import the broker CA (and client certificate/key, if the broker requires mutual TLS) via the X.509 Certificate Manager.
- Connect to the broker, publish and subscribe to topics from ST.
[Da completare: function block/metodi esatti (connect, publish, subscribe, callback su messaggio ricevuto), parametri (client ID, keep-alive, QoS, retain), gestione della riconnessione]