Skip to content

Instantly share code, notes, and snippets.

@pisatoshi
Created March 4, 2014 16:32
Show Gist options
  • Save pisatoshi/9349919 to your computer and use it in GitHub Desktop.
Save pisatoshi/9349919 to your computer and use it in GitHub Desktop.
MQTT publish example
var mqtt = require('mqtt');
var client = mqtt.createClient(61613, { username: 'admin', password: 'password' });
setInterval(function() {
client.publish('test1/111/222');
client.publish('test1/111/222', 'foo');
client.publish('test1/111/222', Date.now().toString());
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment