Table of Contents:

1. BACnet

1.1  Introduction

1.1.1 What is BACnet

BACnet, short for Building Automation and Control networks.

The BACnet communication protocol defines a number of services for communication between devices, and services can be divided into five categories: services related to device object management including Who-Is, I-Am, Who-Has, and other services, services related to object access including reading attributes, writing attributes and other services, and services related to alarms and events include acknowledgment alarms, change of state reports, etc. In addition, there are services related to file reading and writing and virtual terminals.

1.1.2 List supported products and requirements

Gateway model: LPS8v2,LG01v2,MS20

1.2 Download and Install the BACnet

wget http://dragino.vicp.io:6080/bacnet/dragino-bacnet-apps-hp0c-2023-03-01.deb
dpkg -i dragino-bacnet-apps-hp0c-2023-03-01.deb

image-20230401114036-1.png

1.3 Configure BACnet

After BACnet is installed, run commands to modify BACnet configurations

Note: device_port and bacnet_ip_port are not set to the same

nano /etc/config/bacnet

Examples:

config settings 'general'
    option bacnet_ip '10.130.2.80'                     #The IP address of the BACnetIP network, here basically the same IP as the bbmd address below
    option bacnet_ip_port '47808'                     #As with bbmd_port, the purpose of this is to register a Bacnet Server application as a bbmd registration server
    option bbmd_address '10.130.2.80'             #bbmd is the BACnet registration server. Only one bbmd server is required in the same ip network
    option bbmd_port '47808'                           #In general, 47808 is used as the default port
    option bacnet_dev_count '2'                        #Here is the number of BACnet devices that need to be simulated, if the number is 2, then the following settings must have 2, which are bacdev_1, bacdev_2

config settings 'bacdev_1'
    option device_name 'LHT65N-1'                  #The identification name of the bacnet device
    option device_id '10001'                               #The unique identification code in the same network segment of BACnet,Scope is(1 - 4194302)
    option device_port '47912'                           #The IP port occupied by Bacnet when it starts, Scope is (1024 - 65535)

config settings 'bacdev_2'
    option device_name 'LHT65N-2'         
    option device_id '10002'           
    option device_port '47913'   

1.4 Run BACnet

After the configuration is complete, run the following command to start BACnet, The following are two ways to run BACnet:

(1) With /etc/config/bacnet configuration, and to run the registration server on the current machine, start it with the following command (configure the /etc/config/bacnet file correctly):

bacserver  -c -s

(2) Without /etc/config/bacnet, and to run the registration server on the current machine, start it with the following command:

bacserver -s -a 10.130.2.80 -p 47808 

This command simulates two devices, with device IDs 47910 and 47911

Enter bacserver -h to output help

bacserver -h 

image-20230401114458-2.png

1.5 Read devices and modify devices

Enter baccli -h to output help

baccli -h 

image-20230401114641-3.png

Examples:

(1) List the current Bacnet devices:

baccli -l -a

image-20230401114653-4.png

(2) List device information based on device ID:

baccli -l -i id

image-20230401114706-5.png

(3) List the device details by device ID:

baccli -l -v -i id

(4) Modify the specified attribute value based on the device ID:

baccli -i id -p prop -w value

image-20230401114720-6.png

(5) Check the results using the BACnet tool

The user can check the data of the device by using the yabe BACnet tool

image-20230401114729-7.png

1.6 Example: How to transfer data to BACnet via LoRaWAN in LPS8v2

LPS8v2 includes a local TTN Server and Node-Red. This example shows how to configure LHT65N to use with the BACnet. This example assumes users already have:

  • LHT65N register on LPS8v2 Built-In TTN server already
  • The user is able to see the data on the built-in TTN server device page.
  • The LPS8v2 already has BACnet installed

Below are the steps to plot the sensor data on LPS8v2 BACnet.

1.6.1 Link BACnet to Local TTN

Users can download the Node-Red decoder from this link and import it into the Node-Red platform: LHT65N_TTN_to_BACnet.json

For more information on importing Input Flow, check out this link: Import Input Flow for Dragino Sensors

After importing the Input Flow is complete, the user needs to edit the MQTT in the node

Users can edit the MQTT node red color by referring to the following link:

http://wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20TTN/#H6.3A0Example:UseLocalServerTTNandNode-RedinLPS8v2

image-20230401144951-10.png

1.6.2 Check result

image-20230401142357-8.png

The BACnet tool displays the temperature, humidity and battery voltage of the LHT65N

image-20230401144525-9.png

 

Tags:
    
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0