I would like to tell you that I would like to send a message or post a message from Node-red to Niagara 4 framework via Obix communication. The message from Niagara 4 can be read into the Node-red but the message can't be written or posted from Node-red to Niagara 4. I got an error. Also, I attached a screenshot of an error. Please see the attachment
I would like to inform you that if I used what you said in the last message then the msg.payload is written as output. But I want to post the value of msg.payload not just msg.payload.
I am sharing a screenshot. Please see it.
In the screenshot, the value of msg.payload is "ABCD". but the output is written as a msg.payload istead of "ABCD"
msg.payload is undefined
add
node.warn(msg.payload);
just before the line to confirm msg.payload has not been defined
p.s. when posting code it is best to post text, as images are hard to read and copy from.
I would like to tell you that I am trying to read and write data from MySQL into the Niagara 4 via Node-red with Obix driver. The data from the Niagara 4 has been read successfully into the MySQL server but the data from the MySQL has not been read successfully into the Niagara 4. Also, I am going to tell how the connection has been made between Niagara 4 with Node-Red as well as Node-red with MySQL.
connection between the Niagara 4 with Node-red via oBIX: For connection, I built a Node-red flow that can read the data from Niagara 4 into the Node-red. A built Node-red flow includes a function node, HTTP request, XML..
2)connection between the Node-red with MySQL: A mysql driver is used in Nore-red to access to a MySQL database.
Problem: A message, as a string value comes out of the function node, can't be written in Niagara 4.
I have also attached a screenshot of inputs and outputs.
So add something like var payload = msg.payload at the top of your function then use payload instead of msg in line 33
TIP:
Please post actual function code not screenshots of code since it is harder for us to test and provide you with fixes (without re-typing what you have already wrote)
TIP2:
enable monaco editor to see the number of undeclared variables and potential errors you have.