Blame
|
1 | ## MQTT |
||||||
|
2 | |||||||
|
3 | The MQTT publisher sends published values to an MQTT broker, with each value sent to a topic matching its path in the workspace. |
||||||
| 4 | ||||||||
| 5 | ### Publisher Properties |
|||||||
| 6 | - **Broker URI**: the address of the broker, see [supported network protocols](#supported-network-protocols). |
|||||||
| 7 | - **Client ID**: the name Pointcaster identifies itself with to the broker. |
|||||||
| 8 | - **Auto Reconnect**: reconnect automatically if the connection to the broker drops. |
|||||||
| 9 | - **Serialization Format**: how values that aren't plain numbers or strings are encoded, either JSON or MessagePack. |
|||||||
| 10 | - **Serialize As Structures**: send bounding boxes as named fields instead of compact arrays. This is easier to read (e.g. in MQTT Explorer) but less efficient. |
|||||||
| 11 | - **Send Retained**: mark messages as retained, so the broker holds the last value of each topic for new subscribers. |
|||||||
| 12 | - **Empty Message Handling**: whether empty values are ignored, published once, or always published. |
|||||||
| 13 | ||||||||
|
14 | #### Supported Network Protocols |
||||||
|
15 | The network protocol used by the MQTT publisher is selected through the prefix of the Broker URI. |
||||||
|
16 | The following network protocols can be selected (assuming they are supported by the broker): |
||||||
| 17 | - `mqtt://<host>:<port>` |
|||||||
| 18 | - TCP, insecure, fine for must use cases |
|||||||
| 19 | - `tcp://<host>:<port>` |
|||||||
| 20 | - same as above, alias for `mqtt://` |
|||||||
| 21 | - `mqtts://<host>:<port>` |
|||||||
| 22 | - TCP using SSL/TLS |
|||||||
| 23 | - `ssl://<host>:<port>` |
|||||||
| 24 | - same as above, alias for `mqtts://` |
|||||||
| 25 | - `ws://<host>:<port>` |
|||||||
| 26 | - Insecure websockets |
|||||||
| 27 | - `wss://<host>:<port>` |
|||||||
| 28 | - Secure websockets |
|||||||
| 29 | - `unix://<path>` |
|||||||
| 30 | - A UNIX-domain socket |
|||||||
| 31 | - *nix only |
|||||||
| 32 | - Broker must be located on the same physical hardware |
|||||||
| 33 | ||||||||
|
34 | --- |
||||||
| 35 | ||||||||
|
36 | ::: buttonlink |
||||||
|
37 | [View publisher source](https://github.com/matth-av/pointcaster/blob/qt/src/publishers/mqtt/mqtt_client.cc) |
||||||
|
38 | ::: |
||||||
