You are reading a single comment by @MaBe and its replies. Click here to read the full conversation.
  • do you have fully featured test bed for tinyMQTT as at

    I use a local installed mqtt server , MQTTBox to obserrve and some js snippets.

    To fix the last issue a snipped given by Gordon was used.

    var mqtt = require('mqtt');
    var client  = mqtt.connect('mqtt://localhost');
    function go(i) { client.publish('test', ""+i+'.123')}
    setInterval(function() {go(1);go(2);go(3);go(4); console.log("4xgo()");}, 5000);
    

    Simple test frame

    Modules.addCached("tinyMQTT-MAC",
    // place function here
    );
    
    Modules.addCached("tinyMQTT-MAC-MIN",
    // place minimized function here
    );
    
    
    var mqtt = require("tinyMQTT-MAC").create("127.0.0.­1");
    //var mqtt = require("tinyMQTT-MAC-MIN").create("127.­0.0.1");
    
    mqtt.on("connected", function(){mqtt.subscribe("test");});
    mqtt.on("message", function(msg){console.log('['+msg.topic+­'] : ['+ msg.message+']');});
    mqtt.on("published", function(){console.log("message sent");});
    mqtt.on("disconnected", function(){ console.log("disconnected");});
    
About

Avatar for MaBe @MaBe started