Skip to main content

CREATE A CONNECTION TO YOUR BACNET SERVER

Access to MQTT Broker

Refer to the MQTT documentation for this step.

Creating a BACnet Adapter Node with Node-RED

With access to your MQTT broker, let's create a Node-RED flow to connect your MQTT broker to your BACnet server. All messages will be exchanged via your MQTT broker, and Node-RED will handle these messages to interact with the BACnet server.

Create an MQTT Input Node

MQTT Node Screenshot

  1. Drag an "mqtt in" node from the palette onto your Node-RED workspace.

  2. Double-click the node to configure it.

  3. Fill in the connection details for your MQTT broker (click on the pen next to the server input): MQTT Server Input Screenshot

    • Server: Enter the broker address, e.g., mqtt-eco.thingpark.com, depending on the platform you are logged into.
    • Port: Use the associated server port, e.g., 8883.
    • Use TLS: Check this option and configure the TLS settings if necessary.
    • Protocol: Choose MQTT V3.1.1.
    • Client ID: Leave this field empty to auto-generate a unique ID.
    • Keep Alive: Set it to 60.
    • Session: Check the option to "Use a clean session" for a fresh connection each time.

    Refer to the screenshot below for a visual guide:

    MQTT Configuration Screenshot

  4. In the "Security" tab, enter your MQTT broker credentials. Use any username, but ensure your apiKey is entered as the password.

    MQTT Security Tab Screenshot

  5. Select your server and specify the topic you want to subscribe to in the "Topic" field:

    MQTT Node Settings Screenshot

    Note

    Always include the following prefix when publishing or subscribing to your topic:

    actility-tpe-ope|<SubscriptionId>/mqtt/
  6. Click Done to save the configuration.

Test the MQTT Connection

  1. Add a "Debug" node from the palette.

  2. Link both components.

    MQTT Debug Screenshot

  3. Deploy your flow in Node-RED.

  4. Check the debug console to ensure that the "mqtt in" node is successfully connected to your broker. You should also see a green square under the "mqtt in" node, indicating that the connection is active. Once connected, you should start receiving messages from the broker.

    Debug Screenshot

Add Actility BACnet Adapter Node

  1. Download the actility-node-red-contrib-acy-tao-bacnet-adapter-x.x.x.tgz file by clicking here.

  2. Import it into your palette by clicking on "Manage palette".

    MQTT Palette Screenshot

  3. Go to the install tab and click on the import icon to drop your .tgz file.

    Import Icon

  4. You should see the "bacnet-adapter" node available in your palette. Drag the node from the palette onto your Node-RED workspace.

    BACnet Adapter Screenshot

  5. Connect the output of the "mqtt in" node to the input of the "bacnet-adapter" node to link them together. This connection allows messages received from the MQTT broker to be processed by the BACnet adapter. The BACnet adapter is already set up, but you can still configure it.

    MQTT BACnet

Specificities of BACnet Adapter

Double-click on your BACnet adapter to see the settings. It is divided into two tabs: Server properties and Object mapping.

Server Properties

Server Properties

  1. Name: Specifies the name of the BACnet adapter in your Node-RED flow.
  2. Port (hex): Defines the hexadecimal port number used for BACnet communication. The default is BAC0.
  3. Broadcast: Indicates the broadcast IP address used for sending messages to all devices in a BACnet/IP network. In this example, it is set to 255.255.255.255, which is a global broadcast address. For more efficient communication, this can be set to a specific subnet's broadcast address (e.g., 192.168.1.255 for a /24 subnet).
  4. Device ID: A unique identifier for the BACnet device. Here, it is set to 817001.
  5. Device Name: Descriptive name for the BACnet device, such as BACnet Adapter.
  6. Vendor ID: Identifies the vendor of the BACnet device. 0 is used when no specific vendor ID is assigned.
  7. Vendor Name: Field reserved for the vendor's name, left empty in this example.

Object Mapping

Object Mapping

  1. Object Name: Dropdown menu to select the name of the object to map. For example, it can be set to Device Name to link BACnet objects to specific device identifiers. The second option is Device EUI.

  2. LoRaWAN Metadata: A set of optional checkboxes to include metadata from LoRaWAN in the object mapping:

    • RSSI: Received Signal Strength Indicator.
    • SNR: Signal-to-Noise Ratio.
    • FCntUp: Frame counter for uplink messages.
    • SpFact: Spreading factor used in LoRaWAN communication.
  3. Export BACnet Object List: Checkbox to enable the export of the object list as a CSV file. This feature allows you to review the BACnet object list, even if you don't have a BACnet client. It is particularly useful to verify that all MQTT messages have been successfully converted into BACnet objects by the server.

  4. Import Custom Object List: Button to import a custom object mapping configuration from an external CSV file (BACnet Objects).

  5. Clear Object List: Button to clear the current object list.

To deploy your Node-RED workflow, click the Deploy button.

Displaying Information to Know if It Worked

Install YABE

YABE (Yet Another BACnet Explorer) is an open-source tool designed to explore, test, and debug BACnet/IP networks.

  1. Download YABE available for free on SourceForge.
  2. Extract the files on your computer.
  3. Install Required Dependencies: .NET Framework 4.0 or higher.
  4. Run Yabe.exe available in the extracted folder.
Note

If you are using Linux, follow these steps to install and run YABE:

  1. Install the mono-complete package:
    sudo apt install mono-complete
  2. Navigate to the folder where you extracted YABE and run it using the mono command:
    mono ./Yabe.exe
    This will launch YABE on your Linux system.

How to Use YABE

Once YABE is installed and ready, follow these simple steps to explore your BACnet devices and objects:

  1. Search Devices:

    • Open YABE and click on the "+" icon to search all devices. plus
    • This will open a configuration window where you can specify the interface details.
  2. Configure the BACnet Search:

    • Enter the BACnet Port (e.g., 47808, which corresponds to BAC0 in hexadecimal) and the server address of your BACnet device.
    • Note: You can use 0.0.0.0 as the server address. This works because YABE scans all devices within the same IP segment. However, if you have multiple servers, it is recommended to specify the exact IP address of the BACnet server to avoid ambiguity. (You have to be in the same network as your BACnet server to do that, it's UDP protocol so be sure that your firewalls won't block you.)
    • Confirm the settings to establish the connection. search server
  3. View the Device List:

    • Once the search is done, YABE will display a list of detected devices.
    • Double-click on your device from the list to access its associated BACnet objects. search server
  4. Explore BACnet Objects:

    • After selecting your device, YABE will display the list of BACnet objects available on the server. search server
    • On the right-hand side, if you click on one sensor, you will see detailed data associated with each object, such as properties, current values, and additional metadata. search server

Limitations

Note

The current BACnet node is not functioning on local machines. However, it operates correctly on remote servers.

Troubleshooting

As far as we know, there is no problem with the BACnet server.