Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
require 'mqtt'
username = "example@github"
password = "password"
client = MQTT::Client.connect(:host => '', :port => 1883, :username => username, :password => password)
client.publish("#{username}/debug", "helo", 0)
client.get do |topic,message|
print topic
print message
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.