Wiki source code of CPL01 -- LoRaWAN Outdoor Pulse/Contact Sensor
Last modified by Mengting Qiu on 2025/02/11 11:41
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% style="text-align:center" %) | ||
2 | [[image:1652856952171-363.png]] | ||
3 | |||
4 | |||
5 | |||
6 | |||
7 | |||
8 | **Table of Contents:** | ||
9 | |||
10 | {{toc/}} | ||
11 | |||
12 | |||
13 | |||
14 | = 1. Introduction = | ||
15 | |||
16 | == 1.1 What is CPL01 LoRaWAN Pulse/Contact Sensor == | ||
17 | |||
18 | ((( | ||
19 | |||
20 | |||
21 | The Dragino CPL01 is a (% style="color:blue" %)**LoRaWAN Contact Sensor**(%%). It detects open/close status and uplink to IoT server via LoRaWAN network. user can see the dry contact status, open time, open counts in the IoT Server. | ||
22 | ))) | ||
23 | |||
24 | ((( | ||
25 | CPL01 is powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery**(%%), It is designed for long term use up to 10 years. (Actually Battery life depends on the use environment, update period.) | ||
26 | ))) | ||
27 | |||
28 | ((( | ||
29 | The CPL01 will send periodically data every day as well as for each dry contact action. It also counts the contact open times and calculate last open duration. User can also disable the uplink for each open/close event, instead, device can count each open event and uplink periodically. | ||
30 | ))) | ||
31 | |||
32 | ((( | ||
33 | CPL01 has the open alarm feature, user can set this feature so device will send Alarm if the contact has been open for a certain time. | ||
34 | ))) | ||
35 | |||
36 | ((( | ||
37 | CPL01 is designed for outdoor use. It has a weatherproof enclosure and industrial level battery to work in low to high temperatures. | ||
38 | ))) | ||
39 | |||
40 | ((( | ||
41 | Each CPL01 is pre-load with a set of unique keys for LoRaWAN registration, register these keys to LoRaWAN server and it will auto connect after power on. | ||
42 | ))) | ||
43 | |||
44 | ((( | ||
45 | *Battery life depends on how often to send data, please see [[battery analyzer>>||anchor="H4.Battery26PowerConsumption"]]. | ||
46 | ))) | ||
47 | |||
48 | |||
49 | == 1.2 Features == | ||
50 | |||
51 | |||
52 | * LoRaWAN v1.0.3 Class A protocol. | ||
53 | * Frequency Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865/RU864 | ||
54 | * Open/Close detect | ||
55 | * Open/Close statistics | ||
56 | * 8500mAh industrial battery(none-rechargeable) | ||
57 | * AT Commands to change parameters | ||
58 | * Uplink on periodically and open/close event | ||
59 | * Datalog feature | ||
60 | * Remote configure parameters via LoRa Downlink | ||
61 | * Firmware upgradable via program port | ||
62 | * Wall Mountable | ||
63 | * Outdoor Use | ||
64 | |||
65 | == 1.3 Installation == | ||
66 | |||
67 | |||
68 | Connect CPL01 to an Open Close sensor like below. So it can detect the open/close event. | ||
69 | |||
70 | |||
71 | [[image:1652857419839-473.png||height="435" width="482"]] | ||
72 | |||
73 | |||
74 | [[image:image-20221117175638-1.png||height="282" width="750"]] | ||
75 | |||
76 | |||
77 | == 1.4 Storage & Operation Temperature == | ||
78 | |||
79 | |||
80 | -40°C to +85°C | ||
81 | |||
82 | |||
83 | == 1.5 Applications == | ||
84 | |||
85 | |||
86 | (% class="wikigeneratedid" %) | ||
87 | (% style="display:none" %) | ||
88 | |||
89 | * Open/Close Detection | ||
90 | * Pulse meter application | ||
91 | * Dry Contact Detection | ||
92 | |||
93 | == 1.6 Mechanical == | ||
94 | |||
95 | |||
96 | [[image:1652857762997-798.png]] | ||
97 | |||
98 | |||
99 | [[image:1652857791347-991.png]] | ||
100 | |||
101 | |||
102 | == 1.7 Pin Definitions and Switch == | ||
103 | |||
104 | |||
105 | [[image:1652857867227-591.png||height="374" width="727"]] | ||
106 | |||
107 | |||
108 | === 1.7.1 Pin Definition === | ||
109 | |||
110 | |||
111 | CPL01 is pre-configured to connect to two external wires. The other pins are not used. If user wants to know more about other pins, please refer to the user manual of LSN50v2 at: [[https:~~/~~/www.dropbox.com/sh/djkxs7mr17y94mi/AABVlWbM9uzK9OA3mXyAT10Za?dl=0>>https://www.dropbox.com/sh/djkxs7mr17y94mi/AABVlWbM9uzK9OA3mXyAT10Za?dl=0]] | ||
112 | |||
113 | |||
114 | === 1.7.2 Jumper JP2(Power ON/OFF) === | ||
115 | |||
116 | |||
117 | Power on Device when putting this jumper. | ||
118 | |||
119 | |||
120 | === 1.7.3 BOOT MODE / SW1 === | ||
121 | |||
122 | |||
123 | ((( | ||
124 | 1) ISP: upgrade mode, device won't have any signal in this mode. but ready for upgrade firmware. LED won't work. Firmware won't run. | ||
125 | ))) | ||
126 | |||
127 | ((( | ||
128 | 2) Flash: work mode, the device starts to work and send out console output for further debug | ||
129 | ))) | ||
130 | |||
131 | |||
132 | === 1.7.4 Reset Button === | ||
133 | |||
134 | |||
135 | Press to reboot the device. | ||
136 | |||
137 | |||
138 | === 1.7.5 LED === | ||
139 | |||
140 | |||
141 | It will flash: | ||
142 | |||
143 | 1. Boot the device in flash mode | ||
144 | 1. Send an uplink packet | ||
145 | |||
146 | = 2. Operation Mode = | ||
147 | |||
148 | == 2.1 How it works? == | ||
149 | |||
150 | |||
151 | ((( | ||
152 | Each CPL01 is shipped with a worldwide unique set of OTAA keys. To use CPL01 in a LoRaWAN network, user needs to input the OTAA keys in the LoRaWAN network server. So CPL01 can join the LoRaWAN network and start to transmit sensor data. | ||
153 | ))) | ||
154 | |||
155 | |||
156 | == 2.2 Example to use for LoRaWAN network == | ||
157 | |||
158 | |||
159 | This section shows an example of how to join the TTN V3 LoRaWAN IoT server. Usages with other LoRaWAN IoT servers are similar. | ||
160 | |||
161 | [[image:1652858412212-334.png||height="327" width="723"]] | ||
162 | |||
163 | |||
164 | * ((( | ||
165 | In this use case, the CPL01 is connect to a dry contact sensor to detect the open/close event and send the status to the LoRaWAN server. The CPL01 will uplink different types of messages to the LoRaWAN server. See [[Uplink payload>>||anchor="H2.3UplinkPayload"]] for detail. | ||
166 | ))) | ||
167 | |||
168 | ((( | ||
169 | Assume the DLOS8 is already set to connect to the [[TTN V3 network >>url:https://eu1.cloud.thethings.network]]. We need to add the CPL01 device in TTN V3: | ||
170 | |||
171 | |||
172 | ))) | ||
173 | |||
174 | ((( | ||
175 | (% style="color:blue" %)**Step 1**(%%): Create a device in TTN V3 with the OTAA keys from CPL01. | ||
176 | ))) | ||
177 | |||
178 | ((( | ||
179 | Each CPL01 is shipped with a sticker with the default device EUI as below: | ||
180 | ))) | ||
181 | |||
182 | [[image:image-20230426085232-1.png||height="233" width="502"]] | ||
183 | |||
184 | |||
185 | Users can enter these keys in the LoRaWAN Server portal. Below is the TTN V3 screenshot: | ||
186 | |||
187 | Add APP EUI in the application. | ||
188 | |||
189 | [[image:1652858478050-325.png]] | ||
190 | |||
191 | |||
192 | [[image:1652858498638-881.png||height="327" width="727"]] | ||
193 | |||
194 | |||
195 | [[image:1652858507748-628.png]] | ||
196 | |||
197 | |||
198 | [[image:1652858520534-791.png]] | ||
199 | |||
200 | |||
201 | Add APP KEY and DEV EUI | ||
202 | |||
203 | |||
204 | |||
205 | (% style="color:blue" %)**Step 2**(%%): Power on CPL01 | ||
206 | |||
207 | |||
208 | [[image:1652858584749-726.png]] | ||
209 | |||
210 | |||
211 | ((( | ||
212 | Put the jumper to power on CPL01 and it will auto-join to the TTN V3 network. After join success, it will start to upload sensor data to TTN V3 and the user can see it in the panel. | ||
213 | ))) | ||
214 | |||
215 | [[image:1652858597931-989.png||height="322" width="721"]] | ||
216 | |||
217 | |||
218 | == 2.3 Uplink Payload == | ||
219 | |||
220 | |||
221 | ((( | ||
222 | Uplink payloads have two types: | ||
223 | ))) | ||
224 | |||
225 | * ((( | ||
226 | Open/Close Status: Use FPORT=2 | ||
227 | ))) | ||
228 | * ((( | ||
229 | Other control commands: Use other FPORT fields. | ||
230 | ))) | ||
231 | |||
232 | ((( | ||
233 | The application server should parse the correct value based on FPORT settings. | ||
234 | ))) | ||
235 | |||
236 | |||
237 | === 2.3.1 Device Status, FPORT~=5 === | ||
238 | |||
239 | |||
240 | ((( | ||
241 | Include device configure status. Once CPL01 Joined the network, it will uplink this message to the server. After that, CPL01 will uplink Device Status every 12 hours. | ||
242 | ))) | ||
243 | |||
244 | ((( | ||
245 | Users can also use the downlink command(0x26 01) to ask CPL01 to resend this uplink. This uplink payload also includes the DeviceTimeReq to get time. | ||
246 | |||
247 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
248 | |(% colspan="6" style="background-color:#4f81bd; color:white" %)**Device Status (FPORT=5)** | ||
249 | |(% style="width:103px" %)**Size (bytes)**|(% style="width:72px" %)**1**|**2**|(% style="width:91px" %)**1**|(% style="width:86px" %)**1**|(% style="width:44px" %)**2** | ||
250 | |(% style="width:103px" %)Value|(% style="width:72px" %)Sensor Model|Firmware Version|(% style="width:91px" %)Frequency Band|(% style="width:86px" %)Sub-band|(% style="width:44px" %)BAT | ||
251 | |||
252 | |||
253 | ))) | ||
254 | |||
255 | |||
256 | Example parse in TTNv3 | ||
257 | |||
258 | [[image:1652859749264-179.png||height="275" width="723"]] | ||
259 | |||
260 | |||
261 | * ((( | ||
262 | (% style="color:#037691" %)** Sensor Model**(%%): For CPL01, this value is 0x0E | ||
263 | ))) | ||
264 | |||
265 | * ((( | ||
266 | (% style="color:#037691" %)** Firmware Version**(%%): 0x0100, Means: v1.0.0 version | ||
267 | ))) | ||
268 | |||
269 | * ((( | ||
270 | (% style="color:#037691" %)** Frequency Band**: | ||
271 | ))) | ||
272 | |||
273 | ((( | ||
274 | *0x01: EU868 | ||
275 | *0x02: US915 | ||
276 | *0x03: IN865 | ||
277 | *0x04: AU915 | ||
278 | *0x05: KZ865 | ||
279 | *0x06: RU864 | ||
280 | *0x07: AS923 | ||
281 | *0x08: AS923-1 | ||
282 | *0x09: AS923-2 | ||
283 | *0x0a: AS923-3 | ||
284 | *0x0b: CN470 | ||
285 | *0x0c: EU433 | ||
286 | *0x0d: KR920 | ||
287 | *0x0e: MA869 | ||
288 | ))) | ||
289 | |||
290 | * ((( | ||
291 | ((( | ||
292 | (% style="color:#037691" %)** Sub-Band**: | ||
293 | ))) | ||
294 | |||
295 | * ((( | ||
296 | AU915 and US915:value 0x00 ~~ 0x08 | ||
297 | ))) | ||
298 | * ((( | ||
299 | CN470: value 0x0B ~~ 0x0C | ||
300 | ))) | ||
301 | * ((( | ||
302 | Other Bands: Always 0x00 | ||
303 | ))) | ||
304 | ))) | ||
305 | |||
306 | * ((( | ||
307 | (% style="color:#037691" %)** Battery Info:** | ||
308 | ))) | ||
309 | |||
310 | ((( | ||
311 | Check the battery voltage. | ||
312 | ))) | ||
313 | |||
314 | ((( | ||
315 | (% style="color:blue" %)** Ex1**(%%): 0x0B45 = 2885mV | ||
316 | ))) | ||
317 | |||
318 | ((( | ||
319 | (% style="color:blue" %)** Ex2**(%%): 0x0B49 = 2889mV | ||
320 | ))) | ||
321 | |||
322 | |||
323 | === 2.3.2 Sensor Configuration, FPORT~=4 === | ||
324 | |||
325 | |||
326 | CPL01 will only send this data after getting the downlink command (0x26 02) from the server. | ||
327 | |||
328 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
329 | |(% colspan="6" style="background-color:#4f81bd; color:white; width:504px" %)**Sensor Configuration FPORT=4** | ||
330 | |**Size(bytes)**|(% style="width:75px" %)**3**|(% style="width:77px" %)**1**|(% style="width:96px" %)**1**|(% style="width:158px" %)**2**|(% style="width:158px" %)**1** | ||
331 | |Value|(% style="width:75px" %)TDC (unit:sec)|(% style="width:77px" %)Disalarm|(% style="width:96px" %)Keep status|(% style="width:158px" %)Keep time (unit: sec)|(% style="width:158px" %)Trigger mode | ||
332 | |||
333 | * ((( | ||
334 | (% style="color:#037691" %)** TDC: (default: 0x001C20)** | ||
335 | ))) | ||
336 | |||
337 | ((( | ||
338 | Uplink interval for the total pulse count, default value is 0x001C20 which is 7200 seconds = 2 hours. | ||
339 | |||
340 | |||
341 | ))) | ||
342 | |||
343 | * ((( | ||
344 | (% style="color:#037691" %)** Disalarm: (default: 0)** | ||
345 | ))) | ||
346 | |||
347 | ((( | ||
348 | (% style="color:blue" %)** If Disalarm = 1**(%%), CPL01 will only send uplink at every TDC periodically. This is normally use for pulse meter application, in this application, there are many disconnect/connect event, and platform only care about the total number of pulse. | ||
349 | ))) | ||
350 | |||
351 | ((( | ||
352 | (% style="color:blue" %)** If Disalarm = 0**(%%), CPL01 will send uplink at every TDC periodically. | ||
353 | |||
354 | |||
355 | ))) | ||
356 | |||
357 | * ((( | ||
358 | (% style="color:#037691" %)** Keep Status & Keep Time** | ||
359 | ))) | ||
360 | |||
361 | ((( | ||
362 | Shows the configure value of [[Alarm Base on Timeout Feature>>||anchor="H3.5AlarmBaseonTimeout"]] | ||
363 | |||
364 | |||
365 | ))) | ||
366 | |||
367 | * ((( | ||
368 | (% style="color:#037691" %)** Trigger mode (default: 0)** | ||
369 | ))) | ||
370 | |||
371 | ((( | ||
372 | (% style="color:blue" %)** If Trigger mode = 0**(%%), count close to open event. | ||
373 | ))) | ||
374 | |||
375 | ((( | ||
376 | (% style="color:blue" %)** If Trigger mode = 1**(%%), count open to close event. | ||
377 | ))) | ||
378 | |||
379 | [[image:1652860064987-743.png||height="152" width="730"]] | ||
380 | |||
381 | |||
382 | [[image:1652860079526-831.png||height="209" width="729"]] | ||
383 | |||
384 | |||
385 | === 2.3.3 Real-Time Open/Close Status, Uplink FPORT~=2 === | ||
386 | |||
387 | |||
388 | ((( | ||
389 | ((( | ||
390 | CPL01 will send this uplink **after** Device Status once join the LoRaWAN network successfully. And CPL01 will: | ||
391 | ))) | ||
392 | ))) | ||
393 | |||
394 | ((( | ||
395 | ((( | ||
396 | periodically send this uplink every 2 hours, this interval [[can be changed>>||anchor="H3.1SetTransmitIntervalTime"]]. | ||
397 | ))) | ||
398 | ))) | ||
399 | |||
400 | ((( | ||
401 | ((( | ||
402 | Uplink Payload totals 11 bytes. | ||
403 | ))) | ||
404 | ))) | ||
405 | |||
406 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
407 | |=(% colspan="5" style="background-color:#4F81BD;color:white; width: 510px;" %)**Real-Time Open/Close Status, FPORT=2** | ||
408 | |(% style="width:60px" %)**Size(bytes)**|(% style="width:65px" %)**1**|(% style="width:65px" %)**3**|(% style="width:240px" %)**3**|(% style="width:90px" %)**4** | ||
409 | |(% style="width:101px" %)Value|(% style="width:133px" %)Status & [[Alarm>>||anchor="H3.5AlarmBaseonTimeout"]]|(% style="width:92px" %)Total pulse|(% style="width:247px" %)The last open duration (unit: min)|(% style="width:149px" %)[[Unix TimeStamp>>||anchor="H2.4.1UnixTimeStamp"]] | ||
410 | |||
411 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:504px" %) | ||
412 | |=(% colspan="4" style="background-color:#4F81BD;color:white; width: 502px;" %)**Status & Alarm field** | ||
413 | |(% style="width:60px" %)**Size(bit)**|(% style="width:70px" %)**6**|(% style="width:228px" %)**1**|(% style="width:146px" %)**1** | ||
414 | |(% style="width:76px" %)Value|(% style="width:80px" %)Calculate Flag|(% style="width:208px" %)Alarm: 0: No Alarm; 1: Alarm|(% style="width:136px" %)Contact Status: 0: Open, 1: Close | ||
415 | |||
416 | * ((( | ||
417 | (% style="color:#037691" %)** Calculate Flag** | ||
418 | ))) | ||
419 | |||
420 | ((( | ||
421 | The calculate flag is a user define field, IoT server can use this filed to handle different meter with different pulse factor. For example, if there are 100 water meters, meter 1 ~~50 are 1 liter/pulse and meter 51 ~~ 100 has 1.5 liter/pulse. | ||
422 | ))) | ||
423 | |||
424 | ((( | ||
425 | User can set calculate flag to 1 for meter 1~~50 and 2 for meter 51 ~~ 100, So IoT Server can use this field for calculation. | ||
426 | ))) | ||
427 | |||
428 | ((( | ||
429 | Default value: 0. | ||
430 | ))) | ||
431 | |||
432 | ((( | ||
433 | Range (6 bits): (b)000000 ~~ (b) 111111 | ||
434 | ))) | ||
435 | |||
436 | ((( | ||
437 | Refer: [[Set Calculate Flag>>||anchor="H3.9Setthecalculateflag"]] | ||
438 | |||
439 | |||
440 | ))) | ||
441 | |||
442 | * ((( | ||
443 | (% style="color:#037691" %)** Alarm** | ||
444 | ))) | ||
445 | |||
446 | ((( | ||
447 | See [[Alarm Base on Timeout>>||anchor="H3.5AlarmBaseonTimeout"]] | ||
448 | |||
449 | |||
450 | ))) | ||
451 | |||
452 | * ((( | ||
453 | (% style="color:#037691" %)** Contact Status** | ||
454 | ))) | ||
455 | |||
456 | ((( | ||
457 | 0: Open | ||
458 | ))) | ||
459 | |||
460 | ((( | ||
461 | 1: Close | ||
462 | |||
463 | |||
464 | ))) | ||
465 | |||
466 | * ((( | ||
467 | (% style="color:#037691" %)** Total pulse** | ||
468 | ))) | ||
469 | |||
470 | ((( | ||
471 | Total pulse/counting base on dry [[contact trigger event>>||anchor="H2.3.2SensorConfiguration2CFPORT3D4"]] | ||
472 | ))) | ||
473 | |||
474 | ((( | ||
475 | Range (3 Bytes) : 0x000000 ~~ 0xFFFFFF . Max: 16777215 | ||
476 | |||
477 | |||
478 | ))) | ||
479 | |||
480 | * ((( | ||
481 | (% style="color:#037691" %)** The last open duration** | ||
482 | ))) | ||
483 | |||
484 | ((( | ||
485 | Dry Contact last open duration. | ||
486 | ))) | ||
487 | |||
488 | ((( | ||
489 | Unit: min. | ||
490 | ))) | ||
491 | |||
492 | [[image:1652860403792-491.png||height="153" width="735"]] | ||
493 | |||
494 | |||
495 | === 2.3.4 Real-Time Open/Close Status, 3 pulse mode, Uplink FPORT~=6 === | ||
496 | |||
497 | |||
498 | (% style="color:red" %)**Note:** | ||
499 | |||
500 | * Users need to run (% style="color:blue" %)**AT+MOD=3**(%%) to support this model after updating the firmware. | ||
501 | * This mode doesn't support Historical Events and Datalog features. | ||
502 | |||
503 | (% style="color:blue" %)**CPL03 3 Pulse Wiring:** | ||
504 | |||
505 | [[image:image-20221013153352-1.png||height="628" width="720"]] | ||
506 | |||
507 | |||
508 | (% style="color:blue" %)**Payload:** | ||
509 | |||
510 | [[image:image-20221013153352-2.png||height="167" width="1215"]] | ||
511 | |||
512 | |||
513 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:447px" %) | ||
514 | |(% style="background-color:#4f81bd; color:white; width:95px" %)**Size(bytes)**|(% style="background-color:#4f81bd; color:white; width:61px" %)**1**|(% style="background-color:#4f81bd; color:white; width:98px" %)**3**|(% style="background-color:#4f81bd; color:white; width:98px" %)**3**|(% style="background-color:#4f81bd; color:white; width:95px" %)**3** | ||
515 | |(% style="width:93px" %)Value|(% style="width:59px" %)Status|(% style="width:98px" %)((( | ||
516 | Port1 Total Pulse(PB14) | ||
517 | )))|(% style="width:96px" %)((( | ||
518 | Port2 Total Pulse(PB15) | ||
519 | )))|(% style="width:94px" %)((( | ||
520 | Port3 Total Pulse(PA4) | ||
521 | ))) | ||
522 | |||
523 | (% style="color:blue" %)**Status:** | ||
524 | |||
525 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:257px" %) | ||
526 | |(% style="background-color:#4f81bd; color:white; width:75px" %)**Size(bit)**|(% style="background-color:#4f81bd; color:white; width:112px" %)**6**|(% style="background-color:#4f81bd; color:white; width:70px" %)**2** | ||
527 | |(% style="width:75px" %)Value|(% style="width:111px" %)Calculate Flag|(% style="width:68px" %)Reserve | ||
528 | |||
529 | (% style="color:red" %)**Max COUNT for each port is 16777215. Exceed this number will reset to 1.** | ||
530 | |||
531 | |||
532 | (% style="color:blue" %)**Related AT Command:** | ||
533 | |||
534 | (% style="color:#037691" %)**AT+TTRMOD1: Port1 count mode; 0: Signal falling edge(Default), 1: Signal raising edge** | ||
535 | |||
536 | AT+TTRMOD1=0 Downlink Command: 0xA4 01 00 | ||
537 | |||
538 | AT+TTRMOD1=1 Downlink Command: 0xA4 01 01 | ||
539 | |||
540 | |||
541 | (% style="color:#037691" %)**AT+TTRMOD2: Port2 count mode; 0: Signal falling edge(Default), 1: Signal raising edge** | ||
542 | |||
543 | AT+TTRMOD1=0 Downlink Command: 0xA4 02 00 | ||
544 | |||
545 | AT+TTRMOD1=1 Downlink Command: 0xA4 02 01 | ||
546 | |||
547 | |||
548 | (% style="color:#037691" %)**AT+TTRMOD3: Port3 count mode; 0: Signal falling edge(Default), 1: Signal raising edge** | ||
549 | |||
550 | AT+TTRMOD1=0 Downlink Command: 0xA4 03 00 | ||
551 | |||
552 | AT+TTRMOD1=1 Downlink Command: 0xA4 03 01 | ||
553 | |||
554 | |||
555 | (% style="color:#037691" %)**AT+CALCFLAG: Calculate Flag ( Default : 0 )** | ||
556 | |||
557 | AT+CALCFLAG=aa | ||
558 | |||
559 | |||
560 | (% style="color:blue" %)**Downlink Command: 0xA5 aa** | ||
561 | |||
562 | (% style="color:#037691" %)**AT+COUNTMOD: Accumulative Mode; 0: Accumulative (Default),1: Reset after uplink.** | ||
563 | |||
564 | AT+COUNTMOD=0 Downlink Command: 0x0B 00 | ||
565 | |||
566 | AT+COUNTMOD=1 Downlink Command: 0x0B 01 | ||
567 | |||
568 | |||
569 | (% style="color:#037691" %)**AT+SETCNT: Set count value** | ||
570 | |||
571 | AT+SETCNT=1,aa Downlink Command: 0xA6 01 aa aa aa | ||
572 | |||
573 | AT+SETCNT=2,aa Downlink Command: 0xA6 02 aa aa aa | ||
574 | |||
575 | AT+SETCNT=3,aa Downlink Command: 0xA6 03 aa aa aa | ||
576 | |||
577 | |||
578 | (% style="color:blue" %)**Decode: **(%%)[[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>https://github.com/dragino/dragino-end-node-decoder]] | ||
579 | |||
580 | |||
581 | === 2.3.5 Historical Door Open/Close Event, FPORT~=3 === | ||
582 | |||
583 | |||
584 | ((( | ||
585 | CPL01 stores sensor values and users can retrieve these history values via the [[downlink command>>||anchor="H2.4DatalogFeature"]]. | ||
586 | ))) | ||
587 | |||
588 | ((( | ||
589 | The historical payload includes one or multiplies entries and every entry has the same payload as Real-Time open/close status. | ||
590 | ))) | ||
591 | |||
592 | * ((( | ||
593 | Each data entry is 11 bytes and has the same structure as [[Real-Time open/close status>>||anchor="H2.3.3Real-TimeOpen2FCloseStatus2CUplinkFPORT3D2"]], to save airtime and battery, CPL01 will send max bytes according to the current DR and Frequency bands. | ||
594 | ))) | ||
595 | |||
596 | ((( | ||
597 | For example, in the US915 band, the max payload for different DR is: | ||
598 | ))) | ||
599 | |||
600 | ((( | ||
601 | a) (% style="color:blue" %)**DR0**(%%): max is 11 bytes so one entry of data | ||
602 | ))) | ||
603 | |||
604 | ((( | ||
605 | b) (% style="color:blue" %)**DR1**(%%): max is 53 bytes so devices will upload 4 entries of data (total 44 bytes) | ||
606 | ))) | ||
607 | |||
608 | ((( | ||
609 | c) (% style="color:blue" %)**DR2**(%%): total payload includes 11 entries of data | ||
610 | ))) | ||
611 | |||
612 | ((( | ||
613 | d) (% style="color:blue" %)**DR3**(%%): total payload includes 22 entries of data. | ||
614 | ))) | ||
615 | |||
616 | ((( | ||
617 | If CPL01 doesn't have any data in the polling time. It will uplink 11 bytes of 0 | ||
618 | |||
619 | |||
620 | ))) | ||
621 | |||
622 | (% style="color:blue" %)** Downlink:** | ||
623 | |||
624 | (% class="box" %) | ||
625 | ((( | ||
626 | **0x31 61 E9 3A D4 61 E9 3D E0 05** | ||
627 | ))) | ||
628 | |||
629 | [[image:1652861353248-624.png||height="189" width="720"]] | ||
630 | |||
631 | |||
632 | (% style="color:blue" %)** Uplink:** | ||
633 | |||
634 | (% class="box" %) | ||
635 | ((( | ||
636 | **0E 00 23 E6 00 00 00 61 E9 3B 04 0E 00 23 E6 00 00 00 61 E9 3B 25 0D 00 00 00 00 00 00 61 E9 3B C8 0E 00 00 02 00 00 00 61 E9 3B D4 0E 00 00 06 00 00 00 61 E9 3B DB 01 00 00 00 00 00 00 61 E9 3C 91 01 00 00 00 00 00 00 61 E9 3C A1 0D 00 00 00 00 00 00 61 E9 3C BC 0E 00 00 07 00 00 00 61 E9 3C D6 00 00 00 00 00 00 00 61 E9 3D A6** | ||
637 | ))) | ||
638 | |||
639 | (% style="color:#037691" %)** ** | ||
640 | |||
641 | (% style="color:#037691" %)**Parsed Value:** | ||
642 | |||
643 | ((( | ||
644 | [ALARM, PIN_STATUS, TOTAL_PULSE, CALCULATE_FLAG, LAST_OPEN_DURATION, TIME] | ||
645 | ))) | ||
646 | |||
647 | ((( | ||
648 | |||
649 | ))) | ||
650 | |||
651 | ((( | ||
652 | [TRUE, CLOSE, 9190, 3, 0, 2022-01-20 10:35:48], | ||
653 | ))) | ||
654 | |||
655 | ((( | ||
656 | [TRUE, CLOSE, 9190, 3, 0, 2022-01-20 10:36:21], | ||
657 | ))) | ||
658 | |||
659 | ((( | ||
660 | [FALSE, OPEN, 0, 3, 0, 2022-01-20 10:39:04], | ||
661 | ))) | ||
662 | |||
663 | ((( | ||
664 | [TRUE, CLOSE, 2, 3, 0, 2022-01-20 10:39:16], | ||
665 | ))) | ||
666 | |||
667 | ((( | ||
668 | [TRUE, CLOSE, 6, 3, 0, 2022-01-20 10:39:23], | ||
669 | ))) | ||
670 | |||
671 | ((( | ||
672 | [FALSE, OPEN, 0, 0, 0, 2022-01-20 10:42:25], | ||
673 | ))) | ||
674 | |||
675 | ((( | ||
676 | [FALSE, OPEN, 0, 0, 0, 2022-01-20 10:42:41], | ||
677 | ))) | ||
678 | |||
679 | ((( | ||
680 | [FALSE, OPEN, 0, 3, 0, 2022-01-20 10:43:08], | ||
681 | ))) | ||
682 | |||
683 | ((( | ||
684 | [TRUE, CLOSE, 7, 3, 0, 2022-01-20 10:43:34], | ||
685 | ))) | ||
686 | |||
687 | ((( | ||
688 | [FALSE, CLOSE, 0, 0, 0, 2022-01-20 10:47:02], | ||
689 | |||
690 | |||
691 | ))) | ||
692 | |||
693 | [[image:1652861480446-216.png]] | ||
694 | |||
695 | |||
696 | == 2.4 Datalog Feature == | ||
697 | |||
698 | |||
699 | When a user wants to retrieve sensor value, he can send a poll command from the IoT platform to ask the sensor to send value in the required time slot. | ||
700 | |||
701 | |||
702 | === 2.4.1 Unix TimeStamp === | ||
703 | |||
704 | |||
705 | CPL01 uses Unix TimeStamp format based on | ||
706 | |||
707 | [[image:1652861618065-927.png||height="109" width="705"]] | ||
708 | |||
709 | Users can get this time from the link: [[https:~~/~~/www.epochconverter.com/>>url:https://www.epochconverter.com/]] : | ||
710 | |||
711 | Below is the converter example | ||
712 | |||
713 | [[image:1652861637105-371.png||height="428" width="732"]] | ||
714 | |||
715 | |||
716 | === 2.4.2 Set Device Time === | ||
717 | |||
718 | |||
719 | ((( | ||
720 | ((( | ||
721 | There are two ways to set the device's time: | ||
722 | |||
723 | |||
724 | ))) | ||
725 | ))) | ||
726 | |||
727 | ((( | ||
728 | ((( | ||
729 | (% style="color:blue" %)**1. Through LoRaWAN MAC Command (Default settings)** | ||
730 | ))) | ||
731 | ))) | ||
732 | |||
733 | ((( | ||
734 | ((( | ||
735 | Users need to set SYNCMOD=1 to enable sync time via the MAC command. | ||
736 | ))) | ||
737 | ))) | ||
738 | |||
739 | ((( | ||
740 | ((( | ||
741 | Once CPL01 Joined the LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to CPL01. If CPL01 fails to get the time from the server, CPL01 will use the internal time and wait for the next time request ~[[[via Device Status (FPORT=5)>>||anchor="H2.3.1DeviceStatus2CFPORT3D5"]]]. | ||
742 | |||
743 | |||
744 | ))) | ||
745 | ))) | ||
746 | |||
747 | ((( | ||
748 | ((( | ||
749 | (% style="color:red" %)**Note: LoRaWAN Server needs to support LoRaWAN v1.0.3(MAC v1.0.3) or higher to support this MAC command feature.** | ||
750 | ))) | ||
751 | |||
752 | ((( | ||
753 | |||
754 | ))) | ||
755 | |||
756 | ((( | ||
757 | (% style="color:blue" %)**2. Manually Set Time** | ||
758 | ))) | ||
759 | |||
760 | ((( | ||
761 | Users need to set SYNCMOD=0 to manual time, otherwise, the user set time will be overwritten by the time set by the server. | ||
762 | ))) | ||
763 | ))) | ||
764 | |||
765 | |||
766 | === 2.4.3 Poll sensor value === | ||
767 | |||
768 | |||
769 | Users can poll sensor values based on timestamps. Below is the downlink command. | ||
770 | |||
771 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:425.818px" %) | ||
772 | |(% colspan="4" style="background-color:#4f81bd; color:white; width:423px" %)**Downlink Command to poll Open/Close status (0x31)** | ||
773 | |(% style="width:58px" %)**1byte**|(% style="width:127px" %)**4bytes**|(% style="width:124px" %)**4bytes**|(% style="width:114px" %)**1byte** | ||
774 | |(% style="width:58px" %)31|(% style="width:127px" %)Timestamp start|(% style="width:124px" %)Timestamp end|(% style="width:114px" %)Uplink Interval | ||
775 | |||
776 | ((( | ||
777 | Timestamp start and Timestamp end-use Unix TimeStamp format as mentioned above. Devices will reply with all data logs during this period, using the uplink interval. | ||
778 | ))) | ||
779 | |||
780 | ((( | ||
781 | For example, downlink command[[image:image-20220518162852-1.png]] | ||
782 | ))) | ||
783 | |||
784 | ((( | ||
785 | Is to check 2021/11/12 12:00:00 to 2021/11/12 15:00:00's data | ||
786 | ))) | ||
787 | |||
788 | ((( | ||
789 | Uplink Internal =5s,means CPL01 will send one packet every 5s. range 5~~255s. | ||
790 | ))) | ||
791 | |||
792 | |||
793 | === 2.4.4 Decoder in TTN V3 === | ||
794 | |||
795 | |||
796 | [[image:1652862574387-195.png||height="359" width="722"]] | ||
797 | |||
798 | ((( | ||
799 | Please check the decoder from this link: [[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>https://github.com/dragino/dragino-end-node-decoder]] | ||
800 | ))) | ||
801 | |||
802 | ((( | ||
803 | |||
804 | ))) | ||
805 | |||
806 | = 2.5 Show data on Datacake = | ||
807 | |||
808 | |||
809 | ((( | ||
810 | Datacake IoT platform provides a human-friendly interface to show the sensor data, once we have sensor data in TTN V3, we can use Datacake to connect to TTN V3 and see the data in Datacake. Below are the steps: | ||
811 | ))) | ||
812 | |||
813 | ((( | ||
814 | (% style="color:blue" %)**Step 1**(%%): Link TTNv3 to Datacake [[https:~~/~~/docs.datacake.de/lorawan/lns/thethingsindustries#create-integration-on-tti>>url:https://docs.datacake.de/lorawan/lns/thethingsindustries#create-integration-on-tti]] | ||
815 | ))) | ||
816 | |||
817 | ((( | ||
818 | (% style="color:blue" %)**Step 2**(%%): Configure CPL01 in Datacake | ||
819 | ))) | ||
820 | |||
821 | [[image:1652862663124-805.png]] | ||
822 | |||
823 | [[image:1652862686700-576.png]] | ||
824 | |||
825 | |||
826 | |||
827 | |||
828 | [[image:1652862716106-261.png]] | ||
829 | |||
830 | [[image:1652862734313-990.png||height="229" width="707"]] | ||
831 | |||
832 | |||
833 | [[image:1652862744310-982.png||height="380" width="715"]] | ||
834 | |||
835 | |||
836 | [[image:1652862755419-628.png||height="258" width="718"]] | ||
837 | |||
838 | |||
839 | [[image:1652862763975-153.png||height="214" width="720"]] | ||
840 | |||
841 | |||
842 | [[image:1652862773781-198.png||height="321" width="499"]] | ||
843 | |||
844 | |||
845 | [[image:1652862794151-835.png||height="327" width="487"]] | ||
846 | |||
847 | |||
848 | [[image:1652862807472-427.png||height="378" width="670"]] | ||
849 | |||
850 | |||
851 | = 3. Configure CPL01 via AT Command or LoRaWAN Downlink = | ||
852 | |||
853 | |||
854 | ((( | ||
855 | Use can configure CPL01 via AT Command or LoRaWAN Downlink. | ||
856 | ))) | ||
857 | |||
858 | * ((( | ||
859 | AT Command Connection: See [[FAQ>>||anchor="H5.FAQ"]]. | ||
860 | ))) | ||
861 | * ((( | ||
862 | LoRaWAN Downlink instruction for different platforms: [[IoT LoRaWAN Server>>doc:Main.WebHome]] | ||
863 | ))) | ||
864 | |||
865 | ((( | ||
866 | There are two kinds of commands to configure CPL01, they are: | ||
867 | ))) | ||
868 | |||
869 | * ((( | ||
870 | (% style="color:#4f81bd" %)**General Commands**. | ||
871 | ))) | ||
872 | |||
873 | ((( | ||
874 | These commands are to configure: | ||
875 | ))) | ||
876 | |||
877 | * ((( | ||
878 | General system settings like uplink interval. | ||
879 | ))) | ||
880 | * ((( | ||
881 | LoRaWAN protocol & radio related command. | ||
882 | ))) | ||
883 | |||
884 | ((( | ||
885 | They are the same for all Dragino Devices which support DLWS-005 LoRaWAN Stack(Note~*~*). These commands can be found on the wiki: [[End Device AT Commands and Downlink Command>>doc:Main.End Device AT Commands and Downlink Command.WebHome]] | ||
886 | ))) | ||
887 | |||
888 | ((( | ||
889 | |||
890 | ))) | ||
891 | |||
892 | * ((( | ||
893 | (% style="color:#4f81bd" %)**Commands special design for CPL01** | ||
894 | ))) | ||
895 | |||
896 | ((( | ||
897 | These commands are only valid for CPL01, as below: | ||
898 | ))) | ||
899 | |||
900 | |||
901 | == 3.1 Set Transmit Interval Time == | ||
902 | |||
903 | |||
904 | ((( | ||
905 | Feature: Change LoRaWAN End Node Transmit Interval. | ||
906 | |||
907 | |||
908 | ))) | ||
909 | |||
910 | ((( | ||
911 | (% style="color:#4f81bd" %)**AT Command: AT+TDC** | ||
912 | ))) | ||
913 | |||
914 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
915 | |=(% 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** | ||
916 | |(% style="width:156px" %)AT+TDC=?|(% style="width:137px" %)Show current transmit Interval|((( | ||
917 | 30000 | ||
918 | OK | ||
919 | the interval is 30000ms = 30s | ||
920 | ))) | ||
921 | |(% style="width:156px" %)AT+TDC=60000|(% style="width:137px" %)Set Transmit Interval|((( | ||
922 | OK | ||
923 | Set transmit interval to 60000ms = 60 seconds | ||
924 | ))) | ||
925 | |||
926 | ((( | ||
927 | (% style="color:#4f81bd" %)**Downlink Command: 0x01** | ||
928 | ))) | ||
929 | |||
930 | ((( | ||
931 | Format: Command Code (0x01) followed by 3 bytes time value. | ||
932 | ))) | ||
933 | |||
934 | ((( | ||
935 | If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01. | ||
936 | ))) | ||
937 | |||
938 | * ((( | ||
939 | Example 1: Downlink Payload: 0100001E ~/~/ Set Transmit Interval (TDC) = 30 seconds | ||
940 | ))) | ||
941 | * ((( | ||
942 | Example 2: Downlink Payload: 0100003C ~/~/ Set Transmit Interval (TDC) = 60 seconds | ||
943 | |||
944 | |||
945 | |||
946 | ))) | ||
947 | |||
948 | == 3.2 Set Password == | ||
949 | |||
950 | |||
951 | Feature: Set device password, max 9 digits | ||
952 | |||
953 | (% style="color:#4f81bd" %)**AT Command: AT+PWORD** | ||
954 | |||
955 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:405px" %) | ||
956 | |=(% style="width: 170px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 123px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 112px;background-color:#4F81BD;color:white" %)**Response** | ||
957 | |(% style="width:170px" %)((( | ||
958 | AT+PWORD=? | ||
959 | )))|(% style="width:123px" %)((( | ||
960 | Show password | ||
961 | )))|(% style="width:109px" %)((( | ||
962 | ((( | ||
963 | 123456 | ||
964 | ))) | ||
965 | |||
966 | ((( | ||
967 | OK | ||
968 | ))) | ||
969 | ))) | ||
970 | |(% style="width:170px" %)((( | ||
971 | AT+PWORD=999999 | ||
972 | )))|(% style="width:123px" %)((( | ||
973 | Set password | ||
974 | )))|(% style="width:109px" %)((( | ||
975 | OK | ||
976 | ))) | ||
977 | |||
978 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
979 | |||
980 | No downlink command for this feature. | ||
981 | |||
982 | |||
983 | == 3.3 Quit AT Command == | ||
984 | |||
985 | |||
986 | Feature: Quit AT Command mode, so user needs to input the password again before using AT Commands. | ||
987 | |||
988 | (% style="color:#4f81bd" %)**AT Command: AT+DISAT** | ||
989 | |||
990 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:452px" %) | ||
991 | |=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 198px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 99px;background-color:#4F81BD;color:white" %)**Response** | ||
992 | |(% style="width:155px" %)AT+DISAT|(% style="width:198px" %)Quit AT Commands mode|(% style="width:96px" %)OK | ||
993 | |||
994 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
995 | |||
996 | No downlink command for this feature. | ||
997 | |||
998 | |||
999 | == 3.4 Enable / Disable Alarm == | ||
1000 | |||
1001 | |||
1002 | Feature: Enable/Disable Alarm for open/close event. Default value 0. | ||
1003 | |||
1004 | (% style="color:#4f81bd" %)**AT Command:** | ||
1005 | |||
1006 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
1007 | |(% style="background-color:#4f81bd; color:white; width:154px" %)**Command Example**|(% style="background-color:#4f81bd; color:white; width:278px" %)**Function**|(% style="background-color:#4f81bd; color:white; width:78px" %)**Response** | ||
1008 | |(% style="width:154px" %)AT+DISALARM=1|(% style="width:278px" %)End node will only send packets in TDC time.|OK | ||
1009 | |(% style="width:154px" %)AT+DISALARM=0|(% style="width:278px" %)End node will send packets in TDC time or status change for door sensor|OK | ||
1010 | |||
1011 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
1012 | |||
1013 | **0xA7 01** ~/~/ Same As AT+DISALARM=1 | ||
1014 | |||
1015 | **0xA7 00 ** ~/~/ Same As AT+DISALARM=0 | ||
1016 | |||
1017 | (% style="color:red" %)**Notice, This command requires setting CPL01 to LDS03A Mode first. See **(%%)**"(% style="color:blue" %)3.7 Set the sensor mode"(%%)** | ||
1018 | |||
1019 | |||
1020 | == 3.5 Alarm Base on Timeout == | ||
1021 | |||
1022 | |||
1023 | ((( | ||
1024 | ((( | ||
1025 | CPL01 can monitor the timeout for a status change, this feature can be used to monitor some events such as door opening too long etc. Related Parameters are: | ||
1026 | |||
1027 | |||
1028 | ))) | ||
1029 | ))) | ||
1030 | |||
1031 | ((( | ||
1032 | ((( | ||
1033 | (% style="color:#4f81bd" %)**1. Keep Status: Status to be monitor** | ||
1034 | ))) | ||
1035 | ))) | ||
1036 | |||
1037 | ((( | ||
1038 | ((( | ||
1039 | Keep Status = 1: Monitor Close to Open event | ||
1040 | ))) | ||
1041 | ))) | ||
1042 | |||
1043 | ((( | ||
1044 | ((( | ||
1045 | Keep Status = 0: Monitor Open to Close event | ||
1046 | |||
1047 | |||
1048 | ))) | ||
1049 | ))) | ||
1050 | |||
1051 | ((( | ||
1052 | ((( | ||
1053 | (% style="color:#4f81bd" %)**2. Keep Time: Timeout to send an Alarm** | ||
1054 | ))) | ||
1055 | ))) | ||
1056 | |||
1057 | ((( | ||
1058 | ((( | ||
1059 | Range 0 ~~ 65535(0xFFFF) seconds. | ||
1060 | ))) | ||
1061 | ))) | ||
1062 | |||
1063 | ((( | ||
1064 | ((( | ||
1065 | If keep time = 0, Disable Alarm Base on Timeout feature. | ||
1066 | ))) | ||
1067 | ))) | ||
1068 | |||
1069 | ((( | ||
1070 | ((( | ||
1071 | If keep time > 0, device will monitor the keep status event and send an alarm when status doesn’t change after timeout. | ||
1072 | ))) | ||
1073 | |||
1074 | ((( | ||
1075 | |||
1076 | ))) | ||
1077 | ))) | ||
1078 | |||
1079 | ((( | ||
1080 | ((( | ||
1081 | (% style="color:#4f81bd" %)**AT Command**(%%) to configure: | ||
1082 | ))) | ||
1083 | |||
1084 | ((( | ||
1085 | (% style="color:blue" %)**AT+TTRIG=1,30**(%%) ~-~-> When the **Keep Status** change from connect to disconnect, and device remains in disconnect status for more than 30 seconds. CPL01 will send an uplink packet, the [[Alarm bit>>||anchor="H2.3.3Real-TimeOpen2FCloseStatus2CUplinkFPORT3D2"]] (the second bit of 1^^st^^ byte of payload) on this uplink packet is set to 1. | ||
1086 | ))) | ||
1087 | |||
1088 | ((( | ||
1089 | (% style="color:blue" %)**AT+TTIG=0,0 **(%%) ~-~-> Default Value, disable timeout Alarm. | ||
1090 | ))) | ||
1091 | ))) | ||
1092 | |||
1093 | ((( | ||
1094 | |||
1095 | ))) | ||
1096 | |||
1097 | ((( | ||
1098 | ((( | ||
1099 | (% style="color:#4f81bd" %)**Downlink Command**(%%) to configure: | ||
1100 | ))) | ||
1101 | |||
1102 | ((( | ||
1103 | **Command: 0xA9 aa bb cc** | ||
1104 | ))) | ||
1105 | ))) | ||
1106 | |||
1107 | ((( | ||
1108 | ((( | ||
1109 | A9: Command Type Code | ||
1110 | ))) | ||
1111 | ))) | ||
1112 | |||
1113 | ((( | ||
1114 | ((( | ||
1115 | aa: status to be monitored | ||
1116 | ))) | ||
1117 | ))) | ||
1118 | |||
1119 | ((( | ||
1120 | ((( | ||
1121 | bb cc: timeout. | ||
1122 | ))) | ||
1123 | ))) | ||
1124 | |||
1125 | ((( | ||
1126 | |||
1127 | ))) | ||
1128 | |||
1129 | ((( | ||
1130 | ((( | ||
1131 | If user send 0xA9 01 00 1E: equal to AT+TTRIG=1,30 | ||
1132 | ))) | ||
1133 | ))) | ||
1134 | |||
1135 | ((( | ||
1136 | ((( | ||
1137 | Or | ||
1138 | ))) | ||
1139 | ))) | ||
1140 | |||
1141 | ((( | ||
1142 | ((( | ||
1143 | 0xA9 00 00 00: Equal to AT+TTRIG=0,0. Disable timeout Alarm. | ||
1144 | ))) | ||
1145 | ))) | ||
1146 | |||
1147 | |||
1148 | == 3.6 Clear Flash Record == | ||
1149 | |||
1150 | |||
1151 | Feature: Clear flash storage for data log feature. | ||
1152 | |||
1153 | |||
1154 | (% style="color:#4f81bd" %)**AT Command: AT+CLRDTA** | ||
1155 | |||
1156 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:500px" %) | ||
1157 | |=(% style="width: 157px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 169px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 174px;background-color:#4F81BD;color:white" %)**Response** | ||
1158 | |(% style="width:157px" %)AT+CLRDTA|(% style="width:169px" %)Clear flash storage for data log feature.|Clear all stored sensor data… OK | ||
1159 | |||
1160 | ((( | ||
1161 | ((( | ||
1162 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
1163 | ))) | ||
1164 | |||
1165 | ((( | ||
1166 | * **Example**: 0xA301 ~/~/ Same as AT+CLRDTA | ||
1167 | ))) | ||
1168 | ))) | ||
1169 | |||
1170 | |||
1171 | |||
1172 | == 3.7 Set the sensor mode == | ||
1173 | |||
1174 | |||
1175 | Feature: LDS03A and CPL01 use the same firmware. User is possible to switch between this two models. | ||
1176 | |||
1177 | |||
1178 | (% style="color:#4f81bd" %)**AT Command: AT+MOD** | ||
1179 | |||
1180 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:443px" %) | ||
1181 | |=(% style="width: 156px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 197px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 90px;background-color:#4F81BD;color:white" %)**Response** | ||
1182 | |(% style="width:156px" %)AT+MOD=1|(% style="width:195px" %)Set the sensor to LDS03A.|(% style="width:88px" %)OK | ||
1183 | |(% style="width:156px" %)AT+MOD=2|(% style="width:195px" %)Set the sensor to CPL01.|(% style="width:88px" %)OK | ||
1184 | |||
1185 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
1186 | |||
1187 | * **Example**: 0x0A02 ~/~/ Same as AT+MOD=2 | ||
1188 | |||
1189 | == 3.8 Set trigger mode == | ||
1190 | |||
1191 | |||
1192 | Feature: Set the trigger interrupt mode. | ||
1193 | |||
1194 | (% style="color:#4f81bd" %)**AT Command: AT+TTRMOD** | ||
1195 | |||
1196 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:495px" %) | ||
1197 | |=(% style="width: 157px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 246px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 92px;background-color:#4F81BD;color:white" %)**Response** | ||
1198 | |(% style="width:157px" %)((( | ||
1199 | AT+TTRMOD=1 | ||
1200 | )))|(% style="width:156px" %)Count and trigger from open to close (rising edge)|(% style="width:89px" %)((( | ||
1201 | ((( | ||
1202 | OK | ||
1203 | ))) | ||
1204 | ))) | ||
1205 | |(% style="width:157px" %)((( | ||
1206 | AT+TTRMOD=0 | ||
1207 | )))|(% style="width:156px" %)Count and trigger from close to open (falling edge)|(% style="width:89px" %)((( | ||
1208 | OK | ||
1209 | ))) | ||
1210 | |||
1211 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
1212 | |||
1213 | * **Example**: 0xA401 ~/~/ Same as AT+ TTRMOD =1 | ||
1214 | |||
1215 | == 3.9 Set the calculate flag == | ||
1216 | |||
1217 | |||
1218 | Feature: Set the calculate flag | ||
1219 | |||
1220 | (% style="color:#4f81bd" %)**AT Command: AT+CALCFLAG** | ||
1221 | |||
1222 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:461px" %) | ||
1223 | |=(% style="width: 158px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 193px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 110px;background-color:#4F81BD;color:white" %)**Response** | ||
1224 | |(% style="width:158px" %)AT+CALCFLAG =1|(% style="width:192px" %)Set the calculate flag to 1.|(% style="width:109px" %)OK | ||
1225 | |(% style="width:158px" %)AT+CALCFLAG =2|(% style="width:192px" %)Set the calculate flag to 2.|(% style="width:109px" %)OK | ||
1226 | |||
1227 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
1228 | |||
1229 | * **Example**: 0XA501 ~/~/ Same as AT+CALCFLAG =1 | ||
1230 | |||
1231 | == 3.10 Set count number == | ||
1232 | |||
1233 | |||
1234 | Feature: Manually set the count number | ||
1235 | |||
1236 | (% style="color:#4f81bd" %)**AT Command: AT+SETCNT** | ||
1237 | |||
1238 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:479px" %) | ||
1239 | |=(% style="width: 160px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 223px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 96px;background-color:#4F81BD;color:white" %)**Response** | ||
1240 | |(% style="width:160px" %)AT+ SETCNT =0|(% style="width:221px" %)Set the count number to 0.|(% style="width:95px" %)OK | ||
1241 | |(% style="width:160px" %)AT+ SETCNT =100|(% style="width:221px" %)Set the count number to 100.|(% style="width:95px" %)OK | ||
1242 | |||
1243 | (% style="color:#4f81bd" %)**Downlink Command:** | ||
1244 | |||
1245 | 1. **Example**: 0xA6000001 ~/~/ Same as AT+ SETCNT =1 | ||
1246 | 1. **Example**: 0xA6000064 ~/~/ Same as AT+ SETCNT =100 | ||
1247 | |||
1248 | = 4. Battery & Power Consumption = | ||
1249 | |||
1250 | |||
1251 | CPL01 uses ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace. | ||
1252 | |||
1253 | [[**Battery Info & Power Consumption Analyze**>>url:http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] . | ||
1254 | |||
1255 | |||
1256 | = 5. FAQ = | ||
1257 | |||
1258 | == 5.1 How to use AT Command to configure CPL01 == | ||
1259 | |||
1260 | |||
1261 | CPL01 UART connection photo | ||
1262 | |||
1263 | [[image:1652864909750-855.png||height="356" width="728"]] | ||
1264 | |||
1265 | |||
1266 | ((( | ||
1267 | In the PC, you need to set the serial baud rate to (% style="color:green" %)**9600**(%%) to access the serial console for LSN50. LSN50 will output system info once power on as below: | ||
1268 | ))) | ||
1269 | |||
1270 | [[image:1652864915792-686.png||height="508" width="726"]] | ||
1271 | |||
1272 | |||
1273 | == 5.2 How to upgrade the firmware? == | ||
1274 | |||
1275 | |||
1276 | ((( | ||
1277 | ((( | ||
1278 | A new firmware might be available for: | ||
1279 | ))) | ||
1280 | ))) | ||
1281 | |||
1282 | * ((( | ||
1283 | ((( | ||
1284 | Support new features | ||
1285 | ))) | ||
1286 | ))) | ||
1287 | * ((( | ||
1288 | ((( | ||
1289 | For bug fix | ||
1290 | ))) | ||
1291 | ))) | ||
1292 | * ((( | ||
1293 | ((( | ||
1294 | Change LoRaWAN bands. | ||
1295 | ))) | ||
1296 | ))) | ||
1297 | |||
1298 | ((( | ||
1299 | ((( | ||
1300 | Instruction for how to upgrade: [[Firmware Upgrade Instruction>>doc:Main.Firmware Upgrade Instruction for STM32 base products.WebHome||anchor="H2.HardwareUpgradeMethodSupportList"]] | ||
1301 | ))) | ||
1302 | ))) | ||
1303 | |||
1304 | ((( | ||
1305 | ((( | ||
1306 | Firmware location: (**(% style="color:red" %)same firmware as LDS03A(%%)**)[[https:~~/~~/www.dropbox.com/sh/x9rpz9ftyljg135/AAAhC5hqtQOAw9_AoEEZbl9Ca?dl=0>>https://www.dropbox.com/sh/x9rpz9ftyljg135/AAAhC5hqtQOAw9_AoEEZbl9Ca?dl=0]] | ||
1307 | ))) | ||
1308 | ))) | ||
1309 | |||
1310 | |||
1311 | == 5.3 How to change the LoRa Frequency Bands/Region? == | ||
1312 | |||
1313 | |||
1314 | Users can follow the introduction for how to upgrade image. When downloading the images, choose the required image file for download. | ||
1315 | |||
1316 | |||
1317 | == 5.4 How to change CPL01 to uplink on every contact status change? == | ||
1318 | |||
1319 | |||
1320 | ~1. Set mod to 1 (the setting method is in chapter 3.7) | ||
1321 | 2. Use ATZ or physically restart the device | ||
1322 | (If you set a timeout alarm command, the open state will send an uplink according to the set timeout command. | ||
1323 | Example: If you set AT+TTRIG=1,10, then the uplink will be sent after the open state reaches ten seconds) | ||
1324 | |||
1325 | |||
1326 | == 5.5 What is the maximum total number of pulses for CPL01? What happens after the maximum total number of pulses is reached? == | ||
1327 | |||
1328 | |||
1329 | The maximum total number of pulses for CPL01 is three bytes FF FF FF (16,777,215) | ||
1330 | The count is reset when the maximum total number of pulses is reached | ||
1331 | |||
1332 | |||
1333 | = 6. Trouble Shooting = | ||
1334 | |||
1335 | == 6.1 AT Commands input doesn't work == | ||
1336 | |||
1337 | |||
1338 | 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:green" %)**ENTER**(%%) while sending out the command. Some serial tool doesn't send (% style="color:green" %)**ENTER**(%%) while press the send key, user need to add ENTER in their string. | ||
1339 | |||
1340 | |||
1341 | = 7. Order Info = | ||
1342 | |||
1343 | |||
1344 | ((( | ||
1345 | ((( | ||
1346 | Part Number: (% style="color:#4f81bd" %)**CPL01-XX** | ||
1347 | ))) | ||
1348 | ))) | ||
1349 | |||
1350 | ((( | ||
1351 | ((( | ||
1352 | (% style="color:#4f81bd" %)**XX**(%%): The default frequency band | ||
1353 | ))) | ||
1354 | ))) | ||
1355 | |||
1356 | * ((( | ||
1357 | (% style="color:red" %)**AS923 **(%%)**:** LoRaWAN AS923 band | ||
1358 | ))) | ||
1359 | * ((( | ||
1360 | (% style="color:red" %)**AU915 **(%%)**: **LoRaWAN AU915 band | ||
1361 | ))) | ||
1362 | * ((( | ||
1363 | (% style="color:red" %)**EU433 **(%%)**:** LoRaWAN EU433 band | ||
1364 | ))) | ||
1365 | * ((( | ||
1366 | (% style="color:red" %)**EU868 **(%%)**:** LoRaWAN EU868 band | ||
1367 | ))) | ||
1368 | * ((( | ||
1369 | (% style="color:red" %)**KR920 **(%%)**:** LoRaWAN KR920 band | ||
1370 | ))) | ||
1371 | * ((( | ||
1372 | (% style="color:red" %)**US915 **(%%)**: **LoRaWAN US915 band | ||
1373 | ))) | ||
1374 | * ((( | ||
1375 | (% style="color:red" %)**IN865 **(%%)**: **LoRaWAN IN865 band | ||
1376 | ))) | ||
1377 | * ((( | ||
1378 | (% style="color:red" %)**CN470 **(%%)**: **LoRaWAN CN470 band | ||
1379 | |||
1380 | |||
1381 | |||
1382 | ))) | ||
1383 | |||
1384 | = 8. Packing Info = | ||
1385 | |||
1386 | |||
1387 | ((( | ||
1388 | **Package Includes**: | ||
1389 | ))) | ||
1390 | |||
1391 | * ((( | ||
1392 | CPL01 Open/Close Sensor x 1 | ||
1393 | |||
1394 | |||
1395 | |||
1396 | ))) | ||
1397 | |||
1398 | = 9. Support = | ||
1399 | |||
1400 | |||
1401 | * ((( | ||
1402 | 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. | ||
1403 | ))) | ||
1404 | * ((( | ||
1405 | Provide as much information as possible regarding your inquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to [[support@dragino.com>>url:file:///D:/市场资料/说明书/LoRa/LT系列/support@dragino.com]]. | ||
1406 | |||
1407 | |||
1408 | |||
1409 | ))) |