BACnet interface to Node RED

4,618 views
Skip to first unread message

Edward Vielmetti

unread,
Feb 13, 2015, 4:02:24 PM2/13/15
to node...@googlegroups.com
If anyone has any experience or suggestions interfacing to a system that runs BACnet, I'd appreciate the information.

There's a pile of code here


and it looks like it exports a command line interface, so as a first start I can see wrapping an "exec" node around those.

thanks

Ed

--

Lawrence Griffiths

unread,
Feb 14, 2015, 6:23:11 AM2/14/15
to node...@googlegroups.com
I've had limited BACnet experience connecting KNX to it.

Assume your reading values form a BACnet network over IP?
Then you need to be a BACnet Client.

If your trying to get values from sensors etc to a BACnet network your need to be a BACnet Server.

The interface doesn't support RS485 and there are a few different versions of this, 

Using their shell seems like a good place to start.
But there are always the C bindings for node.js

Could you share a bit more about your requirement?

// These might be of help
http://www.bacnet.org/Tutorial/BACnetIP/
http://www.modbusbacnet.com/includes/pdf/Bacnet%20For%20Beginners.pdf

brettnreno

unread,
Mar 15, 2017, 4:32:05 PM3/15/17
to Node-RED, edward.v...@gmail.com
Edward,

Did you ever have any success with a BACnet interface?  I'm attempting to integrate bi-directional communication between node red and BACnet, but so far have not found anything that I'm able to get working.  My only option at this point is to use a modbus <--> bacnet gateway since I can't seem to find any other way of moving data.

Thanks

Lawrence Griffiths

unread,
Mar 15, 2017, 5:14:26 PM3/15/17
to Node-RED, edward.v...@gmail.com
Hi, short answer No.
I've done exactly what your thinking using Modbus TCP to BACnet 
I've been watching this project in the hope that at some point I could create a Node-RED wrapper for it.

Lawrence 

brettnreno

unread,
Mar 31, 2017, 12:14:38 PM3/31/17
to Node-RED, edward.v...@gmail.com
This is interesting.  It seems that this here gentleman has figured something out that I have not been able to accomplish in over 2 months now.

Message has been deleted

brettnreno

unread,
Jul 18, 2017, 12:10:26 AM7/18/17
to Node-RED, edward.v...@gmail.com
Someone did it.  And I found it!  I'm so excited, now I just have to figure out how to actually use it.  It took me awhile to figure out how to install it since I'm still learning challenged in npm, but I first I ran " npm install --save bacstack " then I ran " https://github.com/goliatone/node-red-contrib-bacnet "  When I went back into my node red, the BACnet blocks were in my library.  I haven't been able to actually read or write data yet from any of my BACnet devices, but i'll play around with it more tomorrow.


brettnreno

unread,
Jul 18, 2017, 12:26:34 AM7/18/17
to Node-RED, edward.v...@gmail.com
I messed up the actual node red part.  It's " npm install https://github.com/goliatone/node-red-contrib-bacnet "

Michael Dalby

unread,
Jul 18, 2017, 7:44:38 AM7/18/17
to Node-RED, edward.v...@gmail.com
I'd be interested to hear how you get on with using the implementation as I am also interested in trying to get bacnet up and running at some point

Many thanks and good luck 

Michael

Ishara Hewawasam

unread,
Jul 29, 2017, 7:17:45 AM7/29/17
to Node-RED, edward.v...@gmail.com
I have gone through, each post and tried to conenct to my BACnet interface using node red.

I have used below command.

https://github.com/goliatone/node-red-contrib-bacnet

But when I up the node red and run it locally, it is not showing the BACnet specific nodes, Appreciate any help.

Ishara

Mark Setrem

unread,
Jul 29, 2017, 8:31:00 AM7/29/17
to Node-RED
if you are following the command on the readme
you need to be in your .node-red folder.

if it is failing are there any error messages when you install it, or any error messages when you run node-red.

alternatively you can install the node using the "manage palette" option from the node-red menu.

if you need further help please include the version of node-red , nodejs and npm you are using and details of which platform you are running node-red on.

RMVPAPS

unread,
Sep 21, 2017, 6:43:11 AM9/21/17
to Node-RED
Hi, Were you able to get node-red-contrib-bacnet to work? I got the nodes installed and loaded in my node-RED and all but when trying to run discovery node or read node, I get reference error - this is not defined etc... Any help to get it to work is appreciated. I have at present used the bacstack module and created a custom node for reading property. 

Alberto Gazzin

unread,
Sep 24, 2017, 5:02:02 AM9/24/17
to Node-RED
Hi all,
I have attempt to install node-red-contrib-bacnet from https://github.com/goliatone/node-red-contrib-bacnet/blob/master/README.md, but I have the error:

sudo npm install --save node-red-contrib-bacnet
npm ERR! Linux 4.10.0-35-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "node-red-contrib-bacnet"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/node-red-contrib-bacnet
npm ERR! 404 
npm ERR! 404  'node-red-contrib-bacnet' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/alberto/.node-red/npm-debug.log

It seems the node-red-contrib-bacnet was deleted from repositories.

Can someone help me to install in Node-Red?

My Node-Red version is 0.17.5
Node version 6.11.3
NPM version 3.10.10

Many thanks!

Nick O'Leary

unread,
Sep 24, 2017, 6:25:34 AM9/24/17
to Node-RED Mailing List
The install section of its README says the following: https://github.com/goliatone/node-red-contrib-bacnet/blob/master/README.md#install

Install

NOTE: Currently the module is not published, so you would need to use the following command:

$ npm install goliatone/node-red-contrib-bacnet

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/0d108f63-ebf2-4cbc-a63a-35e8a111ef6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

TridiumControls

unread,
Sep 24, 2017, 2:38:28 PM9/24/17
to Node-RED
Any success? I also get the error, reference undefined when I do a bacnet discovery.

Shows as connected to the bacnet server but not able to poll any bacnet points. Running latest node red on RPI 3.

chris....@gmail.com

unread,
Sep 26, 2017, 2:56:03 AM9/26/17
to Node-RED
I also cannot install node-red-contrib-bacnet follow above procedure.



在 2017年9月25日星期一 UTC+8上午2:38:28,TridiumControls写道:
Auto Generated Inline Image 1
Auto Generated Inline Image 2

Mark Setrem

unread,
Sep 26, 2017, 3:05:35 AM9/26/17
to node...@googlegroups.com
if you read the end of the error message it should give you a hint.
 You need to have git installed if npm is going to install it direct from git.  On windows you will need to install it. 
A minute on google found this page that explains what you need to download and how to correctly set the PATH https://stackoverflow.com/questions/44388889/error-not-found-git-when-install-npm-package-on-windows

Sent from my iPhone

On 26 Sep 2017, at 07:56, chris....@gmail.com wrote:

I also cannot install node-red-contrib-bacnet follow above procedure.

<Auto Generated Inline Image 1>
<Auto Generated Inline Image 2>


在 2017年9月25日星期一 UTC+8上午2:38:28,TridiumControls写道:
Any success? I also get the error, reference undefined when I do a bacnet discovery.

Shows as connected to the bacnet server but not able to poll any bacnet points. Running latest node red on RPI 3.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/fNce4rT613M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

For more options, visit https://groups.google.com/d/optout.
<Auto Generated Inline Image 1>
<Auto Generated Inline Image 2>

TridiumControls

unread,
Sep 26, 2017, 7:12:51 AM9/26/17
to Node-RED
Yeah, agreed. Read the error people. Install isn't the issue, clearly says it's not in the repository, a git install is needed.

it's getting it to work. Keeps showing reference undefined when I try to bacnet discover or do a simple bacnet read and poll the bacnet server. A little help from the dev would be awesome.

Colin Law

unread,
Sep 26, 2017, 8:28:04 AM9/26/17
to node...@googlegroups.com
Probably best to raise an issue against the node on github then.

Colin

On 26 September 2017 at 12:12, TridiumControls <maks...@gmail.com> wrote:
> Yeah, agreed. Read the error people. Install isn't the issue, clearly says it's not in the repository, a git install is needed.
>
> it's getting it to work. Keeps showing reference undefined when I try to bacnet discover or do a simple bacnet read and poll the bacnet server. A little help from the dev would be awesome.
>
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
> To post to this group, send an email to node...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/c2ce6e39-69ac-4f60-a1cd-ae0e4f64e3c5%40googlegroups.com.

chris....@gmail.com

unread,
Sep 27, 2017, 2:56:06 AM9/27/17
to Node-RED
Thanks Mark. I can install now.

BR
Chris

在 2017年9月26日星期二 UTC+8下午3:05:35,Mark Setrem写道:

Aniston Fernandes

unread,
Oct 7, 2017, 6:54:22 PM10/7/17
to Node-RED
@RMVPAPS @TridiumControls

regarding ReferenceError: this is not defined
on my system :
 Node-RED version: v0.17.5
 Node.js  version: v6.11.4
 Linux 4.4.0-96-generic x64 LE

the console log shows ::
[bacnet-server:8066567d.05545] ReferenceError: this is not defined
   at Bacnet (/usr/lib/node_modules/node-red-contrib-bacnet/lib/bacnet.js:8:9)


super();
needs to be included before this can be called at line 8 in lib/bacnet.js

created a PULL request to
GIT https://github.com/goliatone/node-red-contrib-bacnet

Although still having trouble getting a whois reply from the BACnet subnet on my second network card and IP
anyone have a clean working example of the configuration ?


chris....@gmail.com

unread,
Nov 3, 2017, 3:41:23 AM11/3/17
to Node-RED
I have changed some code in bacnet.js and it can work now. However it still have some issue on upd 47808 bind function. I need shutdown node-red and run again to assure the binding port release. Do you anybody how to solve it that I can deploy every time in node-red.



Best Regards,
Chris


  

在 2017年10月8日星期日 UTC+8上午6:54:22,Aniston Fernandes写道:
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

chris....@gmail.com

unread,
Nov 21, 2017, 10:34:21 AM11/21/17
to Node-RED

Hi,

 

I have update the "node-red-contrib-bacnet" and support read, write and whoIs function. But it still have the folllowing small issue and welcome anyone test it and help me solve it.

 

Issue

1. cannot release socket UPD 47808  when deploy a flow

2. cannot well control each BacnetReadProperty return and match each read request

 

Guide

1. download the code from
link: http://pan.baidu.com/s/1pKTRFXD password: uzui
2. copy the folder to "C:\Users\xxxx\AppData\Roaming\npm\node_modules"

3. start node-red

4. inport flow JS as folllows

 

[{"id":"fd06999d.574d8","type":"ui_button","z":"42b0e75.d4c3e58","name":"whoIs","group":"af9caf0c.3ef48","order":1,"width":0,"height":0,"passthru":true,"label":"whoIs","color":"","bgcolor":"","icon":"fa-star","payload":"{\"address\":\"\",\"lowLimit\":\"1\",\"highLimit\":\"999999\"}","payloadType":"json","topic":"whoIs","x":130,"y":1020,"wires":[["3f2af494.3c3094"]]},{"id":"9e7c32d3.2e12a","type":"inject","z":"42b0e75.d4c3e58","name":"","topic":"","payload":"{\"address\":\"\",\"lowLimit\":\"1\",\"highLimit\":\"999999\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":130,"y":1060,"wires":[["3f2af494.3c3094"]]},{"id":"d64d6148.9e077","type":"inject","z":"42b0e75.d4c3e58","name":"","topic":"","payload":"[{\"address\":\"192.168.1.3\",\"objectType\":\"3\",\"objectInstance\":\"0\",\"propertyId\":\"85\"},{\"address\":\"192.168.1.3\",\"objectType\":\"3\",\"objectInstance\":\"1\",\"propertyId\":\"85\"}]","payloadType":"json","repeat":"","crontab":"","once":false,"x":130,"y":1100,"wires":[["4289beff.805084"]]},{"id":"4289beff.805084","type":"bacnet-read","z":"42b0e75.d4c3e58","name":"","address":"192.168.1.105","objectType":"2","objectInstance":"1202","propertyId":"85","arrayIndex":"","server":"b7f40a.4da3f7f8","x":310,"y":1120,"wires":[["8dfa3a6e.c37f5","c910b1b8.fbb52"]]},{"id":"3f2af494.3c3094","type":"bacnet-discovery","z":"42b0e75.d4c3e58","name":"","address":"","lowLimit":"1","highLimit":"1000","server":"b7f40a.4da3f7f8","x":440,"y":1040,"wires":[["ecc85426.59bac8"]]},{"id":"c5cc8971.de3778","type":"ui_text","z":"42b0e75.d4c3e58","group":"af9caf0c.3ef48","order":2,"width":0,"height":0,"name":"","label":"DI_01","format":"{{msg.payload}}","layout":"row-spread","x":550,"y":1100,"wires":[]},{"id":"8dfa3a6e.c37f5","type":"function","z":"42b0e75.d4c3e58","name":"","func":"var m = [];\nvar i=0;\n//var msg1 = {payload: {value: null}};\n\nfor (var i=0;i<2;i++)\n{\nif (msg.payload.address == '192.168.1.3' && \n    msg.payload.objectType == 3 &&\n    msg.payload.objectInstance === 0){\n    //msg1.payload.value = msg.payload.value;\n    m[i++] = {payload:msg.payload.value};\n    //i+=1; \n} else if (msg.payload.address == '192.168.8.3' && \n           msg.payload.objectType == 3 &&\n           msg.payload.objectInstance == 1) {\n    //msg1.payload.value = msg.payload.value;\n    m[i++] = {payload:msg.payload.value};\n    //i+=1; \n}\n}\n\nreturn m;\n\n\n//var m = [];\n\n//for (var i=0;i<2;i++)\n//{\n//    m[i] = {payload:msg.payload[i]};\n//}\n//return m;","outputs":"2","noerr":0,"x":450,"y":1180,"wires":[["c910b1b8.fbb52","c5cc8971.de3778"],["c910b1b8.fbb52","c7cf3c2a.5afe08"]]},{"id":"c910b1b8.fbb52","type":"debug","z":"42b0e75.d4c3e58","name":"","active":true,"console":"false","complete":"false","x":430,"y":1280,"wires":[]},{"id":"c7cf3c2a.5afe08","type":"ui_text","z":"42b0e75.d4c3e58","group":"af9caf0c.3ef48","order":2,"width":0,"height":0,"name":"","label":"DI_02","format":"{{msg.payload}}","layout":"row-spread","x":610,"y":1160,"wires":[]},{"id":"ecc85426.59bac8","type":"debug","z":"42b0e75.d4c3e58","name":"","active":true,"console":"false","complete":"payload","x":850,"y":1180,"wires":[]},{"id":"a60623ad.e25bf","type":"inject","z":"42b0e75.d4c3e58","name":"","topic":"","payload":"{\"address\":\"192.168.1.3\",\"objectType\":\"5\",\"objectInstance\":\"0\",\"propertyId\":\"85\",\"priority\":\"16\",\"applicationTag\":\"9\",\"value\":\"1\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":210,"y":1600,"wires":[["aede93e0.e12f9"]]},{"id":"c73dbd8f.94398","type":"ui_switch","z":"42b0e75.d4c3e58","name":"","label":"DO_01","group":"af9caf0c.3ef48","order":3,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"DO_01","style":"","onvalue":"{\"address\":\"192.168.1.3\",\"objectType\":\"5\",\"objectInstance\":\"0\",\"propertyId\":\"85\",\"priority\":\"16\",\"applicationTag\":\"9\",\"value\":\"1\"}","onvalueType":"json","onicon":"","oncolor":"","offvalue":"{\"address\":\"192.168.1.3\",\"objectType\":\"5\",\"objectInstance\":\"0\",\"propertyId\":\"85\",\"priority\":\"16\",\"applicationTag\":\"9\",\"value\":\"0\"}","offvalueType":"json","officon":"","offcolor":"","x":380,"y":1660,"wires":[["aede93e0.e12f9","d5e6667c.7bf8"]]},{"id":"aede93e0.e12f9","type":"bacnet-write","z":"42b0e75.d4c3e58","name":"","address":"192.168.1.105","objectType":"2","objectInstance":"1202","propertyId":"85","priority":"16","applicationTag":"9","value":"1","server":"b7f40a.4da3f7f8","x":620,"y":1620.8000030517578,"wires":[["ecc85426.59bac8"]]},{"id":"d5e6667c.7bf8","type":"ui_toast","z":"42b0e75.d4c3e58","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":630,"y":1700,"wires":[]},{"id":"af9caf0c.3ef48","type":"ui_group","z":"","name":"Input/Output","tab":"f40c68d5.92478","order":1,"disp":true,"width":"6"},{"id":"b7f40a.4da3f7f8","type":"bacnet-server","z":"","interface":"192.168.1.120","port":"47808","broadcastAddress":"255.255.255.255","adpuTimeout":"5000"},{"id":"f40c68d5.92478","type":"ui_tab","z":"","name":"WAGO BACnet","icon":"dashboard","order":4}]

 

5. update inject node with JSON format depend on your BACnet IP device.

 

BR,

Chris



在 2015年2月14日星期六 UTC+8上午5:02:24,Edward Vielmetti写道:
Reply all
Reply to author
Forward
0 new messages