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 (((
Xiaoling 19.3 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
Xiaoling 19.2 38
Kilight Cao 2.1 39 After BACnet is installed, run commands to modify BACnet configurations
40
Xiaoling 19.2 41 (% style="color:red" %)**Note: device_port and bacnet_ip_port are not set to the same**
Kilight Cao 2.1 42
Kilight Cao 10.1 43 (% class="box infomessage" %)
44 (((
Xiaoling 19.3 45 **nano /etc/config/bacnet**
Kilight Cao 10.1 46 )))
Kilight Cao 2.1 47
48 **Examples:**
49
Kilight Cao 10.1 50 (% class="box infomessage" %)
51 (((
Kilight Cao 2.1 52 config settings 'general'
53 option bacnet_ip '10.130.2.80'  #The IP address of the BACnetIP network, here basically the same IP as the bbmd address below
54 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
55 option bbmd_address '10.130.2.80'  #bbmd is the BACnet registration server. Only one bbmd server is required in the same ip network
56 option bbmd_port '47808'  #In general, 47808 is used as the default port
57 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 58 )))
Kilight Cao 2.1 59
Kilight Cao 10.1 60 (% class="box infomessage" %)
61 (((
Kilight Cao 2.1 62 config settings 'bacdev_1'
63 option device_name 'LHT65N-1'  #The identification name of the bacnet device
64 option device_id '10001'  #The unique identification code in the same network segment of BACnet,Scope is(1 - 4194302)
65 option device_port '47912'  #The IP port occupied by Bacnet when it starts, Scope is (1024 - 65535)
Kilight Cao 10.1 66 )))
Kilight Cao 2.1 67
Kilight Cao 10.1 68 (% class="box infomessage" %)
69 (((
Kilight Cao 2.1 70 config settings 'bacdev_2'
71 option device_name 'LHT65N-2'
72 option device_id '10002'
73 option device_port '47913'  
Kilight Cao 10.1 74 )))
Kilight Cao 2.1 75
Xiaoling 19.2 76
Kilight Cao 12.1 77 == 1.4 Run BACnet ==
Kilight Cao 2.1 78
Xiaoling 19.2 79
Kilight Cao 2.1 80 After the configuration is complete, run the following command to start BACnet, The following are two ways to run BACnet:
81
82 (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):
83
Kilight Cao 10.1 84 (% class="box infomessage" %)
85 (((
Xiaoling 19.3 86 **bacserver -c -s**
Kilight Cao 10.1 87 )))
Kilight Cao 2.1 88
Xiaoling 19.2 89
Kilight Cao 2.1 90 (2) Without /etc/config/bacnet, and to run the registration server on the current machine, start it with the following command:
91
Kilight Cao 10.1 92 (% class="box infomessage" %)
93 (((
Xiaoling 19.3 94 **bacserver -s -a 10.130.2.80 -p 47808 **
Kilight Cao 10.1 95 )))
Kilight Cao 2.1 96
97 This command simulates two devices, with device IDs 47910 and 47911
98
99 Enter bacserver -h to output help
100
Kilight Cao 10.1 101 (% class="box infomessage" %)
102 (((
Xiaoling 19.3 103 **bacserver -h **
Kilight Cao 10.1 104 )))
Kilight Cao 2.1 105
Kilight Cao 10.1 106 [[image:image-20230401114458-2.png]]
Kilight Cao 2.1 107
Xiaoling 19.2 108
Kilight Cao 12.1 109 == 1.5 Read devices and modify devices ==
Kilight Cao 2.1 110
Xiaoling 19.2 111
Kilight Cao 2.1 112 Enter baccli -h to output help
113
Kilight Cao 10.1 114 (% class="box infomessage" %)
115 (((
Xiaoling 19.3 116 **baccli -h **
Kilight Cao 10.1 117 )))
Kilight Cao 2.1 118
Kilight Cao 10.1 119 [[image:image-20230401114641-3.png]]
120
Kilight Cao 12.1 121
Kilight Cao 2.1 122 **Examples:**
123
Xiaoling 19.3 124 **(1) List the current Bacnet devices:**
Kilight Cao 2.1 125
Kilight Cao 10.1 126 (% class="box infomessage" %)
127 (((
Xiaoling 19.3 128 **baccli -l -a**
Kilight Cao 10.1 129 )))
Kilight Cao 2.1 130
Kilight Cao 10.1 131 [[image:image-20230401114653-4.png]]
132
Kilight Cao 12.1 133
Xiaoling 19.3 134 **(2) List device information based on device ID:**
Kilight Cao 2.1 135
Kilight Cao 10.1 136 (% class="box infomessage" %)
137 (((
Xiaoling 19.3 138 **baccli -l -i id**
Kilight Cao 10.1 139 )))
Kilight Cao 2.1 140
Kilight Cao 10.1 141 [[image:image-20230401114706-5.png]]
142
Xiaoling 19.2 143
Xiaoling 19.3 144 **(3) List the device details by device ID:**
Kilight Cao 2.1 145
Kilight Cao 10.1 146 (% class="box infomessage" %)
147 (((
Xiaoling 19.3 148 **baccli -l -v -i id**
Kilight Cao 10.1 149 )))
Kilight Cao 2.1 150
Xiaoling 19.2 151
Xiaoling 19.3 152 **(4) Modify the specified attribute value based on the device ID:**
Kilight Cao 2.1 153
Kilight Cao 10.1 154 (% class="box infomessage" %)
155 (((
Xiaoling 19.3 156 **baccli -i id -p prop -w value**
Kilight Cao 10.1 157 )))
Kilight Cao 2.1 158
Kilight Cao 10.1 159 [[image:image-20230401114720-6.png]]
160
Kilight Cao 12.1 161
Xiaoling 19.3 162 **(5) Check the results using the BACnet tool**
Kilight Cao 12.1 163
Kilight Cao 2.1 164 The user can check the data of the device by using the **[[yabe BACnet tool>>https://sourceforge.net/projects/yetanotherbacnetexplorer/]]**
165
Kilight Cao 10.1 166 [[image:image-20230401114729-7.png||height="521" width="1077"]]
Kilight Cao 2.1 167
Kilight Cao 12.1 168
Kilight Cao 19.1 169 == 1.6 Example: How to transfer data to BACnet via LoRaWAN in LPS8v2 ==
Kilight Cao 12.1 170
Xiaoling 19.2 171
Kilight Cao 12.1 172 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:
173
174 * LHT65N register on LPS8v2 Built-In TTN server already
Xiaoling 19.3 175
Kilight Cao 12.1 176 * The user is able to see the data on the built-in TTN server device page.
Xiaoling 19.3 177
Kilight Cao 12.1 178 * The LPS8v2 already has BACnet installed
179
180 Below are the steps to plot the sensor data on LPS8v2 BACnet.
181
Kilight Cao 16.1 182
Kilight Cao 19.1 183 === 1.6.1 Link BACnet to Local TTN ===
Kilight Cao 16.1 184
Xiaoling 19.2 185
Kilight Cao 16.1 186 Users can download the Node-Red decoder from this link and import it into the Node-Red platform: **[[attach:LHT65N_TTN_to_BACnet.json||target="_blank"]]**
187
Xiaoling 19.3 188 For more information on importing Input Flow, check out this link: **[[Import Input Flow for Dragino Sensors>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Node-RED/#H3.A0ImportInputFlowforDraginoSensors]]**
Kilight Cao 16.1 189
190
191 After importing the Input Flow is complete, the user needs to edit the MQTT in the node
192
Kilight Cao 18.1 193 Users can edit the MQTT node red color by referring to the following link:
Kilight Cao 16.1 194
195 [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20TTN/#H6.3A0Example:UseLocalServerTTNandNode-RedinLPS8v2>>http://wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20TTN/#H6.3A0Example:UseLocalServerTTNandNode-RedinLPS8v2]]
196
Kilight Cao 18.1 197 [[image:image-20230401144951-10.png||height="814" width="1223"]]
198
Kilight Cao 16.1 199
Xiaoling 19.2 200 === 1.6.2 Check result ===
201
202
Kilight Cao 16.1 203 [[image:image-20230401142357-8.png||height="677" width="1232"]]
204
205
206 The BACnet tool displays the temperature, humidity and battery voltage of the LHT65N
207
208 [[image:image-20230401144525-9.png||height="487" width="1237"]]
Xiaoling 19.2 209
210
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0