Have experienced problems with all available bacnet nodes for node red. So to try something else, bacnet stack was included in the docker container and is available through exec node.
For example can run this command:
readprop 111 19 1 description
This returns the description based on the specified arguments, great! So then I made an array of such commands and send them all to exec node. But the result is really weird, because the output gets scrambled and seemingly randomly distributed among the messages!
So I wondered, is this a problem with the readprop program? Is it a cli problem? Or is it an exec node problem? Here are some different attempts and results:
- Add a 1 sec delay in node red. Result: Success
- Loop in linux: Success
for i in {1..10}; do /usr/local/bacnet-stack/build/readprop 111 19 1 description; done
- Add a tag to be concatenated to the output of the command in node red: Fail
msg.payload = `echo "$( ${msg.payload} | tr -d '\r\n' ) ${msg.topic}"`;
Success means each command returns correct payload. This looks like a timing issue? Is there any known bug of exec node to mix up the output and messages?
Was surprised to see even the msg.payload (command) and msg.topic are scrambled in attempt 3).