Version 120.2 by Xiaoling on 2023/11/28 14:40

Hide last authors
Ellie Zhang 26.1 1 (% style="text-align:center" %)
Xiaoling 111.2 2 [[image:image-20231110085342-2.png||height="481" width="481"]]
Edwin Chen 1.1 3
4
Xiaoling 67.2 5
Xiaoling 75.2 6
7
8
9
Xiaoling 111.2 10
kai 31.2 11 **Table of Contents:**
Ellie Zhang 30.1 12
Edwin Chen 1.1 13 {{toc/}}
14
15
16
17
18
19
kai 31.1 20 = 1. Introduction =
Edwin Chen 1.1 21
Xiaoling 113.3 22 == 1.1 What is LoRaWAN Smart Distance Detector ==
Edwin Chen 1.1 23
Xiaoling 39.6 24
Edwin Chen 115.1 25 The Dragino (% style="color:blue" %)**DS20L is a smart distance detector**(%%) base on long-range wireless LoRaWAN technology. It uses (% style="color:blue" %)**LiDAR sensor**(%%) to detect the distance between DS20L and object, then DS20L will send the distance data to the IoT Platform via LoRaWAN. DS20L can measure range between 3cm ~~ 200cm.
Edwin Chen 1.1 26
Xiaoling 113.3 27 DS20L allows users to send data and reach extremely long ranges via LoRaWAN. It provides ultra-long range spread spectrum communication and high interference immunity whilst minimizing current 
28 consumption. It targets professional wireless sensor network applications such smart cities, building automation, and so on.
Edwin Chen 1.1 29
Xiaoling 113.3 30 DS20L has a (% style="color:blue" %)**built-in 2400mAh non-chargeable battery**(%%) for long-term use up to several years*. Users can also power DS20L with an external power source for (% style="color:blue" %)**continuous measuring and distance alarm / counting purposes.**
Edwin Chen 1.1 31
Xiaoling 113.3 32 DS20L is fully compatible with (% style="color:blue" %)**LoRaWAN v1.0.3 Class A protocol**(%%), it can work with a standard LoRaWAN gateway.
Xiaoling 62.4 33
Edwin Chen 1.1 34
Xiaoling 114.2 35 [[image:image-20231110102635-5.png||height="402" width="807"]]
Edwin Chen 1.1 36
Xiaoling 64.2 37
Edwin Chen 1.1 38 == 1.2 ​Features ==
39
Xiaoling 39.6 40
Xiaoling 113.4 41 * LoRaWAN Class A protocol
42 * LiDAR distance detector, range 3 ~~ 200cm
43 * Periodically detect or continuously detect mode
Xiaoling 70.5 44 * AT Commands to change parameters
Xiaoling 113.4 45 * Remotely configure parameters via LoRaWAN Downlink
46 * Alarm & Counting mode
47 * Firmware upgradable via program port or LoRa protocol
48 * Built-in 2400mAh battery or power by external power source
Edwin Chen 1.1 49
50 == 1.3 Specification ==
51
52
Xiaoling 113.5 53 (% style="color:#037691" %)**LiDAR Sensor:**
Xiaoling 70.6 54
Xiaoling 113.5 55 * Operation Temperature: -40 ~~ 80 °C
56 * Operation Humidity: 0~~99.9%RH (no Dew)
57 * Storage Temperature: -10 ~~ 45°C
Xiaoling 113.4 58 * Measure Range: 3cm~~200cm @ 90% reflectivity
59 * Accuracy: ±2cm @ (3cm~~100cm); ±5% @ (100~~200cm)
60 * ToF FoV: ±9°, Total 18°
61 * Light source: VCSEL
Xiaoling 82.3 62
Edwin Chen 115.1 63 == 1.4 Power Consumption ==
Xiaoling 114.2 64
Edwin Chen 115.1 65
Xiaoling 116.2 66 (% style="color:#037691" %)**Battery Power Mode:**
Edwin Chen 115.1 67
kai 116.1 68 * Idle: 0.003 mA @ 3.3v
69 * Max : 360 mA
Edwin Chen 115.1 70
Xiaoling 116.2 71 (% style="color:#037691" %)**Continuously mode**:
Edwin Chen 115.1 72
kai 116.1 73 * Idle: 21 mA @ 3.3v
74 * Max : 360 mA
Edwin Chen 115.1 75
Xiaoling 113.5 76 = 2. Configure DS20L to connect to LoRaWAN network =
Xiaoling 77.4 77
Edwin Chen 1.1 78 == 2.1 How it works ==
79
80
Xiaoling 113.6 81 The DS20L is configured as (% style="color:#037691" %)**LoRaWAN OTAA Class A**(%%) mode by default. It has OTAA keys to join LoRaWAN network. To connect a local LoRaWAN network, you need to input the OTAA keys in the LoRaWAN IoT server and press the button to activate the DS20L. It will automatically join the network via OTAA and start to send the sensor value. The default uplink interval is 20 minutes.
Edwin Chen 1.1 82
Xiaoling 64.2 83 (% style="display:none" %) (%%)
Edwin Chen 1.1 84
85 == 2.2 ​Quick guide to connect to LoRaWAN server (OTAA) ==
86
87
88 Following is an example for how to join the [[TTN v3 LoRaWAN Network>>url:https://console.cloud.thethings.network/]]. Below is the network structure; we use the [[LPS8v2>>url:https://www.dragino.com/products/lora-lorawan-gateway/item/228-lps8v2.html]] as a LoRaWAN gateway in this example.
89
Xiaoling 114.2 90 The LPS8v2 is already set to connected to [[TTN network >>url:https://console.cloud.thethings.network/]], so what we need to now is configure the TTN server.(% style="display:none" %)
Edwin Chen 1.1 91
Xiaoling 114.2 92 [[image:image-20231110102635-5.png||height="402" width="807"]](% style="display:none" %)
Edwin Chen 1.1 93
Xiaoling 113.6 94 (% style="color:blue" %)**Step 1:**(%%) Create a device in TTN with the OTAA keys from DS20L.
Edwin Chen 1.1 95
Xiaoling 113.6 96 Each DS20L is shipped with a sticker with the default device EUI as below:
Edwin Chen 1.1 97
Ellie Zhang 30.1 98 [[image:image-20230426084152-1.png||alt="图片-20230426084152-1.png" height="233" width="502"]]
Edwin Chen 1.1 99
100
101 You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
102
103
104 (% style="color:blue" %)**Register the device**
105
Xiaoling 14.13 106 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/1654935135620-998.png?rev=1.1||alt="1654935135620-998.png"]]
Edwin Chen 1.1 107
108
109 (% style="color:blue" %)**Add APP EUI and DEV EUI**
110
Ellie Zhang 30.1 111 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/image-20220611161308-4.png?width=753&height=551&rev=1.1||alt="图片-20220611161308-4.png"]]
Edwin Chen 1.1 112
113
114 (% style="color:blue" %)**Add APP EUI in the application**
115
116
Ellie Zhang 30.1 117 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/image-20220611161308-5.png?width=742&height=601&rev=1.1||alt="图片-20220611161308-5.png"]]
Edwin Chen 1.1 118
119
120 (% style="color:blue" %)**Add APP KEY**
121
Ellie Zhang 30.1 122 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/image-20220611161308-6.png?width=744&height=485&rev=1.1||alt="图片-20220611161308-6.png"]]
Edwin Chen 1.1 123
124
Xiaoling 113.6 125 (% style="color:blue" %)**Step 2:**(%%) Activate on DS20L
Edwin Chen 1.1 126
Xiaoling 118.2 127 [[image:image-20231128133704-1.png||height="189" width="441"]]
Edwin Chen 1.1 128
Xiaoling 113.6 129 Press the button for 5 seconds to activate the DS20L.
Edwin Chen 6.1 130
Edwin Chen 1.1 131 (% style="color:green" %)**Green led**(%%) will fast blink 5 times, device will enter (% style="color:blue" %)**OTA mode**(%%) for 3 seconds. And then start to JOIN LoRaWAN network. (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network.
132
133 After join success, it will start to upload messages to TTN and you can see the messages in the panel.
134
135
Xiaoling 82.8 136 == 2.3 ​Uplink Payload ==
Edwin Chen 1.1 137
Saxer Lin 85.1 138 === 2.3.1 Device Status, FPORT~=5 ===
139
Xiaoling 90.2 140
Xiaoling 113.6 141 Users can use the downlink command(**0x26 01**) to ask DS20L to send device configure detail, include device configure status. DS20L will uplink a payload via FPort=5 to server.
Saxer Lin 85.1 142
143 The Payload format is as below.
144
Xiaoling 90.2 145 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
Xiaoling 90.11 146 |=(% style="width: 60px;background-color:#4F81BD;color:white" %)(((
Saxer Lin 85.1 147 **Size(bytes)**
Xiaoling 90.11 148 )))|=(% style="width: 100px; background-color: #4F81BD;color:white;" %)**1**|=(% style="width: 100px; background-color: #4F81BD;color:white;" %)**2**|=(% style="background-color: #4F81BD;color:white; width: 100px;" %)**1**|=(% style="background-color: #4F81BD;color:white; width: 100px;" %)**1**|=(% style="background-color: #4F81BD;color:white; width: 50px;" %)**2**
Saxer Lin 85.1 149 |(% style="width:62.5px" %)Value|(% style="width:110px" %)Sensor Model|(% style="width:48px" %)Firmware Version|(% style="width:94px" %)Frequency Band|(% style="width:91px" %)Sub-band|(% style="width:60px" %)BAT
150
151 Example parse in TTNv3
152
Xiaoling 118.2 153 [[image:1701149922873-259.png]]
Saxer Lin 93.1 154
Xiaoling 118.2 155 (% style="color:blue" %)**Sensor Model**(%%): For DS20L, this value is 0x21
Saxer Lin 85.1 156
Xiaoling 90.17 157 (% style="color:blue" %)**Firmware Version**(%%): 0x0100, Means: v1.0.0 version
Saxer Lin 85.1 158
Xiaoling 90.17 159 (% style="color:blue" %)**Frequency Band**:
Saxer Lin 85.1 160
161 0x01: EU868
162
163 0x02: US915
164
165 0x03: IN865
166
167 0x04: AU915
168
169 0x05: KZ865
170
171 0x06: RU864
172
173 0x07: AS923
174
175 0x08: AS923-1
176
177 0x09: AS923-2
178
179 0x0a: AS923-3
180
181 0x0b: CN470
182
183 0x0c: EU433
184
185 0x0d: KR920
186
187 0x0e: MA869
188
Xiaoling 90.17 189 (% style="color:blue" %)**Sub-Band**:
Saxer Lin 85.1 190
191 AU915 and US915:value 0x00 ~~ 0x08
192
193 CN470: value 0x0B ~~ 0x0C
194
195 Other Bands: Always 0x00
196
Xiaoling 90.17 197 (% style="color:blue" %)**Battery Info**:
Saxer Lin 85.1 198
199 Check the battery voltage.
200
201 Ex1: 0x0B45 = 2885mV
202
203 Ex2: 0x0B49 = 2889mV
204
205
Saxer Lin 89.1 206 === 2.3.2 Uplink Payload, FPORT~=2 ===
Saxer Lin 85.1 207
Xiaoling 90.2 208
Xiaoling 62.5 209 (((
Xiaoling 113.6 210 DS20L will send this uplink **after** Device Status once join the LoRaWAN network successfully. And DS20L will:
Edwin Chen 1.1 211
Xiaoling 109.2 212 periodically send this uplink every 20 minutes, this interval [[can be changed>>||anchor="H3.3.1SetTransmitIntervalTime"]].
Saxer Lin 93.1 213
214 Uplink Payload totals 11 bytes.
Xiaoling 62.5 215 )))
Edwin Chen 1.1 216
Xiaoling 90.7 217 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
218 |=(% style="width: 60px;background-color:#4F81BD;color:white" %)(((
Xiaoling 70.10 219 **Size(bytes)**
Xiaoling 90.9 220 )))|=(% style="width: 30px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 80px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 70px;background-color:#4F81BD;color:white" %)**2**|=(% style="background-color:#4F81BD;color:white; width: 80px;" %)**1**|=(% style="background-color: #4F81BD;color:white; width: 70px;" %)**1**|=(% style="background-color: #4F81BD;color:white; width: 70px;" %)**1**
Xiaoling 90.6 221 |(% style="width:62.5px" %)Value|(% style="width:62.5px" %)[[BAT>>||anchor="HBatteryInfo"]]|(% style="width:62.5px" %)(((
222 [[Temperature DS18B20>>||anchor="HDS18B20Temperaturesensor"]]
223 )))|[[Distance>>||anchor="HDistance"]]|[[Distance signal strength>>||anchor="HDistancesignalstrength"]]|(% style="width:122px" %)(((
Xiaoling 90.14 224 [[Interrupt flag & Interrupt_level>>||anchor="HInterruptPin26A0InterruptLevel"]]
Xiaoling 90.6 225 )))|(% style="width:54px" %)[[LiDAR temp>>||anchor="HLiDARtemp"]]|(% style="width:96px" %)(((
226 [[Message Type>>||anchor="HMessageType"]]
Xiaoling 82.4 227 )))
Edwin Chen 1.1 228
Xiaoling 120.2 229 ==== **MOD~=1** ====
Edwin Chen 1.1 230
Xiaoling 120.2 231 Regularly detect distance and report. When the distance exceeds the limit, the alarm flag is set to 1, and the report can be triggered by external interrupts.
Edwin Chen 1.1 232
Xiaoling 120.2 233 Uplink Payload totals 10 bytes.
Edwin Chen 1.1 234
Xiaoling 120.2 235 (% border="1" cellspacing="4" style="width:510px;background-color:#f2f2f2" %)
236 |(% style="width:60px;background-color:#4F81BD;color:white" %)**Size(bytes)**|(% style="width:41px;background-color:#4F81BD;color:white" %)**2**|(% style="width:176px;background-color:#4F81BD;color:white" %)**1**|(% style="width:74px;background-color:#4F81BD;color:white" %)**2**|(% style="width:100px;background-color:#4F81BD;color:white" %)**1**|(% style="width:119px;background-color:#4F81BD;color:white" %)**4**
237 |(% style="width:91px" %)Value|(% style="width:41px" %)[[BAT>>||anchor="HBatteryInfo"]]|(% style="width:176px" %)MOD+ Alarm+Interrupt|(% style="width:74px" %)Distance|(% style="width:100px" %)Sensor State|(% style="width:119px" %)Interrupt Count
Edwin Chen 1.1 238
239
Xiaoling 120.2 240 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png]]
Edwin Chen 1.1 241
Xiaoling 120.2 242 ==== **Battery Info** ====
Saxer Lin 46.1 243
Xiaoling 120.2 244 Check the battery voltage for DS20L
Edwin Chen 1.1 245
Xiaoling 120.2 246 Ex1: 0x0E10 = 3600mV
Xiaoling 67.7 247
Xiaoling 120.2 248 **MOD & Alarm & Interrupt**
Xiaoling 67.7 249
Xiaoling 120.2 250 **MOD:**
Edwin Chen 1.1 251
Xiaoling 120.2 252 **Example: ** (0x60>>6) & 0x3f =1
Xiaoling 14.22 253
Xiaoling 120.2 254 **0x01:**  Regularly detect distance and report.
255 **0x02: ** Uninterrupted measurement (external power supply).
Edwin Chen 1.1 256
Xiaoling 120.2 257 **Alarm:**
Xiaoling 79.11 258
Xiaoling 120.2 259 When the detection distance exceeds the limit, the alarm flag is set to 1.
Xiaoling 67.7 260
Xiaoling 120.2 261 **Interrupt:**
Xiaoling 67.7 262
Xiaoling 120.2 263 Whether it is an external interrupt.
Edwin Chen 10.1 264
Xiaoling 120.2 265 ==== Distance** info** ====
Edwin Chen 1.1 266
Xiaoling 82.4 267 **Example**:
268
Xiaoling 120.2 269 If payload is: 0708H: distance = 0708H = 1800 mm
Xiaoling 82.4 270
Xiaoling 120.2 271 ==== **Sensor State** ====
Xiaoling 82.4 272
Xiaoling 120.2 273 Ex1: 0x00: Normal collection distance
Xiaoling 82.4 274
Xiaoling 120.2 275 Ex2 0x0x: Distance collection is wrong
Xiaoling 82.4 276
Xiaoling 120.2 277 ==== **Interript Count** ====
Xiaoling 82.4 278
Xiaoling 120.2 279 If payload is:000007D0H: count = 07D0H =2000
Xiaoling 82.4 280
Xiaoling 120.2 281 **MOD=2**
Xiaoling 82.4 282
Xiaoling 120.2 283 Uninterrupted measurement. When the distance exceeds the limit, the output IO is set high and reports are reported every five minutes. The time can be set and powered by an external power supply.Uplink Payload totals 11bytes.
Xiaoling 82.4 284
Xiaoling 120.2 285 |**Size(bytes)**|**2**|**1**|**4**|**2**|**2**
286 |Value|[[BAT>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/DS20L_LoRaWAN_Smart_Distance_Detector_User_Manual/#HBatteryInfo]]|MOD+ Alarm+Do+ Limit flag|Distance Limit  Alarm count|Upper limit|Lower limit
Xiaoling 82.4 287
288
Xiaoling 120.2 289 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png]]
Saxer Lin 104.1 290
Xiaoling 120.2 291 **MOD & Alarm & Do & Limit** **flag**
Saxer Lin 104.1 292
Xiaoling 120.2 293 **MOD:**
Saxer Lin 104.1 294
Xiaoling 120.2 295 **Example: ** (0x60>>6) & 0x3f =1
Saxer Lin 104.1 296
Xiaoling 120.2 297 **0x01:**  Regularly detect distance and report.
298 **0x02: ** Uninterrupted measurement (external power supply).
Saxer Lin 104.1 299
Xiaoling 120.2 300 **Alarm:**
Saxer Lin 104.1 301
Xiaoling 120.2 302 When the detection distance exceeds the limit, the alarm flag is set to 1.
Saxer Lin 104.1 303
Xiaoling 120.2 304 **Do:**
Saxer Lin 104.1 305
Xiaoling 120.2 306 When the distance exceeds the set threshold, pull the Do pin high.
Saxer Lin 104.1 307
Xiaoling 120.2 308 **Limit** **flag:**
Xiaoling 82.4 309
Xiaoling 120.2 310 Mode for setting threshold: 0~~5
Xiaoling 82.4 311
Xiaoling 120.2 312 0: does not use upper and lower limits
Xiaoling 82.4 313
Xiaoling 120.2 314 1: Use upper and lower limits
Xiaoling 82.4 315
Xiaoling 120.2 316 2: is less than the lower limit value
Edwin Chen 1.1 317
Xiaoling 120.2 318 3: is greater than the lower limit value
Edwin Chen 1.1 319
Xiaoling 120.2 320 4: is less than the upper limit
Edwin Chen 1.1 321
Xiaoling 120.2 322 5: is greater than the upper limit
Edwin Chen 1.1 323
Xiaoling 120.2 324 **Upper limit:**
Xiaoling 62.5 325
Xiaoling 120.2 326 The upper limit of the threshold cannot exceed 2000mm.
Edwin Chen 1.1 327
Xiaoling 120.2 328 **Lower limit:**
Edwin Chen 1.1 329
Xiaoling 120.2 330 The lower limit of the threshold cannot be less than 3mm.
Edwin Chen 1.1 331
Xiaoling 39.5 332
Saxer Lin 99.1 333 === 2.3.3 Historical measuring distance, FPORT~=3 ===
Saxer Lin 97.1 334
Saxer Lin 99.1 335
Xiaoling 113.6 336 DS20L stores sensor values and users can retrieve these history values via the [[downlink command>>||anchor="H2.5.4Pollsensorvalue"]].
Xiaoling 109.3 337
Saxer Lin 107.1 338 The historical payload includes one or multiplies entries and every entry has the same payload as Real-Time measuring distance.
Saxer Lin 97.1 339
Xiaoling 109.10 340 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
Saxer Lin 99.1 341 |=(% style="width: 60px;background-color:#4F81BD;color:white" %)(((
342 **Size(bytes)**
Xiaoling 109.5 343 )))|=(% style="width: 80px;background-color:#4F81BD;color:white" %)1|=(% style="width: 80px;background-color:#4F81BD;color:white" %)**1**|=(% style="width: 50px;background-color:#4F81BD;color:white" %)**2**|=(% style="width: 70px;background-color:#4F81BD;color:white" %)**2**|=(% style="background-color:#4F81BD; color: white; width: 85px;" %)**1**|=(% style="background-color: #4F81BD; color: white; width: 85px;" %)4
Saxer Lin 99.1 344 |(% style="width:62.5px" %)Value|(% style="width:62.5px" %)Interrupt flag & Interrupt_level|(% style="width:62.5px" %)(((
345 Reserve(0xFF)
346 )))|Distance|Distance signal strength|(% style="width:88px" %)(((
347 LiDAR temp
348 )))|(% style="width:85px" %)Unix TimeStamp
Saxer Lin 97.1 349
Saxer Lin 99.1 350 **Interrupt flag & Interrupt level:**
351
Xiaoling 109.10 352 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:480px" %)
Saxer Lin 99.1 353 |=(% style="width: 60px;background-color:#4F81BD;color:white" %)(((
354 **Size(bit)**
Xiaoling 109.7 355 )))|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**bit7**|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**bit6**|=(% style="width: 60px;background-color:#4F81BD;color:white" %)**[bit5:bit2]**|=(% style="width: 90px; background-color: #4F81BD; color: white;" %)**bit1**|=(% style="background-color: #4F81BD; color: white; width: 90px;" %)**bit0**
Saxer Lin 99.1 356 |(% style="width:62.5px" %)Value|(% style="width:62.5px" %)No ACK message|(% style="width:62.5px" %)Poll Message Flag|Reserve|(% style="width:91px" %)Interrupt level|(% style="width:88px" %)(((
357 Interrupt flag
358 )))
359
Saxer Lin 97.1 360 * (((
Xiaoling 113.6 361 Each data entry is 11 bytes and has the same structure as [[Uplink Payload>>||anchor="H2.3.2UplinkPayload2CFPORT3D2"]], to save airtime and battery, DS20L will send max bytes according to the current DR and Frequency bands.
Saxer Lin 97.1 362 )))
363
364 For example, in the US915 band, the max payload for different DR is:
365
366 **a) DR0:** max is 11 bytes so one entry of data
367
368 **b) DR1:** max is 53 bytes so devices will upload 4 entries of data (total 44 bytes)
369
370 **c) DR2:** total payload includes 11 entries of data
371
372 **d) DR3:** total payload includes 22 entries of data.
373
Xiaoling 113.6 374 If DS20L doesn't have any data in the polling time. It will uplink 11 bytes of 0
Saxer Lin 97.1 375
376
377 **Downlink:**
378
379 0x31 64 CC 68 0C 64 CC 69 74 05
380
381 [[image:image-20230805144936-2.png||height="113" width="746"]]
382
383 **Uplink:**
384
385 43 FF 0E 10 00 B0 1E 64 CC 68 0C 40 FF 0D DE 00 A8 1E 64 CC 68 29 40 FF 09 92 00 D3 1E 64 CC 68 65 40 FF 02 3A 02 BC 1E 64 CC 68 A1 41 FF 0E 1A 00 A4 1E 64 CC 68 C0 40 FF 0D 2A 00 B8 1E 64 CC 68 E8 40 FF 00 C8 11 6A 1E 64 CC 69 24 40 FF 0E 24 00 AD 1E 64 CC 69 6D
386
387
388 **Parsed Value:**
389
390 [DISTANCE , DISTANCE_SIGNAL_STRENGTH,LIDAR_TEMP,EXTI_STATUS , EXTI_FLAG , TIME]
391
392
393 [360,176,30,High,True,2023-08-04 02:53:00],
394
395 [355,168,30,Low,False,2023-08-04 02:53:29],
396
397 [245,211,30,Low,False,2023-08-04 02:54:29],
398
399 [57,700,30,Low,False,2023-08-04 02:55:29],
400
401 [361,164,30,Low,True,2023-08-04 02:56:00],
402
403 [337,184,30,Low,False,2023-08-04 02:56:40],
404
405 [20,4458,30,Low,False,2023-08-04 02:57:40],
406
407 [362,173,30,Low,False,2023-08-04 02:58:53],
408
409
Saxer Lin 107.1 410 **History read from serial port:**
Saxer Lin 97.1 411
412 [[image:image-20230805145056-3.png]]
413
414
Saxer Lin 100.1 415 === 2.3.4 Decode payload in The Things Network ===
Xiaoling 82.8 416
417
Xiaoling 70.10 418 While using TTN network, you can add the payload format to decode the payload.
Edwin Chen 1.1 419
Xiaoling 82.10 420 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LLDS12-LoRaWAN%20LiDAR%20ToF%20Distance%20Sensor%20User%20Manual/WebHome/1654592762713-715.png?rev=1.1||alt="1654592762713-715.png"]]
Edwin Chen 1.1 421
422
Xiaoling 62.5 423 (((
Xiaoling 82.4 424 The payload decoder function for TTN is here:
Xiaoling 62.5 425 )))
Edwin Chen 1.1 426
Xiaoling 82.4 427 (((
Xiaoling 113.6 428 DS20L TTN Payload Decoder:  [[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>https://github.com/dragino/dragino-end-node-decoder]]
Xiaoling 82.4 429 )))
Edwin Chen 1.1 430
Xiaoling 82.4 431
Saxer Lin 93.1 432 == 2.4 ​Show Data in DataCake IoT Server ==
Edwin Chen 1.1 433
434
Xiaoling 62.5 435 (((
Xiaoling 70.10 436 [[DATACAKE>>url:https://datacake.co/]] provides a human friendly interface to show the sensor data, once we have data in TTN, we can use [[DATACAKE>>url:https://datacake.co/]] to connect to TTN and see the data in DATACAKE. Below are the steps:
Xiaoling 62.5 437 )))
Edwin Chen 1.1 438
439
Xiaoling 62.5 440 (((
Xiaoling 70.10 441 (% style="color:blue" %)**Step 1**(%%)**: Be sure that your device is programmed and properly connected to the network at this time.**
Xiaoling 62.5 442 )))
Edwin Chen 1.1 443
Xiaoling 62.5 444 (((
Xiaoling 70.10 445 (% style="color:blue" %)**Step 2**(%%)**: 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 62.5 446 )))
Xiaoling 14.26 447
Saxer Lin 55.1 448
Xiaoling 70.10 449 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LDDS75%20-%20LoRaWAN%20Distance%20Detection%20Sensor%20User%20Manual/WebHome/1654592790040-760.png?rev=1.1||alt="1654592790040-760.png"]]
Edwin Chen 1.1 450
451
Xiaoling 70.10 452 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LDDS75%20-%20LoRaWAN%20Distance%20Detection%20Sensor%20User%20Manual/WebHome/1654592800389-571.png?rev=1.1||alt="1654592800389-571.png"]]
Edwin Chen 1.1 453
454
Xiaoling 70.10 455 (% style="color:blue" %)**Step 3**(%%)**: Create an account or log in Datacake.**
Edwin Chen 1.1 456
Xiaoling 113.6 457 (% style="color:blue" %)**Step 4**(%%)**: Search the DS20L and add DevEUI.**
Edwin Chen 1.1 458
Xiaoling 70.10 459 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LDDS75%20-%20LoRaWAN%20Distance%20Detection%20Sensor%20User%20Manual/WebHome/1654851029373-510.png?rev=1.1||alt="1654851029373-510.png"]]
Xiaoling 62.5 460
Edwin Chen 1.1 461
Xiaoling 70.10 462 After added, the sensor data arrive TTN V3, it will also arrive and show in Datacake.
Edwin Chen 1.1 463
Xiaoling 120.2 464 [[image:1701152946067-561.png]]
Edwin Chen 1.1 465
466
Xiaoling 118.2 467 == 2.5 Frequency Plans ==
Edwin Chen 1.1 468
469
Xiaoling 113.7 470 The DS20L uses OTAA mode and below frequency plans by default. If user want to use it with different frequency plan, please refer the AT command sets.
Edwin Chen 1.1 471
472 [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/>>http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/]]
473
474
Xiaoling 118.2 475 = 3. Configure DS20L =
Xiaoling 82.4 476
kai 16.4 477 == 3.1 Configure Methods ==
Edwin Chen 1.1 478
479
Xiaoling 113.7 480 DS20L supports below configure method:
Edwin Chen 1.1 481
482 * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]].
Xiaoling 67.20 483
Edwin Chen 11.1 484 * AT Command via UART Connection : See [[UART Connection>>http://wiki.dragino.com/xwiki/bin/view/Main/UART%20Access%20for%20LoRa%20ST%20v4%20base%20model/#H2.3UARTConnectionforSN50v3basemotherboard]].
Xiaoling 67.20 485
Edwin Chen 1.1 486 * LoRaWAN Downlink.  Instruction for different platforms: See [[IoT LoRaWAN Server>>http://wiki.dragino.com/xwiki/bin/view/Main/]] section.
487
488 == 3.2 General Commands ==
489
490
491 These commands are to configure:
492
493 * General system settings like: uplink interval.
Xiaoling 67.20 494
Edwin Chen 1.1 495 * LoRaWAN protocol & radio related command.
496
497 They are same for all Dragino Devices which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki:
498
499 [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20AT%20Commands%20and%20Downlink%20Command/>>http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20AT%20Commands%20and%20Downlink%20Command/]]
500
501
Xiaoling 113.7 502 == 3.3 Commands special design for DS20L ==
Edwin Chen 1.1 503
504
Xiaoling 113.7 505 These commands only valid for DS20L, as below:
Edwin Chen 1.1 506
507
508 === 3.3.1 Set Transmit Interval Time ===
509
510
Xiaoling 62.5 511 (((
Edwin Chen 1.1 512 Feature: Change LoRaWAN End Node Transmit Interval.
Xiaoling 62.5 513 )))
514
515 (((
Edwin Chen 1.1 516 (% style="color:blue" %)**AT Command: AT+TDC**
Xiaoling 62.5 517 )))
Edwin Chen 1.1 518
Xiaoling 14.34 519 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
Xiaoling 82.16 520 |=(% style="width: 156px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 137px;background-color:#4F81BD;color:white" %)**Function**|=(% style="background-color:#4F81BD;color:white" %)**Response**
Edwin Chen 1.1 521 |(% style="width:156px" %)AT+TDC=?|(% style="width:137px" %)Show current transmit Interval|(((
522 30000
523 OK
524 the interval is 30000ms = 30s
525 )))
526 |(% style="width:156px" %)AT+TDC=60000|(% style="width:137px" %)Set Transmit Interval|(((
527 OK
528 Set transmit interval to 60000ms = 60 seconds
529 )))
530
Xiaoling 62.5 531 (((
Edwin Chen 1.1 532 (% style="color:blue" %)**Downlink Command: 0x01**
Xiaoling 62.5 533 )))
Edwin Chen 1.1 534
Xiaoling 62.5 535 (((
Edwin Chen 1.1 536 Format: Command Code (0x01) followed by 3 bytes time value.
Xiaoling 62.5 537 )))
Edwin Chen 1.1 538
Xiaoling 62.5 539 (((
Edwin Chen 1.1 540 If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01.
Xiaoling 62.5 541 )))
Edwin Chen 1.1 542
Xiaoling 62.5 543 * (((
544 Example 1: Downlink Payload: 0100001E  ~/~/ Set Transmit Interval (TDC) = 30 seconds
545 )))
546 * (((
Xiaoling 118.2 547 Example 2: Downlink Payload: 0100003C  ~/~/ Set Transmit Interval (TDC) = 60 seconds
548 )))
Xiaoling 82.22 549
Xiaoling 70.11 550 === 3.3.2 Set Interrupt Mode ===
Xiaoling 62.5 551
552
Saxer Lin 109.1 553 Feature, Set Interrupt mode for pin of GPIO_EXTI.
Edwin Chen 1.1 554
Saxer Lin 107.1 555 When AT+INTMOD=0 is set, GPIO_EXTI is used as a digital input port.
Saxer Lin 46.1 556
Edwin Chen 1.1 557 (% style="color:blue" %)**AT Command: AT+INTMOD**
558
Xiaoling 14.34 559 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
Xiaoling 82.16 560 |=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 197px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 158px;background-color:#4F81BD;color:white" %)**Response**
Edwin Chen 1.1 561 |(% style="width:154px" %)AT+INTMOD=?|(% style="width:196px" %)Show current interrupt mode|(% style="width:157px" %)(((
562 0
563 OK
564 the mode is 0 =Disable Interrupt
565 )))
Saxer Lin 107.1 566 |(% style="width:154px" %)(((
Xiaoling 118.2 567 AT+INTMOD=3
Saxer Lin 107.1 568
569 (default)
570 )))|(% style="width:196px" %)(((
Edwin Chen 1.1 571 Set Transmit Interval
572 0. (Disable Interrupt),
573 ~1. (Trigger by rising and falling edge)
574 2. (Trigger by falling edge)
575 3. (Trigger by rising edge)
576 )))|(% style="width:157px" %)OK
577
578 (% style="color:blue" %)**Downlink Command: 0x06**
579
580 Format: Command Code (0x06) followed by 3 bytes.
581
582 This means that the interrupt mode of the end node is set to 0x000003=3 (rising edge trigger), and the type code is 06.
583
584 * Example 1: Downlink Payload: 06000000  ~/~/  Turn off interrupt mode
Xiaoling 62.6 585
Edwin Chen 1.1 586 * Example 2: Downlink Payload: 06000003  ~/~/  Set the interrupt mode to rising edge trigger
587
Xiaoling 118.2 588
589 == 3.3.3 Set work mode ==
590
591
592 Feature: Switch working mode
593
594 (% style="color:blue" %)**AT Command: AT+MOD**
595
Xiaoling 118.12 596 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:510px" %)
597 |=(% style="width: 162px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 193px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Response**
Xiaoling 118.2 598 |(% style="width:162px" %)AT+MOD=?|(% style="width:191px" %)Get the current working mode.|(% style="width:106px" %)OK
599 |(% style="width:162px" %)AT+MOD=1|(% style="width:191px" %)Set the working mode to Regular measurements.|(% style="width:106px" %)(((
600 OK
601 Attention:Take effect after ATZ
602 )))
603
604 (% style="color:blue" %)**Downlink Command:**
605
606 * **Example: **0x0A00  ~/~/  Same as AT+MOD=0
607
608 * **Example:** 0x0A01  ~/~/  Same as AT+MOD=1
609
610 === 3.3.4 Set threshold and threshold mode ===
611
612
613 Feature, Set threshold and threshold mode
614
Xiaoling 118.9 615 When (% style="color:#037691" %)**AT+DOL=0,0,0,0,400**(%%) is set, No threshold is used, the sampling time is 400ms.
Xiaoling 118.2 616
Xiaoling 118.3 617 (% style="color:blue" %)**AT Command: AT+DOL**
Xiaoling 118.2 618
Xiaoling 118.17 619 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
620 |(% style="background-color:#4f81bd; color:white; width:162px" %)**Command Example**|(% style="background-color:#4f81bd; color:white; width:240px" %)**Function**|(% style="background-color:#4f81bd; color:white; width:108px" %)**Response**
Xiaoling 118.2 621 |(% style="width:172px" %)AT+ DOL =?|(% style="width:279px" %)Get the current threshold mode and sampling time|(% style="width:118px" %)(((
622 0,0,0,0,400
623 OK
624 )))
625 |(% style="width:172px" %)AT+ DOL =1,1800,100,0,400|(% style="width:279px" %)Set only the upper and lower thresholds|(% style="width:118px" %)OK
626
627
Xiaoling 118.17 628
629 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
630 |(% rowspan="11" style="color:blue; width:120px" %)**AT+DOL=5,1800,0,0,400**|(% rowspan="6" style="width:240px" %)The first bit sets the limit mode|(% style="width:150px" %)0: Do not use upper and lower limits
631 |(% style="width:251px" %)1: Use upper and lower limits
632 |(% style="width:251px" %)2: Less than the lower limit
633 |(% style="width:251px" %)3: Greater than the lower limit
634 |(% style="width:251px" %)4: Less than the upper limit
Xiaoling 118.2 635 |(% style="width:251px" %)5: Greater than the upper limit
636 |(% style="width:226px" %)The second bit sets the upper limit value|(% style="width:251px" %)3~~2000MM
637 |(% style="width:226px" %)The third bit sets the lower limit value|(% style="width:251px" %)3~~2000MM
638 |(% rowspan="2" style="width:226px" %)The fourth bit sets the over-limit alarm or person or object count.|(% style="width:251px" %)0 Over-limit alarm, DO output is high
639 |(% style="width:251px" %)1 Person or object counting statistics
640 |(% style="width:226px" %)The fifth bit sets the sampling time|(% style="width:251px" %)(((
641 0~~10000ms
642
643
644 )))
645
Xiaoling 118.3 646 (% style="color:blue" %)**Downlink Command: 0x07**
Xiaoling 118.2 647
648 Format: Command Code (0x07) followed by 9bytes.
649
650 * Example 0: Downlink Payload: 070000000000000190  **~-~-->**  AT+MOD=0,0,0,0,400
Xiaoling 118.3 651
Xiaoling 118.2 652 * Example 1: Downlink Payload: 070107080064000190  **~-~-->**  AT+MOD=1,1800,100,0,400
653
Xiaoling 118.3 654
655
kai 16.4 656 = 4. Battery & Power Consumption =
Xiaoling 14.45 657
Edwin Chen 1.1 658
Xiaoling 113.7 659 DS20L use built-in 2400mAh non-chargeable battery for long-term use up to several years*. See below link for detail information about the battery info and how to replace.
Edwin Chen 1.1 660
661 [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] .
662
663
kai 16.4 664 = 5. OTA Firmware update =
Edwin Chen 1.1 665
666
Edwin Chen 13.1 667 (% class="wikigeneratedid" %)
Xiaoling 113.7 668 User can change firmware DS20L to:
Edwin Chen 1.1 669
Edwin Chen 13.1 670 * Change Frequency band/ region.
Xiaoling 62.7 671
Edwin Chen 13.1 672 * Update with new features.
Xiaoling 62.7 673
Edwin Chen 13.1 674 * Fix bugs.
Edwin Chen 1.1 675
Xiaoling 113.6 676 Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/zqv1vt3komgp4tu/AAC33PnXIcWOVl_UXBEAeT_xa?dl=0]]**
Edwin Chen 1.1 677
kai 31.1 678 Methods to Update Firmware:
Edwin Chen 1.1 679
Xiaoling 79.15 680 * (Recommanded way) OTA firmware update via wireless:  **[[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/Firmware%20OTA%20Update%20for%20Sensors/>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Firmware%20OTA%20Update%20for%20Sensors/]]**
Xiaoling 62.7 681
Xiaoling 70.18 682 * Update through UART TTL interface: **[[Instruction>>url:http://wiki.dragino.com/xwiki/bin/view/Main/UART%20Access%20for%20LoRa%20ST%20v4%20base%20model/#H1.LoRaSTv4baseHardware]]**.
Edwin Chen 1.1 683
kai 31.1 684 = 6. FAQ =
Edwin Chen 1.1 685
Xiaoling 113.8 686 == 6.1 What is the frequency plan for DS20L? ==
Edwin Chen 1.1 687
Xiaoling 62.7 688
Xiaoling 113.8 689 DS20L use the same frequency as other Dragino products. User can see the detail from this link:  [[Introduction>>doc:Main.End Device Frequency Band.WebHome||anchor="H1.Introduction"]]
Xiaoling 62.7 690
Edwin Chen 1.1 691
Xiaoling 80.4 692 = 7. Trouble Shooting =
Edwin Chen 1.1 693
Xiaoling 80.4 694 == 7.1 AT Command input doesn't work ==
Edwin Chen 1.1 695
Xiaoling 70.14 696
Xiaoling 80.4 697 In the case if user can see the console output but can't type input to the device. Please check if you already include the (% style="color:blue" %)**ENTER**(%%) while sending out the command. Some serial tool doesn't send (% style="color:blue" %)**ENTER**(%%) while press the send key, user need to add ENTER in their string.
Xiaoling 70.14 698
699
Xiaoling 80.4 700 == 7.2 Significant error between the output distant value of LiDAR and actual distance ==
Xiaoling 70.14 701
702
Xiaoling 80.4 703 (((
Xiaoling 82.21 704 (% style="color:blue" %)**Cause ①**(%%)**:**Due to the physical principles of The LiDAR probe, the above phenomenon is likely to occur if the detection object is the material with high reflectivity (such as mirror, smooth floor tile, etc.) or transparent substance. (such as glass and water, etc.)
Xiaoling 80.4 705 )))
Xiaoling 70.14 706
Xiaoling 80.4 707 (((
Xiaoling 82.21 708 (% style="color:red" %)**Troubleshooting**(%%): Please avoid use of this product under such circumstance in practice.
Xiaoling 80.4 709 )))
Xiaoling 70.14 710
711
Xiaoling 80.4 712 (((
713 (% style="color:blue" %)**Cause ②**(%%)**: **The IR-pass filters are blocked.
714 )))
Xiaoling 70.14 715
Xiaoling 79.7 716 (((
Xiaoling 82.21 717 (% style="color:red" %)**Troubleshooting**(%%): please use dry dust-free cloth to gently remove the foreign matter.
Xiaoling 79.7 718 )))
Xiaoling 70.14 719
720
721 = 8. Order Info =
722
723
Xiaoling 113.5 724 Part Number: (% style="color:blue" %)**DS20L-XXX**
Xiaoling 70.14 725
Xiaoling 70.12 726 (% style="color:red" %)**XXX**(%%): **The default frequency band**
Edwin Chen 1.1 727
Ellie Zhang 38.1 728 * (% style="color:red" %)**AS923**(%%): LoRaWAN AS923 band
Edwin Chen 1.1 729
Ellie Zhang 38.1 730 * (% style="color:red" %)**AU915**(%%): LoRaWAN AU915 band
Edwin Chen 1.1 731
Ellie Zhang 38.1 732 * (% style="color:red" %)**EU433**(%%): LoRaWAN EU433 band
Edwin Chen 1.1 733
Ellie Zhang 38.1 734 * (% style="color:red" %)**EU868**(%%): LoRaWAN EU868 band
Edwin Chen 1.1 735
Ellie Zhang 38.1 736 * (% style="color:red" %)**KR920**(%%): LoRaWAN KR920 band
Edwin Chen 1.1 737
Ellie Zhang 38.1 738 * (% style="color:red" %)**US915**(%%): LoRaWAN US915 band
Edwin Chen 1.1 739
Ellie Zhang 38.1 740 * (% style="color:red" %)**IN865**(%%): LoRaWAN IN865 band
Edwin Chen 1.1 741
Ellie Zhang 38.1 742 * (% style="color:red" %)**CN470**(%%): LoRaWAN CN470 band
Edwin Chen 1.1 743
Xiaoling 70.14 744 = 9. ​Packing Info =
Xiaoling 67.11 745
746
Ellie Zhang 39.1 747 (% style="color:#037691" %)**Package Includes**:
Edwin Chen 1.1 748
Xiaoling 113.5 749 * DS20L LoRaWAN Smart Distance Detector x 1
Edwin Chen 1.1 750
Ellie Zhang 39.1 751 (% style="color:#037691" %)**Dimension and weight**:
Edwin Chen 1.1 752
kai 31.1 753 * Device Size: cm
Edwin Chen 1.1 754
kai 31.1 755 * Device Weight: g
Edwin Chen 1.1 756
kai 31.1 757 * Package Size / pcs : cm
Edwin Chen 1.1 758
kai 31.1 759 * Weight / pcs : g
Edwin Chen 1.1 760
Xiaoling 70.14 761 = 10. Support =
762
763
kai 31.1 764 * Support is provided Monday to Friday, from 09:00 to 18:00 GMT+8. Due to different timezones we cannot offer live support. However, your questions will be answered as soon as possible in the before-mentioned schedule.
Xiaoling 39.6 765
766 * Provide as much information as possible regarding your enquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to [[Support@dragino.cc>>mailto:Support@dragino.cc]].