MS/TP bacnet protocol

I have controller from Johnson control and I want read signals from it , by using rs485 MS/TP BACnet.
if there is any way to read .
BACnet node available for Ethernet only.
so any help I will be thankfully.

have search of forum as someone has a way of calling bacpypes MS/TP see

I just updated the repo on the Python side to include a swagger definition of the restapi endpoints.

Let me know if you have any questions feel free to submit a git issue for getting started. You just need to git clone the repo and run a python web where you can do BACnet read, write, releases with Python BACnet stacks via restapi calls from node red.

1 Like

Hi - just looking at the repo I can't see the swagger yaml or json ? I was going to run it through nodegen Home · node-red/node-red-nodegen Wiki · GitHub to see if it generated successfully.

Let me look into this! Ill post something soon

I think
I found a solution but need to check and test.
by using http request,
take the full address of point.
its hopefully work with bacnet router

@dceejay I updated my repo for a swagger json file.

Is there any chance you could give me a few tips on how to implement the nodegen part? In your link would I just substitute my git URL versus the pet store example?

(1) Generate node using node-red-nodegen command

node-red-nodegen http://petstore.swagger.io/v2/swagger.json

Node-RED users typically import the generated node to the palette of Node-RED flow editor using the following procedures.

(2) Change directory to the generated node's directory

cd node-red-contrib-swagger-petstore

(3) Prepare the symbolic link

sudo npm link

(4) Change current directory to Node-RED home directory (Typically, Node-RED home directory is ".node-red" under the home directory)

cd ~/.node-red

(5) Create a symbolic link

npm link node-red-contrib-swagger-petstore

(6) Start Node-RED

node-red

Hi,
yes - at most basic you can just run node-red-nodegen yourSwaggerFile.json - this will create a directory based off the "info - title" . You can then simply install it by changing to your .node-red directory and running npm i path-to-generated-directory/ (No need to do the link steps any more as the local install will do that for you).

If you want to move the node around you can just run npm pack in that directory and then move the created .tgz file and just npm install that.

Then restarting Node-RED and you should have a node with the name in it...
Of course you can go into the generated directory and then manually edit things in the package.json and other files a per any other node to set colour, name etc etc.

In many ways it's actually very easy to just use the request node as you have done already - but sometimes it's useful to generate a node like this to help users to get it right. (Not the help generation isn't great - but it does try to pick up things from the swagger but it's not obvious which parts make it through the process :slight_smile:

@dceejay I updated the git repo to include the Node Red Function Block building. Any chance you could glance at the README and give me some feedback if it makes sense for the Node Red community? Or if anything is confusing? I am actually a python guy learning javascript and Node Red.

1 Like

Thanks for this contribution. Just to clarify, the original topic was Bacnet MS/TP serial Rs485 communication to a Bacnet device. The python webap is started with an ip address and port, so no access to the serial port. Can this only be used with a Bacnet Ip to MS/TP router? The ideal solution is a USB Rs485 adapter and serial configuration in the webap to communicate directly with the hardware through the serial port without a router

@mtoko yes your right about the original topic here. That would be a cool project of direct USB rs485 BACnet for node red. This instructables tutorial demonstrates that with modbus direct to Node Red without a web app/http requests.

One question I have is if someone replicated the instructables tutorial for BACnet, can Python be used at all to create some sort of Node block for Node Red? Can javascript in Node Red call Python code? Any info on this I am sort of curious, for me there is no better way to learn something than create something in the process. Are there any tutorials for creating Node blocks or Node Red modules/packages? Is this a good place to start?

My original idea behind the web app BACnet restapi is to gather lots of data for IoT applications. Like many devices many points on one restapi call from many different BACnet networks on a LAN, but this idea of serial rs-485 network is different but seems interesting... Thanks for any response!

can shear video please ?

Hi sorry for the late response, what do you mean by a video? Feel free to reach out for questions

Hi. the bacnet router its necessary to enable this config for make possible to read the data?