Read from a mqtt topic
Posted: Mon Apr 27, 2015 1:15 pm
Hi,
i want to read a message from a mqtt topic.
Posting with this:
Is no problem but how can I read messages of the topic?
Throws nothing back, but there are messages on the topic?!
Greetings from Germany
Joshua
i want to read a message from a mqtt topic.
Posting with this:
Code: Select all
m:publish("Led","hello",0,0, function(con) print("published") end)
Is no problem but how can I read messages of the topic?
Code: Select all
m:subscribe("Led",0, function(conn) print("subscribe success") end)
m:on("message", function(conn, topic, data)
print(topic .. ":" )
if data ~= nil then
print(data)
end
end)
Throws nothing back, but there are messages on the topic?!
Greetings from Germany
Joshua