Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'mqtt'
username = "example@github"
password = "password"
client = MQTT::Client.connect(:host => 'free.mqtt.shiguredo.jp', :port => 1883, :username => username, :password => password)
client.subscribe("#{username}/debug")
client.publish("#{username}/debug", "helo", 0)
client.get do |topic,message|
print topic
print message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.