Hi Rich,
It highly depends on what you want to achieve.
- MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol [1].
- It is based on a concept that is known as: "publish/subscribe messaging" [2] aka: PubSub
To make this work you need a client-side software
and server-side software.
In your post you mentioned a client library. .. but implementing a client library is useless, if you don't say how your data flow looks like. ...
In MQTT terms the server-side software is called an information broker. This broker is needed for publishing and subscribing to the information stream.
One possible data flow can look like this
sensor -> MQTT broker +-> MQTT client -+-http-> a) TiddlyWeb server <--http--> TW5
^ |
| +-http-> b) TiddlyWeb server <--http--> TW5 (no live update out of the box)
| ^
| |
| v
+-----------<--MQTT protocol--> c) TW5 with TWeb and MQTT-client (live update with raw data both directions)
So it depends, on what you already have and what you need
- If you have an existing MQTT broker,
- add a) you can create an independent MQTT client software that connects to the broker and writes tiddlers to the TiddlyWeb server.
- add a) there is no need that TW user is online to create new tiddlers
- add b) TiddlyWiki doesn't need to know anything from MQTT, since it gets all the info from TWeb server
- add b) If sensor data changes, TWeb creates a new tiddler, but since TW client doesn't know about MQTT it doesn't get live update
- add b) live update is possible, but it needs plugins and imo increases complexity quite a bit.
- add c) If you want TW to be part of IoT you may want to directly send messages to the broker, so other TWs can see them.
- add c) TiddlyWeb connection can be used out of the box
- add c) MQTT connection would need a new plugin with js libraries (there are several possibilities)
- As an MQTT broker the mosquitto [3] project could be used.
- For testing / low traffic usage there public test server [4] could be used.
have fun!
mario
[1]
http://mqtt.org/[2]
http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern[3]
http://mosquitto.org/[4]
http://test.mosquitto.org/