I try to interpet a subscribe message but only
printCoud be a callback problem ???
If no message is received (in 5 seconds) than nothing happens, thats okay.
Some ideas everyone, please
Thanks for help
Rabis
LUA 5.1.4 , SDK 2.1.0
______________________________________________________________
function Output (message)
print(message)
end
function mqtt_do()
m:on("message", function(serverIP, topic_subscribe, data)
if data ~= nil then
print(" " .. topic_subscribe .. ": '" .. data .. "'") -- works fine!
Output(data) -- 1.periode: 1 time ,
-- 2.periode. 2 times and so on ...
end
end)
end
tmr.alarm(0, 5000, 1, function() mqtt_do() end) -- every 5 seconds