Wiki source code of CPL03-NB -- NB-IoT Pulse Contact Sensor User Manual
Last modified by Mengting Qiu on 2024/05/09 11:54
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | |||
2 | |||
3 | |||
4 | (% style="text-align:center" %) | ||
5 | [[image:image-20231012084342-1.png||height="530" width="701"]] | ||
6 | |||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
13 | |||
14 | |||
15 | **Table of Contents:** | ||
16 | |||
17 | {{toc/}} | ||
18 | |||
19 | |||
20 | |||
21 | |||
22 | |||
23 | |||
24 | = 1. Introduction = | ||
25 | |||
26 | == 1.1 What is CPL03-NB NB-IoT Pulse/Contact Sensor == | ||
27 | |||
28 | |||
29 | The Dragino CPL03-NB is a (% style="color:blue" %)**NB-IoT Contact Sensor**(%%) for Internet of Things solution. It detects (% style="color:blue" %)**dry contact status, open time, open counts,**(%%) and then upload to IoT server via NB-IoT network. | ||
30 | |||
31 | The CPL03-NB 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. | ||
32 | |||
33 | CPL03-NB supports (% style="color:blue" %)**open alarm feature**(%%), user can set open alarm for instant notice. CPL03-NB supports (% style="color:blue" %)**Datalog feature**(%%), it can save the data when there is no NB-IoT network and uplink when network recover. | ||
34 | |||
35 | CPL03-NB is designed for outdoor use. It has a weatherproof enclosure and industrial level battery to work in low to high temperatures. | ||
36 | |||
37 | CPL03-NB supports different uplink methods including (% style="color:blue" %)**MQTT, MQTTs, UDP & TCP**(%%) for different application requirement, and support uplinks to various IoT Servers. | ||
38 | |||
39 | CPL03-NB (% style="color:blue" %)**supports BLE configure **(%%)and(% style="color:blue" %)** OTA update**(%%) which make user easy to use. | ||
40 | |||
41 | CPL03-NB is powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery**(%%), it is designed for long-term use up to several years. | ||
42 | |||
43 | CPL03-NB has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration. | ||
44 | |||
45 | [[image:image-20231012085712-2.png||height="345" width="896"]] | ||
46 | |||
47 | |||
48 | == 1.2 Features == | ||
49 | |||
50 | |||
51 | * NB-IoT Bands: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85 @H-FDD | ||
52 | * Ultra-low power consumption | ||
53 | * Upload water flow volume | ||
54 | * Door Open/Close detect | ||
55 | * Door open/close statistics | ||
56 | * Datalog Feature | ||
57 | * Open Alarm Feature | ||
58 | * Multiply Sampling and one uplink | ||
59 | * Support Bluetooth v5.1 remote configure and update firmware | ||
60 | * Uplink on periodically | ||
61 | * Downlink to change configure | ||
62 | * 8500mAh Battery for long term use | ||
63 | * Nano SIM card slot for NB-IoT SIM | ||
64 | |||
65 | (% style="display:none" %) (%%) | ||
66 | |||
67 | == 1.3 Specification == | ||
68 | |||
69 | |||
70 | (% style="color:blue" %)**Common DC Characteristics:** | ||
71 | |||
72 | * Supply Voltage: 2.5v ~~ 3.6v | ||
73 | * Operating Temperature: -40 ~~ 85°C | ||
74 | |||
75 | (% style="color:blue" %)**NB-IoT Spec:** | ||
76 | |||
77 | (% style="color:#037691" %)**NB-IoT Module: BC660K-GL** | ||
78 | |||
79 | (% style="color:#037691" %)**Support Bands:** | ||
80 | |||
81 | * B1 @H-FDD: 2100MHz | ||
82 | * B2 @H-FDD: 1900MHz | ||
83 | * B3 @H-FDD: 1800MHz | ||
84 | * B4 @H-FDD: 2100MHz | ||
85 | * B5 @H-FDD: 860MHz | ||
86 | * B8 @H-FDD: 900MHz | ||
87 | * B12 @H-FDD: 720MHz | ||
88 | * B13 @H-FDD: 740MHz | ||
89 | * B17 @H-FDD: 730MHz | ||
90 | * B18 @H-FDD: 870MHz | ||
91 | * B19 @H-FDD: 870MHz | ||
92 | * B20 @H-FDD: 790MHz | ||
93 | * B25 @H-FDD: 1900MHz | ||
94 | * B28 @H-FDD: 750MHz | ||
95 | * B66 @H-FDD: 2000MHz | ||
96 | * B70 @H-FDD: 2000MHz | ||
97 | * B85 @H-FDD: 700MHz | ||
98 | |||
99 | (% style="color:blue" %)**Battery:** | ||
100 | |||
101 | * Li/SOCI2 un-chargeable battery | ||
102 | * Capacity: 8500mAh | ||
103 | * Self Discharge: <1% / Year @ 25°C | ||
104 | * Max continuously current: 130mA | ||
105 | * Max boost current: 2A, 1 second | ||
106 | |||
107 | (% style="color:blue" %)**Power Consumption** | ||
108 | |||
109 | * STOP Mode: 10uA @ 3.3v | ||
110 | * Max transmit power: 350mA@3.3v | ||
111 | |||
112 | (% style="display:none" %) (%%) | ||
113 | |||
114 | == 1.4 Applications == | ||
115 | |||
116 | |||
117 | * Open/Close Detection | ||
118 | * Pulse meter application | ||
119 | * Dry Contact Detection | ||
120 | |||
121 | (% style="display:none" %) (%%) | ||
122 | |||
123 | == 1.5 Sleep mode and working mode == | ||
124 | |||
125 | |||
126 | (% style="color:blue" %)**Deep Sleep Mode: **(%%)Sensor doesn't have any NB-IoT activate. This mode is used for storage and shipping to save battery life. | ||
127 | |||
128 | (% style="color:blue" %)**Working Mode:** (%%)In this mode, Sensor will work as NB-IoT Sensor to Join NB-IoT network and send out sensor data to server. Between each sampling/tx/rx periodically, sensor will be in IDLE mode), in IDLE mode, sensor has the same power consumption as Deep Sleep mode. | ||
129 | |||
130 | |||
131 | == 1.6 Button & LEDs == | ||
132 | |||
133 | |||
134 | [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675071855856-879.png]] | ||
135 | |||
136 | |||
137 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
138 | |=(% style="width: 167px;background-color:#4F81BD;color:white" %)**Behavior on ACT**|=(% style="width: 117px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width:225px;background-color:#4F81BD;color:white" %)**Action** | ||
139 | |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)((( | ||
140 | If sensor has already attached to NB-IoT network, sensor will send an uplink packet, (% style="color:blue" %)**blue led** (%%)will blink once. | ||
141 | Meanwhile, BLE module will be active and user can connect via BLE to configure device. | ||
142 | ))) | ||
143 | |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)((( | ||
144 | (% style="color:green" %)**Green led**(%%) will fast blink 5 times, device will enter (% style="color:#037691" %)**OTA mode**(%%) for 3 seconds. And then start to attach NB-IoT network. | ||
145 | (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network. | ||
146 | Once sensor is active, BLE module will be active and user can connect via BLE to configure device, no matter if device attach NB-IoT network or not. | ||
147 | ))) | ||
148 | |(% style="width:167px" %)Fast press ACT 5 times.|(% style="width:117px" %)Deactivate Device|(% style="width:225px" %)(% style="color:red" %)**Red led**(%%) will solid on for 5 seconds. Means device is in Deep Sleep Mode. | ||
149 | |||
150 | (% class="wikigeneratedid" %) | ||
151 | (% style="color:red" %)**Note: When the device is executing a program, the buttons may become invalid. It is best to press the buttons after the device has completed the program execution.** | ||
152 | |||
153 | |||
154 | == 1.7 BLE connection == | ||
155 | |||
156 | |||
157 | CPL03-NB support BLE remote configure and firmware update. | ||
158 | |||
159 | |||
160 | BLE can be used to configure the parameter of sensor or see the console output from sensor. BLE will be only activate on below case: | ||
161 | |||
162 | * Press button to send an uplink | ||
163 | * Press button to active device. | ||
164 | * Device Power on or reset. | ||
165 | |||
166 | If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode. | ||
167 | |||
168 | |||
169 | == 1.8 Pin Definitions , Switch & SIM Direction == | ||
170 | |||
171 | |||
172 | [[image:image-20230819104805-5.png]] | ||
173 | |||
174 | |||
175 | === 1.8.1 Jumper JP2 === | ||
176 | |||
177 | |||
178 | Power on Device when put this jumper. | ||
179 | |||
180 | |||
181 | === 1.8.2 BOOT MODE / SW1 === | ||
182 | |||
183 | |||
184 | **1)** (% style="color:blue" %)**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. | ||
185 | |||
186 | **2)** (% style="color:blue" %)**Flash**(%%): work mode, device starts to work and send out console output for further debug | ||
187 | |||
188 | |||
189 | === 1.8.3 Reset Button === | ||
190 | |||
191 | |||
192 | Press to reboot the device. | ||
193 | |||
194 | |||
195 | === 1.8.4 SIM Card Direction === | ||
196 | |||
197 | |||
198 | See this link. [[How to insert SIM Card>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H2.AttachNetwork]]. | ||
199 | |||
200 | |||
201 | == 1.9 Mechanical == | ||
202 | |||
203 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual/WebHome/1675143884058-338.png?rev=1.1||alt="1675143884058-338.png"]] | ||
204 | |||
205 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual/WebHome/1675143899218-599.png?rev=1.1||alt="1675143899218-599.png"]] | ||
206 | |||
207 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual/WebHome/1675143909447-639.png?rev=1.1||alt="1675143909447-639.png"]] | ||
208 | |||
209 | |||
210 | = 2. Use CPL03-NB to communicate with IoT Server = | ||
211 | |||
212 | == 2.1 Send data to IoT server via NB-IoT network == | ||
213 | |||
214 | |||
215 | The CPL03-NB is equipped with a NB-IoT module, the pre-loaded firmware in CPL03-NB will get environment data from sensors and send the value to local NB-IoT network via the NB-IoT module. The NB-IoT network will forward this value to IoT server via the protocol defined by CPL03-NB. | ||
216 | |||
217 | |||
218 | Below shows the network structure: | ||
219 | |||
220 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/CPL03-NB_NB-IoT_Pulse_Contact_Sensor_User_Manual/WebHome/image-20231012085712-2.png?width=896&height=345&rev=1.1||alt="image-20231012085712-2.png"]] | ||
221 | |||
222 | |||
223 | There are two version: (% style="color:blue" %)**-GE**(%%) and (% style="color:blue" %)**-1D**(%%) version of CPL03-NB. | ||
224 | |||
225 | |||
226 | (% style="color:blue" %)**GE Version**(%%): This version doesn't include SIM card or point to any IoT server. User needs to use AT Commands to configure below two steps to set CPL03-NB send data to IoT server. | ||
227 | |||
228 | * Install NB-IoT SIM card and configure APN. See instruction of [[Attach Network>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H2.AttachNetwork]]. | ||
229 | |||
230 | * Set up sensor to point to IoT Server. See instruction of [[Configure to Connect Different Servers>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.Configuretoconnecttodifferentservers]]. | ||
231 | |||
232 | Below shows result of different server as a glance. | ||
233 | |||
234 | (% border="1" cellspacing="4" style="width:515px" %) | ||
235 | |(% style="background-color:#4f81bd; color:white; width:100px" %)**Servers**|(% style="background-color:#4f81bd; color:white; width:300px" %)**Dash Board**|(% style="background-color:#4f81bd; color:white; width:115px" %)**Comments** | ||
236 | |(% style="width:127px" %)[[Node-Red>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.5A0Node-RedA028viaA0MQTT29]]|(% style="width:385px" %)((( | ||
237 | (% style="text-align:center" %) | ||
238 | [[image:image-20230819113244-8.png||height="183" width="367"]] | ||
239 | )))|(% style="width:170px" %) | ||
240 | |(% style="width:127px" %)[[DataCake>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.4Datacake]]|(% style="width:385px" %)((( | ||
241 | (% style="text-align:center" %) | ||
242 | [[image:image-20230819113244-9.png||height="119" width="367"]] | ||
243 | )))|(% style="width:170px" %) | ||
244 | |(% style="width:127px" %)[[Tago.IO>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.7A0Tago.ioA028viaA0MQTT29]]|(% style="width:385px" %) |(% style="width:170px" %) | ||
245 | |(% style="width:127px" %)[[General UDP>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.1GeneralA0UDPA0Connection]]|(% style="width:385px" %)Raw Payload. Need Developer to design Dash Board|(% style="width:170px" %) | ||
246 | |(% style="width:127px" %)[[General MQTT>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.2GeneralA0MQTTA0Connection]]|(% style="width:385px" %)Raw Payload. Need Developer to design Dash Board|(% style="width:170px" %) | ||
247 | |(% style="width:127px" %)[[ThingSpeak>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.3A0ThingSpeakA028viaA0MQTT29]]|(% style="width:385px" %)((( | ||
248 | (% style="text-align:center" %) | ||
249 | [[image:image-20230819113244-10.png||height="104" width="367"]] | ||
250 | )))|(% style="width:170px" %) | ||
251 | |(% style="width:127px" %)[[ThingsBoard>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.6A0ThingsBoard.CloudA028viaA0MQTT29]]|(% style="width:385px" %)((( | ||
252 | (% style="text-align:center" %) | ||
253 | [[image:image-20230819113244-11.png||height="141" width="367"]] | ||
254 | )))|(% style="width:170px" %) | ||
255 | |||
256 | (% style="color:blue" %)**1D Version**(%%): This version has 1NCE SIM card pre-installed and configure to send value to DataCake. User Just need to select the sensor type in DataCake and Activate CPL03-NB and user will be able to see data in DataCake. See here for [[DataCake Config Instruction>>url:http://wiki.dragino.com/xwiki/bin/view/Main/General%20Configure%20to%20Connect%20to%20IoT%20server%20for%20-NB%20%26%20-NS%20NB-IoT%20models/#H3.4Datacake]]. | ||
257 | |||
258 | |||
259 | == 2.2 Payload Types == | ||
260 | |||
261 | |||
262 | To meet different server requirement, CPL03-NB supports different payload type. | ||
263 | |||
264 | **Includes:** | ||
265 | |||
266 | * [[General JSON format payload>>||anchor="H2.2.1GeneralJsonFormat28Type3D529"]]. (Type=5) | ||
267 | |||
268 | * [[HEX format Payload>>||anchor="H2.2.2HEXformatPayload28Type3D029"]]. (Type=0) | ||
269 | |||
270 | * [[ThingSpeak Format>>||anchor="H2.2.4ThingSpeakPayload28Type3D129"]]. (Type=1) | ||
271 | |||
272 | * [[ThingsBoard Format>>||anchor="H2.2.3ThingsBoardPayload28Type3D329"]]. (Type=3) | ||
273 | |||
274 | User can specify the payload type when choose the connection protocol. Example: | ||
275 | |||
276 | (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Use UDP Connection & hex Payload | ||
277 | |||
278 | (% style="color:#037691" %)**AT+PRO=2,5** (%%) ~/~/ Use UDP Connection & Json Payload | ||
279 | |||
280 | (% style="color:#037691" %)**AT+PRO=3,5 ** (%%) ~/~/ Use MQTT Connection & Json Payload | ||
281 | |||
282 | |||
283 | === 2.2.1 General Json Format(Type~=5) === | ||
284 | |||
285 | ==== 2.2.1.1 AT+MOD~=1(Real-Time Open/Close Status) ==== | ||
286 | |||
287 | |||
288 | (% style="color:#4472c4" %)**{"IMEI":"866207058378443","Model":"CPL03-NB","work mode":1,"count_mode":0,"tdc send flag":1,"trigger mode":0,"alarm":0,"pa8 level status":1,"count time":0,"door duration":0,"battery":3.49,"signal":5,"1":{0,0,0,0,0,25,0,2023/11/06 09:43:51},"2":{0,1,0,1,1,5628535,0,2023/11/06 09:04:51},"3":{0,1,0,1,1,5627635,0,2023/11/15 09:13:24},"4":{0,1,0,1,1,5626735,0,2023/11/15 08:58:24},"5":{0,1,0,1,1,5624751,0,2023/11/15 08:43:24},"6":{0,1,0,1,1,5623851,0,2023/11/15 08:21:49},"7":{0,1,0,1,1,5622951,0,2023/11/15 07:54:30},"8":{0,1,0,1,1,5622050,0,2023/11/15 07:10:04}}** | ||
289 | |||
290 | [[image:image-20231120175036-2.png||height="738" width="775"]] | ||
291 | |||
292 | |||
293 | (% style="color:red" %)**Notice, from above payload:** | ||
294 | |||
295 | * work mode, calc flag, count_mode, tdc send flag, count time1, count time2, count time3, Battery & Signal are the value at uplink time. | ||
296 | |||
297 | * Json entry 1 ~~ 8 are the last 1 ~~ 8 sampling data as specify by (% style="color:#037691" %)**AT+NOUD=8 ** (%%)Command. Each entry includes (from left to right): calc flag, count_mode, count time1, count time2, count time3, Sampling time. | ||
298 | |||
299 | * ((( | ||
300 | (% id="cke_bm_795997S" style="color:#037691; display:none" %)** **(% style="color:#037691" %)**Count mod: Default=0** | ||
301 | ))) | ||
302 | |||
303 | 0: Uplink total open door times since factory | ||
304 | |||
305 | 1 : Uplink total open door times since last FPORT=2 uplink. | ||
306 | |||
307 | |||
308 | * (% style="color:#037691" %)**TDC send flag** | ||
309 | |||
310 | When the flag is 1, it means sending packets at normal time intervals. | ||
311 | |||
312 | Otherwise, it is a packet sent at non-TDC time. | ||
313 | |||
314 | ((( | ||
315 | |||
316 | |||
317 | * (% style="color:#037691" %)**Work mod** | ||
318 | |||
319 | 0: CPL03-NB-Real-Time Open/Close Status mode. | ||
320 | |||
321 | 1: CPL03-NB-3 pulse mode. | ||
322 | |||
323 | |||
324 | * (% style="color:#037691" %)**Trigger mod** | ||
325 | |||
326 | ((( | ||
327 | 0: The pulse count will increment by one after a close to open event and the last duration is for the open event. | ||
328 | ))) | ||
329 | |||
330 | ((( | ||
331 | 1: The pulse count will increment by one after a open to close event and the last duration is for the close event. | ||
332 | ))) | ||
333 | |||
334 | |||
335 | ))) | ||
336 | |||
337 | * ((( | ||
338 | (% style="color:#037691" %)** Alarm** | ||
339 | ))) | ||
340 | |||
341 | ((( | ||
342 | See [[Alarm Base on Timeout>>||anchor="H2.9AlarmBaseonTimeout"]] | ||
343 | ))) | ||
344 | |||
345 | ((( | ||
346 | |||
347 | ))) | ||
348 | |||
349 | * ((( | ||
350 | (% style="color:#037691" %)** count time** | ||
351 | ))) | ||
352 | |||
353 | ((( | ||
354 | Total pulse/counting base on dry contact trigger event | ||
355 | ))) | ||
356 | |||
357 | ((( | ||
358 | Range (3 Bytes) : 0x000000 ~~ 0xFFFFFF . Max: 16777215 | ||
359 | |||
360 | |||
361 | ))) | ||
362 | |||
363 | * ((( | ||
364 | (% style="color:#037691" %)** Door duration** | ||
365 | ))) | ||
366 | |||
367 | ((( | ||
368 | **1) AT+TTRMOD1=0 **: Dry Contact last open duration.(Unit: sec) | ||
369 | ))) | ||
370 | |||
371 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/CPL01%20LoRaWAN%20Outdoor%20PulseContact%20%20Sensor%20Manual/WebHome/1652860403792-491.png?width=735&height=153&rev=1.1||alt="1652860403792-491.png"]] | ||
372 | |||
373 | |||
374 | ((( | ||
375 | **2) AT+TTRMOD1=1 **: Dry Contact last close duration.(Unit: sec) | ||
376 | ))) | ||
377 | |||
378 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/CPL03-LB_LoRaWAN_Outdoor_PulseContact%20_Sensor_User_Manual/WebHome/image-20230710144115-1.png?width=627&height=153&rev=1.1||alt="image-20230710144115-1.png"]] | ||
379 | |||
380 | |||
381 | |||
382 | (% style="display:none" %) (%%) | ||
383 | |||
384 | ==== 2.2.1.2 AT+MOD~=2(3 pulse mode) ==== | ||
385 | |||
386 | |||
387 | (% style="color:#4472c4" %)**{"IMEI":"866207058378443","Model":"CPL03-NB","work mode":2,"calc flag":1,"count_mode":0,"tdc send flag":0,"count time1":13,"count time2":13,"count time3":13,"battery":3.50,"signal":3,"1":{0,0,6553863,0,0,2023/11/06 09:43:51},"2":{0,0,6750472,0,0,2023/11/06 09:04:51},"3":{0,0,0,0,0,2023/11/15 09:13:24},"4":{0,0,0,0,0,2023/11/15 08:58:24},"5":{0,0,0,0,0,2023/11/15 08:43:24},"6":{0,0,2,0,0,2023/11/15 08:21:49},"7":{0,0,3,4,0,2023/11/15 07:54:30},"8":{0,0,6,3,0,2023/11/15 07:10:04}}** | ||
388 | |||
389 | [[image:image-20231120175426-3.png||height="737" width="776"]] | ||
390 | |||
391 | |||
392 | (% style="color:red" %)**Notice, from above payload:** | ||
393 | |||
394 | * work mode, calc flag, count_mode, tdc send flag, count time1, count time2, count time3, Battery & Signal are the value at uplink time. | ||
395 | |||
396 | * Json entry 1 ~~ 8 are the last 1 ~~ 8 sampling data as specify by (% style="color:#037691" %)**AT+NOUD=8 ** (%%)Command. Each entry includes (from left to right): calc flag, count_mode, count time1, count time2, count time3, Sampling time. | ||
397 | |||
398 | (% style="color:red" %)**Max COUNT for each port is 16777215. Exceed this number will reset to 1.** | ||
399 | |||
400 | * ((( | ||
401 | (% style="color:#037691" %)**Count mod:Default=0** | ||
402 | ))) | ||
403 | |||
404 | 0: Uplink total open door times since factory | ||
405 | |||
406 | 1 : Uplink total open door times since last FPORT=2 uplink. | ||
407 | |||
408 | |||
409 | * (% style="color:#037691" %)**TDC send flag** | ||
410 | |||
411 | When the flag is 1, it means sending packets at normal time intervals. | ||
412 | |||
413 | Otherwise, it is a packet sent at non-TDC time. | ||
414 | |||
415 | |||
416 | * (% style="color:#037691" %)**Work mod** | ||
417 | |||
418 | 0: CPL01-Real-Time Open/Close Status mode. | ||
419 | |||
420 | 1: CPL03-3 pulse mode. | ||
421 | |||
422 | |||
423 | * ((( | ||
424 | (% style="color:#037691" %)** Calculate Flag** | ||
425 | ))) | ||
426 | |||
427 | ((( | ||
428 | 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. | ||
429 | ))) | ||
430 | |||
431 | ((( | ||
432 | 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. | ||
433 | ))) | ||
434 | |||
435 | ((( | ||
436 | Default value: 0. | ||
437 | ))) | ||
438 | |||
439 | ((( | ||
440 | Range (3 bits): (b)000 ~~ (b) 111 | ||
441 | ))) | ||
442 | |||
443 | ((( | ||
444 | Refer: [[Set Calculate Flag>>||anchor="H2.14Setthecalculateflag"]] | ||
445 | |||
446 | |||
447 | * ((( | ||
448 | (% style="color:#037691" %)** Port1 Total Pulse(PA8 of pin)** | ||
449 | ))) | ||
450 | |||
451 | ((( | ||
452 | Range (3 Bytes) : 0x000000 ~~ 0xFFFFFF . Max: 16777215.Exceed this number will reset to 1. | ||
453 | |||
454 | |||
455 | * ((( | ||
456 | (% style="color:#037691" %)** Port2 Total Pulse(PA4 of pin)** | ||
457 | ))) | ||
458 | |||
459 | ((( | ||
460 | Range (3 Bytes) : 0x000000 ~~ 0xFFFFFF . Max: 16777215.Exceed this number will reset to 1. | ||
461 | |||
462 | |||
463 | * ((( | ||
464 | (% style="color:#037691" %)** Port3 Total Pulse(PB15 of pin)** | ||
465 | ))) | ||
466 | |||
467 | ((( | ||
468 | Range (3 Bytes) : 0x000000 ~~ 0xFFFFFF . Max: 16777215.Exceed this number will reset to 1. | ||
469 | ))) | ||
470 | ))) | ||
471 | ))) | ||
472 | ))) | ||
473 | |||
474 | (% style="display:none" %) (%%) | ||
475 | |||
476 | === 2.2.2 HEX format Payload(Type~=0) === | ||
477 | |||
478 | ==== 2.2.2.1 AT+MOD~=1(Real-Time Open/Close Status) ==== | ||
479 | |||
480 | |||
481 | (% style="color:#4472c4" %)**f86620705837844300640da1021100000f000000655b2e0900000019000000010000000000001903000000000004000000190000005e48b5650000001900000000000004000000190000005e48b565000000190000000000000400000019000000655b2bfa00000019000000655b2876** | ||
482 | |||
483 | |||
484 | [[image:image-20231120180142-6.png||height="187" width="1149"]] | ||
485 | |||
486 | |||
487 | If we use the MQTT client to subscribe to this MQTT topic, we can see the following information when the NB sensor uplink data. | ||
488 | |||
489 | [[image:image-20231120180217-7.png||height="833" width="879"]] | ||
490 | |||
491 | (% style="color:blue" %)**Version:** | ||
492 | |||
493 | These bytes include the hardware and software version. | ||
494 | |||
495 | (% style="color:#037691" %)**Higher byte:**(%%) Specify Sensor Model: 0x00 for CPL03-NB | ||
496 | |||
497 | (% style="color:#037691" %)**Lower byte:**(%%) Specify the software version: 0x64=100, means firmware version 1.0.0 | ||
498 | |||
499 | |||
500 | (% style="color:blue" %)**BAT (Battery Info):** | ||
501 | |||
502 | Ex1: 0x0dda = 3546mV | ||
503 | |||
504 | |||
505 | (% style="color:blue" %)**Signal Strength:** | ||
506 | |||
507 | NB-IoT Network signal Strength. | ||
508 | |||
509 | **Ex1: 0x15 = 21** | ||
510 | |||
511 | **0** -113dBm or less | ||
512 | |||
513 | **1** -111dBm | ||
514 | |||
515 | **2...30** -109dBm... -53dBm | ||
516 | |||
517 | **31** -51dBm or greater | ||
518 | |||
519 | **99** Not known or not detectable | ||
520 | |||
521 | |||
522 | |||
523 | (% style="color:blue" %)**PA8 Status:** | ||
524 | |||
525 | PA8 Status consists of Count mode, TDC send flag, Trigger mode, PA8 alarm status, PA8 level status. | ||
526 | |||
527 | (PA8 level Status=(count_mode<<5) | (tdc_send_flag<<4) | (0<<3) | (trigger_mode[0]<<2) | (pa8_alarm_status<<1) | pa8_level_status) | ||
528 | |||
529 | |||
530 | (% style="color:blue" %)**Timestamp: ** | ||
531 | |||
532 | Unit Timestamp Example: 650abc40(H) = 1695202368(D) | ||
533 | |||
534 | Put the decimal value into this link([[https:~~/~~/www.epochconverter.com)>>https://www.epochconverter.com]]) to get the time. | ||
535 | |||
536 | |||
537 | |||
538 | |||
539 | ==== 2.2.2.2 AT+MOD~=2(3 pulse mode) ==== | ||
540 | |||
541 | |||
542 | (% style="color:#4472c4" %)**f86620705837844300640cbb051900000f00000f00000f655b2d5e01640106000000000000010000000160011100000000000000000004015d010e000000000fff5e48b5650165010d00000000000000000004016801190000000000005e48b565015b0106000000000000000000040900000d00000d00000d655b2bfa0900000d00000d00000d655b2876** | ||
543 | |||
544 | |||
545 | [[image:image-20231120175947-5.png||height="184" width="1133"]] | ||
546 | |||
547 | |||
548 | If we use the MQTT client to subscribe to this MQTT topic, we can see the following information when the NB sensor uplink data. | ||
549 | |||
550 | [[image:image-20231120175837-4.png||height="862" width="907"]] | ||
551 | |||
552 | |||
553 | (% style="color:blue" %)**Version:** | ||
554 | |||
555 | These bytes include the hardware and software version. | ||
556 | |||
557 | (% style="color:#037691" %)**Higher byte:**(%%) Specify Sensor Model: 0x00 for CPL03-NB | ||
558 | |||
559 | (% style="color:#037691" %)**Lower byte:**(%%) Specify the software version: 0x64=100, means firmware version 1.0.0 | ||
560 | |||
561 | |||
562 | (% style="color:blue" %)**BAT (Battery Info):** | ||
563 | |||
564 | Ex1: 0x0dda = 3546mV | ||
565 | |||
566 | |||
567 | (% style="color:blue" %)**Signal Strength:** | ||
568 | |||
569 | NB-IoT Network signal Strength. | ||
570 | |||
571 | **Ex1: 0x15 = 21** | ||
572 | |||
573 | **0** -113dBm or less | ||
574 | |||
575 | **1** -111dBm | ||
576 | |||
577 | **2...30** -109dBm... -53dBm | ||
578 | |||
579 | **31** -51dBm or greater | ||
580 | |||
581 | **99** Not known or not detectable | ||
582 | |||
583 | |||
584 | |||
585 | (% style="color:blue" %)**PA8 Status:** | ||
586 | |||
587 | PA8 Status consists of Count mode, TDC send flag, Calculate flag. | ||
588 | |||
589 | (PA8 level Status=(count_mode<<5) | (tdc_send_flag<<4) | (1<<3) |calculate_flag) | ||
590 | |||
591 | |||
592 | (% style="color:blue" %)**Timestamp: ** | ||
593 | |||
594 | Unit Timestamp Example: 650abc40(H) = 1695202368(D) | ||
595 | |||
596 | Put the decimal value into this link([[https:~~/~~/www.epochconverter.com)>>https://www.epochconverter.com]]) to get the time. | ||
597 | |||
598 | |||
599 | === 2.2.3 ThingsBoard Payload(Type~=3) === | ||
600 | |||
601 | |||
602 | Type3 payload special design for ThingsBoard, it will also configure other default server to ThingsBoard. | ||
603 | |||
604 | |||
605 | ==== 2.2.3.1 AT+MOD~=1(Real-Time Open/Close Status) ==== | ||
606 | |||
607 | |||
608 | (% style="color:#4472c4" %)**{"IMEI":"866207058378443","Model":"CPL03-NB","work mode":1,"count_mode":0,"tdc send flag":1,"trigger mode":0,"alarm":0,"pa8 level status":1,"count time":15,"door duration":0,"battery":3.05,"signal":3}** | ||
609 | |||
610 | [[image:image-20231121161501-2.png||height="505" width="952"]] | ||
611 | |||
612 | |||
613 | ==== 2.2.3.2 AT+MOD~=2(3 pulse mode) ==== | ||
614 | |||
615 | |||
616 | (% style="color:#4472c4" %)**{"IMEI":"866207058378443","Model":"CPL03-NB","work mode":2,"calc flag":1,"count_mode":0,"tdc send flag":1,"count time1":15,"count time2":15,"count time3":15,"battery":3.48,"signal":2}** | ||
617 | |||
618 | [[image:image-20231121161425-1.png||height="510" width="961"]] | ||
619 | |||
620 | |||
621 | === 2.2.4 ThingSpeak Payload(Type~=1) === | ||
622 | |||
623 | ==== 2.2.4.1 AT+MOD~=1(Real-Time Open/Close Status) ==== | ||
624 | |||
625 | |||
626 | (% style="color:#4472c4" %)**field1=work mod value&field2=count mode value&ield3=tdc send flag value&field4=trigger mode value&field5=alarm value&field6=pa8 level status value&field7=count time value&field8=door duration value** | ||
627 | |||
628 | [[image:image-20231121172519-6.png||height="612" width="899"]] | ||
629 | |||
630 | [[image:image-20231121172536-7.png||height="546" width="868"]] | ||
631 | |||
632 | |||
633 | ==== 2.2.4.2 AT+MOD~=2(3 pulse mode) ==== | ||
634 | |||
635 | |||
636 | (% style="color:#4472c4" %)**field1=work mod value&field2=calc flag value&field3=count mode value&ield4=tdc send flag value&field5=count time1 value&field6=count time2 value&field7=count time3 value&field8=Battery value** | ||
637 | |||
638 | [[image:image-20231121164943-4.png||height="581" width="866"]] | ||
639 | |||
640 | [[image:image-20231121165024-5.png||height="533" width="852"]] | ||
641 | |||
642 | |||
643 | == 2.3 Uplink Payload == | ||
644 | |||
645 | === 2.3.1 Real-Time Open/Close Status === | ||
646 | |||
647 | |||
648 | **Default working mode, (% style="color:blue" %)AT+MOD=1:(%%)** | ||
649 | |||
650 | The wiring of the Real-Time Open/Close Status mode is as follows: | ||
651 | |||
652 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/CPL03-LB_LoRaWAN_Outdoor_PulseContact%20_Sensor_User_Manual/WebHome/image-20230810113214-2.png?width=565&height=399&rev=1.1||alt="image-20230810113214-2.png"]] | ||
653 | |||
654 | |||
655 | === 2.3.2 pulse mode === | ||
656 | |||
657 | |||
658 | **To use this working mode, you need to set (% style="color:blue" %)AT+MOD=2.(%%)** | ||
659 | |||
660 | The wiring of the three pulse counting mode are as follows: | ||
661 | |||
662 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/CPL03-LB_LoRaWAN_Outdoor_PulseContact%20_Sensor_User_Manual/WebHome/image-20230810114416-3.png?width=610&height=497&rev=1.1||alt="image-20230810114416-3.png"]] | ||
663 | |||
664 | (% style="color:blue" %)**Related AT Command:** | ||
665 | |||
666 | (% style="color:#037691" %)**AT+TTRMOD1: Port1 count mode; 0: Signal falling edge(Default), 1: Signal raising edge** | ||
667 | |||
668 | AT+TTRMOD1=0 | ||
669 | |||
670 | AT+TTRMOD1=1 | ||
671 | |||
672 | |||
673 | (% style="color:#037691" %)**AT+TTRMOD2: Port2 count mode; 0: Signal falling edge(Default), 1: Signal raising edge** | ||
674 | |||
675 | AT+TTRMOD2=0 | ||
676 | |||
677 | AT+TTRMOD2=1 | ||
678 | |||
679 | |||
680 | (% style="color:#037691" %)**AT+TTRMOD3: Port3 count mode; 0: Signal falling edge(Default), 1: Signal raising edge** | ||
681 | |||
682 | AT+TTRMOD3=0 | ||
683 | |||
684 | AT+TTRMOD3=1 | ||
685 | |||
686 | |||
687 | (% style="color:#037691" %)**AT+CALCFLAG: Calculate Flag ( Default : 0 )** | ||
688 | |||
689 | AT+CALCFLAG=aa | ||
690 | |||
691 | |||
692 | (% style="color:#037691" %)**AT+COUNTMOD: Accumulative Mode; 0: Accumulative (Default),1: Reset after uplink.** | ||
693 | |||
694 | AT+COUNTMOD=0 | ||
695 | |||
696 | AT+COUNTMOD=1 | ||
697 | |||
698 | |||
699 | (% style="color:#037691" %)**AT+SETCNT: Set count value** | ||
700 | |||
701 | AT+SETCNT=1,aa | ||
702 | |||
703 | AT+SETCNT=2,aa | ||
704 | |||
705 | AT+SETCNT=3,aa | ||
706 | |||
707 | |||
708 | == 2.4 Test Uplink and Change Update Interval == | ||
709 | |||
710 | |||
711 | By default, Sensor will send uplinks (% style="color:blue" %)**every 2 hours**(%%) & AT+NOUD=8 | ||
712 | |||
713 | User can use below commands to change the (% style="color:blue" %)**uplink interval**. | ||
714 | |||
715 | (% style="color:#037691" %)**AT+TDC=600 ** (%%) ~/~/ Set Update Interval to 600s | ||
716 | |||
717 | User can also push the button for more than 1 seconds to activate an uplink. | ||
718 | |||
719 | |||
720 | == 2.5 Multi-Samplings and One uplink == | ||
721 | |||
722 | (% style="color:red" %)Notice: The AT+NOUD feature is upgraded to Clock Logging, please refer [[Clock Logging Feature>>||anchor="H2.19Clocklogging28Sincefirmwareversionv1.2.129"]] | ||
723 | |||
724 | To save battery life, CPL03-NB will sample Water Flow data every 15 minutes and send one uplink every 2 hours. So each uplink it will include 8 stored data + 1 real-time data. They are defined by: | ||
725 | |||
726 | * (% style="color:#037691" %)**AT+TR=900** (%%) ~/~/ The unit is seconds, and the default is to record data once every 900 seconds (15 minutes, the minimum can be set to 180 seconds) | ||
727 | |||
728 | * (% style="color:#037691" %)**AT+NOUD=8** (%%)~/~/ The device uploads 8 sets of recorded data by default. Up to 32 sets of record data can be uploaded. | ||
729 | |||
730 | The diagram below explains the relationship between TR, NOUD, and TDC more clearly: | ||
731 | |||
732 | [[image:1692424376354-959.png]] | ||
733 | |||
734 | |||
735 | == 2.6 Trggier an uplink by external interrupt == | ||
736 | |||
737 | |||
738 | CPL03-NB has an external trigger interrupt function. Users can use the PB15 pin to trigger the upload of data packets. | ||
739 | |||
740 | (% style="color:blue" %)**AT command:** | ||
741 | |||
742 | * (% style="color:#037691" %)**AT+INTMOD **(%%) ~/~/ Set the trigger interrupt mode | ||
743 | |||
744 | * (% style="color:#037691" %)**AT+INTMOD=0 **(%%) ~/~/ Disable Interrupt | ||
745 | |||
746 | * (% style="color:#037691" %)**AT+INTMOD=1 **(%%) ~/~/ Trigger by rising and falling edge | ||
747 | |||
748 | * (% style="color:#037691" %)**AT+INTMOD=2 **(%%) ~/~/ Trigger by falling edge | ||
749 | |||
750 | * (% style="color:#037691" %)**AT+INTMOD=3 **(%%) ~/~/ Trigger by rising edge | ||
751 | |||
752 | (% style="display:none" %) (%%) | ||
753 | |||
754 | == 2.7 Set Transmit Interval Time == | ||
755 | |||
756 | |||
757 | ((( | ||
758 | Feature: Change NB-IoT End Node Transmit Interval. | ||
759 | ))) | ||
760 | |||
761 | ((( | ||
762 | (% style="color:blue" %)**AT Command: AT+TDC** | ||
763 | ))) | ||
764 | |||
765 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
766 | |=(% 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** | ||
767 | |(% style="width:156px" %)AT+TDC=?|(% style="width:137px" %)Show current transmit Interval|((( | ||
768 | 30000 | ||
769 | OK | ||
770 | the interval is 30000ms = 30s | ||
771 | ))) | ||
772 | |(% style="width:156px" %)AT+TDC=60000|(% style="width:137px" %)Set Transmit Interval|((( | ||
773 | OK | ||
774 | Set transmit interval to 60000ms = 60 seconds | ||
775 | ))) | ||
776 | |||
777 | (% style="display:none" %) (%%) | ||
778 | |||
779 | == 2.8 Enable / Disable Alarm == | ||
780 | |||
781 | |||
782 | Feature: Enable/Disable Alarm for open/close event. Default value 0. | ||
783 | |||
784 | (% style="color:blue" %)**AT Command: ** | ||
785 | |||
786 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:515px" %) | ||
787 | |(% style="background-color:#4f81bd; color:white; width:153px" %)**Command Example**|(% style="background-color:#4f81bd; color:white; width:276px" %)**Function**|(% style="background-color:#4f81bd; color:white; width:86px" %)**Response** | ||
788 | |(% style="width:154px" %)AT+DISALARM=1|(% style="width:278px" %)End node will only send packets in TDC time.|OK | ||
789 | |(% style="width:154px" %)AT+DISALARM=0|(% style="width:278px" %)End node will send packets in TDC time or status change for door sensor|OK | ||
790 | |||
791 | == 2.9 Alarm Base on Timeout == | ||
792 | |||
793 | |||
794 | **It only takes effect when (% style="color:blue" %)AT+MOD=1(%%).** | ||
795 | |||
796 | ((( | ||
797 | CPL03-NB 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: | ||
798 | ))) | ||
799 | |||
800 | ((( | ||
801 | (% style="color:#4f81bd" %)**1. Keep Status: Status to be monitor** | ||
802 | ))) | ||
803 | |||
804 | ((( | ||
805 | **Keep Status = 1**: Monitor Close to Open event | ||
806 | ))) | ||
807 | |||
808 | ((( | ||
809 | **Keep Status = 0**: Monitor Open to Close event | ||
810 | ))) | ||
811 | |||
812 | |||
813 | ((( | ||
814 | (% style="color:#4f81bd" %)**2. Keep Time: Timeout to send an Alarm** | ||
815 | ))) | ||
816 | |||
817 | ((( | ||
818 | Range 0 ~~ 65535(0xFFFF) seconds. | ||
819 | ))) | ||
820 | |||
821 | ((( | ||
822 | If** keep time = 0**, Disable Alarm Base on Timeout feature. | ||
823 | ))) | ||
824 | |||
825 | ((( | ||
826 | If **keep time > 0**, device will monitor the keep status event and send an alarm when status doesn’t change after timeout. | ||
827 | ))) | ||
828 | |||
829 | |||
830 | ((( | ||
831 | (% style="color:#4f81bd" %)**AT Command**(%%) to configure: | ||
832 | ))) | ||
833 | |||
834 | ((( | ||
835 | (% 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. CPL03-NB will send an uplink packet, the Alarm bit (the second bit of 1^^st^^ byte of payload) on this uplink packet is set to 1. | ||
836 | ))) | ||
837 | |||
838 | ((( | ||
839 | (% style="color:blue" %)**AT+TTRIG=0,0 **(%%) ~-~-> Default Value, disable timeout Alarm. | ||
840 | ))) | ||
841 | |||
842 | |||
843 | == 2.10 TTRIG timeout status alarm == | ||
844 | |||
845 | |||
846 | **It only takes effect when (% style="color:blue" %)AT+MOD=1(%%).** | ||
847 | It needs to be used with AT+TTRIG . When TTRIG times out and causes an alarm, and the status does not change subsequently, an alarm packet will be sent at the alarm interval. | ||
848 | |||
849 | (% style="color:blue" %)**AT Command:** | ||
850 | |||
851 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
852 | |=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 279px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 76px;background-color:#4F81BD;color:white" %)**Response** | ||
853 | |(% style="width:155px" %)((( | ||
854 | AT+TTRALARM=0 | ||
855 | )))|(% style="width:279px" %)((( | ||
856 | disable continuous alarm | ||
857 | )))|(% style="width:84px" %)((( | ||
858 | OK | ||
859 | ))) | ||
860 | |(% style="width:155px" %)((( | ||
861 | AT+TTRALARM=60 | ||
862 | )))|(% style="width:279px" %)((( | ||
863 | The alarm interval is 60 minutes (unit: minutes) | ||
864 | )))|(% style="width:84px" %)((( | ||
865 | OK | ||
866 | ))) | ||
867 | |||
868 | == 2.11 Set trigger mode of PA8 == | ||
869 | |||
870 | |||
871 | Feature: Set the trigger interrupt mode. | ||
872 | |||
873 | (% style="color:blue" %)**AT Command: AT+TTRMOD1** | ||
874 | |||
875 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:499px" %) | ||
876 | |=(% style="width: 157px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 246px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 96px; background-color:#4F81BD;color:white" %)**Response** | ||
877 | |(% style="width:157px" %)((( | ||
878 | AT+TTRMOD1=1 | ||
879 | )))|(% style="width:156px" %)Count and trigger from open to close (rising edge)|(% style="width:96px" %)((( | ||
880 | ((( | ||
881 | OK | ||
882 | ))) | ||
883 | ))) | ||
884 | |(% style="width:157px" %)((( | ||
885 | AT+TTRMOD1=0 | ||
886 | )))|(% style="width:156px" %)Count and trigger from close to open (falling edge)|(% style="width:96px" %)((( | ||
887 | OK(default) | ||
888 | ))) | ||
889 | |||
890 | (% style="display:none" %) (%%) | ||
891 | |||
892 | == 2.12 Set trigger mode of PA4 == | ||
893 | |||
894 | |||
895 | **It only takes effect when (% style="color:blue" %)AT+MOD=2(%%).** | ||
896 | |||
897 | Feature: Set the trigger interrupt mode. | ||
898 | |||
899 | (% style="color:blue" %)**AT Command: AT+TTRMOD2** | ||
900 | |||
901 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:501px" %) | ||
902 | |=(% style="width: 157px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 246px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 98px; background-color:#4F81BD;color:white" %)**Response** | ||
903 | |(% style="width:157px" %)((( | ||
904 | AT+TTRMOD2=1 | ||
905 | )))|(% style="width:156px" %)Count and trigger from open to close (rising edge)|(% style="width:98px" %)((( | ||
906 | ((( | ||
907 | OK | ||
908 | ))) | ||
909 | ))) | ||
910 | |(% style="width:157px" %)((( | ||
911 | AT+TTRMOD2=0 | ||
912 | )))|(% style="width:156px" %)Count and trigger from close to open (falling edge)|(% style="width:98px" %)((( | ||
913 | OK(default) | ||
914 | ))) | ||
915 | |||
916 | == 2.13 Set trigger mode of PB15 == | ||
917 | |||
918 | |||
919 | **It only takes effect when (% style="color:blue" %)AT+MOD=2(%%).** | ||
920 | |||
921 | Feature: Set the trigger interrupt mode. | ||
922 | |||
923 | (% style="color:blue" %)**AT Command: AT+TTRMOD3** | ||
924 | |||
925 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:500px" %) | ||
926 | |=(% style="width: 157px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 246px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 97px; background-color:#4F81BD;color:white" %)**Response** | ||
927 | |(% style="width:157px" %)((( | ||
928 | AT+TTRMOD3=1 | ||
929 | )))|(% style="width:156px" %)Count and trigger from open to close (rising edge)|(% style="width:97px" %)((( | ||
930 | ((( | ||
931 | OK | ||
932 | ))) | ||
933 | ))) | ||
934 | |(% style="width:157px" %)((( | ||
935 | AT+TTRMOD3=0 | ||
936 | )))|(% style="width:156px" %)Count and trigger from close to open (falling edge)|(% style="width:97px" %)((( | ||
937 | OK(default) | ||
938 | ))) | ||
939 | |||
940 | (% style="display:none" %) (%%) | ||
941 | |||
942 | == 2.14 Set the calculate flag == | ||
943 | |||
944 | |||
945 | **It only takes effect when (% style="color:blue" %)AT+MOD=2(%%).** | ||
946 | |||
947 | Feature: Set the calculate flag.**(Range is 0 to 7)** | ||
948 | |||
949 | (% style="color:blue" %)**AT Command: AT+CALCFLAG** | ||
950 | |||
951 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:472px" %) | ||
952 | |=(% style="width: 158px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 193px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 121px; background-color:#4F81BD;color:white" %)**Response** | ||
953 | |(% style="width:158px" %)AT+CALCFLAG =0|(% style="width:192px" %)Set the calculate flag to 0.|(% style="width:119px" %)OK(default) | ||
954 | |(% style="width:158px" %)AT+CALCFLAG =2|(% style="width:192px" %)Set the calculate flag to 2.|(% style="width:119px" %)OK | ||
955 | |||
956 | (% style="display:none" %) (%%) | ||
957 | |||
958 | == 2.15 Set count number == | ||
959 | |||
960 | |||
961 | Feature: Manually set the count number | ||
962 | |||
963 | In CPL01 work mode, the Total_pulse set by the "AT+SETCNT=1,xx" command. | ||
964 | |||
965 | In CPL03 work mode, the Port1_Total_pulse(PA8) set by the "AT+SETCNT=1,xx" command. | ||
966 | |||
967 | (% style="color:blue" %)**AT Command: AT+SETCNT** | ||
968 | |||
969 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:479px" %) | ||
970 | |=(% 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** | ||
971 | |(% style="width:160px" %)AT+ SETCNT =1,100|(% style="width:221px" %)Set the count number to 0.|(% style="width:95px" %)OK | ||
972 | |(% style="width:160px" %)AT+ SETCNT =2,0|(% style="width:221px" %)Set the count number to 100.|(% style="width:95px" %)OK | ||
973 | |(% style="width:160px" %)AT+ SETCNT =3,50|(% style="width:221px" %)Set the count number to 50.|(% style="width:95px" %)OK | ||
974 | |||
975 | == 2.16 Clear all counter values == | ||
976 | |||
977 | |||
978 | Feature: Manually clear all counter values | ||
979 | |||
980 | (% style="color:blue" %)**AT Command:** | ||
981 | |||
982 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:479px" %) | ||
983 | |=(% 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** | ||
984 | |(% style="width:160px" %)AT+CLRC|(% style="width:221px" %)((( | ||
985 | Clear current open count and the duration of the last open | ||
986 | )))|(% style="width:95px" %)OK | ||
987 | |||
988 | == 2.17 Count Mod == | ||
989 | |||
990 | |||
991 | Feature: Manually set the count mode. | ||
992 | |||
993 | (% style="color:blue" %)**AT Command:** | ||
994 | |||
995 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:515px" %) | ||
996 | |=(% style="width: 160px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 269px; background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 86px; background-color:#4F81BD;color:white" %)**Response** | ||
997 | |(% style="width:160px" %)AT+COUNTMOD=0|(% style="width:318px" %)the count value keeps accumulating mode|(% style="width:96px" %)OK(default) | ||
998 | |(% style="width:160px" %)AT+COUNTMOD=1|(% style="width:318px" %)the count value will be reset after each TDC time(Last Close Duration Reset after each uplink)|(% style="width:96px" %)OK | ||
999 | |||
1000 | == 2.18 Work Mod == | ||
1001 | |||
1002 | |||
1003 | Feature: Manually set the work mode. | ||
1004 | |||
1005 | (% style="color:blue" %)**AT Command:** | ||
1006 | |||
1007 | (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:474px" %) | ||
1008 | |=(% style="width: 155px; 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** | ||
1009 | |(% style="width:155px" %)AT+MOD=1|(% style="width:223px" %)Set the Real-Time Open/Close Status mode(CPL01).|(% style="width:96px" %)OK(default) | ||
1010 | |(% style="width:155px" %)AT+MOD=2|(% style="width:223px" %)Set the 3 pulse mode(CPL03).|(% style="width:96px" %)OK | ||
1011 | |||
1012 | == 2.19 Clock logging (Since firmware version v1.2.1) == | ||
1013 | |||
1014 | |||
1015 | Sometimes when we deploy lots of end nodes in field. We want all sensors sample data at the same time, and upload these data together for analyze. In such case, we can use clock loging feature. | ||
1016 | |||
1017 | We can use this command to set the start time of data recording and the time interval to meet the requirements of the specific collection time of data. | ||
1018 | |||
1019 | * (% style="color:blue" %)**AT Command: AT+CLOCKLOG=a,b,c,d** | ||
1020 | |||
1021 | (% style="color:blue" %)**a: **(%%)**0:** Disable Clock logging. ** 1: **Enable Clock Logging | ||
1022 | |||
1023 | (% style="color:blue" %)**b:**(%%)** **Specify First sampling start second: range **(0 ~~ 3599, 65535) ** ~/~/ (% style="color:red" %)**Note:**(%%)** **If parameter b is set to 65535, the log period starts after the node accesses the network and sends packets. | ||
1024 | |||
1025 | (% style="color:blue" %)**c: **(%%)Specify the sampling interval: range **(0 ~~ 255 minutes)** | ||
1026 | |||
1027 | (% style="color:blue" %)**d:**(%%)** **How many entries should be uplink on every TDC **(max 32)** | ||
1028 | |||
1029 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/SPH01-NB_NB-IoT_Soil_pH_Sensor_User_Manual/WebHome/image-20240315141254-1.png?rev=1.1||alt="image-20240315141254-1.png"]] | ||
1030 | |||
1031 | **Example:** | ||
1032 | |||
1033 | **AT+CLOCKLOG=1,65535,1,5** | ||
1034 | |||
1035 | After the node sends the first packet, data is recorded to the memory at intervals of 1 minute. For each TDC uplink, the uplink load will include: battery information + the last 5 memory records (payload + timestamp). | ||
1036 | |||
1037 | [[image:image-20240316175728-1.png||height="602" width="1175"]] | ||
1038 | |||
1039 | (% style="color:red" %)**Note: Users need to synchronize the server time before configuring this command. If the server time is not synchronized before this command is configured, the command takes effect only after the node is reset.** | ||
1040 | |||
1041 | |||
1042 | == 2.20 Example Query saved historical records == | ||
1043 | |||
1044 | |||
1045 | * (% style="color:blue" %)**AT Command: AT+CDP** | ||
1046 | |||
1047 | This command can be used to search the saved history, recording up to 32 groups of data, each group of historical data contains a maximum of 100 bytes. | ||
1048 | |||
1049 | [[image:image-20240316175809-2.png||height="651" width="845"]] | ||
1050 | |||
1051 | |||
1052 | == 2.21 Uplink log query == | ||
1053 | |||
1054 | |||
1055 | * (% style="color:blue" %)**AT Command: AT+GETLOG** | ||
1056 | |||
1057 | This command can be used to query upstream logs of data packets. | ||
1058 | |||
1059 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/PS-NB-NA_NB-IoT_Analog_Sensor_User_Manual/WebHome/image-20240407191922-2.png?width=903&height=631&rev=1.1||alt="image-20240407191922-2.png"]] | ||
1060 | |||
1061 | |||
1062 | |||
1063 | = 3. Configure CPL03-NB = | ||
1064 | |||
1065 | == 3.1 Configure Methods == | ||
1066 | |||
1067 | |||
1068 | CPL03-NB supports below configure method: | ||
1069 | |||
1070 | * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]]. | ||
1071 | |||
1072 | * 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]]. | ||
1073 | |||
1074 | (% style="display:none" %) (%%) | ||
1075 | |||
1076 | == 3.2 AT Commands Set == | ||
1077 | |||
1078 | |||
1079 | AT+<CMD>? : Help on <CMD> | ||
1080 | |||
1081 | AT+<CMD> : Run <CMD> | ||
1082 | |||
1083 | AT+<CMD>=<value> : Set the value | ||
1084 | |||
1085 | AT+<CMD>=? : Get the value | ||
1086 | |||
1087 | |||
1088 | (% style="color:blue" %)**General Commands** | ||
1089 | |||
1090 | AT : Attention | ||
1091 | |||
1092 | AT? : Short Help | ||
1093 | |||
1094 | ATZ : MCU Reset | ||
1095 | |||
1096 | AT+TDC : Application Data Transmission Interval | ||
1097 | |||
1098 | AT+CFG : Print all configurations | ||
1099 | |||
1100 | AT+DEUI : Get or set the Device ID | ||
1101 | |||
1102 | AT+5VT : Set extend the time of 5V power | ||
1103 | |||
1104 | AT+PRO : Choose agreement | ||
1105 | |||
1106 | AT+RXDL : Extend the sending and receiving time | ||
1107 | |||
1108 | AT+DNSCFG : Get or Set DNS Server | ||
1109 | |||
1110 | AT+GETSENSORVALUE : Returns the current sensor measurement | ||
1111 | |||
1112 | AT+NOUD : Get or Set the number of data to be uploaded | ||
1113 | |||
1114 | AT+CDP : Read or Clear cached data | ||
1115 | |||
1116 | AT+SERVADDR : Server Address | ||
1117 | |||
1118 | |||
1119 | (% style="color:blue" %)**MQTT Management** | ||
1120 | |||
1121 | AT+CLIENT : Get or Set MQTT client | ||
1122 | |||
1123 | AT+UNAME : Get or Set MQTT Username | ||
1124 | |||
1125 | AT+PWD : Get or Set MQTT password | ||
1126 | |||
1127 | AT+PUBTOPIC : Get or Set MQTT publish topic | ||
1128 | |||
1129 | AT+SUBTOPIC : Get or Set MQTT subscription topic | ||
1130 | |||
1131 | |||
1132 | (% style="color:blue" %)**Information** | ||
1133 | |||
1134 | AT+FDR : Factory Data Reset | ||
1135 | |||
1136 | AT+PWORD : Serial Access Password | ||
1137 | |||
1138 | AT+LDATA : Get the last upload data | ||
1139 | |||
1140 | AT+CDP : Read or Clear cached data | ||
1141 | |||
1142 | |||
1143 | = 4. Battery & Power Consumption = | ||
1144 | |||
1145 | |||
1146 | CPL03-NB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace. | ||
1147 | |||
1148 | [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] . | ||
1149 | |||
1150 | |||
1151 | = 5. Firmware update = | ||
1152 | |||
1153 | |||
1154 | User can change device firmware to:: | ||
1155 | |||
1156 | * Update with new features. | ||
1157 | |||
1158 | * Fix bugs. | ||
1159 | |||
1160 | Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/6715dbjc3o9f5bu/AABnJhRXt7RRlth2IJdjAkSoa?dl=0]]** | ||
1161 | |||
1162 | Methods to Update Firmware: | ||
1163 | |||
1164 | * (Recommended way) OTA firmware update via BLE: [[**Instruction**>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE_Firmware_Update_NB_Sensors_BC660K-GL/]]. | ||
1165 | |||
1166 | * Update through UART TTL interface : **[[Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/UART_Access_for_NB_ST_BC660K-GL/#H4.2UpdateFirmware28Assumethedevicealreadyhaveabootloader29]]**. | ||
1167 | |||
1168 | (% style="display:none" %) (%%) | ||
1169 | |||
1170 | = 6. FAQ = | ||
1171 | |||
1172 | == 6.1 How can I access t BC660K-GL AT Commands? == | ||
1173 | |||
1174 | |||
1175 | User can access to BC660K-GL directly and send AT Commands. | ||
1176 | |||
1177 | [[See BC660K-GL AT Command set>>url:https://www.dropbox.com/sh/5f6ssda5fum8rvs/AABT68l8ZzWOvZ5eg2qwOoFda?dl=0]] | ||
1178 | |||
1179 | |||
1180 | == 6.2 How to Connect Dry contacts or Wet Contacts == | ||
1181 | |||
1182 | |||
1183 | CPL03-NB can only be connected to dry contacts by default, and the wiring method is to connect the two ports of dry contacts to the VDD pin and pulse input pin of CPL03-NB respectively. | ||
1184 | |||
1185 | If you want to connect a wet contact, you need to change the original wiring method. The wiring method is that the GND of the wet contact is connected to the GND of CPL03-NB, and the pulse output is connected to the pulse pin, but the pulse output voltage of the wet contact must be less than 3.6V. | ||
1186 | |||
1187 | |||
1188 | == 6.3 What is the maximum total number of pulses for CPL03? What happens after the maximum total number of pulses is reached? == | ||
1189 | |||
1190 | |||
1191 | The maximum total number of pulses for CPL03 is three bytes FF FF FF (16,777,215). | ||
1192 | |||
1193 | The count is reset when the maximum total number of pulses is reached. | ||
1194 | |||
1195 | |||
1196 | = 7. Order Info = | ||
1197 | |||
1198 | |||
1199 | Part Number: (% style="color:blue" %)**CPL03-NB-XX** | ||
1200 | |||
1201 | (% style="color:red" %)**XX**(%%): | ||
1202 | |||
1203 | * (% style="color:#037691" %)**GE**(%%): General version ( Exclude SIM card) | ||
1204 | |||
1205 | * (% style="color:#037691" %)**1D**(%%): with 1NCE* 10 years 500MB SIM card and Pre-configure to DataCake server | ||
1206 | |||
1207 | (% style="color:#037691" %)**1NCE SIM Card NB-IoT network coverage**(%%): Austria, Belgium, Bulgaria, Croatia, Czech Republic, Denmark, Finland, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Latvia, Malta, Netherlands, Norway, Puerto Rico, Russia, Slovak , Republic, Slovenia, Spain, Sweden, Switzerland, Taiwan, USA, US Virgin Islands | ||
1208 | |||
1209 | |||
1210 | = 8. Packing Info = | ||
1211 | |||
1212 | |||
1213 | (% style="color:#037691" %)**Package Includes**: | ||
1214 | |||
1215 | * CPL03-NB NB-IoT Pulse/Contact sensor x 1 | ||
1216 | |||
1217 | * External antenna x 1 | ||
1218 | |||
1219 | (% style="color:#037691" %)**Dimension and weight**: | ||
1220 | |||
1221 | * Device Size: 13.0 x 5 x 4.5 cm | ||
1222 | |||
1223 | * Device Weight: 150g | ||
1224 | |||
1225 | * Package Size / pcs : 14.0 x 8x 5 cm | ||
1226 | |||
1227 | * Weight / pcs : 180g | ||
1228 | |||
1229 | (% style="display:none" %) (%%) | ||
1230 | |||
1231 | = 9. Support = | ||
1232 | |||
1233 | |||
1234 | * 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. | ||
1235 | |||
1236 | * 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]]. | ||
1237 | |||
1238 | (% style="display:none" %) (%%) |