10.09.2019, 06:52
(06.09.2019, 15:52)admin Wrote: Can you post complete script listing?
Hi, yes here it is;
Thank you
Code:
mqtt = require("mosquitto")
client = mqtt.new()
client:tls_set('/data/ftp/ca.pem', nil, '/data/ftp/client.pem', '/data/ftp/client.key')
client:tls_insecure_set(true)
client.ON_CONNECT = function()
log('connected')
value = grp.getvalue('0/3/4') or 0
client:publish("SOME/TOPIC/1", value, qos, retain)
value = grp.getvalue('0/3/5') or 0
client:publish("SOME/TOPIC/2", value, qos, retain)
client:disconnect()
end
broker = 'some.broker.domain'
client:login_set('someuser', 'somepass')
client:connect(broker,8883)
client:loop_forever()
netstat:
tcp 0 0 <broker_ip>:8883 <lua-client_ip>:38060 ESTABLISHED -