1786
|
1 |
#summary MQTT interface to Prosody's pubsub |
|
2 |
#labels Stage-Beta |
|
3 |
|
|
4 |
= Introduction = |
|
5 |
|
|
6 |
[http://mqtt.org/ MQTT] is a lightweight binary pubsub protocol suited to embedded devices. This module provides a way for MQTT clients to connect to Prosody and publish or subscribe to local pubsub nodes. |
|
7 |
|
|
8 |
= Details = |
|
9 |
|
|
10 |
MQTT has the concept of 'topics' (similar to XMPP's pubsub 'nodes'). mod_pubsub_mqtt maps pubsub nodes to MQTT topics of the form `HOST/NODE', e.g. `pubsub.example.org/mynode`. |
|
11 |
|
|
12 |
== Limitations == |
|
13 |
The current implementation is quite basic, and in particular: |
|
14 |
|
|
15 |
* Authentication is not supported |
|
16 |
* SSL/TLS is not supported |
|
17 |
* Only QoS level 0 is supported |
|
18 |
|
|
19 |
== Payloads == |
|
20 |
XMPP payloads are always XML, but MQTT does not define a payload format. Therefore mod_pubsub_mqtt will attempt to convert data of certain recognised payload types. Currently supported: |
|
21 |
|
|
22 |
* JSON (see [http://xmpp.org/extensions/xep-0335.html XEP-0335] for the format) |
|
23 |
* Plain UTF-8 text (wrapped inside `<data xmlns="https://prosody.im/protocol/mqtt"/>`) |
|
24 |
|
|
25 |
All other XMPP payload types are sent to the client directly as XML. Data published by MQTT clients is currently never translated, and always treated as UTF-8 text. |
|
26 |
|
|
27 |
= Configuration = |
|
28 |
|
|
29 |
There is no special configuration for this module. Simply load it on your pubsub host like so: |
|
30 |
|
|
31 |
{{{ |
|
32 |
Component "pubsub.example.org" "pubsub" |
|
33 |
modules_enabled = { "pubsub_mqtt" } |
|
34 |
}}} |
|
35 |
|
|
36 |
You may also configure which port(s) mod_pubsub_mqtt listens on using Prosody's standard config directives, such as `mqtt_ports`. Network settings *must* be specified in the global section of the config file, not under any particular pubsub component. The default port is 1883 (MQTT's standard port number). |
|
37 |
|
|
38 |
= Compatibility = |
|
39 |
|| trunk || Works || |
|
40 |
|| 0.9 || Works || |
|
41 |
|| 0.8 || Doesn't work || |