> For the complete documentation index, see [llms.txt](https://wiki.bitpool.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.bitpool.com/bitpool-edge/connectors/bitpool-edge-bacnet.md).

# Bitpool Edge BACnet

## **Getting Started**

This is a standard Node.js module developed specifically to function within the Node-RED ecosystem.

## **How to Use**

Use the following procedure to install this module to your Node-RED instance, or download the pre-themed [Bitpool-Edge Docker](/bitpool-edge/bitpool-edge-installation.md) image that contains all our favourite nodes pre-installed.

### **Bitpool-Edge Install**

1. Log into your Bitpool-Edge instance and click the `Hamburger` icon, in the top-right corner.
2. Select `Manage Palette` from the drop down menu then click the `Pallete->Install` tabs to install.
3. Using the search bar type `@bitpoolos/edge-bacnet` and install the module once displayed.
4. Finally, use the left most navigation menu to scroll down to the heading `Bitpool BACnet` to reveal available nodes

### **Docker Install** :whale:

This BACnet module and many other Bitpool developed nodes have been pre-installed for your convenience in a Bitpool themed Node-RED application.

Go here for how to [install Bitpool-Edge](/bitpool-edge/bitpool-edge-installation.md).

### **BACnet Nodes**

The edge-bacnet library of nodes is broken down into 4x functional blocks.

![](/files/lShm3amIJCjsqThJMq87)

**Gateway**

The main component to the BACnet node collection. This node contains the interface to the node-bacnet package. All Read and Write nodes must link into the gateway. The gateway node also contains all network properties, to be configured by the user.

*Please note*: any property changes to the Gateway node currently requires a Node-RED **restart**.

There are 3 tabs on the gateway node:

*Gateway Tab*

* Network Interface - the desired interface for the BACnet client to bind to. This interface must not have any other BACnet clients bound to it.
* Broadcast Address - the desired subnet for global msgs to be broadcast and received on. This should be as strict as possible. Use 255.255.255.255 if unsure.
* Local Device Port - the port to be used for BACnet comms. Default is 47808
* Device ID - the Device ID the node itself would use if the Server is enabled. Ie: if the server is enabled, and a foreign device were to execute a discovery, that is the ID it would see for this node.
* Device ID range - a filter range for discovering other devices. &#x20;

*Discovery Tab*

* APDU Timeout - BACnet msg timeout option
* Max APDU Size - BACnet max apdu size
* Max Segments - BACnet max segments
* Number of Retries - The amount of retries the node will do if an error is found while fetching a foreign point list.&#x20;
* Global Discover Frequency - the frequency at which the gateway issues global WhoIs BACnet commands. This should be limited to the least amount possible, as over-loading a network can be a serious issue with BACnet commmunications.
* Manual Point Discovery Instance Range - if a BACnet device doesnt have a Object list (BACnet objectType:propertyId - 8:76), the this bacnet client will enter into manual discovery mode, where it iterates through types and instnace ranges. This range can be used to limit this manual scanning
* Log Device Found - toggles logging of found devices to the node-red debug tab.
* Log BACnet Errors to Console - toggles logging of BACnet related errors to the node-red console
* Device List - Import / Export. The Import option allows the user to import a JSON model for the node to use. The Export option exports the currently active model in JSON format.

*Server Tab*

This section provides the ability to simulate a BACnet device and BACnet points using node-red.

Injecting a msg.topic and msg.payload into the gateway node will create a virtual point that can be discovered by other devices via BACnet/IP

This node only supports 2 BACnet object types, Analog Value - to show numeric data, and a Character String - to show string data.

* Enabled - toggles whether or not the local BACnet server is started or not.
* Reinitialize Server - a button that completely clears the server and associated points

**Read**

The node that handles point and property selection for reading operations. The node is split up into 3 tabs:

1\. Device List - used to select points / devices to add to the read list,       &#x20;

2\. Read List - list of selected points / devices.       &#x20;

3\. Properties - the point properties to be read from the points in the read list.

**Write**

Much like the read node, this node handles point and property selection for writing operations. The node is split up into 3 tabs:

1\. Device List - used to select points / devices to add to the write list.    &#x20;

&#x20;2\. Write List - list of selected points / devices.       &#x20;

3\. Properties - the operation property's for the write command. Configuring the receiving BACnet device and setting            these properties are critical for a sucessfull write operation.

**Inject**

An extension of the Node-RED Inject node. It contains all of the standard inject node functionality, with 2 added buttons for a improved user experience. The buttons add a command to the msg object, which can instruct the Read, Write, or Gateway nodes, to either:

1\. Poll - invokes a Read or Write operation. A inject node with the Poll option must link into a Read or Write node.       &#x20;

2\. Discover - invokes a BACnet global WhoIs broadcast on the specified broadcast address. A inject node with the Discover option must link into a Gateway node.

### **Examples**

**Video walk-through**&#x20;

{% embed url="<https://youtu.be/4K7mVxfvfbc>" %}

Here are some examples and scenarios that could potentially be used with the edge-bacnet node.

**Read and Write**

*A flow with all of the BACnet read and write provided features*

<figure><img src="/files/PGmHMZHe1pnPD9YGobqA" alt=""><figcaption></figcaption></figure>

*Inject node used for Polling*

<figure><img src="/files/oZIV4fuQcvr5IAOzYs8x" alt=""><figcaption></figcaption></figure>

*Inject node used for Discovery*

<figure><img src="/files/1igj1vTfxDsQQe9rX4Yn" alt=""><figcaption></figcaption></figure>

*Read node action buttons*

<figure><img src="/files/Cl4Z7ifnRr2kspszuCQQ" alt=""><figcaption></figcaption></figure>

Add All Devices - this action adds all of the devices listed on the Device List tab to the Read List

<figure><img src="/files/PgGKohHlVuYasFNmLWOx" alt=""><figcaption></figcaption></figure>

Refresh Device List - this action refreshes the list

<figure><img src="/files/e9cxz8iPyNfAAs5RtxAc" alt=""><figcaption></figcaption></figure>

Clear Data model: - this action deletes and resets the bacnet data model. The user must wait for the node to construct the site model after selecting this button.

<figure><img src="/files/oC4xJODiLLcEtYZ2cJtJ" alt=""><figcaption></figcaption></figure>

*Example Gateway configurations*

<figure><img src="/files/GqW0jVfcFUrlagO4hlyE" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3s7WYla3uvGNYuMMESZx" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/E4woy0EYBxdR3LrKeBAI" alt=""><figcaption></figcaption></figure>

**BACnet Server**

*MQTT to BACnet*

<figure><img src="/files/1aXXhREW9Pt5nkn6mGHh" alt=""><figcaption></figcaption></figure>

*Function generated data*

<figure><img src="/files/jA6tDvbjeVWwZkUueCgJ" alt=""><figcaption></figcaption></figure>

*Contents of previous function*

<figure><img src="/files/oUJAMVHKni3A0ytZKxpF" alt=""><figcaption></figcaption></figure>

*Yabe view of function generated BACnet data*

<figure><img src="/files/mGzOK25HoDobWiakaFOo" alt=""><figcaption></figcaption></figure>

### **Further Information**

Now that your Bitpool-Edge is up and running, we have included simple examples flows to demonstrate how to create a basic solution.

1. Log into your Bitpool-Edge instance and click the `Hamburger` icon, in the top-right corner.
2. Select `Manage Palette` from the drop down menu then click the `Import->Examples` tabs to see this node.
3. Navigate the ‘Examples flows’ tree and select `@bitpoolos/edge-bacnet` to reveal the preconfigured examples.
4. Click the example you would like to test the click the `Import` button.
5. Place the example nodes on a flow and review the configuration of each node. You will need to make suitable changes for your system.
6. Finally, click `Deploy` to test.

> Additionally, there is basic helper documentation on each node. Just select a target node and click the `Help` tab found at the top right corner of Bitpool-Edge.
>
> **Hint** *- the icon looks like a book!*
