Last modified by Xiaoling on 2025/05/08 09:22

Hide last authors
Xiaoling 69.8 1
2
Xiaoling 2.2 3 (% style="text-align:center" %)
Xiaoling 33.2 4 [[image:1654679359875-169.png]]
Xiaoling 1.1 5
6
7
Xiaoling 47.14 8 **Table of Contents:**
9
Xiaoling 17.3 10 {{toc/}}
Xiaoling 1.1 11
12
13
Xiaoling 17.3 14
15
Xiaoling 48.4 16
17
18
Xiaoling 2.2 19 = 1. Introduction =
Xiaoling 1.1 20
Dilisi S 76.1 21 == 1.1 What is the LDS02 LoRaWAN Door Sensor? ==
Xiaoling 1.1 22
23
Xiaoling 3.2 24 (((
Xiaoling 47.9 25 (((
Dilisi S 78.1 26 The** Dragino LDS02 **is a **LoRaWAN Door Sensor** designed to detect door open/close status and send data to a LoRaWAN Network Server. Users can view the door status, open time, and open counts in an IoT platform by integrating it with the LoRaWAN Network Server.
Xiaoling 47.9 27 )))
Xiaoling 1.1 28
Xiaoling 47.9 29 (((
Dilisi S 77.1 30 The sensor is powered by **two AAA batteries**, making it suitable for long-term use. These batteries can provide approximately 16,000 to 70,000 uplink packets. When the batteries run out, users can easily open the enclosure and replace them with standard AAA batteries.
Xiaoling 1.2 31
Dilisi S 77.1 32 The device sends data periodically every day and for each door open/close action. It also **counts the number of door openings** and **calculates the duration of the last door opening**. Users can disable the uplink for each open/close event if preferred. In this mode, the device will count each event and upload the data periodically instead.
Xiaoling 1.2 33
Dilisi S 77.1 34 The LDS02 **features an open alarm**, which can be configured to send an alarm if the door remains open for a specified duration.
Xiaoling 33.2 35
Dilisi S 77.1 36 Each sensor comes with information (keys and identifiers) for LoRaWAN Network registration. Registering these keys with a LoRaWAN server allows the device to connect automatically upon powering on.
Xiaoling 47.21 37
Dilisi S 76.1 38
39 The following figure shows how the LDS02 is connected to a typical LoRaWAN network server.
40
Xiaoling 129.2 41 [[image:LDS02-lorawan.jpg||height="458" width="1166"]]
Dilisi S 76.1 42
Xiaoling 47.21 43
Xiaoling 3.2 44 )))
Xiaoling 47.9 45 )))
Xiaoling 1.2 46
Xiaoling 3.3 47 == 1.2 Features ==
Xiaoling 1.2 48
Xiaoling 50.2 49
Xiaoling 1.2 50 * LoRaWAN Class A v1.0.3
Xiaoling 66.3 51 * Frequency Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865
52 * Door Open/Close detect
53 * Door open/close statistics
Xiaoling 1.2 54 * 2 x AAA LR03 Batteries
55 * AT Commands to change parameters
56 * Uplink on periodically and open/close action
57 * Remote configure parameters via LoRa Downlink
58 * Firmware upgradable via program port
59
Xiaoling 69.5 60 == 1.3 Storage & Operation Temperature ==
Xiaoling 50.2 61
Xiaoling 69.3 62
Dilisi S 77.1 63 -10 ~~ 50 °C  or -40 ~~ 60 °C (depends on the battery type, see [[FAQ>>||anchor="H7.6Whyiseedifferentworkingtemperatureforthedevice3F"]])
Xiaoling 69.3 64
65
66 == 1.4 Applications ==
67
68
Xiaoling 1.2 69 * Smart Buildings & Home Automation
70 * Logistics and Supply Chain Management
71 * Smart Metering
72 * Smart Agriculture
73 * Smart Cities
74 * Smart Factory
75
Xiaoling 69.3 76 == 1.5 Dimension ==
Xiaoling 1.2 77
Xiaoling 50.2 78
Dilisi S 77.1 79 Units in mm
Xiaoling 1.2 80
Xiaoling 37.2 81 [[image:1654680563545-120.png]]
Xiaoling 1.2 82
Xiaoling 5.2 83
Xiaoling 37.2 84 [[image:1654680510816-654.png]]
Xiaoling 5.2 85
Xiaoling 37.2 86
Dilisi S 77.1 87 == 1.6 Firmware Change Log ==
Xiaoling 5.2 88
Xiaoling 50.2 89
Xiaoling 26.8 90 (((
Xiaoling 37.2 91 (((
Dilisi S 77.1 92 LDS02 uses the same firmware as LDS01:[[LDS02 Image files – Download link>>https://www.dropbox.com/sh/9j35mnsxnz0y3ye/AACj5gHGOURGEHCpj-E861Mua?dl=0]]
Xiaoling 26.8 93 )))
94 )))
Xiaoling 1.2 95
96
Mengting Qiu 136.1 97 == 1.7 Hardware Variant (Since LDWS v2.4 PCB) ==
98
99
100 Starting from the LDWS v2.4 motherboard, we made adjustments to the button and LED light of LDS02, and the corresponding adjustments were also made to the shell at the same time.
101
102
Edwin Chen 142.1 103 === 1.7.1 How to identify the old and new versions ===
Mengting Qiu 136.1 104
105
106 Check the **external enclosure** for these differences:
107
Mengting Qiu 140.1 108 ~1. RESET Button Hole
Mengting Qiu 136.1 109
Mengting Qiu 140.1 110 * New Version: Larger hole (Corresponding to the position of the RESET button on the motherboard).
Mengting Qiu 136.1 111 * Old Version: Smaller hole (The original position of the LED).
112
113 2. LED
114
Mengting Qiu 140.1 115 * New Version: Thinner circular area below RESET hole (for LED light transmission).
Mengting Qiu 136.1 116 * Old Version: The small hole directly above the shell (Corresponding to the position of the LED on the motherboard).
117
118 3. Arrow Marking
119
120 * New Version: Edge-embossed arrow shape.
121 * Old Version: Fully recessed arrow shape.
122
123 (% style="color:blue" %)**Actual appearance comparison picture:**
124
Mengting Qiu 140.1 125 [[image:image-20250507161458-4.jpeg||height="456" width="665"]]
Mengting Qiu 136.1 126
127
Edwin Chen 142.1 128 === 1.7.2 RESET button & LED Display ===
Mengting Qiu 136.1 129
130
Mengting Qiu 140.1 131 **1. RESET button**
Mengting Qiu 136.1 132
Mengting Qiu 140.1 133 Restart the device through the physical reset button.
134
135 It is suitable for rapid restart when the equipment malfunctions (such as communication failure, sensor unresponsiveness).
136
137 * For old version, the RESET button was located inside the device enclosure, requiring the housing to be opened for access.
138 * For new version, the RESET button is located in a small hole in the device's case and can simply be pressed with a thin pin without opening the case.
139
140 Example:
141
142 [[image:image-20250507172832-6.png||height="372" width="274"]]
143
144
145 **2. LED display**
146
Mengting Qiu 136.1 147 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:463px" %)
148 |=(% style="width: 186px;background-color:#4F81BD;color:white" %)**Action**|=(% style="width: 277px;background-color:#4F81BD;color:white" %)**LED behavior**
149 |(% style="width:184px" %)Power On|(% style="width:275px" %)(% style="color:green" %)**GREEN LED on 1s, **(% style="color:red" %)**RED LED on 1s,**(%%)** (% style="color:blue" %)BLUE LED on 1s(%%)**
150 |(% style="width:184px" %)Joined successful|(% style="width:275px" %)(% style="color:green" %)**GRENN LED **(%%)on 5s
151 |(% style="width:184px" %)Send an uplink message|(% style="width:275px" %)(% style="color:green" %)**GREEN LED**(%%) blinks once
152 |(% style="width:184px" %)Received a downlink message|(% style="width:275px" %)(% style="color:blue" %)**BLUE LED**(%%) blinks once
153
Xiaoling 143.1 154 = (% style="color:inherit; font-family:inherit; font-size:29px" %)2. Power ON LDS02(%%) =
Mengting Qiu 136.1 155
156
Dilisi S 77.1 157 When receive the LDS02, open the enclosure and insert two AAA batteries to power it. The [[LED>>||anchor="H4.7LEDs"]] will blink when the device is powered on.
Xiaoling 1.2 158
159
Dilisi S 77.1 160 = 3. How to Install LDS02 =
Xiaoling 1.2 161
Xiaoling 69.7 162
Dilisi S 79.1 163 The LDS02 has two parts: sensor and the magnet. These parts can be attached to a surface using either screws or double sided tapes.For example, if you install it to detect door open/close events, the sensor part can be attached to the door frame, and the magnet can be attached to the door panel.
164
165
Dilisi S 77.1 166 Fixing with screws:
Xiaoling 50.2 167
Dilisi S 79.1 168 * Each part has a bottom lid that can be detached from its enclosure. Detach the bottom lids of both the sensor and the magnet enclosures. You will notice two holes on each bottom lid for inserting screws. First, attach the bottom lids to the surface using screws, ensuring a minimal gap between them. Then snap the top part of the enclosure onto the bottom. You will hear a clicking sound once they are securely fitted together.
Mengting Qiu 69.1 169
170 [[image:image-20231222111730-1.jpeg||height="428" width="686"]]
171
172
Dilisi S 80.1 173 Fixing with double-sided adhesive pads:
Dilisi S 79.1 174
175 * The double-sided adhesive pad included with the LDS01 has a pre-cut section that can be attached to the bottom of the magnet enclosure (first remove the protective backing of one side only). The remaining section should be affixed to the bottom of the sensor enclosure. Once the tape is in place, remove the protective backing and secure both enclosures to the surface, ensuring a minimal gap between them.
176
Mengting Qiu 69.1 177 [[image:image-20231222111834-2.jpeg||height="443" width="685"]]
178
179
Xiaoling 7.4 180 (((
Xiaoling 37.4 181 (((
Dilisi S 79.1 182 When installing the LDS02, make sure to install it as shown below so that the marks align closely when the door is closed.
Xiaoling 7.4 183 )))
Xiaoling 1.2 184
Xiaoling 37.4 185 (((
Dilisi S 79.1 186 Open/Close threshold range (the minimum gap between sensor enclosure and the magnet enclosure): ~~ 10mm
Xiaoling 37.4 187 )))
188 )))
Xiaoling 1.2 189
Xiaoling 69.7 190 [[image:1654680716522-793.png||height="505" width="497"]]
Xiaoling 1.2 191
192
Xiaoling 7.2 193 = 4. Operation Mode =
Xiaoling 1.2 194
Dilisi S 78.1 195 == 4.1 How It Works? ==
Xiaoling 1.2 196
Xiaoling 50.2 197
Xiaoling 26.5 198 (((
Dilisi S 109.1 199 The LDS02 is configured as a LoRaWAN Class A device by default. It contains a DevEUI, AppEUI, and AppKey, which allow it to join a LoRaWAN network using OTAA (Over-The-Air Activation). To connect the LDS02 to a LoRaWAN network, you need to configure these keys and identifiers with the LoRaWAN network server first, and then [[power on>>||anchor="H2.PowerONLDS02"]] the LDS02. The device will automatically join the network using OTAA. This device information can be found in your package, printed on a sticker.
Xiaoling 1.2 200
Dilisi S 78.1 201 [[image:image-20230426084924-1.png||height="229" width="493"]]
202
203 If you cannot set the device registration information, such as the DevEUI, AppEUI, and AppKey, in the network server, you must use the information generated by the network server, which differs from the information already stored on the device. In this case, you can use [[AT Command>>||anchor="H6.UseATCommand"]]s to write the new information to the device.
Xiaoling 26.5 204 )))
Xiaoling 1.2 205
206
Dilisi S 77.1 207 == 4.2 Example of Joining a LoRaWAN Network ==
Xiaoling 7.2 208
Xiaoling 50.2 209
Dilisi S 77.1 210 The following figure shows how the LDS02 connects to [[The Things Stack>>https://eu1.cloud.thethings.network/]]. The LDS02 sends messages (uplinks) to The Things Stack via a LoRaWAN gateway (e.g., Dragino LPS8N) and can also receive messages (downlinks) from The Things Stack. The Things Stack can be integrated with ThingsEye, allowing it to forward uplinks to ThingsEye. ThingsEye is an IoT platform used for visualizing and analyzing sensor data. You can also send downlinks from ThingsEye (via The Things Stack) to the LDS02.
Xiaoling 1.2 211
212
Xiaoling 129.2 213 [[image:LDS02-tts.jpg||height="333" width="1245"]]
Xiaoling 1.2 214
Dilisi S 76.1 215
Xiaoling 129.2 216 === 4.2.1 Prerequisites ===
Dilisi S 76.1 217
Xiaoling 1.2 218
Xiaoling 9.6 219 (((
Dilisi S 78.1 220 * The LDS02 is installed with the magnet on the door and the sensor part on the door frame to detect open/close events and send the status to the LoRaWAN server. The LDS02 will uplink two types of messages to the server:
221 ** A keep-alive message, which is sent once per day.
222 ** A door event message when a door is opened or closed ([[Alarm event can be disabled>>||anchor="H7.3CanIdisableuplinkforeacheventtosavebatterylife3F"]])
223 * The Things Stack community network coverage, or private LoRaWAN Network Coverage with any The Things Stack deployment plan.
Xiaoling 9.6 224 )))
Xiaoling 1.2 225
226
Dilisi S 90.1 227 ==== 4.2.1.1 Setting up ====
Xiaoling 1.2 228
Xiaoling 129.2 229
Dilisi S 90.1 230 * Sign up for a free account with [[The Things Stack Sandbox>>url:https://eu1.cloud.thethings.network]] if you do not have one yet.
Dilisi S 112.1 231 * Log in to your **The Things Stack** account.
232 * Create an **application** with The Things Stack if you do not have one yet.
233 ** On the left navigation, click **Applications**.
234 ** Then click **+ Add Application** button.
Dilisi S 90.1 235
Xiaoling 129.2 236 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LWL02%20-%20LoRaWAN%20Door%20Sensor%20User%20Manual/WebHome/lwl02-4.png?rev=1.1||alt="lwl02-4.png" height="768" width="1230"]]
Dilisi S 112.1 237
238
239 * On the **Create Application **page, configure the following:
240 ** **Application ID**: Provide a unique identification for your application within The Things Stack.
241 ** **Application name**: (optional) Provide a descriptive name.
242 ** **Description**: (optional) Provide a description.
243 * Click on **Create application **button.
244
Xiaoling 129.2 245 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LWL02%20-%20LoRaWAN%20Door%20Sensor%20User%20Manual/WebHome/lwl02-5.png?rev=1.1||alt="lwl02-5.png" height="802" width="1284"]]
Dilisi S 112.1 246
247
248
Dilisi S 90.1 249 * Go to your application's page and click on the **End devices** in the left menu.
250 * On the End devices page, click on **+ Register end device**.
Xiaoling 1.2 251
Xiaoling 129.2 252 [[image:lds02-step-5.png||height="819" width="1311"]]
Xiaoling 1.2 253
Dilisi S 90.1 254 * Two registration options are available:
255 ** Using the LoRaWAN Device Repositoty
256 ** Manual registration
Xiaoling 1.2 257
Dilisi S 90.1 258 ==== 4.2.1.2 Using the LoRaWAN Device Repository ====
Xiaoling 1.2 259
Xiaoling 129.2 260
Dilisi S 90.1 261 * On the **Register end device** page:
262 ** Select the option **Select the end device in the LoRaWAN Device Repository **under **Input method**.
263 ** Select the **End device brand**, **Model**, **Hardware version**, **Firmware version**, and **Profile (Region)** from the respective dropdown lists.
264 *** **End device brand**: Dragino Technology Co., Limited
265 *** **Model**: LDS02 - Door Sensor
266 *** **Hardware ver**: Unknown
267 *** **Firmware ver**: 1.6
268 *** **Profile (Region)**: Select the region that matches your device.
269 ** Select the **Frequency plan** that matches your device from the **Frequency plan** dropdown list.
270 ** Enter the **AppEUI** in the **JoinEUI** field and click the **Confirm** button. If The Things Stack accepts the JoinEUI you provided, it will display the message 'This end device can be registered on the network.
Xiaoling 47.16 271
Xiaoling 129.2 272 [[image:lds02-step-2.png||height="812" width="1300"]]
Xiaoling 40.2 273
Xiaoling 50.2 274
Xiaoling 1.2 275
Dilisi S 90.1 276 * In the **DevEUI** field, enter the **DevEUI**.
277 * In the **AppKey** field, enter the **AppKey.**
278 * In the **End device ID** field, enter a unique name for your LDS02 within this application.
279 * Under **After registration**, select the **View registered end device** option.
280 * Click **Register end device** button.
Xiaoling 1.2 281
Xiaoling 129.2 282 [[image:lds02-step-3.png||height="797" width="1276"]]
Dilisi S 90.1 283
284
285 * You will be navigated to the Device overview page.
286
Xiaoling 129.2 287 [[image:lds02-step-4.png||height="817" width="1308"]]
Dilisi S 90.1 288
289
290 * Click on the Live Data tab and then **[[Power on>>||anchor="H2.PowerONLDS02"]]** the LDS02. It will first join The Things Stack network server. You can confirm this by looking for the Join-request and Join-accept messages. After successfully joining the network, the LDS02 will start sending uplink messages to The Things Stack, and you can see them in the Live Data panel.
291
Xiaoling 43.2 292 [[image:1654681390551-993.png]]
Xiaoling 1.2 293
Xiaoling 40.2 294
Xiaoling 14.5 295 == 4.3 Uplink Payload ==
296
Mengting Qiu 119.1 297 === 4.3.1 Sensor value, Uplink via FPORT~=10 ===
Xiaoling 26.11 298
Mengting Qiu 119.1 299
300 The data is sent in the following cases:
301
Mengting Qiu 123.1 302 * TDC (Transmit Time Interval-Keep Alive Interval), the default TDC is 24 hours, so this data is automatically sent every 24 hours.
Mengting Qiu 119.1 303 * This data is sent each time the door is opened or closed, [[AT+DISALARM=0(default)>>||anchor="H7.3CanIdisableuplinksforeacheventtosavebatterylife3F
304 "]].
305
Dilisi S 80.1 306 The uplink payload is a total of 10 bytes.
Xiaoling 1.2 307
Xiaoling 69.7 308 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:480px" %)
Dilisi S 80.1 309 |=(% style="width: 80px;background-color:#4F81BD;color:white" %)**Size (bytes)**|=(% style="width: 80px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 80px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 80px;background-color:#4F81BD;color:white" %)**3**|=(% style="width: 80px;background-color:#4F81BD;color:white" %)**3**|=(% style="width: 80px;background-color:#4F81BD;color:white" %)**1**
310 |Value|Door State & BAT|(((
Xiaoling 129.3 311 MOD Always:0x01
Xiaoling 43.2 312 )))|Total open door events|(((
313 Last door open
314 duration (unit: min)
Bei Jinggeng 113.1 315 )))|(((
Xiaoling 129.3 316 [[Alarm>>||anchor="H4.6AlarmBaseonTimeout"]] (Only used in LWL02) Always:0x00
Bei Jinggeng 113.1 317 )))
318
Xiaoling 16.2 319 **Example:**
Xiaoling 1.2 320
Mengting Qiu 119.1 321 [[image:image-20250211113735-1.png||height="351" width="1090"]]
Xiaoling 1.2 322
323
Mengting Qiu 119.1 324 [[image:image-20250211113814-2.png]]
325
Xiaoling 62.2 326 (((
Dilisi S 80.1 327
Xiaoling 43.2 328
Dilisi S 80.1 329 This example uses the payload decoder in The Things Stack V3: [[https:~~/~~/github.com/dragino/dragino-end-node-decoder/tree/main/LDS02>>https://github.com/dragino/dragino-end-node-decoder/tree/main/LDS02]]
Bei Jinggeng 62.1 330
Mengting Qiu 119.1 331 (% style="color:blue" %)**Battery Info**
Dilisi S 80.1 332
333 Check the battery voltage:
Bei Jinggeng 62.1 334
Dilisi S 80.1 335 Example 1: 0x0B88&3FFF = 2952mV
Bei Jinggeng 62.1 336
Dilisi S 80.1 337 Example 2: 0xD152&3FFF = 4434mV
Bei Jinggeng 62.1 338
Xiaoling 62.2 339
Mengting Qiu 119.1 340 (% class="wikigeneratedid" id="H4.3.2Status" %)
341 (% style="color:blue" %)**Status**
Bei Jinggeng 62.1 342
Dilisi S 80.1 343 Check the door state:
Bei Jinggeng 62.1 344
345 **Example**:
346
Dilisi S 80.1 347 If the payload is: **0B**:  (0000 1011&1000 0000== 0), **DOOR_OPEN_STATUS** is 0(**CLOSE**)
Bei Jinggeng 62.1 348
Dilisi S 80.1 349 If the payload is: **D1**: (1101 0001&1000 0000== 1), **DOOR_OPEN_STATUS** is 1(**OPEN**)
Bei Jinggeng 62.1 350
Xiaoling 62.2 351
Mengting Qiu 119.1 352 (% style="color:blue" %)**MOD**
Bei Jinggeng 62.1 353
Dilisi S 80.1 354 Check the working mode (MOD):
Bei Jinggeng 62.1 355
356 **Example:**
357
Dilisi S 80.1 358 If the payload is: 01, the MOD is 1.
Bei Jinggeng 62.1 359
360
Mengting Qiu 119.1 361 (% style="color:blue" %)**Total door open events**
Bei Jinggeng 62.1 362
Dilisi S 81.1 363 Get the total number of door open events:
Bei Jinggeng 62.1 364
365 **Example**:
366
Dilisi S 81.1 367 If payload is: **00 00 93, **the total is 147 events.
Bei Jinggeng 62.1 368
Dilisi S 81.1 369 If payload is: **00 00 00, **the total is 0 events.
Bei Jinggeng 62.1 370
371
Mengting Qiu 119.1 372 (% style="color:blue" %)**Last door open duration(unit:min)**
Bei Jinggeng 62.1 373
Dilisi S 80.1 374 Get the last door open duration:
Bei Jinggeng 62.1 375
376 **Example:**
377
Dilisi S 81.1 378 If the payload is: **00 00 25, **the last door open duration is 37 minutes.
Bei Jinggeng 62.1 379
Dilisi S 81.1 380 If payload is: **00 00 01,** the last door open duration is 1 minute.
Bei Jinggeng 62.1 381
382
Mengting Qiu 119.1 383 (% style="color:blue" %)**Alarm(Only used in LWL02) Always:0x00**
Bei Jinggeng 62.1 384
Dilisi S 80.1 385 Get alarm status.
Bei Jinggeng 62.1 386
387 **Example:**
388
Dilisi S 81.1 389 If the payload is: 01:  (0001 & 0001== 1), the alarm status is 1
Bei Jinggeng 62.1 390
Dilisi S 81.1 391 If the payload is: 00:  (0000 & 0001== 0), the alarm status is 0
Bei Jinggeng 62.1 392
Mengting Qiu 119.1 393
Mengting Qiu 122.1 394 === 4.3.2 EDC mode value, Uplink via FPORT~=7 ===
Mengting Qiu 119.1 395
396
Mengting Qiu 122.1 397 When **[[EDC>>||anchor="H4.7A0EDCMode28Sincefirmwarev1.8.229"]]** is enabled, LDS02 will send this data.
Mengting Qiu 119.1 398
Mengting Qiu 122.1 399 The uplink payload is a total of 5 bytes.
Mengting Qiu 119.1 400
Xiaoling 129.4 401 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:320px" %)
Mengting Qiu 131.1 402 |=(% style="width: 50px;background-color:#4F81BD;color:white" %)**byte**|=(% style="width: 136px; background-color: rgb(79, 129, 189); color: white;" %)**2**|=(% style="width: 114px; background-color: rgb(79, 129, 189); color: white;" %)**3**
403 |Value|(% style="width:136px" %)EDC_MOD & BAT|(% style="width:114px" %)(((
404 Times
405 )))
Mengting Qiu 119.1 406
Mengting Qiu 129.1 407 **Example:**
408
409 * (((
410 AT+EDC=1,10
Mengting Qiu 122.1 411 )))
Mengting Qiu 119.1 412
Mengting Qiu 129.1 413 [[image:image-20250211162026-2.png||height="275" width="944"]]
Mengting Qiu 122.1 414
415 [[image:image-20250211120039-4.png]]
416
Mengting Qiu 129.1 417 * AT+EDC=0,20
418
419 [[image:image-20250211161956-1.png||height="307" width="958"]]
420
421 [[image:image-20250211162046-3.png]]
422
Mengting Qiu 123.1 423 (% style="color:blue" %)**Battery Info**
Mengting Qiu 122.1 424
Mengting Qiu 123.1 425 Check the battery voltage:
Mengting Qiu 122.1 426
Mengting Qiu 124.1 427 Ex1: (bytes[0]<<8 | bytes[1])&0x3FFF = 0x8C60&3FFF = 3168mV
Mengting Qiu 123.1 428
Mengting Qiu 124.1 429 Ex2: (bytes[0]<<8 | bytes[1])&0x3FFF = 0xD152&3FFF = 4434mV
Mengting Qiu 123.1 430
431
432 (% style="color:blue" %)**EDC_MOD**
433
434 This field is used to indicate whether the EDC mode packet sending condition is dependent on the number of door open accumulations or on the number of door close accumulations.
435
Mengting Qiu 129.1 436 Ex1: bytes[0]&0x80 = 8C & 0x80 = **1**000 0000(BIN), "OPEN".
Mengting Qiu 123.1 437
Mengting Qiu 129.1 438 Ex2: bytes[0]&0x80 = 0C & 0x80 = **0**000 0000(BIN), "CLOSE".
Mengting Qiu 124.1 439
440
Mengting Qiu 123.1 441 (% style="color:blue" %)**Times**
442
443 This field is used to display the number of open/closed events.
444
445 Ex1: 0x00000A(H) =10
446
447 Ex2: 0x000014(H) =20
448
Xiaoling 50.2 449
Xiaoling 16.3 450 )))
Xiaoling 1.2 451
Xiaoling 16.4 452 == 4.4 Downlink Payload ==
Xiaoling 1.2 453
Xiaoling 26.9 454
Xiaoling 69.7 455 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:505px" %)
Dilisi S 83.1 456 |=(% style="width: 182px;background-color:#4F81BD;color:white" %)**Downlink Control Type**|=(% style="width: 96px;background-color:#4F81BD;color:white" %)**Type Code**|=(% style="width: 227px;background-color:#4F81BD;color:white" %)**Downlink Payload Size (bytes)**
Xiaoling 50.8 457 |(% style="width:180px" %)TDC (Transmit Time Interval—Keep Alive Interval)|(% style="width:94px" %)0x01|(% style="width:226px" %)4
458 |(% style="width:180px" %)RESET|(% style="width:94px" %)0x04|(% style="width:226px" %)2
459 |(% style="width:180px" %)[[Set confirmed mode>>||anchor="HTypeCode0x05"]]|(% style="width:94px" %)0x05|(% style="width:226px" %)2
460 |(% style="width:180px" %)[[Clear Counting>>||anchor="HTypeCode0xA6"]]|(% style="width:94px" %)0xA6|(% style="width:226px" %)2
461 |(% style="width:180px" %)[[Enable/Disable Alarm>>||anchor="HTypeCode0xA7"]]|(% style="width:94px" %)0xA7|(% style="width:226px" %)2
462 |(% style="width:180px" %)[[Control ADR/DR>>||anchor="HTypeCode0xA8"]]|(% style="width:94px" %)0xA8|(% style="width:226px" %)3
463 |(% style="width:180px" %)[[Set Alarm Timeout>>||anchor="HTypeCode0xA9"]]|(% style="width:94px" %)0xA9|(% style="width:226px" %)4
Xiaoling 1.2 464
Dilisi S 83.1 465 The following image illustrates how to send a downlink payload from The Things Stack.
466
Xiaoling 17.2 467 [[image:1654673412319-976.png]]
Xiaoling 1.2 468
469
Xiaoling 69.8 470 === (% style="color:#037691" %)**Type Code 0x01**(%%) ===
Xiaoling 1.2 471
Dilisi S 83.1 472 If the payload is **0100003C**, it means controlling the LDS02’s Keep Alive interval to **0x00003C = 60 seconds (s)**.
Xiaoling 1.2 473
474
Xiaoling 69.8 475 === (% style="color:#037691" %)**Type Code 0x04**(%%) ===
Xiaoling 1.2 476
Dilisi S 83.1 477 If the payload is **0x04FF**, it will reset the LDS02.
Xiaoling 1.2 478
479
Xiaoling 69.8 480 === (% style="color:#037691" %)**Type Code 0x05**(%%) ===
Xiaoling 1.2 481
Xiaoling 47.11 482 (((
Dilisi S 83.1 483 **0x05 00**: Set uplink to LoRaWAN unconfirmed mode
Xiaoling 47.11 484 )))
Xiaoling 1.2 485
Xiaoling 47.11 486 (((
Dilisi S 83.1 487 **0x05 01**: Set uplink to LoRaWAN confirmed mode
Xiaoling 47.11 488 )))
Xiaoling 1.2 489
490
Xiaoling 69.8 491 === (% style="color:#037691" %)**Type Code 0xA6**(%%) ===
Xiaoling 1.2 492
Xiaoling 47.11 493 (((
Dilisi S 83.1 494 **Example:** 0xA601 – Clear Counting
495 For the LDS02: Resets both the count number and time.
Xiaoling 47.11 496 )))
Xiaoling 1.2 497
498
Xiaoling 69.8 499 === (% style="color:#037691" %)**Type Code 0xA7**(%%) ===
Xiaoling 1.2 500
Xiaoling 47.11 501 (((
Dilisi S 83.1 502 **0xA701**: Equivalent to AT+DISALARM=1
Xiaoling 47.11 503 )))
Xiaoling 1.2 504
Xiaoling 47.11 505 (((
Dilisi S 83.1 506 **0xA700**: Equivalent to AT+DISALARM=0
Xiaoling 47.11 507 )))
Xiaoling 1.2 508
509
Xiaoling 69.8 510 === (% style="color:#037691" %)**Type Code 0xA8**(%%) ===
Xiaoling 1.2 511
Xiaoling 47.11 512 (((
Dilisi S 83.1 513 **Format:** 0xA8 aa bb
Xiaoling 1.2 514
Dilisi S 83.1 515 * **aa**: 1 – Enable ADR; 0 – Disable ADR (same as the AT+CADR command)
516 * **bb**: Set DR (same as AT+CDATARATE; only valid after ADR=0)
Xiaoling 1.2 517
Dilisi S 83.1 518 **Example:** 0xA80001 – Set ADR=0 and DR=1
Xiaoling 47.11 519 )))
Xiaoling 1.2 520
521
Xiaoling 69.8 522 === (% style="color:#037691" %)**Type Code 0xA9**(%%) ===
Xiaoling 1.2 523
Dilisi S 83.1 524 See, [[Alarm Base Timeout>>||anchor="H4.6AlarmBaseonTimeout"]] for details.
Xiaoling 1.2 525
526
Dilisi S 93.1 527 == 4.5 Integrate with IoT Platforms ==
Xiaoling 1.2 528
Xiaoling 50.2 529
Dilisi S 93.1 530 The Things Stack can be integrated with many IoT platforms, including ThingsEye and Datacake, for visualizing and analyzing data coming from the LDS02. Most of these IoT platforms also support sending downlinks to the LDS02.
531
532 === 4.5.1 Integrate with ThingsEye ===
533
534
535 The Things Stack application supports integration with ThingsEye.io. Once integrated, ThingsEye.io acts as an MQTT client for The Things Stack MQTT broker, allowing it to subscribe to upstream traffic and publish downlink traffic.
536
537
538 ==== 4.5.1.1 Configuring The Things Stack ====
539
540 We use The Things Stack Sandbox in this example:
541
542 * In **The Things Stack Sandbox**, go to the **Application **for the LDS02 you added.
543 * Select **MQTT** under **Integrations** in the left menu.
544 * In the **Connection information **section, under **Connection credentials**, The Things Stack displays an auto-generated **username**. You can use it or provide a new one.
545 * Click the **Generate new API key** button to generate a password. You can view it by clicking on the **visibility toggle/eye** icon. The API key works as the password.
546
547 {{info}}
548 The username and  password (API key) you created here are required in the next section.
549 {{/info}}
550
551
Xiaoling 130.1 552 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/tts-mqtt-integration.png?rev=1.1||alt="tts-mqtt-integration.png" height="845" width="1353"]]
Dilisi S 93.1 553
554
555 ==== 4.5.1.2 Configuring ThingsEye.io ====
556
557 The ThingsEye.io IoT platform is not open for self-registration at the moment. If you are interested in testing the platform, please send your project information to admin@thingseye.io, and we will create an account for you.
558
559 * Login to your [[ThingsEye.io >>url:https://thingseye.io]]account.
560 * Under the **Integrations center**, click **Integrations**.
561 * Click the **Add integration** button (the button with the **+** symbol).
562
Xiaoling 130.1 563 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/thingseye-io-step-1.png?rev=1.2||alt="thingseye-io-step-1.png" height="845" width="1353"]]
Dilisi S 93.1 564
565
566 On the **Add integration** window, configure the following:
567
568 **Basic settings:**
569
570 * Select **The Things Stack Community** from the **Integration type** list.
571 * Enter a suitable name for your integration in the **Name **text** **box or keep the default name.
572 * Ensure the following options are turned on.
573 ** Enable integration
574 ** Debug mode
575 ** Allow creating devices or assets
576 * Click the **Next** button. you will be navigated to the **Uplink data converter** tab.
577
Xiaoling 130.1 578 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/thingseye-io-step-2.png?rev=1.1||alt="thingseye-io-step-2.png" height="842" width="1348"]]
Dilisi S 93.1 579
580
581 **Uplink data converter:**
582
583 * Click the **Create new** button if it is not selected by default.
584 * Enter a suitable name for the uplink data converter in the **Name **text** **box or keep the default name.
585 * Click the **JavaScript** button.
586 * Paste the uplink decoder function into the text area (first, delete the default code). The demo uplink decoder function can be found [[here>>url:https://raw.githubusercontent.com/ThingsEye-io/te-platform/refs/heads/main/Data%20Converters/The_Things_Network_MQTT_Uplink_Converter.js]].
587 * Click the **Next** button. You will be navigated to the **Downlink data converter **tab.
588
Xiaoling 130.1 589 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/thingseye-io-step-3.png?rev=1.1||alt="thingseye-io-step-3.png" height="842" width="1348"]]
Dilisi S 93.1 590
591
592 **Downlink data converter (this is an optional step):**
593
594 * Click the **Create new** button if it is not selected by default.
595 * Enter a suitable name for the downlink data converter in the **Name **text** **box or keep the default name.
596 * Click the **JavaScript** button.
597 * Paste the downlink decoder function into the text area (first, delete the default code). The demo downlink decoder function can be found [[here>>url:https://raw.githubusercontent.com/ThingsEye-io/te-platform/refs/heads/main/Data%20Converters/The_Things_Network_MQTT_Downlink_Converter.js]].
598 * Click the **Next** button. You will be navigated to the **Connection** tab.
599
Xiaoling 130.1 600 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/thingseye-io-step-4.png?rev=1.1||alt="thingseye-io-step-4.png" height="842" width="1348"]]
Dilisi S 93.1 601
602
603 **Connection:**
604
605 * Choose **Region** from the **Host type**.
606 * Enter the **cluster** of your **The Things Stack** in the **Region** textbox. You can find the cluster in the url (e.g., https:~/~/**eu1**.cloud.thethings.network/...).
Dilisi S 111.1 607 * Enter the **Username** and **Password** of the MQTT integration in the **Credentials** section. The **username **and **password **can be found on the MQTT integration page of your The Things Stack account (see **4.5.1.1 Configuring The Things Stack**).
Dilisi S 93.1 608 * Click the **Check connection** button to test the connection. If the connection is successful, you will see the message saying **Connected**.
609
610 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/message-1.png?rev=1.1||alt="message-1.png"]]
611
612
613 * Click the **Add** button.
614
Xiaoling 130.1 615 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/thingseye-io-step-5.png?rev=1.1||alt="thingseye-io-step-5.png" height="835" width="1337"]]
Dilisi S 93.1 616
617
618 Your integration has been added to the** Integrations** list and will be displayed on the **Integrations** page. Check whether the status is shown as **Active**. If not, review your configuration settings and correct any errors.
619
620
Xiaoling 130.1 621 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/thingseye.io_integrationsCenter_integrations.png?rev=1.2||alt="thingseye.io_integrationsCenter_integrations.png" height="916" width="1335"]]
Dilisi S 93.1 622
623
624 ==== 4.5.1.3 Viewing integration details ====
625
626
627 Click on your integration from the list. The **Integration details** window will appear with the **Details **tab selected. The **Details **tab shows all the settings you have provided for this integration.
628
629
Xiaoling 130.1 630 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/integration-details.png?rev=1.1||alt="integration-details.png" height="917" width="1336"]]
Dilisi S 93.1 631
632
633 If you want to edit the settings you have provided, click on the **Toggle edit mode** button. Once you have done click on the **Apply changes **button.
634
635 {{info}}
636 See also [[ThingsEye documentation>>url:https://wiki.thingseye.io/xwiki/bin/view/Main/]].
637 {{/info}}
638
639
640 ==== 4.5.1.4 Viewing events ====
641
642
Dilisi S 111.1 643 The **Events **tab displays all the uplink messages from the LDS02.
Dilisi S 93.1 644
645 * Select **Debug **from the **Event type** dropdown.
646 * Select the** time frame** from the **time window**.
647
Xiaoling 130.1 648 [[image:https://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/WebHome/thingseye-events.png?rev=1.1||alt="thingseye-events.png" height="916" width="1335"]]
Dilisi S 93.1 649
650
651 * To view the **JSON payload** of a message, click on the **three dots (...)** in the **Message** column of the desired message.
652
Xiaoling 130.1 653 [[image:lds02-thingseye-payload.png||height="621" width="1335"]]
Dilisi S 93.1 654
655
656 ==== 4.5.1.5 Deleting an integration ====
657
658
659 If you want to delete an integration, click the **Delete integration** button on the Integrations page.
660
661
662 ==== 4.5.1.6 Viewing sensor data on a dashboard ====
663
664
Dilisi S 111.1 665 You can create a dashboard with ThingsEye to visualize the sensor data coming from the LDS02. The following image shows a dashboard created for the LDS02. See **Creating a dashboard** in ThingsEye documentation for more information.
Dilisi S 93.1 666
667
Xiaoling 130.1 668 [[image:lds02-thingseye-dashboard.png||height="692" width="1323"]]
Dilisi S 93.1 669
670
671 === 4.5.2 Integrate with Datacake ===
672
673
Xiaoling 21.5 674 (((
Dilisi S 94.1 675 Datacake is a multi-purpose, low-code IoT platform that allows you to integrate sensor data for visualization and analysis. With The Things Stack, you can easily create an integration with Datacake to forward your sensor data to the Datacake IoT platform.
676
677
678 ==== 4.5.2.1 Prerequisites ====
679
680 * The LDS02 device is joined to The Things Stack.
681 * Uplinks from the LDS02 device are being received by The Things Stack.
682 * A Datacake account (a free account is sufficient for this example).
683
Dilisi S 108.1 684 ==== 4.5.2.2 Procedure ====
685
686
687 * In the Datacake workspace, on the left navigation, click **Account Settings**.
688 * Then click **API Token**.
689 * In the **API Token** tab, click the **Copy** button to copy the API token. You will need this API token when creating a webhook with The Things Stack.
690
Xiaoling 130.1 691 [[image:datacake-1.png||height="816" width="1306"]]
Dilisi S 108.1 692
693
Xiaoling 21.5 694 )))
Xiaoling 1.2 695
Xiaoling 47.12 696 (((
Dilisi S 94.1 697 To configure the Application to forward data to Datacake you will need to add integration. To add the Datacake integration, perform the following steps:
Xiaoling 1.2 698
Dilisi S 94.1 699 * In The Things Stack console, on the left navigation,
700 ** First select your **application** (**Applications -> <your application>**)
701 ** Then select **Integrations -> Webhooks**
Dilisi S 108.1 702 * On the **Webhooks** page, click + **Add Webhook** button.
703
Xiaoling 130.1 704 [[image:tts-webhook-1.png||height="817" width="1308"]]
Dilisi S 108.1 705
706
Dilisi S 94.1 707 * On the **Choose webhook template** page, select **Datacake**.
Dilisi S 108.1 708 )))
709
710
Xiaoling 130.1 711 [[image:tts-webhook-2.png||height="822" width="1316"]]
Dilisi S 108.1 712
713
Dilisi S 94.1 714 * On the Setup webhook for Datacake page,
715 ** **Webhook ID**: provide an unique identifier for this webhook
Dilisi S 108.1 716 ** **Token**: Paste the **Datacake API Token** when you copied from the Datacake **Account Settings**.
717 * Click on the **Create Datacake webhook** button.
Xiaoling 1.2 718
Xiaoling 130.1 719 [[image:tts-webhook-3.png||height="819" width="1311"]]
Xiaoling 1.2 720
721
Dilisi S 108.1 722 Now the Webhook is created and displayed on the Webhooks page.
Xiaoling 1.2 723
Xiaoling 130.1 724 [[image:tts-webhook-4.png||height="821" width="1314"]]
Xiaoling 1.2 725
726
Dilisi S 108.1 727 * In the Datacake workspace, on the left navigation, click **Devices**.
728 * On the Devices page, click **+Add Device**.
Xiaoling 1.2 729
Xiaoling 130.1 730 [[image:datacake-2.png||height="820" width="1313"]]
Xiaoling 1.2 731
732
Dilisi S 108.1 733 * On the **Add Device** window, click **LoRaWAN** option.
734 * Click on the **Next** button.
Xiaoling 1.2 735
Xiaoling 130.1 736 [[image:datacake-3.png||height="823" width="1318"]]
Dilisi S 108.1 737
738
739 * On the **Add LoRaWAN Device** window, **STEP 1**, click on **New Product from template** option.
740 * Under **Device Template**, search **lds02**. Then click on **Dragino LDS02 Door Sensor** option.
741 * Click on the **Next** button.
742
Xiaoling 130.1 743 [[image:datacake-4.png||height="827" width="1324"]]
Dilisi S 108.1 744
745
746 * On the **Add LoRaWAN Device** window, **STEP 2**, under **Network Server**, click on **The Things Stack V3** option.
747 * Click on the **Next** button.
748
Xiaoling 130.1 749 [[image:datacake-5.png||height="831" width="1330"]]
Dilisi S 108.1 750
751
752 * On the **Add LoRaWAN Device** window, **STEP 3**, under **Add Devices**, click **Manual** tab.
753 * In the **DEVEUI** textbox, enter your LDS02's 8 bytes **DevEUI**.
754 * In the **NAME** textbox, enter a suitable name to identify your LDS02.
755 * Click on the **Next** button.
756
Xiaoling 130.1 757 [[image:datacake-6.png||height="830" width="1329"]]
Dilisi S 108.1 758
759
760 * On the **Add LoRaWAN Device** window, **STEP 4**, select **Individual device plans** tab.
761 * Click **Free** option.
762 * Click on the **Add 1 Device** button.
763
Xiaoling 130.1 764 [[image:datacake-7.png||height="831" width="1330"]]
Dilisi S 108.1 765
766
767 * The device is now added to the Datacake workspace and is ready to receive uplinks from the LDS02 via The Things Stack.
768 * In the **DEVICE** column, click **lds02**.
769
Xiaoling 130.1 770 [[image:datacake-8.png||height="824" width="1319"]]
Dilisi S 108.1 771
772
773 You can see the **pre-built dashboard** from our template, displaying the LDS02's sensor data on various **widgets**.
774
Xiaoling 130.1 775 [[image:datacake-9.png||height="826" width="1322"]]
Dilisi S 108.1 776
777
Dilisi S 83.1 778 == 4.6 Alarm Based on Timeout ==
Xiaoling 1.2 779
Xiaoling 50.2 780
Xiaoling 23.4 781 (((
Dilisi S 83.1 782 The LDS02 can monitor the timeout for a status change. This feature can be used to monitor events such as a fridge being left open for too long, etc. You can configure this feature using either AT commands or a downlink command:
Xiaoling 23.4 783 )))
Xiaoling 1.2 784
Xiaoling 23.4 785 (((
Dilisi S 83.1 786 (% style="color:blue" %)**Using AT Commands**(%%)**:**
Xiaoling 23.4 787 )))
Xiaoling 1.2 788
Xiaoling 23.4 789 (((
Dilisi S 83.1 790
Xiaoling 1.2 791
Dilisi S 83.1 792 * **AT+TTRIG=1,30 ~-~-> **When the status changes from closed to open, and the device remains in the open status for more than 30 seconds, the LDS02 will send an uplink packet. The Alarm bit (the lowest bit of the 10th byte of the payload) in this uplink packet is set to 1.
793 * **AT+TTRIG=0,0 ~-~-> **Default value, disables the timeout alarm.
Xiaoling 23.4 794 )))
Xiaoling 1.2 795
Xiaoling 23.4 796 (((
Dilisi S 83.1 797 (% style="color:blue" %)**Using Downlink Commands**(%%)**:**
Xiaoling 23.4 798 )))
Xiaoling 1.2 799
Xiaoling 43.8 800 (((
Dilisi S 83.1 801 **Command:** 0xA9 aa bb cc
Xiaoling 1.2 802
Dilisi S 83.1 803 * **A9:** Command Type Code
804 * **aa:** Status to be monitored
805 * **bb cc:** Timeout
Xiaoling 1.2 806
Dilisi S 83.1 807 If the user sends **0xA9 01 00 1E**, this is equivalent to **AT+TTRIG=1,30**.
Xiaoling 1.2 808
Dilisi S 83.1 809 Or
Xiaoling 1.2 810
Dilisi S 83.1 811 **0xA9 00 00 00**, this is equivalent to **AT+TTRIG=0,0**, which disables the timeout alarm.
Xiaoling 23.4 812 )))
Xiaoling 1.2 813
814
Mengting Qiu 114.1 815 == 4.7 EDC Mode(Since firmware v1.8.2) ==
Xiaoling 1.2 816
Xiaoling 25.9 817
Mengting Qiu 114.1 818 Feature: Set EDC mode, when the cumulative number of opening/closing reaches the set count value, LDS02 will send the packet.
819
820 (% style="color:blue" %)**AT Command: AT+EDC**
821
822 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %)
Xiaoling 129.6 823 |=(% style="width: 138px; background-color: rgb(79, 129, 189); color: white;" %)**Command Example**|=(% style="width: 196px; background-color: rgb(79, 129, 189); color: white;" %)**Function**|=(% style="width: 176px; background-color: rgb(79, 129, 189); color: white;" %)**Response/Parameters**
Mengting Qiu 114.1 824 |(% style="width:126px" %)AT+EDC?|(% style="width:196px" %)Show current Settings|(% style="width:176px" %)(((
825 0,0 (default)
826 OK
827 )))
828 |(% colspan="1" rowspan="2" style="width:126px" %)(((
829
830
831
832
833 AT+EDC=aa,bb
834 )))|(% style="width:196px" %)aa: Set the open/close cumulative packet sending mode|(% style="width:176px" %)(((
835 0: Set the close cumulative packet sending mode
836 1: Set the open cumulative packet sending mode
837 )))
838 |(% style="width:196px" %)bb: Set the cumulative count and send packets when the cumulative count is reached|(% style="width:176px" %)
839
840 (% style="color:blue" %)**Downlink Command: 0X02**
841
842 Format: Command Code (0x02) followed by 4 bytes.
843
Mengting Qiu 129.1 844 Example:
845
Xiaoling 130.1 846 * Downlink paylaod: 02 01 00 00 0A  ~/~/ AT+EDC=1,10  The LDS02 will send a packet for every 10 increases in the open_count.
847 * Downlink paylaod: 02 00 00 00 14  ~/~/ AT+EDC=0,20  The LDS02 will send a packet for every 20 increases in the close_count.
Mengting Qiu 129.1 848
Mengting Qiu 116.1 849 (% style="color:red" %)**Note: To use the EDC mode, you need to set [[AT+DISALARM=1(downlink payload: A701)>>||anchor="H7.3CanIdisableuplinksforeacheventtosavebatterylife3F
850 "]], so that LDS02 will send packets only when the TDC time and cumulative count reach the set value.**
Mengting Qiu 114.1 851
852
853 == 4.8 Set count value(Since firmware v1.8.2) ==
854
855
856 Feature: Set the initial count value.
857
858 (% style="color:blue" %)**AT Command: AT+SETCNT**
859
860 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:500px" %)
Xiaoling 129.12 861 |=(% style="width: 157px; background-color: rgb(79, 129, 189); color: white;" %)**Command Example**|=(% style="width: 243px; background-color: rgb(79, 129, 189); color: white;" %)**Function**|=(% style="width: 100px; background-color: rgb(79, 129, 189); color: white;" %)**Response**
862 |(% style="width:154px" %)AT+SETCNT=100|(% style="width:241px" %)Initialize the count value to 100.|(% style="width:100px" %)(((
Mengting Qiu 114.1 863 OK
864 )))
865
866 (% style="color:blue" %)**Downlink Command: 0XAA**
867
Mengting Qiu 129.1 868 (% style="color:#037691" %)**For normal mode: 0xAA xx xx xx**
Mengting Qiu 114.1 869
Mengting Qiu 129.1 870 0xAA is the function code, and the next 3 bytes are the count value to be initialized.
Mengting Qiu 114.1 871
Mengting Qiu 129.1 872 * Example: Downlink Payload: AA 00 00 00 **~-~-->**  AT+SETCNT=0  Set the open door count to 0.
Mengting Qiu 114.1 873
Mengting Qiu 129.1 874 (% style="color:#037691" %)**For EDC mode: 0xAA aa xx xx xx**
875
876 0xAA is the function code. aa sets how the EDC mode is accumulated (0x01: open; 0x00: close). and the next 3 bytes are the count values to be initialized.
877
878 * Example 1: Downlink Payload: AA 01 00 00 0A  **~-~-->**  AT+SETCNT=10  Set the door open count to 10.
879 * Example 2: Downlink Payload: AA 00 00 00 14  **~-~-->**  AT+SETCNT=20  Set the door close count to 10.
880
Xiaoling 21.8 881 = 5. Battery & How to replace =
882
883 == 5.1 Battery Type and replace ==
884
Xiaoling 50.3 885
Xiaoling 22.3 886 (((
Dilisi S 83.1 887 The LDS02 is equipped with 2 x AAA LR03 batteries. If the batteries are running low (showing 2.1V on the platform), the user can buy generic AAA batteries and replace them.
Xiaoling 1.2 888
Xiaoling 48.3 889 (% style="color:red" %)**Note:**
Xiaoling 43.10 890
Xiaoling 130.1 891 1. The LDS02 doesn't have any screws; you can use a nail to open it from the middle.
Dilisi S 83.1 892 1. Make sure the direction is correct when installing the AAA batteries.
Xiaoling 22.3 893 )))
Xiaoling 1.2 894
Xiaoling 22.3 895 (((
Dilisi S 83.1 896 (% style="color:red" %)**Important Note: **(%%)Ensure you use new AAA LR03 batteries, and that the battery surfaces are not damaged.
Xiaoling 22.3 897 )))
Xiaoling 1.2 898
Xiaoling 22.3 899 (((
900
901 )))
Xiaoling 1.2 902
Xiaoling 22.3 903 (((
Dilisi S 83.1 904 Example of AAA LR03 battery:
Xiaoling 22.3 905 )))
Xiaoling 1.2 906
Xiaoling 22.2 907 [[image:1654675278044-307.png]]
Xiaoling 1.2 908
909
Dilisi S 83.1 910 == 5.2 Power Consumption Analysis ==
Xiaoling 22.4 911
Xiaoling 50.3 912
Xiaoling 26.6 913 (((
Dilisi S 83.1 914 Dragino battery-powered products all run in Low Power mode. Users can refer to the guidelines from this [[**link**>>https://www.dragino.com/downloads/downloads/LoRa_End_Node/Battery_Analyze/DRAGINO_Battery_Life_Guide.pdf]] to estimate battery life:
Xiaoling 26.6 915 )))
Xiaoling 1.2 916
917
Dilisi S 83.1 918 = 6. Use AT Commands =
Xiaoling 1.2 919
Dilisi S 83.1 920 == 6.1 Access AT Commands ==
Xiaoling 1.2 921
Xiaoling 22.4 922
Dilisi S 83.1 923 The LDS02 supports an AT command set. You can use a USB to TTL adapter to configure the LDS02 via AT commands, as shown below.
Xiaoling 50.3 924
Edwin Chen 53.1 925 [[image:image-20221226104705-1.png||height="572" width="872"]]
Xiaoling 1.2 926
927
Xiaoling 24.3 928 (((
Dilisi S 83.1 929 On the PC, the user needs to set the **serial tool** (such as [[PuTTY>>https://www.chiark.greenend.org.uk/~~sgtatham/putty/latest.html]] or SecureCRT) baud rate to **115200** to access the serial console of the LDS02. Below is the output for reference:
Xiaoling 24.3 930 )))
Xiaoling 1.2 931
Xiaoling 24.3 932 (((
Dilisi S 83.1 933 The AT command access password is (% style="color:red" %)**123456**.
Xiaoling 24.3 934 )))
Xiaoling 1.2 935
Xiaoling 24.2 936 [[image:1654675618022-630.png]]
Xiaoling 1.2 937
Xiaoling 44.3 938
Dilisi S 83.1 939 Each AT command needs to have an **ENTER** key pressed at the end before sending.
Xiaoling 1.2 940
Dilisi S 83.1 941 When entering the first command, the **RED LED** will turn on, and the user can now input AT commands. After entering all the required AT commands, input **AT+CLPM=1** to set the device to Low Power mode, and the **RED LED** will turn off.
Xiaoling 1.2 942
Dilisi S 83.1 943 More details can be found in the [[AT Command Manual>>http://www.dragino.com/downloads/index.php?dir=LoRa_End_Node/LDS01/]].
Xiaoling 1.2 944
945
Xiaoling 1.5 946 = 7. FAQ =
947
948 == 7.1 How to upgrade the image? ==
949
Xiaoling 50.3 950
Dilisi S 83.1 951 **~1. Connect the DAPLINK to the LDS02 as below:**
Xiaoling 64.2 952
Xiaoling 1.2 953
954
Xiaoling 64.2 955 **3.3V<~-~-~-~-->VDD**
Bei Jinggeng 64.1 956
Xiaoling 64.2 957 **CLK<~-~-~-~-~-~->CLK**
Bei Jinggeng 64.1 958
Edwin Chen 70.1 959 **DIO<~-~-~-~-~-~->DIO (SWD)**
Bei Jinggeng 64.1 960
Xiaoling 64.2 961 **GND<~-~-~-~-~-~->GND**
Bei Jinggeng 64.1 962
Dilisi S 83.1 963 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/Firmware%20Upgrade%20Instruction/WebHome/image-20220527084230-4.png?rev=1.1||alt="image-20220527084230-4.png"]]
Bei Jinggeng 64.1 964
Dilisi S 83.1 965 [[image:image-20230726175624-1.jpeg||height="565" width="753"]]
Bei Jinggeng 64.1 966
Dilisi S 83.1 967
968 **2. Install PSoC Programmer 3.27.1**
969
Bei Jinggeng 64.1 970 Download Link: [[PSoCProgrammer3.27.1>>url:https://www.dragino.com/downloads/index.php?dir=tools/]]
971
Dilisi S 83.1 972 Then, use PSoC Programmer to upgrade the firmware (**must use this version: PSoC Programmer 3.27.1**).
Bei Jinggeng 64.1 973
974 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/Firmware%20Upgrade%20Instruction/WebHome/image-20220527084537-7.png?rev=1.1||alt="image-20220527084537-7.png"]]
975
976
Xiaoling 64.2 977 **3. Download Sensor Firmware**
Bei Jinggeng 64.1 978
979 Downlink [[Firmware Location(same as LDS01)>>url:https://www.dropbox.com/sh/9j35mnsxnz0y3ye/AACj5gHGOURGEHCpj-E861Mua?dl=0]] to prepare the update.
980
981
Xiaoling 64.2 982 **4. Upgrade Firmware**
Bei Jinggeng 64.1 983
Dilisi S 83.1 984 * Open PSoC Programmer, then select the default configuration.
Bei Jinggeng 64.1 985
986 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/Firmware%20Upgrade%20Instruction/WebHome/image-20220527084612-8.png?rev=1.1||alt="image-20220527084612-8.png"]]
987
Dilisi S 83.1 988 * Click the file icon to select the software to be burned.
Bei Jinggeng 64.1 989
990 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/Firmware%20Upgrade%20Instruction/WebHome/image-20220527084705-9.png?rev=1.1||alt="image-20220527084705-9.png"]]
991
992 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/Firmware%20Upgrade%20Instruction/WebHome/image-20220527084739-10.png?width=1034&height=453&rev=1.1||alt="image-20220527084739-10.png" height="453" width="1034"]]
993
Dilisi S 83.1 994 * Click the download icon, and the progress bar, as shown in the figure below, will appear. When **PASS** appears, it indicates that the burning was successful.
Bei Jinggeng 64.1 995
996 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/Firmware%20Upgrade%20Instruction/WebHome/image-20220527084831-11.png?rev=1.1||alt="image-20220527084831-11.png"]]
997
998 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/Firmware%20Upgrade%20Instruction/WebHome/image-20220527084907-12.png?rev=1.1||alt="image-20220527084907-12.png"]]
999
1000
Dilisi S 83.1 1001 **It is very important to press the reset button after the upgrade. This sets the device to work in Low Power mode.**
Bei Jinggeng 64.1 1002
Dilisi S 83.1 1003 **If you change to a different LoRa frequency band/region, you need to use the AT+FDR command to restore the factory data after the program is successfully applied.**
Bei Jinggeng 64.1 1004
Dilisi S 83.1 1005
Xiaoling 1.5 1006 == 7.2 How to change the LoRa Frequency Bands/Region? ==
Xiaoling 1.2 1007
Xiaoling 50.3 1008
Dilisi S 110.1 1009 If you have the US915 frequency and want to change it to the AS923 frequency, you can follow the same instructions mentioned in the [[How to upgrade the image?>>doc:||anchor="How to upgrade the image?"]] section to upgrade the image. When downloading the image, select the required file.
Xiaoling 1.2 1010
1011
Dilisi S 84.1 1012 == 7.3 Can I disable uplinks for each event to save battery life? ==
Xiaoling 1.5 1013
Xiaoling 50.3 1014
Dilisi S 84.1 1015 Yes, you can use one of the methods below:
Xiaoling 1.2 1016
Xiaoling 47.20 1017
Dilisi S 84.1 1018 (% style="color:blue" %)**Via AT Command**:
Xiaoling 1.2 1019
Dilisi S 84.1 1020 (% style="color:red" %)**AT+DISALARM=1**(%%) : The end node will only send packets during the TDC time.
Xiaoling 1.2 1021
Dilisi S 85.1 1022 (% style="color:red" %)**AT+DISALARM=0**(%%) : The end node will send packets either during the TDC time or when there is a status change in the door sensor.
Xiaoling 1.2 1023
Xiaoling 47.20 1024
Dilisi S 84.1 1025 (% style="color:blue" %)**Via LoRaWAN downlink Command**:
Xiaoling 1.2 1026
Dilisi S 85.1 1027 (% style="color:red" %)**0xA701**(%%) : Equivalent to AT+DISALARM=1
Xiaoling 1.2 1028
Dilisi S 85.1 1029 (% style="color:red" %)**0xA700**(%%) : Equivalent to AT+DISALARM=0
Xiaoling 1.2 1030
1031
Dilisi S 85.1 1032 == 7.4 How can I change the Subband for LDS02? ==
Edwin Chen 54.1 1033
1034
Dilisi S 85.1 1035 **Before v1.6 firmware:**
1036 LDS02 operates in Subband 2 by default in the AU915/US915 band. If the LoRaWAN server operates on another subband, LDS02 may have trouble joining the server. In this case, the user can use the AT command to change the subband. See the AT Command chapter for hardware connection details. Below are the steps to change the subband:
Xiaoling 54.2 1037
Dilisi S 85.1 1038 1. Press the reset button.
1039 1. Send the password **123456**.
1040 1. Send the command: **AT+CFREQBANDMASK=0006** (use 0001 for Subband 1, 0002 for Subband 2, etc.).
1041 1. Press the reset button to restart and switch to the new subband.
Xiaoling 54.2 1042
Dilisi S 85.1 1043 Example output:
1044
Edwin Chen 54.1 1045 (% class="mark small" %)[3369]DRAGINO LWL01 Device
1046 [3370]Frequency Band: US915 v1.5
1047 [3373]OTAA
1048 [3374]DevEui= 7896785455246354
1049 [3377]class type A
1050 [3379]freq mode intra
1051 [3381]**scan chn mask 0x0002   ~-~-> use subband 2**
1052
1053 (% class="mark small" %)LM502:~~# [10793]txDone
1054 123456       ~-~-> ENTER PASSWORD
1055 Correct Password
1056
1057 (% class="mark small" %)[105115]rxTimeOut
Edwin Chen 57.1 1058 **AT+CFREQBANDMASK=0020 ~-~-> Change to Subband6**
Edwin Chen 54.1 1059 OK
1060
1061 (% class="mark small" %)[3371]DRAGINO LWL01 Device
1062 [3373]Frequency Band: US915 v1.5
1063 [3376]OTAA
1064 [3377]DevEui= 7896785455246354
1065 [3380]class type A
1066 [3382]freq mode intra
1067 [3384]**scan chn mask 0x0001  ~-~-> reboot and works on Subband1 now**
1068
Edwin Chen 58.1 1069 [[image:image-20230103143821-1.png]]
Edwin Chen 54.1 1070
Edwin Chen 57.1 1071
Dilisi S 85.1 1072 **Since firmware v1.6:**
Edwin Chen 54.1 1073
Dilisi S 85.1 1074 LDS02 works with the channel mask 0x0000, which covers all subbands. Therefore, there is no need to use AT commands to change the subband, and it will work for every subband.
Xiaoling 54.2 1075
Edwin Chen 54.1 1076
Dilisi S 85.1 1077 == 7.5 My sensor worked for Helium AU915 before, but now it doesn't work. Why? ==
Xiaoling 54.2 1078
Edwin Chen 54.1 1079
Dilisi S 85.1 1080 This is a sub-band issue. See chapter 7.4. Helium changed the sub-band for AU915 from subband 2 to subband 6, which caused the sensor to stop working.
Edwin Chen 54.1 1081
Xiaoling 69.2 1082
Dilisi S 85.1 1083 == 7.6 Why do I see different working temperatures for the device? ==
Xiaoling 69.2 1084
1085
Dilisi S 85.1 1086 The working temperature range of the device depends on the battery the user chooses.
Xiaoling 69.2 1087
Dilisi S 85.1 1088 * A standard AAA battery can support a working range of -10°C to 50°C.
1089 * A special AAA battery can support a working range of -40°C to 60°C. For example, [[Energizer L92>>url:https://data.energizer.com/pdfs/l92.pdf]]
1090
Bei Jinggeng 72.1 1091 == 7.7 The device keeps rejoining the network and is not working properly ==
1092
Xiaoling 82.1 1093
Dilisi S 85.1 1094 **Cause of the problem:**
Bei Jinggeng 72.1 1095
Dilisi S 85.1 1096 When the DR of AU915 and AS923 is 2 or the DR of US915 is 0, upon receiving the MAC Command from the server, the node will enter deep sleep and will not send packets because the attached MAC answer exceeds the number of bytes.
Bei Jinggeng 72.1 1097
Dilisi S 85.1 1098 **Solution:**
Bei Jinggeng 72.1 1099
Dilisi S 85.1 1100 1. Manually restart the device, then downlink 21 03 (only needs to be set once to be effective).
1101 1. Manually restart the device, then set AT+RPL=3 (only needs to be set once to be effective).
1102 1. Update the firmware to version v1.8 or above.
Bei Jinggeng 72.1 1103
Dilisi S 110.1 1104 = 8. Ordering Information =
Bei Jinggeng 72.1 1105
1106
Xiaoling 44.5 1107 **Part Number: (% style="color:blue" %)LDS02-XXX(%%)**
Xiaoling 1.2 1108
Xiaoling 62.3 1109 (% style="color:blue" %)**XXX:**(%%) The default frequency band
Xiaoling 1.2 1110
Xiaoling 1.10 1111 * (% style="color:red" %)**EU433**(%%): frequency  bands EU433
1112 * (% style="color:red" %)**EU868**(%%): frequency  bands EU868
1113 * (% style="color:red" %)**KR920**(%%): frequency  bands KR920
Xiaoling 1.6 1114 * (% style="color:red" %)**CN470**(%%): frequency bands CN470
Xiaoling 1.10 1115 * (% style="color:red" %)**AS923**(%%): frequency  bands AS923
Xiaoling 1.6 1116 * (% style="color:red" %)**AU915**(%%): frequency bands AU915
Xiaoling 1.10 1117 * (% style="color:red" %)**US915**(%%): frequency bands  US915
1118 * (% style="color:red" %)**IN865**(%%):  frequency bands  IN865
Xiaoling 1.6 1119 * (% style="color:red" %)**CN779**(%%): frequency bands CN779
Xiaoling 1.2 1120
Dilisi S 110.1 1121 = 9. Packaging Information =
Xiaoling 1.4 1122
Xiaoling 50.3 1123
Xiaoling 47.13 1124 (((
Xiaoling 1.2 1125 **Package Includes**:
Xiaoling 47.13 1126 )))
Xiaoling 1.2 1127
Xiaoling 47.13 1128 * (((
1129 LDS02 x 1
1130 )))
Xiaoling 1.2 1131
Xiaoling 47.13 1132 (((
Xiaoling 44.7 1133 **Dimension and weight**:
Xiaoling 47.13 1134 )))
Xiaoling 44.6 1135
Xiaoling 47.13 1136 * (((
1137 Device Size: 69.2 x 29.2 x 14.8 mm
Xiaoling 47.19 1138
1139
Xiaoling 47.13 1140 )))
Xiaoling 44.6 1141
Xiaoling 31.2 1142 = 10. Support =
Xiaoling 1.2 1143
Xiaoling 50.3 1144
Dilisi S 85.1 1145 * Support is provided Monday to Friday, from 09:00 to 18:00 GMT+8. Due to different time zones, we cannot offer live support. However, your questions will be answered as soon as possible during the aforementioned schedule.
Dilisi S 110.1 1146 * Please provide as much information as possible regarding your inquiry (product models, a clear description of the problem, steps to replicate it, etc.) and send an email to [[support@dragino.com>>mailto:support@dragino.com]].