29.11.2018, 08:53
You have disconnect on first publish, remove this code.
Also, try replacing the loop part to log the result:
Code:
client.ON_PUBLISH = function()
client:disconnect()
end
Also, try replacing the loop part to log the result:
Code:
while true do
res, err = client:loop()
if not res then
log('mqtt error', err)
os.sleep(1)
end
end