Hide last authors
Kilight Cao 10.1 1 **Table of Contents:**
Kilight Cao 2.1 2
Kilight Cao 10.1 3 {{toc/}}
4
5
6 = 1. BACnet =
7
8 == 1.1  Introduction ==
9
10 === 1.1.1 What is BACnet ===
11
12
13 BACnet, short for Building Automation and Control networks.
14
15 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.
16
17
18 === 1.1.2 List supported products and requirements ===
19
20
21 Gateway model: LPS8v2,LG01v2,MS20
22
23
Kilight Cao 11.1 24 == 1.2 Download and Install the BACnet ==
Kilight Cao 10.1 25
26
27 (% class="box infomessage" %)
28 (((
Kilight Cao 2.1 29 wget [[http:~~/~~/dragino.vicp.io:6080/bacnet/dragino-bacnet-apps-hp0c-2023-03-01.deb>>url:http://dragino.vicp.io:6080/bacnet/dragino-bacnet-apps-hp0c-2023-03-01.deb]]
30 dpkg -i dragino-bacnet-apps-hp0c-2023-03-01.deb
Kilight Cao 10.1 31 )))
Kilight Cao 2.1 32
Kilight Cao 10.1 33 [[image:image-20230401114036-1.png]]
Kilight Cao 2.1 34
35
Kilight Cao 12.1 36 == 1.3 Configure BACnet ==
Kilight Cao 10.1 37
Kilight Cao 2.1 38 After BACnet is installed, run commands to modify BACnet configurations
39
40 **Note: device_port and bacnet_ip_port are not set to the same**
41
Kilight Cao 10.1 42 (% class="box infomessage" %)
43 (((
Kilight Cao 2.1 44 nano /etc/config/bacnet
Kilight Cao 10.1 45 )))
Kilight Cao 2.1 46
47 **Examples:**
48
Kilight Cao 10.1 49 (% class="box infomessage" %)
50 (((
Kilight Cao 2.1 51 config settings 'general'
52 option bacnet_ip '10.130.2.80'  #The IP address of the BACnetIP network, here basically the same IP as the bbmd address below
53 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
54 option bbmd_address '10.130.2.80'  #bbmd is the BACnet registration server. Only one bbmd server is required in the same ip network
55 option bbmd_port '47808'  #In general, 47808 is used as the default port
56 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
Kilight Cao 10.1 57 )))
Kilight Cao 2.1 58
Kilight Cao 10.1 59 (% class="box infomessage" %)
60 (((
Kilight Cao 2.1 61 config settings 'bacdev_1'
62 option device_name 'LHT65N-1'  #The identification name of the bacnet device
63 option device_id '10001'  #The unique identification code in the same network segment of BACnet,Scope is(1 - 4194302)
64 option device_port '47912'  #The IP port occupied by Bacnet when it starts, Scope is (1024 - 65535)
Kilight Cao 10.1 65 )))
Kilight Cao 2.1 66
Kilight Cao 10.1 67 (% class="box infomessage" %)
68 (((
Kilight Cao 2.1 69 config settings 'bacdev_2'
70 option device_name 'LHT65N-2'
71 option device_id '10002'
72 option device_port '47913'  
Kilight Cao 10.1 73 )))
Kilight Cao 2.1 74
Kilight Cao 12.1 75 == 1.4 Run BACnet ==
Kilight Cao 2.1 76
77 After the configuration is complete, run the following command to start BACnet, The following are two ways to run BACnet:
78
79 (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):
80
Kilight Cao 10.1 81 (% class="box infomessage" %)
82 (((
Kilight Cao 2.1 83 bacserver -c -s
Kilight Cao 10.1 84 )))
Kilight Cao 2.1 85
86 (2) Without /etc/config/bacnet, and to run the registration server on the current machine, start it with the following command:
87
Kilight Cao 10.1 88 (% class="box infomessage" %)
89 (((
Kilight Cao 2.1 90 bacserver -s -a 10.130.2.80 -p 47808
Kilight Cao 10.1 91 )))
Kilight Cao 2.1 92
93 This command simulates two devices, with device IDs 47910 and 47911
94
95 Enter bacserver -h to output help
96
Kilight Cao 10.1 97 (% class="box infomessage" %)
98 (((
Kilight Cao 2.1 99 bacserver -h
Kilight Cao 10.1 100 )))
Kilight Cao 2.1 101
Kilight Cao 10.1 102 [[image:image-20230401114458-2.png]]
Kilight Cao 2.1 103
Kilight Cao 12.1 104 == 1.5 Read devices and modify devices ==
Kilight Cao 2.1 105
106 Enter baccli -h to output help
107
Kilight Cao 10.1 108 (% class="box infomessage" %)
109 (((
Kilight Cao 2.1 110 baccli -h
Kilight Cao 10.1 111 )))
Kilight Cao 2.1 112
Kilight Cao 10.1 113 [[image:image-20230401114641-3.png]]
114
Kilight Cao 12.1 115
Kilight Cao 2.1 116 **Examples:**
117
118 (1) List the current Bacnet devices:
119
Kilight Cao 10.1 120 (% class="box infomessage" %)
121 (((
Kilight Cao 2.1 122 baccli -l -a
Kilight Cao 10.1 123 )))
Kilight Cao 2.1 124
Kilight Cao 10.1 125 [[image:image-20230401114653-4.png]]
126
Kilight Cao 12.1 127
Kilight Cao 2.1 128 (2) List device information based on device ID:
129
Kilight Cao 10.1 130 (% class="box infomessage" %)
131 (((
Kilight Cao 2.1 132 baccli -l -i id
Kilight Cao 10.1 133 )))
Kilight Cao 2.1 134
Kilight Cao 10.1 135 [[image:image-20230401114706-5.png]]
136
Kilight Cao 2.1 137 (3) List the device details by device ID:
138
Kilight Cao 10.1 139 (% class="box infomessage" %)
140 (((
Kilight Cao 2.1 141 baccli -l -v -i id
Kilight Cao 10.1 142 )))
Kilight Cao 2.1 143
144 (4) Modify the specified attribute value based on the device ID:
145
Kilight Cao 10.1 146 (% class="box infomessage" %)
147 (((
Kilight Cao 2.1 148 baccli -i id -p prop -w value
Kilight Cao 10.1 149 )))
Kilight Cao 2.1 150
Kilight Cao 10.1 151 [[image:image-20230401114720-6.png]]
152
Kilight Cao 12.1 153
154 (5)Check the results using the BACnet tool
155
Kilight Cao 2.1 156 The user can check the data of the device by using the **[[yabe BACnet tool>>https://sourceforge.net/projects/yetanotherbacnetexplorer/]]**
157
Kilight Cao 10.1 158 [[image:image-20230401114729-7.png||height="521" width="1077"]]
Kilight Cao 2.1 159
Kilight Cao 12.1 160
161 = 1.6 Example: How to transfer data to BACnet via LoRaWAN in LPS8v2 =
162
163 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:
164
165 * LHT65N register on LPS8v2 Built-In TTN server already
166 * The user is able to see the data on the built-in TTN server device page.
167 * The LPS8v2 already has BACnet installed
168
169 Below are the steps to plot the sensor data on LPS8v2 BACnet.
170
Kilight Cao 2.1 171
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0