node package manager



IOTDB Transporter for MQTT


This Transporter will transport data from and to MQTT. Note that reading commands like list, get, bands are meaningless as data only exists when it shows up on the wire: this Transport does not retain anything.


See the samples folder for working examples


Get another transporter as a "source" - typically this will be IOTDB. In this particular example, we will connect to a WeMoSocket on the network.

const iotdb = require("iotdb");

const things = iotdb.connect("WeMoSocket");

const iotdb_transport = require("iotdb-transport-iotdb");
const iotdb_transporter = iotdb_transport.make({}, things);

Create a MQTT client instance. We provide a helper for this.

const mqtt_transport = require("iotdb-transport-mqtt");

const mqtt_client = mqtt_transport.connect({
    host: "",
    verbose: true,
}, (error, mqtt_client) => {
    if (error) {
        return console.log("#", _.error.message(error));

Then we create a MQTT Transporter using the client.

const mqtt_transporter = mqtt_transport.make({
    prefix: "things",
}, mqtt_client);

Then we tell the MQTT Transporter to get all the data from the IOTDB Transporter.


That's it - we are operational. If you go to mqtt:// you will see all changes to your things being broadcasted.


If you'd like to be able to control IOTDB from MQTT - we don't recommend this because there isn't a good security model here yet - just add this