This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Getting a log value and introduce it in a BacNet object
#1
Hello, i'm new to the LUA language and to the LM interface and i need a bit of help.

Right now i have the following script in wich i get a string from a MQTT Topic and now i want to get that string and send it via BacNet to another system.

broker = '172.30.10.185' -- default port is 1883
username = 'icosaedro' -- device serial
password = 'hola' -- device credentials


topic = "Habitacion_02/a848faf8cb70/status"

mqtt = require('mosquitto')
client = mqtt.new()

client.ON_CONNECT = function(status, rc, err)
  if status then
    log('connect ok')
    client:subscribe(topic)
  else
    log('connect error', rc, err)
  end
end

client.ON_MESSAGE = function(mid, topic, data)
  log('message',topic, data)
end






client:login_set(username, password)
client:connect(broker)
client:loop_forever()


Firts of all i would like to know if i'm doing "Overexcessive" struggle and i can just put the string in a variable and then send it to a bacnet object or how can i get the value from the log and create a bacnet object that i could send later from another software.

Thank you very much!!
Martí.
Reply


Messages In This Thread
Getting a log value and introduce it in a BacNet object - by mripoll - 25.11.2022, 08:57

Forum Jump: