Show last authors
1
2
3 (% style="text-align:center" %)
4 [[image:1654679359875-169.png]]
5
6
7
8
9
10
11
12
13
14 **Table of Contents:**
15
16 {{toc/}}
17
18
19
20
21
22
23
24
25 = 1. Introduction =
26
27 == 1.1 What is the LDS02 LoRaWAN Door Sensor? ==
28
29
30 (((
31 (((
32 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.
33 )))
34
35 (((
36 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.
37
38 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.
39
40 The LDS02 **features an open alarm**, which can be configured to send an alarm if the door remains open for a specified duration.
41
42 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.
43
44
45 The following figure shows how the LDS02 is connected to a typical LoRaWAN network server.
46
47 [[image:LDS02-lorawan.jpg]]
48
49
50 )))
51 )))
52
53
54 == 1.2 Features ==
55
56
57 * LoRaWAN Class A v1.0.3
58 * Frequency Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865
59 * Door Open/Close detect
60 * Door open/close statistics
61 * 2 x AAA LR03 Batteries
62 * AT Commands to change parameters
63 * Uplink on periodically and open/close action
64 * Remote configure parameters via LoRa Downlink
65 * Firmware upgradable via program port
66
67 == 1.3 Storage & Operation Temperature ==
68
69
70 -10 ~~ 50 °C  or -40 ~~ 60 °C (depends on the battery type, see [[FAQ>>||anchor="H7.6Whyiseedifferentworkingtemperatureforthedevice3F"]])
71
72
73 == 1.4 Applications ==
74
75
76 * Smart Buildings & Home Automation
77 * Logistics and Supply Chain Management
78 * Smart Metering
79 * Smart Agriculture
80 * Smart Cities
81 * Smart Factory
82
83 == 1.5 Dimension ==
84
85
86 Units in mm
87
88 [[image:1654680563545-120.png]]
89
90
91 [[image:1654680510816-654.png]]
92
93
94 == 1.6 Firmware Change Log ==
95
96
97 (((
98 (((
99 LDS02 uses the same firmware as LDS01:[[LDS02 Image files – Download link>>https://www.dropbox.com/sh/9j35mnsxnz0y3ye/AACj5gHGOURGEHCpj-E861Mua?dl=0]]
100 )))
101 )))
102
103
104 = 2. Power ON LDS02 =
105
106
107 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.
108
109
110 = 3. How to Install LDS02 =
111
112
113 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.
114
115
116 Fixing with screws:
117
118 * 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.
119
120 [[image:image-20231222111730-1.jpeg||height="428" width="686"]]
121
122
123 Fixing with double-sided adhesive pads:
124
125 * 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.
126
127 [[image:image-20231222111834-2.jpeg||height="443" width="685"]]
128
129
130 (((
131 (((
132 When installing the LDS02, make sure to install it as shown below so that the marks align closely when the door is closed.
133 )))
134
135 (((
136 Open/Close threshold range (the minimum gap between sensor enclosure and the magnet enclosure): ~~ 10mm
137 )))
138 )))
139
140 [[image:1654680716522-793.png||height="505" width="497"]]
141
142
143 = 4. Operation Mode =
144
145 == 4.1 How It Works? ==
146
147
148 (((
149 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.
150
151 [[image:image-20230426084924-1.png||height="229" width="493"]]
152
153 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.
154 )))
155
156
157 == 4.2 Example of Joining a LoRaWAN Network ==
158
159
160 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.
161
162
163 [[image:LDS02-tts.jpg]]
164
165
166
167 === 4.2.1 Prerequisites: ===
168
169 (((
170 * 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:
171 ** A keep-alive message, which is sent once per day.
172 ** A door event message when a door is opened or closed ([[Alarm event can be disabled>>||anchor="H7.3CanIdisableuplinkforeacheventtosavebatterylife3F"]])
173 * The Things Stack community network coverage, or private LoRaWAN Network Coverage with any The Things Stack deployment plan.
174 )))
175
176
177 ==== 4.2.1.1 Setting up ====
178
179 * Sign up for a free account with [[The Things Stack Sandbox>>url:https://eu1.cloud.thethings.network]] if you do not have one yet.
180 * Log in to your **The Things Stack** account.
181 * Create an **application** with The Things Stack if you do not have one yet.
182 ** On the left navigation, click **Applications**.
183 ** Then click **+ Add Application** button.
184
185
186
187 [[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"]]
188
189
190 * On the **Create Application **page, configure the following:
191 ** **Application ID**: Provide a unique identification for your application within The Things Stack.
192 ** **Application name**: (optional) Provide a descriptive name.
193 ** **Description**: (optional) Provide a description.
194 * Click on **Create application **button.
195
196 [[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"]]
197
198
199
200 * Go to your application's page and click on the **End devices** in the left menu.
201 * On the End devices page, click on **+ Register end device**.
202
203 [[image:lds02-step-5.png]]
204
205 * Two registration options are available:
206 ** Using the LoRaWAN Device Repositoty
207 ** Manual registration
208
209 ==== 4.2.1.2 Using the LoRaWAN Device Repository ====
210
211 * On the **Register end device** page:
212 ** Select the option **Select the end device in the LoRaWAN Device Repository **under **Input method**.
213 ** Select the **End device brand**, **Model**, **Hardware version**, **Firmware version**, and **Profile (Region)** from the respective dropdown lists.
214 *** **End device brand**: Dragino Technology Co., Limited
215 *** **Model**: LDS02 - Door Sensor
216 *** **Hardware ver**: Unknown
217 *** **Firmware ver**: 1.6
218 *** **Profile (Region)**: Select the region that matches your device.
219 ** Select the **Frequency plan** that matches your device from the **Frequency plan** dropdown list.
220 ** 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.
221
222 [[image:lds02-step-2.png]]
223
224
225
226 * In the **DevEUI** field, enter the **DevEUI**.
227 * In the **AppKey** field, enter the **AppKey.**
228 * In the **End device ID** field, enter a unique name for your LDS02 within this application.
229 * Under **After registration**, select the **View registered end device** option.
230 * Click **Register end device** button.
231
232 [[image:lds02-step-3.png]]
233
234
235 * You will be navigated to the Device overview page.
236
237 [[image:lds02-step-4.png]]
238
239
240 * 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.
241
242 [[image:1654681390551-993.png]]
243
244
245 == 4.3 Uplink Payload ==
246
247
248 The uplink payload is a total of 10 bytes.
249
250 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:480px" %)
251 |=(% 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**
252 |Value|Door State & BAT|(((
253 MOD
254 Always:0x01
255 )))|Total open door events|(((
256 Last door open
257 duration (unit: min)
258 )))|(((
259 [[Alarm>>||anchor="H4.6AlarmBaseonTimeout"]]
260
261 (Only used in LWL02) Always:0x00
262 )))
263
264 **Example:**
265
266 [[image:1654681706301-731.png]]
267
268 [[image:1654681714641-440.png]]
269
270 (((
271
272
273 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]]
274
275
276 === 4.3.1 Battery Info ===
277
278
279 Check the battery voltage:
280
281 Example 1: 0x0B88&3FFF = 2952mV
282
283 Example 2: 0xD152&3FFF = 4434mV
284
285
286 === 4.3.2 Status ===
287
288
289 Check the door state:
290
291 **Example**:
292
293 If the payload is: **0B**:  (0000 1011&1000 0000== 0), **DOOR_OPEN_STATUS** is 0(**CLOSE**)
294
295 If the payload is: **D1**: (1101 0001&1000 0000== 1), **DOOR_OPEN_STATUS** is 1(**OPEN**)
296
297
298 === 4.3.3 MOD ===
299
300
301 Check the working mode (MOD):
302
303 **Example:**
304
305 If the payload is: 01, the MOD is 1.
306
307
308 === 4.3.4 Total door open events ===
309
310
311 Get the total number of door open events:
312
313 **Example**:
314
315 If payload is: **00 00 93, **the total is 147 events.
316
317 If payload is: **00 00 00, **the total is 0 events.
318
319
320 === 4.3.5 Last door open duration (unit: min) ===
321
322
323 Get the last door open duration:
324
325 **Example:**
326
327 If the payload is: **00 00 25, **the last door open duration is 37 minutes.
328
329 If payload is: **00 00 01,** the last door open duration is 1 minute.
330
331
332 === 4.3.6 Alarm (Only used in LWL02) Always:0x00 ===
333
334
335 Get alarm status.
336
337 **Example:**
338
339 If the payload is: 01:  (0001 & 0001== 1), the alarm status is 1
340
341 If the payload is: 00:  (0000 & 0001== 0), the alarm status is 0
342
343
344 )))
345
346 == 4.4 Downlink Payload ==
347
348
349 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:505px" %)
350 |=(% 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)**
351 |(% style="width:180px" %)TDC (Transmit Time Interval—Keep Alive Interval)|(% style="width:94px" %)0x01|(% style="width:226px" %)4
352 |(% style="width:180px" %)RESET|(% style="width:94px" %)0x04|(% style="width:226px" %)2
353 |(% style="width:180px" %)[[Set confirmed mode>>||anchor="HTypeCode0x05"]]|(% style="width:94px" %)0x05|(% style="width:226px" %)2
354 |(% style="width:180px" %)[[Clear Counting>>||anchor="HTypeCode0xA6"]]|(% style="width:94px" %)0xA6|(% style="width:226px" %)2
355 |(% style="width:180px" %)[[Enable/Disable Alarm>>||anchor="HTypeCode0xA7"]]|(% style="width:94px" %)0xA7|(% style="width:226px" %)2
356 |(% style="width:180px" %)[[Control ADR/DR>>||anchor="HTypeCode0xA8"]]|(% style="width:94px" %)0xA8|(% style="width:226px" %)3
357 |(% style="width:180px" %)[[Set Alarm Timeout>>||anchor="HTypeCode0xA9"]]|(% style="width:94px" %)0xA9|(% style="width:226px" %)4
358
359 The following image illustrates how to send a downlink payload from The Things Stack.
360
361 [[image:1654673412319-976.png]]
362
363
364 === (% style="color:#037691" %)**Type Code 0x01**(%%) ===
365
366 If the payload is **0100003C**, it means controlling the LDS02’s Keep Alive interval to **0x00003C = 60 seconds (s)**.
367
368
369 === (% style="color:#037691" %)**Type Code 0x04**(%%) ===
370
371 If the payload is **0x04FF**, it will reset the LDS02.
372
373
374 === (% style="color:#037691" %)**Type Code 0x05**(%%) ===
375
376 (((
377 **0x05 00**: Set uplink to LoRaWAN unconfirmed mode
378 )))
379
380 (((
381 **0x05 01**: Set uplink to LoRaWAN confirmed mode
382 )))
383
384
385 === (% style="color:#037691" %)**Type Code 0xA6**(%%) ===
386
387 (((
388 **Example:** 0xA601 – Clear Counting
389 For the LDS02: Resets both the count number and time.
390 )))
391
392
393 === (% style="color:#037691" %)**Type Code 0xA7**(%%) ===
394
395 (((
396 **0xA701**: Equivalent to AT+DISALARM=1
397 )))
398
399 (((
400 **0xA700**: Equivalent to AT+DISALARM=0
401 )))
402
403
404 === (% style="color:#037691" %)**Type Code 0xA8**(%%) ===
405
406 (((
407 **Format:** 0xA8 aa bb
408
409 * **aa**: 1 – Enable ADR; 0 – Disable ADR (same as the AT+CADR command)
410 * **bb**: Set DR (same as AT+CDATARATE; only valid after ADR=0)
411
412 **Example:** 0xA80001 – Set ADR=0 and DR=1
413 )))
414
415
416 === (% style="color:#037691" %)**Type Code 0xA9**(%%) ===
417
418 See, [[Alarm Base Timeout>>||anchor="H4.6AlarmBaseonTimeout"]] for details.
419
420
421 == 4.5 Integrate with IoT Platforms ==
422
423
424 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.
425
426 === 4.5.1 Integrate with ThingsEye ===
427
428
429 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.
430
431
432 ==== 4.5.1.1 Configuring The Things Stack ====
433
434 We use The Things Stack Sandbox in this example:
435
436 * In **The Things Stack Sandbox**, go to the **Application **for the LDS02 you added.
437 * Select **MQTT** under **Integrations** in the left menu.
438 * 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.
439 * 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.
440
441 {{info}}
442 The username and  password (API key) you created here are required in the next section.
443 {{/info}}
444
445
446 [[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"]]
447
448
449 ==== 4.5.1.2 Configuring ThingsEye.io ====
450
451 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.
452
453 * Login to your [[ThingsEye.io >>url:https://thingseye.io]]account.
454 * Under the **Integrations center**, click **Integrations**.
455 * Click the **Add integration** button (the button with the **+** symbol).
456
457 [[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"]]
458
459
460 On the **Add integration** window, configure the following:
461
462 **Basic settings:**
463
464 * Select **The Things Stack Community** from the **Integration type** list.
465 * Enter a suitable name for your integration in the **Name **text** **box or keep the default name.
466 * Ensure the following options are turned on.
467 ** Enable integration
468 ** Debug mode
469 ** Allow creating devices or assets
470 * Click the **Next** button. you will be navigated to the **Uplink data converter** tab.
471
472 [[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"]]
473
474
475 **Uplink data converter:**
476
477 * Click the **Create new** button if it is not selected by default.
478 * Enter a suitable name for the uplink data converter in the **Name **text** **box or keep the default name.
479 * Click the **JavaScript** button.
480 * 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]].
481 * Click the **Next** button. You will be navigated to the **Downlink data converter **tab.
482
483 [[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"]]
484
485
486 **Downlink data converter (this is an optional step):**
487
488 * Click the **Create new** button if it is not selected by default.
489 * Enter a suitable name for the downlink data converter in the **Name **text** **box or keep the default name.
490 * Click the **JavaScript** button.
491 * 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]].
492 * Click the **Next** button. You will be navigated to the **Connection** tab.
493
494 [[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"]]
495
496
497 **Connection:**
498
499 * Choose **Region** from the **Host type**.
500 * 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/...).
501 * 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**).
502 * Click the **Check connection** button to test the connection. If the connection is successful, you will see the message saying **Connected**.
503
504 [[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"]]
505
506
507 * Click the **Add** button.
508
509 [[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"]]
510
511
512 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.
513
514
515 [[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"]]
516
517
518 ==== 4.5.1.3 Viewing integration details ====
519
520
521 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.
522
523
524 [[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"]]
525
526
527 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.
528
529 {{info}}
530 See also [[ThingsEye documentation>>url:https://wiki.thingseye.io/xwiki/bin/view/Main/]].
531 {{/info}}
532
533
534 ==== 4.5.1.4 Viewing events ====
535
536
537 The **Events **tab displays all the uplink messages from the LDS02.
538
539 * Select **Debug **from the **Event type** dropdown.
540 * Select the** time frame** from the **time window**.
541
542 [[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"]]
543
544
545 * To view the **JSON payload** of a message, click on the **three dots (...)** in the **Message** column of the desired message.
546
547 [[image:lds02-thingseye-payload.png]]
548
549
550 ==== 4.5.1.5 Deleting an integration ====
551
552
553 If you want to delete an integration, click the **Delete integration** button on the Integrations page.
554
555
556 ==== 4.5.1.6 Viewing sensor data on a dashboard ====
557
558
559 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.
560
561
562 [[image:lds02-thingseye-dashboard.png]]
563
564
565
566
567 === 4.5.2 Integrate with Datacake ===
568
569
570 (((
571 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.
572
573
574 ==== 4.5.2.1 Prerequisites ====
575
576 * The LDS02 device is joined to The Things Stack.
577 * Uplinks from the LDS02 device are being received by The Things Stack.
578 * A Datacake account (a free account is sufficient for this example).
579
580 ==== 4.5.2.2 Procedure ====
581
582
583 * In the Datacake workspace, on the left navigation, click **Account Settings**.
584 * Then click **API Token**.
585 * 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.
586
587 [[image:datacake-1.png]]
588
589
590 )))
591
592 (((
593 To configure the Application to forward data to Datacake you will need to add integration. To add the Datacake integration, perform the following steps:
594
595 * In The Things Stack console, on the left navigation,
596 ** First select your **application** (**Applications -> <your application>**)
597 ** Then select **Integrations -> Webhooks**
598 * On the **Webhooks** page, click + **Add Webhook** button.
599
600 [[image:tts-webhook-1.png]]
601
602
603 * On the **Choose webhook template** page, select **Datacake**.
604 )))
605
606
607
608 [[image:tts-webhook-2.png]]
609
610
611 * On the Setup webhook for Datacake page,
612 ** **Webhook ID**: provide an unique identifier for this webhook
613 ** **Token**: Paste the **Datacake API Token** when you copied from the Datacake **Account Settings**.
614 * Click on the **Create Datacake webhook** button.
615
616 [[image:tts-webhook-3.png]]
617
618
619 Now the Webhook is created and displayed on the Webhooks page.
620
621 [[image:tts-webhook-4.png]]
622
623
624 * In the Datacake workspace, on the left navigation, click **Devices**.
625 * On the Devices page, click **+Add Device**.
626
627 [[image:datacake-2.png]]
628
629
630 * On the **Add Device** window, click **LoRaWAN** option.
631 * Click on the **Next** button.
632
633 [[image:datacake-3.png]]
634
635
636 * On the **Add LoRaWAN Device** window, **STEP 1**, click on **New Product from template** option.
637 * Under **Device Template**, search **lds02**. Then click on **Dragino LDS02 Door Sensor** option.
638 * Click on the **Next** button.
639
640 [[image:datacake-4.png]]
641
642
643
644
645 * On the **Add LoRaWAN Device** window, **STEP 2**, under **Network Server**, click on **The Things Stack V3** option.
646 * Click on the **Next** button.
647
648 [[image:datacake-5.png]]
649
650
651 * On the **Add LoRaWAN Device** window, **STEP 3**, under **Add Devices**, click **Manual** tab.
652 * In the **DEVEUI** textbox, enter your LDS02's 8 bytes **DevEUI**.
653 * In the **NAME** textbox, enter a suitable name to identify your LDS02.
654 * Click on the **Next** button.
655
656 [[image:datacake-6.png]]
657
658
659 * On the **Add LoRaWAN Device** window, **STEP 4**, select **Individual device plans** tab.
660 * Click **Free** option.
661 * Click on the **Add 1 Device** button.
662
663 [[image:datacake-7.png]]
664
665
666 * The device is now added to the Datacake workspace and is ready to receive uplinks from the LDS02 via The Things Stack.
667 * In the **DEVICE** column, click **lds02**.
668
669 [[image:datacake-8.png]]
670
671
672 You can see the **pre-built dashboard** from our template, displaying the LDS02's sensor data on various **widgets**.
673
674 [[image:datacake-9.png]]
675
676
677 == 4.6 Alarm Based on Timeout ==
678
679
680 (((
681 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:
682 )))
683
684 (((
685 (% style="color:blue" %)**Using AT Commands**(%%)**:**
686 )))
687
688 (((
689
690
691 * **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.
692 * **AT+TTRIG=0,0 ~-~-> **Default value, disables the timeout alarm.
693 )))
694
695 (((
696 (% style="color:blue" %)**Using Downlink Commands**(%%)**:**
697 )))
698
699 (((
700 **Command:** 0xA9 aa bb cc
701
702 * **A9:** Command Type Code
703 * **aa:** Status to be monitored
704 * **bb cc:** Timeout
705
706 If the user sends **0xA9 01 00 1E**, this is equivalent to **AT+TTRIG=1,30**.
707
708 Or
709
710 **0xA9 00 00 00**, this is equivalent to **AT+TTRIG=0,0**, which disables the timeout alarm.
711 )))
712
713
714 == 4.7 LEDs ==
715
716
717 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:463px" %)
718 |=(% style="width: 186px;background-color:#4F81BD;color:white" %)**Action**|=(% style="width: 277px;background-color:#4F81BD;color:white" %)**LED behavior**
719 |(% 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(%%)**
720 |(% style="width:184px" %)Joined successful|(% style="width:275px" %)(% style="color:green" %)**GRENN LED **(%%)on 5s
721 |(% style="width:184px" %)Send an uplink message|(% style="width:275px" %)(% style="color:green" %)**GREEN LED**(%%) blinks once
722 |(% style="width:184px" %)Received a downlink message|(% style="width:275px" %)(% style="color:blue" %)**BLUE LED**(%%) blinks once
723
724 = 5. Battery & How to replace =
725
726 == 5.1 Battery Type and replace ==
727
728
729 (((
730 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.
731
732 (% style="color:red" %)**Note:**
733
734 1. The LDS02 doesn’t have any screws; you can use a nail to open it from the middle.
735 1. Make sure the direction is correct when installing the AAA batteries.
736 )))
737
738 (((
739 (% style="color:red" %)**Important Note: **(%%)Ensure you use new AAA LR03 batteries, and that the battery surfaces are not damaged.
740 )))
741
742 (((
743
744 )))
745
746 (((
747 Example of AAA LR03 battery:
748 )))
749
750 [[image:1654675278044-307.png]]
751
752
753 == 5.2 Power Consumption Analysis ==
754
755
756 (((
757 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:
758 )))
759
760
761 = 6. Use AT Commands =
762
763 == 6.1 Access AT Commands ==
764
765
766 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.
767
768 [[image:image-20221226104705-1.png||height="572" width="872"]]
769
770
771 (((
772 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:
773 )))
774
775 (((
776 The AT command access password is (% style="color:red" %)**123456**.
777 )))
778
779 [[image:1654675618022-630.png]]
780
781
782 Each AT command needs to have an **ENTER** key pressed at the end before sending.
783
784 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.
785
786 More details can be found in the [[AT Command Manual>>http://www.dragino.com/downloads/index.php?dir=LoRa_End_Node/LDS01/]].
787
788
789 = 7. FAQ =
790
791 == 7.1 How to upgrade the image? ==
792
793
794 **~1. Connect the DAPLINK to the LDS02 as below:**
795
796
797
798 **3.3V<~-~-~-~-->VDD**
799
800 **CLK<~-~-~-~-~-~->CLK**
801
802 **DIO<~-~-~-~-~-~->DIO (SWD)**
803
804 **GND<~-~-~-~-~-~->GND**
805
806 [[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"]]
807
808 [[image:image-20230726175624-1.jpeg||height="565" width="753"]]
809
810
811 **2. Install PSoC Programmer 3.27.1**
812
813 Download Link: [[PSoCProgrammer3.27.1>>url:https://www.dragino.com/downloads/index.php?dir=tools/]]
814
815 Then, use PSoC Programmer to upgrade the firmware (**must use this version: PSoC Programmer 3.27.1**).
816
817 [[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"]]
818
819
820 **3. Download Sensor Firmware**
821
822 Downlink [[Firmware Location(same as LDS01)>>url:https://www.dropbox.com/sh/9j35mnsxnz0y3ye/AACj5gHGOURGEHCpj-E861Mua?dl=0]] to prepare the update.
823
824
825 **4. Upgrade Firmware**
826
827 * Open PSoC Programmer, then select the default configuration.
828
829 [[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"]]
830
831 * Click the file icon to select the software to be burned.
832
833 [[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"]]
834
835 [[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"]]
836
837 * 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.
838
839 [[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"]]
840
841 [[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"]]
842
843
844 **It is very important to press the reset button after the upgrade. This sets the device to work in Low Power mode.**
845
846 **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.**
847
848
849 == 7.2 How to change the LoRa Frequency Bands/Region? ==
850
851
852 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.
853
854
855 == 7.3 Can I disable uplinks for each event to save battery life? ==
856
857
858 Yes, you can use one of the methods below:
859
860
861 (% style="color:blue" %)**Via AT Command**:
862
863 (% style="color:red" %)**AT+DISALARM=1**(%%) : The end node will only send packets during the TDC time.
864
865 (% 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.
866
867
868 (% style="color:blue" %)**Via LoRaWAN downlink Command**:
869
870 (% style="color:red" %)**0xA701**(%%) : Equivalent to AT+DISALARM=1
871
872 (% style="color:red" %)**0xA700**(%%) : Equivalent to AT+DISALARM=0
873
874
875 == 7.4 How can I change the Subband for LDS02? ==
876
877
878 **Before v1.6 firmware:**
879 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:
880
881 1. Press the reset button.
882 1. Send the password **123456**.
883 1. Send the command: **AT+CFREQBANDMASK=0006** (use 0001 for Subband 1, 0002 for Subband 2, etc.).
884 1. Press the reset button to restart and switch to the new subband.
885
886 Example output:
887
888 (% class="mark small" %)[3369]DRAGINO LWL01 Device
889 [3370]Frequency Band: US915 v1.5
890 [3373]OTAA
891 [3374]DevEui= 7896785455246354
892 [3377]class type A
893 [3379]freq mode intra
894 [3381]**scan chn mask 0x0002   ~-~-> use subband 2**
895
896 (% class="mark small" %)LM502:~~# [10793]txDone
897 123456       ~-~-> ENTER PASSWORD
898 Correct Password
899
900 (% class="mark small" %)[105115]rxTimeOut
901 **AT+CFREQBANDMASK=0020 ~-~-> Change to Subband6**
902 OK
903
904 (% class="mark small" %)[3371]DRAGINO LWL01 Device
905 [3373]Frequency Band: US915 v1.5
906 [3376]OTAA
907 [3377]DevEui= 7896785455246354
908 [3380]class type A
909 [3382]freq mode intra
910 [3384]**scan chn mask 0x0001  ~-~-> reboot and works on Subband1 now**
911
912 [[image:image-20230103143821-1.png]]
913
914
915 **Since firmware v1.6:**
916
917 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.
918
919
920 == 7.5 My sensor worked for Helium AU915 before, but now it doesn't work. Why? ==
921
922
923 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.
924
925
926 == 7.6 Why do I see different working temperatures for the device? ==
927
928
929 The working temperature range of the device depends on the battery the user chooses.
930
931 * A standard AAA battery can support a working range of -10°C to 50°C.
932 * 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]]
933
934 == 7.7 The device keeps rejoining the network and is not working properly ==
935
936
937 **Cause of the problem:**
938
939 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.
940
941 **Solution:**
942
943 1. Manually restart the device, then downlink 21 03 (only needs to be set once to be effective).
944 1. Manually restart the device, then set AT+RPL=3 (only needs to be set once to be effective).
945 1. Update the firmware to version v1.8 or above.
946
947 = 8. Ordering Information =
948
949
950 **Part Number: (% style="color:blue" %)LDS02-XXX(%%)**
951
952 (% style="color:blue" %)**XXX:**(%%) The default frequency band
953
954 * (% style="color:red" %)**EU433**(%%): frequency  bands EU433
955 * (% style="color:red" %)**EU868**(%%): frequency  bands EU868
956 * (% style="color:red" %)**KR920**(%%): frequency  bands KR920
957 * (% style="color:red" %)**CN470**(%%): frequency bands CN470
958 * (% style="color:red" %)**AS923**(%%): frequency  bands AS923
959 * (% style="color:red" %)**AU915**(%%): frequency bands AU915
960 * (% style="color:red" %)**US915**(%%): frequency bands  US915
961 * (% style="color:red" %)**IN865**(%%):  frequency bands  IN865
962 * (% style="color:red" %)**CN779**(%%): frequency bands CN779
963
964 = 9. Packaging Information =
965
966
967 (((
968 **Package Includes**:
969 )))
970
971 * (((
972 LDS02 x 1
973 )))
974
975 (((
976 **Dimension and weight**:
977 )))
978
979 * (((
980 Device Size: 69.2 x 29.2 x 14.8 mm
981
982
983 )))
984
985 = 10. Support =
986
987
988 * 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.
989 * 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]].
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0