Last active
August 29, 2015 14:06
-
-
Save kevsmith/bf4e889bb3d1b49125e3 to your computer and use it in GitHub Desktop.
test.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function test() | |
mqtt = require("mqtt/mqtt") | |
conn = mqtt:new_connection() | |
conn.user = "guest" | |
conn.password = "guest" | |
if conn:connect("localhost", 1883, true) then | |
conn:loop(100) | |
conn:publish("testing", "this is a test", mqtt.qos1, false) | |
conn:loop(100) | |
conn:disconnect() | |
conn:loop_once() | |
end | |
end | |
local r, v = pcall(test) | |
print(r,v) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment