Skip to content

Instantly share code, notes, and snippets.

@hiyosi
Created January 25, 2014 18:31
Show Gist options
  • Save hiyosi/8621171 to your computer and use it in GitHub Desktop.
Save hiyosi/8621171 to your computer and use it in GitHub Desktop.
require 'mqtt'
host = '127.0.0.1'
port = 61613
MQTT::Client.connect(:remote_host => host, :remote_port => port,
:username => 'admin', :password => 'password') do |client|
client.get('tutorial') do |topic,message|
puts "#{topic}: #{message}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment