Wiki source code of CS01-NB/NS -- NB-IoT 4 Channels Current Sensor Converter User Manual
Version 156.1 by Mengting Qiu on 2024/07/31 17:58
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% style="display:none" %) (%%) (% style="display:none" %) (%%) | ||
2 | |||
3 | (% style="text-align:center" %) | ||
4 | [[image:image-20240128210544-1.png]] | ||
5 | |||
6 | |||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | **Table of Contents:** | ||
13 | |||
14 | {{toc/}} | ||
15 | |||
16 | |||
17 | |||
18 | |||
19 | |||
20 | |||
21 | = 1. Introduction = | ||
22 | |||
23 | == 1.1 What is LoRaWAN 4 Channels Current Sensor Converter == | ||
24 | |||
25 | |||
26 | The Dragino CS01-NB/NS is a (% style="color:blue" %)**NB-IoT 4 Channels Current Sensor Converter**(%%). It can convert the reading from current sensors and and then upload to IoT server via NB-IoT network. | ||
27 | |||
28 | CS01-NB/NS can be used to (% style="color:blue" %)**monitor the machine running status**(%%) and (% style="color:blue" %)**analyze power consumption trends**. | ||
29 | |||
30 | The CS01-NB/NS supports maximum 4 current sensors. The current sensors are detachable and can be replaced with different scales. | ||
31 | |||
32 | CS01-NB/NS (% style="color:blue" %)**supports BLE configure**(%%) and (% style="color:blue" %)**wireless OTA update**(%%) which make user easy to use. | ||
33 | |||
34 | CS01-NB/NS is powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery, **(%%)it is designed for long-term use up to several years. | ||
35 | |||
36 | CS01-NB/NS has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration. | ||
37 | |||
38 | |||
39 | == 1.2 Features == | ||
40 | |||
41 | |||
42 | * NB-IoT Bands: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85 @H-FDD | ||
43 | * Ultra-low power consumption | ||
44 | * Supports maximum 4 current sensors | ||
45 | * Support various current sensor Ratio: 50A, 100A etc. | ||
46 | * Monitor the machine running status | ||
47 | * Analyze power consumption trends | ||
48 | * Current Alarm | ||
49 | * Multiply Sampling and one uplink | ||
50 | * Support Bluetooth v5.1 remote configure and update firmware | ||
51 | * Uplink on periodically | ||
52 | * Downlink to change configure | ||
53 | * 8500mAh Battery for long term use | ||
54 | * Nano SIM card slot for NB-IoT SIM | ||
55 | |||
56 | == 1.3 Specification == | ||
57 | |||
58 | |||
59 | (% style="color:blue" %)**Common DC Characteristics:** | ||
60 | |||
61 | * Supply Voltage: Built-in Battery , 2.5v ~~ 3.6v | ||
62 | * Operating Temperature: -40 ~~ 85°C | ||
63 | |||
64 | (% style="color:blue" %)**NB-IoT Spec:** | ||
65 | |||
66 | (% style="color:#037691" %)**NB-IoT Module: BC660K-GL** | ||
67 | |||
68 | (% style="color:#037691" %)**Support Bands:** | ||
69 | |||
70 | * B1 @H-FDD: 2100MHz | ||
71 | * B2 @H-FDD: 1900MHz | ||
72 | * B3 @H-FDD: 1800MHz | ||
73 | * B4 @H-FDD: 2100MHz | ||
74 | * B5 @H-FDD: 860MHz | ||
75 | * B8 @H-FDD: 900MHz | ||
76 | * B12 @H-FDD: 720MHz | ||
77 | * B13 @H-FDD: 740MHz | ||
78 | * B17 @H-FDD: 730MHz | ||
79 | * B18 @H-FDD: 870MHz | ||
80 | * B19 @H-FDD: 870MHz | ||
81 | * B20 @H-FDD: 790MHz | ||
82 | * B25 @H-FDD: 1900MHz | ||
83 | * B28 @H-FDD: 750MHz | ||
84 | * B66 @H-FDD: 2000MHz | ||
85 | * B70 @H-FDD: 2000MHz | ||
86 | * B85 @H-FDD: 700MHz | ||
87 | |||
88 | (% style="color:blue" %)**Battery:** | ||
89 | |||
90 | * Li/SOCI2 un-chargeable battery | ||
91 | * Capacity: 8500mAh | ||
92 | * Self-Discharge: <1% / Year @ 25°C | ||
93 | * Max continuously current: 130mA | ||
94 | * Max boost current: 2A, 1 second | ||
95 | |||
96 | (% style="color:blue" %)**Power Consumption** | ||
97 | |||
98 | * Sleep Mode: 5uA @ 3.3v | ||
99 | * LoRa Transmit Mode: 125mA @ 20dBm, 82mA @ 14dBm | ||
100 | |||
101 | == 1.4 Applications == | ||
102 | |||
103 | * Smart Buildings & Home Automation | ||
104 | * Logistics and Supply Chain Management | ||
105 | * Smart Metering | ||
106 | * Smart Agriculture | ||
107 | * Smart Cities | ||
108 | * Smart Factory | ||
109 | |||
110 | == 1.5 Sleep mode and working mode == | ||
111 | |||
112 | |||
113 | (% 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. | ||
114 | |||
115 | (% 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. | ||
116 | |||
117 | |||
118 | == 1.6 Button & LEDs == | ||
119 | |||
120 | |||
121 | [[image:image-20240123095435-2.png]] | ||
122 | |||
123 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
124 | |=(% style="width: 167px;background-color:#4F81BD;color:white" %)**Behavior on ACT**|=(% style="width: 117px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 226px;background-color:#4F81BD;color:white" %)**Action** | ||
125 | |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)((( | ||
126 | If sensor has already attached to NB-IoT network, sensor will send an uplink packet, (% style="color:blue" %)**blue led**(%%) will blink once. | ||
127 | Meanwhile, BLE module will be active and user can connect via BLE to configure device. | ||
128 | ))) | ||
129 | |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)((( | ||
130 | (% 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. | ||
131 | (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network. | ||
132 | 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. | ||
133 | ))) | ||
134 | |(% 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. | ||
135 | |||
136 | == 1.7 BLE connection == | ||
137 | |||
138 | |||
139 | CS01-NB/NS support BLE remote configure and firmware update. | ||
140 | |||
141 | 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: | ||
142 | |||
143 | * Press button to send an uplink | ||
144 | * Press button to active device. | ||
145 | * Device Power on or reset. | ||
146 | |||
147 | If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode. | ||
148 | |||
149 | |||
150 | == 1.8 Pin Definitions , Switch & SIM Direction == | ||
151 | |||
152 | |||
153 | CS01-NB/NS use the mother board which as below. | ||
154 | |||
155 | [[image:image-20240731094359-1.png||height="426" width="749"]] | ||
156 | |||
157 | |||
158 | === 1.8.1 Jumper JP2 === | ||
159 | |||
160 | Power on Device when put this jumper. | ||
161 | |||
162 | Power off device when take out this jumper | ||
163 | |||
164 | |||
165 | === 1.8.2 BOOT MODE / SW1 === | ||
166 | |||
167 | **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. | ||
168 | |||
169 | **2)** (% style="color:blue" %)**Flash:**(%%) work mode, device starts to work and send out console output for further debug. | ||
170 | |||
171 | |||
172 | === 1.8.3 Reset Button === | ||
173 | |||
174 | Press to reboot the device. | ||
175 | |||
176 | |||
177 | === 1.8.4 SIM Card Direction === | ||
178 | |||
179 | 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]]. | ||
180 | |||
181 | |||
182 | == 1.9 Mechanical == | ||
183 | |||
184 | [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143884058-338.png]] | ||
185 | |||
186 | [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143899218-599.png]] | ||
187 | |||
188 | [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143909447-639.png]] | ||
189 | |||
190 | |||
191 | == 1.10 Current Sensor Spec == | ||
192 | |||
193 | |||
194 | The current sensor list below is not ship with CS01-NB/NS, user need to order seperately: | ||
195 | |||
196 | (% border="1" cellspacing="3" style="width:475px" %) | ||
197 | |=(% style="width: 132px; background-color:#4F81BD;color:white" %)**Model**|=(% style="width: 115px; background-color:#4F81BD;color:white" %)**Photo**|=(% style="width: 228px; background-color: #4F81BD;color:white" %)**Specification** | ||
198 | |(% style="width:131px" %)**SCT013G-D-100**|(% style="width:114px" %)((( | ||
199 | (% style="text-align:center" %) | ||
200 | [[image:image-20240128212549-2.png]] | ||
201 | )))|(% style="width:226px" %)* Split core current transformer | ||
202 | ~* Spec: 100A/50mA | ||
203 | ~* φ16mm Aperture | ||
204 | ~* Material of core: Ferrite | ||
205 | |||
206 | = 2. Use CS01-NB/NS to communicate with IoT Server = | ||
207 | |||
208 | == 2.1 Send data to IoT server via NB-IoT network == | ||
209 | |||
210 | |||
211 | The CS01-NB/NS is equipped with a NB-IoT module, the pre-loaded firmware in CS01-NB/NS 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 CS01-NB/NS. | ||
212 | |||
213 | |||
214 | Below shows the network structure: | ||
215 | |||
216 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/S31-NBS31B-NB_BN-IoT_Outdoor_Temperature_Humidity_Sensor_User_Manual/WebHome/1692415924540-357.png?rev=1.1||alt="1692415924540-357.png"]] | ||
217 | |||
218 | There are two version: (% style="color:blue" %)**-GE**(%%) and (% style="color:blue" %)**-1D**(%%) version of S31-NB. | ||
219 | |||
220 | (% 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 S31-NB send data to IoT server. | ||
221 | |||
222 | * 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]]. | ||
223 | |||
224 | * 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]]. | ||
225 | |||
226 | Below shows result of different server as a glance. | ||
227 | |||
228 | (% border="1" cellspacing="3" style="width:515px" %) | ||
229 | |(% 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** | ||
230 | |(% 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" %)((( | ||
231 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/S31-NBS31B-NB_BN-IoT_Outdoor_Temperature_Humidity_Sensor_User_Manual/WebHome/image-20230819113244-8.png?width=367&height=183&rev=1.1||alt="image-20230819113244-8.png"]] | ||
232 | )))|(% style="width:170px" %) | ||
233 | |(% 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" %)((( | ||
234 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/S31-NBS31B-NB_BN-IoT_Outdoor_Temperature_Humidity_Sensor_User_Manual/WebHome/image-20230819113244-9.png?width=367&height=119&rev=1.1||alt="image-20230819113244-9.png"]] | ||
235 | )))|(% style="width:170px" %) | ||
236 | |(% 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" %) | ||
237 | |(% 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" %) | ||
238 | |(% 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" %) | ||
239 | |(% 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" %)((( | ||
240 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/S31-NBS31B-NB_BN-IoT_Outdoor_Temperature_Humidity_Sensor_User_Manual/WebHome/image-20230819113244-10.png?width=367&height=104&rev=1.1||alt="image-20230819113244-10.png"]] | ||
241 | )))|(% style="width:170px" %) | ||
242 | |(% 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" %)((( | ||
243 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/S31-NBS31B-NB_BN-IoT_Outdoor_Temperature_Humidity_Sensor_User_Manual/WebHome/image-20230819113244-11.png?width=367&height=141&rev=1.1||alt="image-20230819113244-11.png"]] | ||
244 | )))|(% style="width:170px" %) | ||
245 | |||
246 | (% 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 CS01-NB/NS 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||style="background-color: rgb(255, 255, 255);"]]. | ||
247 | |||
248 | |||
249 | == 2.2 Payload Types == | ||
250 | |||
251 | |||
252 | To meet different server requirement, CS01-NB/NS supports different payload type. | ||
253 | |||
254 | **Includes:** | ||
255 | |||
256 | * [[General JSON format payload>>||anchor="H2.2.1GeneralJsonFormat28Type3D529"]]. (Type=5) | ||
257 | |||
258 | * [[HEX format Payload>>||anchor="H2.2.2HEXformatPayload28Type3D029"]]. (Type=0) | ||
259 | |||
260 | * [[ThingSpeak Format>>||anchor="H2.2.4ThingSpeakPayload28Type3D129"]]. (Type=1) | ||
261 | |||
262 | * [[ThingsBoard Format>>||anchor="H2.2.3ThingsBoardPayload28Type3D329"]]. (Type=3) | ||
263 | |||
264 | User can specify the payload type when choose the connection protocol. Example: | ||
265 | |||
266 | (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Use UDP Connection & hex Payload | ||
267 | |||
268 | (% style="color:#037691" %)**AT+PRO=2,5** (%%) ~/~/ Use UDP Connection & Json Payload | ||
269 | |||
270 | (% style="color:#037691" %)**AT+PRO=3,5 ** (%%) ~/~/ Use MQTT Connection & Json Payload | ||
271 | |||
272 | |||
273 | |||
274 | == 2.3 Working Mode & Uplink Payload == | ||
275 | |||
276 | |||
277 | === 2.3.1 Working Mode === | ||
278 | |||
279 | |||
280 | ==== 2.3.1.1 General acquisition mode (MOD~=1) ==== | ||
281 | |||
282 | |||
283 | (% style="color:red" %)**Note: The AT+CCAL=0,0,0,0 command needs to be set when the v1.0 version firmware is used for the first time, otherwise there will be inaccurate current issue. ** | ||
284 | |||
285 | MOD=1 is the default mode. End Node will uplink the real-time current sensor value in two case: | ||
286 | |||
287 | * Each TDC Interval. | ||
288 | * Trigger Alarm according to **AT+CALARM **configure. | ||
289 | |||
290 | ==== 2.3.1.2 Continuous Sampling Mode (MOD~=2) ==== | ||
291 | |||
292 | |||
293 | In Continuous Sampling Mode**(AT+MOD=2,aa,bb)**, CS01 will record the current sensor data at a fix interval, and report multiply group of data together to IoT server later. | ||
294 | |||
295 | (% style="color:red" %)**Notice: This mode has high power consumption. External power supply might be needed. More detail please check power consumption section.** | ||
296 | |||
297 | |||
298 | **AT+MOD=2,aa,bb format:** | ||
299 | |||
300 | * (% style="color:blue" %)**First Parameter set to 2**(%%)**:** Set CS01-NB/NS to work in Continuous Sampling Mode. | ||
301 | * (% style="color:blue" %)**aa** (%%): Set Sampling Interval, Unit: Second. | ||
302 | * (% style="color:blue" %)**bb** (%%): Define how many group of data will be uplink together. | ||
303 | |||
304 | When CS01-NB/NS is in Continuous Sampling Mode, the TDC time setting is disabled, and CS01-NB/NS will send uplink once it finished the number of sampling define in "bb". | ||
305 | |||
306 | |||
307 | **Example Command:(% style="color:blue" %)AT+MOD=2,60,5(%%)** | ||
308 | CS01-NB/NS will read 4 channels data every 1 minutes. When it reads 5 groups, CS01-NB/NS will send an uplink. So the uplink interval is 5 minutes. Each uplink will include 5 groups of sensor value. Each Group include 4 channels data. so the payload for each uplink will include: | ||
309 | |||
310 | * Battery (2 bytes) | ||
311 | * + Group1 Sensor Value (8 Bytes): **the last 4th** reading for Channel 1 + Channel 2 + Channel 3 + Channel 4 | ||
312 | * + Group2 Sensor Value (8 Bytes): **the last 3rd** reading for Channel 1 + Channel 2 + Channel 3 + Channel 4 | ||
313 | * + Group3 Sensor Value (8 Bytes): **the last 2nd** reading for Channel 1 + Channel 2 + Channel 3 + Channel 4 | ||
314 | * + Group4 Sensor Value (8 Bytes): **the last** reading for Channel 1 + Channel 2 + Channel 3 + Channel 4 | ||
315 | * + Group5 Sensor Value (8 Bytes): **current** reading for Channel 1 + Channel 2 + Channel 3 + Channel 4 | ||
316 | |||
317 | So totally 42 bytes payload in this example. | ||
318 | |||
319 | |||
320 | === 2.3.2 HEX format Payload(Type~=0) === | ||
321 | |||
322 | |||
323 | ==== 2.3.2.1 MOD~=1 (General acquisition mode) ==== | ||
324 | |||
325 | |||
326 | (% style="color:#4472c4" %)**f86366306279881518640cdd13000000003ddc003d84003e1f003df866a9edeb003dd9003d78003e1d003e1266a9ed4a003dd4003d82003e17003de366a9ecd2003e20003dce003e5f003e2966a9ec5a003e1e003dc8003e52003e2266a9ebe2003ddc003d8b003e20003de966a9eb6a003d6e003d18003da7003d8266a9eaf2003d77003d1f003db1003d8566a9ea7a003d94003d3e003dcf003d9366a9ea02** | ||
327 | |||
328 | [[image:image-20240731163909-3.png||height="238" width="1498"]] | ||
329 | |||
330 | If we use the MQTT client to subscribe to this MQTT topic, we can see the following information when the NB sensor uplink data. | ||
331 | |||
332 | [[image:image-20240731155655-2.png||height="748" width="883"]] | ||
333 | |||
334 | (% style="color:blue" %)**Version:** | ||
335 | |||
336 | These bytes include the hardware and software version. | ||
337 | |||
338 | (% style="color:#037691" %)**Higher byte:**(%%) Specify Sensor Model: 0x18 for CS01-NB/NS | ||
339 | |||
340 | (% style="color:#037691" %)**Lower byte:**(%%) Specify the software version: 0x64=100, means firmware version 1.0.0 | ||
341 | |||
342 | |||
343 | (% style="color:blue" %)**Battery Info:** | ||
344 | |||
345 | Check the battery voltage for CS01-NB/NS. | ||
346 | |||
347 | Ex1: 0x0B45&0x3FFF = 2885mV | ||
348 | |||
349 | Ex2: 0x0B49&0x3FFF = 2889mV | ||
350 | |||
351 | |||
352 | (% style="color:blue" %)**Signal Strength:** | ||
353 | |||
354 | NB-IoT Network signal Strength. | ||
355 | |||
356 | **Ex1: 0x16 = 22** | ||
357 | |||
358 | **0** -113dBm or less | ||
359 | |||
360 | **1** -111dBm | ||
361 | |||
362 | **2...30** -109dBm... -53dBm | ||
363 | |||
364 | **31** -51dBm or greater | ||
365 | |||
366 | **99** Not known or not detectable | ||
367 | |||
368 | |||
369 | (% style="color:blue" %)**GPIO_EXIT Level:** | ||
370 | |||
371 | GPIO_EXTI is used as Interrupt Pin. | ||
372 | |||
373 | **Example:** | ||
374 | |||
375 | 01 (H): GPIO_EXTI pin is high level. | ||
376 | |||
377 | 00 (L): GPIO_EXTI pin is low level. | ||
378 | |||
379 | Level of PA4 pin. (0: Low level 1: High level) | ||
380 | |||
381 | |||
382 | (% style="color:blue" %)**GPIO_EXIT Flag:** | ||
383 | |||
384 | This data field shows if this packet is generated by **Interrupt Pin** or not. | ||
385 | |||
386 | Note: The Interrupt Pin is a separate pin in the screw terminal. | ||
387 | |||
388 | **Example:** | ||
389 | |||
390 | 0x00: Normal uplink packet. | ||
391 | |||
392 | 0x01: Interrupt Uplink Packet. | ||
393 | |||
394 | |||
395 | (% style="color:blue" %)**Current_alarm:** | ||
396 | |||
397 | **Current_alarm** is a combination for Cur1L_status, Cur1H_status, Cur2L_status, Cur2H_status, Cur3L_status, Cur3H_status, Cur4L_status and Cur4H_status. | ||
398 | |||
399 | Totally 1bytes as below: | ||
400 | |||
401 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:480px" %) | ||
402 | |=(% style="width: 60px;background-color:#4F81BD;color:white" %)((( | ||
403 | **Bit7** | ||
404 | )))|=(% style="width: 60px;background-color:#4F81BD;color:white" %)Bit6|=(% style="width: 60px;background-color:#4F81BD;color:white" %)Bit5|=(% style="width: 60px; background-color: #4F81BD;color:white" %)Bit4|=(% style="width: 60px; background-color: #4F81BD;color:white" %)Bit3|=(% style="width: 60px; background-color: #4F81BD;color:white" %)Bit2|=(% style="width: 60px; background-color: #4F81BD;color:white" %)Bit1|=(% style="width: 60px; background-color: #4F81BD;color:white" %)Bit0 | ||
405 | |(% style="width:99px" %)((( | ||
406 | Cur1L | ||
407 | )))|(% style="width:69px" %)((( | ||
408 | Cur1H | ||
409 | )))|(% style="width:130px" %)((( | ||
410 | Cur2L | ||
411 | )))|(% style="width:194px" %)((( | ||
412 | Cur2H | ||
413 | )))|(% style="width:106px" %)((( | ||
414 | Cur3L | ||
415 | )))|(% style="width:97px" %)((( | ||
416 | Cur3H | ||
417 | )))|(% style="width:97px" %)((( | ||
418 | Cur4L | ||
419 | )))|(% style="width:97px" %)((( | ||
420 | Cur4H | ||
421 | ))) | ||
422 | |||
423 | **Cur1L_status:** | ||
424 | |||
425 | When setting the current threshold alarm of channel 1, this flag is True when it is lower than the set threshold, otherwise it is False. | ||
426 | |||
427 | **Cur1H_status:** | ||
428 | |||
429 | When setting the current threshold alarm of channel 1, this flag is True when it is higher than the set threshold, otherwise it is False. | ||
430 | |||
431 | **Cur2L_status:** | ||
432 | |||
433 | When setting the current threshold alarm of channel 2, this flag is True when it is lower than the set threshold, otherwise it is False. | ||
434 | |||
435 | **Cur2H_status:** | ||
436 | |||
437 | When setting the current threshold alarm of channel 2, this flag is True when it is higher than the set threshold, otherwise it is False. | ||
438 | |||
439 | **Cur3L_status:** | ||
440 | |||
441 | When setting the current threshold alarm of channel 3, this flag is True when it is lower than the set threshold, otherwise it is False. | ||
442 | |||
443 | **Cur3H_status:** | ||
444 | |||
445 | When setting the current threshold alarm of channel 3, this flag is True when it is higher than the set threshold, otherwise it is False. | ||
446 | |||
447 | **Cur4L_status:** | ||
448 | |||
449 | When setting the current threshold alarm of channel 4, this flag is True when it is lower than the set threshold, otherwise it is False. | ||
450 | |||
451 | **Cur4H_status:** | ||
452 | |||
453 | When setting the current threshold alarm of channel 4, this flag is True when it is higher than the set threshold, otherwise it is False. | ||
454 | |||
455 | |||
456 | (% class="wikigeneratedid" id="HCurrentchannel1:" %) | ||
457 | (% style="color:blue" %)**Current channel 1:** | ||
458 | |||
459 | Channel 1 for measuring AC current. Resolution 0.01A. | ||
460 | |||
461 | Ext: 0x03e8 =1000/100=10.00A | ||
462 | |||
463 | |||
464 | (% class="wikigeneratedid" id="HCurrentchannel2:" %) | ||
465 | (% style="color:blue" %)**Current channel 2:** | ||
466 | |||
467 | Channel 2 for measuring AC current. Resolution 0.01A. | ||
468 | |||
469 | Ext: 0x041A =1050/100=10.50A | ||
470 | |||
471 | |||
472 | (% class="wikigeneratedid" id="HCurrentchannel3:" %) | ||
473 | (% style="color:blue" %)**Current channel 3:** | ||
474 | |||
475 | Channel 3 for measuring AC current. Resolution 0.01A. | ||
476 | |||
477 | Ext: 0x044C =1100/100=11.00A | ||
478 | |||
479 | |||
480 | (% class="wikigeneratedid" id="HCurrentchannel4:" %) | ||
481 | (% style="color:blue" %)**Current channel 4:** | ||
482 | |||
483 | Channel 4 for measuring AC current. Resolution 0.01A. | ||
484 | |||
485 | Ext: 0x04B0 =1200/100=12.00A | ||
486 | |||
487 | |||
488 | (% style="color:blue" %)**TimeStamp: ** | ||
489 | |||
490 | Unit TimeStamp Example: 66a9edeb(H) = 1722412523(D) | ||
491 | |||
492 | Put the decimal value into this link(https://www.epochconverter.com/) to get the time. | ||
493 | |||
494 | |||
495 | ==== 2.3.2.2 MOD~=2 (Continuous Sampling Mode) ==== | ||
496 | |||
497 | |||
498 | (% style="color:red" %)**Notice: The payload is determined by the command setting:** | ||
499 | |||
500 | **Example: ** | ||
501 | |||
502 | (% style="color:blue" %)**AT+MOD=2,60,5,0**(%%) | ||
503 | CS01-NB/NS read 4 channels data every 1 minutes. When it reads 5 groups, CS01-NB/NS will send an uplink. So the uplink interval is 5 minutes. Each uplink will include 5 groups of sensor value. Each Group include 4 channels data. | ||
504 | |||
505 | |||
506 | (% style="color:#4472c4" %)**f8636** | ||
507 | |||
508 | |||
509 | |||
510 | |||
511 | |||
512 | |||
513 | |||
514 | === 2.3.3 General Json Format(Type~=5) === | ||
515 | |||
516 | |||
517 | ==== 2.3.3.1 MOD~=1 (General acquisition mode) ==== | ||
518 | |||
519 | |||
520 | (% style="color:#4472c4" %)**{"IMEI":"863663062798815","Model":"CS01-NB","current_alarm":"NNNN","current_chan1":20.496,"current_chan2":20.374,"current_chan3":20.572,"current_chan4":20.478,"battery":3.267,"signal":25,"1":[0.024,0.003,0.002,0.002,"2024/07/31 05:26:08"],"2":[0.024,0.003,0.001,0.001,"2024/07/31 05:11:08"],"3":[0.024,0.003,0.001,0.001,"2024/07/31 04:56:08"],"4":[0.024,0.003,0.001,0.001,"2024/07/31 04:41:08"],"5":[0.024,0.003,0.001,0.001,"2024/07/31 04:26:08"],"6":[0.024,0.003,0.001,0.001,"2024/07/31 04:11:08"],"7":[11.023,10.944,11.067,11.019,"2024/07/31 03:56:08"],"8":[10.907,10.831,10.948,10.893,"2024/07/31 03:41:08"]}** | ||
521 | |||
522 | If we use the MQTT client to subscribe to this MQTT topic, we can see the following information when the NB sensor uplink data. | ||
523 | |||
524 | [[image:image-20240731135015-2.png||height="729" width="858"]] | ||
525 | |||
526 | (% style="color:red" %)**Notice, from above payload:** | ||
527 | |||
528 | * Current_alarm, Current_chan1, Current_chan2, Current_chan3, Current_chan4, Battery & Signal are the value at uplink time. | ||
529 | |||
530 | * Json entry 1 ~~ 8 are the last 1 ~~ 8 sampling data as specify by (% style="color:#037691" %)**AT+CLOCKLOG=1,65535,15,8 ** (%%)Command. Each entry includes (from left to right): Current_chan1, Current_chan2, Current_chan3, Current_chan4, Sampling time. | ||
531 | |||
532 | ==== 2.3.3.2 MOD~=2 (Continuous Sampling Mode) ==== | ||
533 | |||
534 | |||
535 | (% style="color:red" %)**Notice: The payload is determined by the command setting:** | ||
536 | |||
537 | **Example: ** | ||
538 | |||
539 | (% style="color:blue" %)**AT+MOD=2,60,5,0**(%%) | ||
540 | CS01-NB/NS read 4 channels data every 1 minutes. When it reads 5 groups, CS01-NB/NS will send an uplink. So the uplink interval is 5 minutes. Each uplink will include 5 groups of sensor value. Each Group include 4 channels data. | ||
541 | |||
542 | |||
543 | (% style="color:#4472c4" %)**{"IMEI":"863663062798815","Model":"CS01-NB","battery":3.267,"signal":25,"Data":"(15.402,15.377,15.381,15.332)(15.329,15.280,15.336,15.300)(15.172,15.136,15.189,15.140)(15.165,15.136,15.185,15.135)(15.161,15.137,15.174,15.205)"}** | ||
544 | |||
545 | If we use the MQTT client to subscribe to this MQTT topic, we can see the following information when the NB sensor uplink data. | ||
546 | |||
547 | [[image:image-20240731174355-4.png||height="745" width="888"]] | ||
548 | |||
549 | |||
550 | |||
551 | === 2.3.4 ThingsBoard Payload(Type~=3) === | ||
552 | |||
553 | |||
554 | Type3 payload special design for ThingsBoard, it will also configure other default server to ThingsBoard. | ||
555 | |||
556 | |||
557 | ==== 2.3.4.1 MOD~=1 (General acquisition mode) ==== | ||
558 | |||
559 | (% style="color:#4472c4" %)**{ | ||
560 | "topic": "2276492", | ||
561 | "payload": { | ||
562 | "IMEI": "863663062798914", | ||
563 | "Model": "S31x-NB", | ||
564 | "temperature": 26.0, | ||
565 | "humidity": 70.8, | ||
566 | "interrupt": 0, | ||
567 | "interrupt_level": 0, | ||
568 | "battery": 3.36, | ||
569 | "signal": 21, | ||
570 | "1": [204.8, 10.0, "2024/05/30 10:19:53"], | ||
571 | "2": [204.8, 10.0, "2024/05/30 10:19:18"], | ||
572 | "3": [204.8, 10.0, "2024/05/30 10:17:53"], | ||
573 | "4": [204.8, 10.0, "2024/05/30 10:16:53"], | ||
574 | "5": [204.8, 10.0, "2024/05/30 10:16:28"], | ||
575 | "6": [204.8, 10.0, "2024/05/30 10:14:53"], | ||
576 | "7": [204.8, 10.0, "2024/05/30 10:13:53"], | ||
577 | "8": [204.8, 10.0, "2024/05/30 10:12:53"] | ||
578 | } | ||
579 | }** | ||
580 | |||
581 | |||
582 | |||
583 | ==== 2.3.4.2 MOD~=2 (Continuous Sampling Mode) ==== | ||
584 | |||
585 | |||
586 | |||
587 | |||
588 | |||
589 | === 2.3.5 ThingSpeak Payload(Type~=1) === | ||
590 | |||
591 | |||
592 | This payload meets ThingSpeak platform requirement. It includes only four fields. Form 1~~4 are: | ||
593 | |||
594 | Temperature, Humidity, Battery & Signal. This payload type only valid for ThingsSpeak Platform. | ||
595 | |||
596 | |||
597 | ==== 2.3.5.1 MOD~=1 (General acquisition mode) ==== | ||
598 | |||
599 | |||
600 | (% style="color:#4472c4" %)**field1=Tem&field2=Hum&field3=BatV&field4=Singal** | ||
601 | |||
602 | |||
603 | |||
604 | |||
605 | |||
606 | ==== 2.3.5.2 MOD~=2 (Continuous Sampling Mode) ==== | ||
607 | |||
608 | |||
609 | |||
610 | |||
611 | |||
612 | |||
613 | == 2.5 Payload Decoder file == | ||
614 | |||
615 | |||
616 | In TTN, use can add a custom payload so it shows friendly reading | ||
617 | |||
618 | In the page (% style="color:#037691" %)**Applications ~-~-> Payload Formats ~-~-> Custom ~-~-> decoder**(%%) to add the decoder from: | ||
619 | |||
620 | [[https:~~/~~/github.com/dragino/dragino-end-node-decoder/tree/main/CS01-LB>>https://github.com/dragino/dragino-end-node-decoder/tree/main/CS01-LB]] | ||
621 | |||
622 | |||
623 | == 2.6 Firmware Change Log == | ||
624 | |||
625 | |||
626 | Firmware download link:** **[[https:~~/~~/www.dropbox.com/scl/fo/cnnyz4ynebs3am96jvtv0/h?rlkey=4no594ssi0nzt2lc3irbkid9b&dl=0>>https://www.dropbox.com/scl/fo/cnnyz4ynebs3am96jvtv0/h?rlkey=4no594ssi0nzt2lc3irbkid9b&dl=0]] | ||
627 | |||
628 | |||
629 | = 3. Configure CS01-NB/NS = | ||
630 | |||
631 | == 3.1 Configure Methods == | ||
632 | |||
633 | |||
634 | CS01-NB/NS supports below configure method: | ||
635 | |||
636 | * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]]. | ||
637 | * 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]]. | ||
638 | * LoRaWAN Downlink. Instruction for different platforms: See [[IoT LoRaWAN Server>>http://wiki.dragino.com/xwiki/bin/view/Main/]] section. | ||
639 | |||
640 | == 3.2 General Commands == | ||
641 | |||
642 | |||
643 | These commands are to configure: | ||
644 | |||
645 | * General system settings like: uplink interval. | ||
646 | * LoRaWAN protocol & radio related command. | ||
647 | |||
648 | They are same for all Dragino Devices which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki: | ||
649 | |||
650 | [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20AT%20Commands%20and%20Downlink%20Command/>>http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20AT%20Commands%20and%20Downlink%20Command/]] | ||
651 | |||
652 | |||
653 | == 3.3 Commands special design for CS01-NB/NS == | ||
654 | |||
655 | |||
656 | These commands only valid for CS01-NB/NS, as below: | ||
657 | |||
658 | |||
659 | === 3.3.1 Set Transmit Interval Time === | ||
660 | |||
661 | |||
662 | Feature: Change LoRaWAN End Node Transmit Interval. | ||
663 | |||
664 | (% style="color:blue" %)**AT Command: AT+TDC** | ||
665 | |||
666 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
667 | |=(% 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** | ||
668 | |(% style="width:156px" %)AT+TDC=?|(% style="width:137px" %)Show current transmit Interval|((( | ||
669 | 30000 | ||
670 | OK | ||
671 | the interval is 30000ms = 30s | ||
672 | ))) | ||
673 | |(% style="width:156px" %)AT+TDC=60000|(% style="width:137px" %)Set Transmit Interval|((( | ||
674 | OK | ||
675 | Set transmit interval to 60000ms = 60 seconds | ||
676 | ))) | ||
677 | |||
678 | (% style="color:blue" %)**Downlink Command: 0x01** | ||
679 | |||
680 | Format: Command Code (0x01) followed by 3 bytes time value. | ||
681 | |||
682 | If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01. | ||
683 | |||
684 | * Example 1: Downlink Payload: 0100001E ~/~/ Set Transmit Interval (TDC) = 30 seconds | ||
685 | * Example 2: Downlink Payload: 0100003C ~/~/ Set Transmit Interval (TDC) = 60 seconds | ||
686 | |||
687 | === 3.3.2 Get Device Status === | ||
688 | |||
689 | |||
690 | Send a LoRaWAN downlink to ask device send Alarm settings. | ||
691 | |||
692 | (% style="color:blue" %)**Downlink Payload: **(%%)0x26 01 | ||
693 | |||
694 | Sensor will upload Device Status via FPORT=5. See payload section for detail. | ||
695 | |||
696 | |||
697 | === 3.3.3 Get data === | ||
698 | |||
699 | |||
700 | Feature: Get the current sensor data. | ||
701 | |||
702 | **AT Command:** | ||
703 | |||
704 | * **AT+GETSENSORVALUE=0** ~/~/ The serial port gets the reading of the current sensor | ||
705 | * **AT+GETSENSORVALUE=1** ~/~/ The serial port gets the current sensor reading and uploads it. | ||
706 | |||
707 | === 3.3.4 Set Interrupt Mode === | ||
708 | |||
709 | |||
710 | Feature, Set Interrupt mode for PA8 of pin. | ||
711 | |||
712 | When AT+INTMOD=0 is set, PA8 is used as a digital input port. | ||
713 | |||
714 | (% style="color:blue" %)**AT Command: AT+INTMOD** | ||
715 | |||
716 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
717 | |=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 197px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 158px;background-color:#4F81BD;color:white" %)**Response** | ||
718 | |(% style="width:154px" %)AT+INTMOD=?|(% style="width:196px" %)Show current interrupt mode|(% style="width:157px" %)((( | ||
719 | 0 | ||
720 | OK | ||
721 | the mode is 0 =Disable Interrupt | ||
722 | ))) | ||
723 | |(% style="width:154px" %)AT+INTMOD=2|(% style="width:196px" %)((( | ||
724 | Set Transmit Interval | ||
725 | 0. (Disable Interrupt), | ||
726 | ~1. (Trigger by rising and falling edge) | ||
727 | 2. (Trigger by falling edge) | ||
728 | 3. (Trigger by rising edge) | ||
729 | )))|(% style="width:157px" %)OK | ||
730 | |||
731 | (% style="color:blue" %)**Downlink Command: 0x06** | ||
732 | |||
733 | Format: Command Code (0x06) followed by 3 bytes. | ||
734 | |||
735 | This means that the interrupt mode of the end node is set to 0x000003=3 (rising edge trigger), and the type code is 06. | ||
736 | |||
737 | * Example 1: Downlink Payload: 06000000 ~/~/ Turn off interrupt mode | ||
738 | * Example 2: Downlink Payload: 06000003 ~/~/ Set the interrupt mode to rising edge trigger | ||
739 | |||
740 | === 3.3.5 Set Power Output Duration === | ||
741 | |||
742 | |||
743 | Control the output duration 3.3V. Before each sampling, device will | ||
744 | |||
745 | ~1. first enable the power output to external sensor, | ||
746 | |||
747 | 2. keep it on as per duration, read sensor value and construct uplink payload | ||
748 | |||
749 | 3. final, close the power output. | ||
750 | |||
751 | (% style="color:blue" %)**AT Command: AT+3V3T** | ||
752 | |||
753 | (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) | ||
754 | |=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 197px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 158px;background-color:#4F81BD;color:white" %)**Response** | ||
755 | |(% style="width:154px" %)AT+3V3T=?|(% style="width:196px" %)Show 3.3V open time.|(% style="width:157px" %)0 (default) | ||
756 | OK | ||
757 | |(% style="width:154px" %)AT+3V3T=1000|(% style="width:196px" %)Close after a delay of 1000 milliseconds.|(% style="width:157px" %)OK | ||
758 | |||
759 | (% style="color:blue" %)**Downlink Command: 0x07** | ||
760 | |||
761 | Format: Command Code (0x07) followed by 3 bytes. | ||
762 | |||
763 | The first byte is which power, the second and third bytes are the time to turn on. | ||
764 | |||
765 | * Example 1: Downlink Payload: 07 01 01 F4 **~-~-->** AT+3V3T=500 | ||
766 | * Example 2: Downlink Payload: 07 01 FF FF **~-~-->** AT+3V3T=65535 | ||
767 | |||
768 | === 3.3.6 Set working mode === | ||
769 | |||
770 | Feature, Get or Set working mode. | ||
771 | |||
772 | (% style="color:blue" %)**AT Command: AT+MOD** | ||
773 | |||
774 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
775 | |=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 197px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 158px;background-color:#4F81BD;color:white" %)**Response** | ||
776 | |(% style="width:154px" %)AT+MOD=?|(% style="width:196px" %)Shows the current working mode|(% style="width:157px" %)1 (default) | ||
777 | OK | ||
778 | |(% style="width:154px" %)AT+MOD=2,60,5,0|(% style="width:196px" %)Set working mode 2|(% style="width:157px" %)OK | ||
779 | |||
780 | (% style="color:blue" %)**Description of AT instruction for setting working mode 2:** | ||
781 | |||
782 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) | ||
783 | |=(% style="width: 155px; background-color:#4F81BD; color: white" %)**Command Example**|=(% style="width: 186.5px; background-color:#4F81BD; color: white" %)**Function**|=(% style="width: 168.5px; background-color:#4F81BD;color: white" %)Parameter | ||
784 | |(% colspan="1" style="width:158px" %)AT+MOD=1|(% style="width:185px" %)Set General acquisition mode.|(% style="width:165px" %)1:General acquisition mode. | ||
785 | |(% colspan="1" rowspan="5" style="width:158px" %)((( | ||
786 | |||
787 | |||
788 | |||
789 | |||
790 | AT+MOD=2,60,5,0 | ||
791 | )))|(% style="width:185px" %)The first parameter sets the continuous detection mode 2.|(% style="width:165px" %)2: Continuous acquisition mode. | ||
792 | |(% style="width:185px" %)The second parameter sets the detection sampling interval.|(% style="width:165px" %)60: Data were collected every 60 seconds. | ||
793 | |(% style="width:185px" %)The third bit parameter sets the number of groups to record data.|(% style="width:165px" %)After 5 groups of data are collected, the uplink is performed. | ||
794 | |(% style="width:185px" %)The fourth parameter setting 5V normally open.|(% style="width:165px" %)((( | ||
795 | 0: Not set 5V normally open | ||
796 | |||
797 | 1: Setting 5V normally open | ||
798 | ))) | ||
799 | |(% colspan="2" rowspan="1" style="width:185px" %)(% style="color:red" %)**Note: If the collection interval is very short, that is, a group of data needs to be collected in a few seconds, you are advised to set 5V on normally. The module startup time can be removed, but the power consumption is relatively high.** | ||
800 | |||
801 | (% style="color:blue" %)**Downlink Command: 0x0A** | ||
802 | |||
803 | Format: Command Code (0x0A) followed by 1 byte or 4 bytes. | ||
804 | |||
805 | * Example 1: Downlink Payload: 0A 01 **~-~-->** AT+MOD=1 | ||
806 | * Example 2: Downlink Payload: 0A 02 00 3C 05 **~-~-->** AT+MOD=2,60,5 | ||
807 | |||
808 | === 3.3.7 Set the alarm threshold === | ||
809 | |||
810 | |||
811 | Feature, Get or set current alarm threshold. (% style="color:red" %)**(Takes effect only when AT+MOD=1)** | ||
812 | |||
813 | (% style="color:red" %)**Note:The third, fifth, seventh and ninth parameter units of the v1.0 version are A, and the units of the third, fifth, seventh, and ninth parameters of versions after v1.1 are mA.** | ||
814 | |||
815 | |||
816 | (% style="color:blue" %)**AT Command: AT+CALARM** | ||
817 | |||
818 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:779px" %) | ||
819 | |=(% style="width: 283px; background-color: rgb(79, 129, 189); color: white;" %)**Command Example**|=(% style="width: 200px; background-color: rgb(79, 129, 189); color: white;" %)**Function**|=(% style="width: 296px; background-color: rgb(79, 129, 189); color: white;" %)**Response** | ||
820 | |(% style="width:283px" %)((( | ||
821 | AT+CALARM=? | ||
822 | )))|(% style="width:200px" %)Get current alarm threshold.|(% style="width:296px" %)((( | ||
823 | 0,0,0,0,0,0,0,0,0(default) | ||
824 | OK | ||
825 | ))) | ||
826 | |(% style="width:283px" %)((( | ||
827 | AT+CALARM=1,1,20,1,20,0,0,0,0 | ||
828 | |||
829 | (v1.0 version) | ||
830 | )))|(% style="width:200px" %)When the current of channel 1 and channel 2 exceeds 20A, it will alarm and send a data packet.|(% style="width:296px" %)OK | ||
831 | |||
832 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:779.778px" %) | ||
833 | |=(% style="width: 138px; background-color:#4F81BD; color: white" %)**Command Example**|=(% style="width: 225px; background-color:#4F81BD; color: white" %)**Function**|=(% style="width: 334px; background-color: rgb(79, 129, 189); color: white;" %)Parameter | ||
834 | |(% colspan="1" rowspan="5" style="width:158px" %)((( | ||
835 | |||
836 | |||
837 | |||
838 | |||
839 | |||
840 | |||
841 | |||
842 | |||
843 | |||
844 | |||
845 | |||
846 | |||
847 | AT+CALARM=1,1,10000,0,20000,0,0,0,0 | ||
848 | |||
849 | (Versions after v1.1) | ||
850 | )))|(% style="width:185px" %)The first parameter enables or disables the threshold alarm. |(% style="width:334px" %)0: Not Alarm | ||
851 | 1: Alarm | ||
852 | |(% style="width:185px" %)The second and third parameters set "current 1" below threshold alarm or above threshold alarm. |(% style="width:334px" %)((( | ||
853 | 0,xx: Means if value <xx, Then Alarm | ||
854 | 1,xx: Means if value >xx, Then Alarm | ||
855 | |||
856 | |||
857 | **eg:**1,10000: if value >10000mA(10A), Then Alarm | ||
858 | ))) | ||
859 | |(% style="width:185px" %)The fourth and fifth parameters set "current 2" below the threshold alarm or above the threshold alarm. |(% style="width:334px" %)((( | ||
860 | 0,xx: Means if value <xx, Then Alarm | ||
861 | 1,xx: Means if value >xx, Then Alarm | ||
862 | |||
863 | |||
864 | **eg:**0,20000: if value <20000mA(20A), Then Alarm | ||
865 | ))) | ||
866 | |(% style="width:185px" %)The sixth and seventh parameters set "current 3" below the threshold alarm or above the threshold alarm.|(% style="width:334px" %)((( | ||
867 | 0,0: Means if value <xx, Then Alarm | ||
868 | 0,0: Means if value >xx, Then Alarm | ||
869 | |||
870 | |||
871 | **eg:**0,0: Disable this channel alarm | ||
872 | ))) | ||
873 | |(% style="width:185px" %)The eighth and ninth parameters set "current 4" below the threshold alarm or above the threshold alarm.|(% style="width:334px" %)((( | ||
874 | 0,0: Means if value <xx, Then Alarm | ||
875 | 0,0: Means if value >xx, Then Alarm | ||
876 | |||
877 | |||
878 | **eg:**0,0: Disable this channel alarm | ||
879 | ))) | ||
880 | |||
881 | (% style="color:blue" %)**Downlink Command: 0x0B** | ||
882 | |||
883 | Format: Command Code (0x0B) followed by 17 bytes. | ||
884 | |||
885 | * Example 1: Downlink Payload: 0B 01 01 00 27 10 00 00 4E 20 00 00 00 00 00 00 00 00 **~-~-->** AT+CALARM=1,1,10000,0,20000,0,0,0,0 =>1(01),1(01),10000(00 27 10),0(00),20000(00 4E 20),0(00),0(00 00 00),0(00),0(00 00 00) | ||
886 | * Example 2: Downlink Payload: 0B 01 00 00 00 00 00 00 00 00 00 00 03 E8 01 00 07 D0 **~-~-->** AT+CALARM=1,0,0,0,0,0,1000,1,2000 =>1(01),0(00),0(00 00 00),0(00),0(00 00 00),0(00),1000(00 03 E8),1(01),2000(00 07 D0) | ||
887 | * Example 3: Downlink Payload: 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 **~-~-->** AT+CALARM=0,0,0,0,0,0,0,0,0 =>0(00),0(00),0(00 00 00),0(00),0(00 00 00),0(00),0(00 00 00),0(00),0(00 00 00) | ||
888 | |||
889 | Format: The first byte(Command Code ) is 0x0B, the last byte is 0x01 or 0x02, and the middle 9 bytes. | ||
890 | |||
891 | When the last byte is 0x01, you can set the first, second, third, fourth and fifth parameters of the AT command. | ||
892 | |||
893 | * Example 1: Downlink Payload: 0B 01 01 00 27 10 00 00 4E 20 01**~-~-->** AT+CALARM=1,1,10000,0,20000,0,0,0,0 =>1(01),1(01),10000(00 27 10),0(00),20000(00 4E 20) | ||
894 | |||
895 | When the last byte is 0x02, you can set the first, sixth, seventh, eighth and ninth parameters of the AT command. | ||
896 | |||
897 | * Example 2: Downlink Payload: 0B 01 00 00 03 E8 01 00 07 D0 02**~-~-->** AT+CALARM=1,0,0,0,0,0,1000,1,2000 =>1(01),0(00),1000(00 03 E8),1(01),2000(00 07 D0) | ||
898 | |||
899 | Format: Command Code (0x0B) followed by 9 bytes. | ||
900 | |||
901 | * Example 1: Downlink Payload: 0B 01 01 14 01 14 00 00 00 00 **~-~-->** AT+CALARM=1,1,20,1,20,0,0,0,0 (v1.0 version) =>1(01),1(01),20(14),1(01),20(14),0(00),0(00),0(00),0(00) | ||
902 | * Example 2: Downlink Payload: 0B 01 01 14 01 14 00 00 00 00 **~-~-->** AT+CALARM=1,1,20000,1,20000,0,0,0,0 (Versions after v1.1) =>1(01),1(01),20(14),1(01),20(14),0(00),0(00),0(00),0(00) | ||
903 | * Example 3: Downlink Payload: 0B 00 00 00 00 00 00 00 00 00 **~-~-->** AT+CALARM=0,0,0,0,0,0,0,0,0 =>0(00),0(00),0(00),0(00),0(00),0(00),0(00),0(00),0(00) | ||
904 | |||
905 | === 3.3.8 Set Alarm Interval === | ||
906 | |||
907 | |||
908 | The shortest time of two Alarm packet(unit: min). The default is 20 minutes. | ||
909 | |||
910 | * (% style="color:blue" %)**AT Command:** | ||
911 | |||
912 | (% style="color:#037691" %)**AT+ATDC=30** (%%) ~/~/ The shortest interval of two Alarm packets is 30 minutes, Means is there is an alarm packet uplink, there won't be another one in the next 30 minutes. | ||
913 | |||
914 | * (% style="color:blue" %)**Downlink Payload:** | ||
915 | |||
916 | (% style="color:#037691" %)**0x(0C 1E)**(%%) **~-~--> ** Set AT+ATDC=0x 1E = 30 minutes | ||
917 | |||
918 | |||
919 | === 3.3.9 Set enable or disable of the measurement channel === | ||
920 | |||
921 | |||
922 | This command can be used when user connects **less than four current sensors**. This command can turn off unused measurement channels to **save battery life**. | ||
923 | |||
924 | (% style="color:blue" %)**AT Command: AT+ENCHANNEL** | ||
925 | |||
926 | (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:500px" %) | ||
927 | |=(% style="width: 185px; background-color: #4F81BD; color: white" %)**Command Example**|=(% style="width: 193px; background-color: #4F81BD; color: white" %)**Function**|=(% style="width: 122px; background-color: #4F81BD; color: white" %)**Response** | ||
928 | |(% style="width:199px" %)AT+ENCHANNEL=?|(% style="width:199px" %)Get enabled channels.|(% style="width:150px" %)1,1,1,1 (default) | ||
929 | OK | ||
930 | |(% style="width:199px" %)AT+ENCHANNEL=1,1,1,0|(% style="width:199px" %)Channel 4 disabled.|(% style="width:150px" %)OK | ||
931 | |(% style="width:199px" %)AT+ENCHANNEL=1,1,0,0|(% style="width:199px" %)Channel 3 and 4 disabled.|(% style="width:150px" %)OK | ||
932 | |||
933 | (% style="color:blue" %)**Downlink Command: 0x08** | ||
934 | |||
935 | Format: Command Code (0x08) followed by 4 bytes. | ||
936 | |||
937 | The first byte means the first channel, the second byte means the second channel, the third byte means the third channel, and the fourth byte means the fourth channel.And 1 means enable channel, 0 means disable channel. | ||
938 | |||
939 | * Example 1: Downlink Payload: 08 01 01 01 01 **~-~-->** AT+ENCHANNEL=1,1,1,1 ~/~/ All channels are enabled | ||
940 | |||
941 | * Example 2: Downlink Payload: 08 01 01 01 00 **~-~-->** AT+ENCHANNEL=1,1,1,0 ~/~/ Channel 4 disabled | ||
942 | |||
943 | * Example 3: Downlink Payload: 08 01 01 00 00 **~-~-->** AT+ENCHANNEL=1,1,0,0 ~/~/ Channel 3 and 4 disabled | ||
944 | |||
945 | = 4. [[Use Case>>Main.User Manual for LoRaWAN End Nodes.CS01-LB_LoRaWAN_4_Channels_Current_Sensor_Converter_User_Manual.CS01_Use_Cases.WebHome]] = | ||
946 | |||
947 | == 4.1 Monitor the power status of office == | ||
948 | |||
949 | [[image:image-20240505210624-1.png||height="234" width="697"]] | ||
950 | |||
951 | This is a case study for CS01-NB/NS current sensor. It shows how to use CS01 to monitor office power use status. | ||
952 | |||
953 | Click here for more: **[[Case 1: Monitor the power status of office>>Main.User Manual for LoRaWAN End Nodes.CS01-LB_LoRaWAN_4_Channels_Current_Sensor_Converter_User_Manual.CS01_Use_Cases.WebHome||anchor="HCase1:Monitorthepowerstatusofoffice"]]** | ||
954 | |||
955 | |||
956 | == 4.2 Function setting power consumption calculation case == | ||
957 | |||
958 | Set alarm for, when current = 0.1 send data | ||
959 | Set alarm interval for 5 mins | ||
960 | Set regular data interval for 6 hours or so Power outage alarm is the priority. | ||
961 | Then switch OFF the connected load. | ||
962 | Look for alarm message, as the current will drop to very minimum. | ||
963 | Repeat LOAD OFF after 8 mins ( we have set alarm interval as 5 mins) and check for alarm message. | ||
964 | When a scenario like 4 outages per day, then we should get 4 Alarm + 4 regular current messages (data frequency set to 6 hours), then how much will be the battery life. | ||
965 | |||
966 | |||
967 | (% style="color:red" %)**The third, fifth, seventh and ninth parameter units of the v1.0 version are A, and the units of the third, fifth, seventh, and ninth parameters of versions after v1.1 are mA.** | ||
968 | |||
969 | (% style="color:red" %)**Below I set | ||
970 | AT+CALARM=1,0,0,0,0,0,0,0,100 | ||
971 | AT+ENCHANNEL=0,0,0,1** | ||
972 | |||
973 | [[image:image-20240723152145-3.png||height="61" width="568"]] | ||
974 | |||
975 | According to the settings, three aspects need to be calculated, as follows | ||
976 | (1) The alarm interval is once every five minutes, 12 times per hour, a total of 288 times a day, one alarm is equivalent to one detection, and the consumption per detection is ≈0.0172mAh, so the daily consumption is calculated as follows | ||
977 | 0.0172*288=4.9536mAh | ||
978 | (2) The sleep current consumption per day is ≈0.0053268*24=0.1278432mAh | ||
979 | (3) 4 alarms + 4 regular current messages, equivalent to sending 8 uplink messages a day, each upload will consume | ||
980 | Single sensor: 0.076761064mAh | ||
981 | Four sensors: 0.109365489mAh | ||
982 | So | ||
983 | Single sensor consumption per day: 0.076761064*8=0.614088512mAh | ||
984 | Four sensors consumption per day: 0.109365489*8=0.874923912mAh | ||
985 | The CS01-NB/NS battery capacity is 8500mAh. Calculated by the above data | ||
986 | Single sensor: 8500/(4.9536+0.1278432+0.614088512)=1492 days | ||
987 | Four sensors: 8500/(4.9536+0.1278432+0.874923912)=1427 days | ||
988 | The above calculation is the approximate battery life. | ||
989 | The battery life is also related to the frequency band and DR you use. See the figure below for details. | ||
990 | |||
991 | [[image:image-20240723152001-2.png]] | ||
992 | |||
993 | |||
994 | = 5. Battery & Power Consumption = | ||
995 | |||
996 | |||
997 | CS01-NB/NS use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace. | ||
998 | |||
999 | [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] . | ||
1000 | |||
1001 | |||
1002 | (% style="color:red" %)**Notice: Continuous Sampling Mode will increase the power consumption a lot.** | ||
1003 | |||
1004 | (% style="color:blue" %)**For example, if use all four channels to sampling data:** | ||
1005 | |||
1006 | ~-~- Sample every minute and uplink data every 5 minutes. The battery life is about 10 monthes. | ||
1007 | ~-~- Sample every minute and uplink data every 20 minutes. The battery life is about 12 monthes. | ||
1008 | |||
1009 | If user want to use external DC Adapter, to power the CS01-NB/NS in this case, please refer [[Power Device use 3.3v Power Adapter>>http://wiki.dragino.com/xwiki/bin/view/Main/Can%20I%20use%20an%20external%20power%20adapter%20or%20solar%20panel%20to%20power%20LSN50v2%3F/#H1.1A0Poweritviaexternalpower283.3v29andnoneedbackupbattery]]. | ||
1010 | |||
1011 | |||
1012 | = 6. OTA Firmware update = | ||
1013 | |||
1014 | |||
1015 | (% class="wikigeneratedid" %) | ||
1016 | User can change firmware CS01-NB/NS to: | ||
1017 | |||
1018 | * Change Frequency band/ region. | ||
1019 | * Update with new features. | ||
1020 | * Fix bugs. | ||
1021 | |||
1022 | Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/g99v0fxcltn9r1y/AABh2OCu4fZazNPhQtU9mPpKa/CS01-LB?dl=0&subfolder_nav_tracking=1]]** | ||
1023 | |||
1024 | |||
1025 | Methods to Update Firmware: | ||
1026 | |||
1027 | * (Recommanded way) OTA firmware update via wireless : **[[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/Firmware%20OTA%20Update%20for%20Sensors/>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Firmware%20OTA%20Update%20for%20Sensors/]]** | ||
1028 | * Update through UART TTL interface : **[[Instruction>>url:http://wiki.dragino.com/xwiki/bin/view/Main/UART%20Access%20for%20LoRa%20ST%20v4%20base%20model/#H1.LoRaSTv4baseHardware]]**. | ||
1029 | |||
1030 | = 7. FAQ = | ||
1031 | |||
1032 | |||
1033 | |||
1034 | = 8. Troubleshooting = | ||
1035 | |||
1036 | == 8.1 Why are the collected current values inaccurate? == | ||
1037 | |||
1038 | When the current value collected by the node is inaccurate, please check whether the calibration value is set by the AT+CCAL command in the node. If so, please change the calibration value to 0, that is: AT+CCAL=0,0,0,0. | ||
1039 | |||
1040 | |||
1041 | |||
1042 | = 9. Order Info = | ||
1043 | |||
1044 | |||
1045 | Part Number: (% style="color:blue" %)**CS01-NB-XX** | ||
1046 | |||
1047 | (% style="color:red" %)**XX**(%%): The default frequency band | ||
1048 | |||
1049 | * (% style="color:red" %)**AS923**(%%): LoRaWAN AS923 band | ||
1050 | * (% style="color:red" %)**AU915**(%%): LoRaWAN AU915 band | ||
1051 | * (% style="color:red" %)**EU433**(%%): LoRaWAN EU433 band | ||
1052 | * (% style="color:red" %)**EU868**(%%): LoRaWAN EU868 band | ||
1053 | * (% style="color:red" %)**KR920**(%%): LoRaWAN KR920 band | ||
1054 | * (% style="color:red" %)**US915**(%%): LoRaWAN US915 band | ||
1055 | * (% style="color:red" %)**IN865**(%%): LoRaWAN IN865 band | ||
1056 | * (% style="color:red" %)**CN470**(%%): LoRaWAN CN470 band | ||
1057 | |||
1058 | (% style="color:red" %)**Notice: CS01-NB doesn't include current sensor. User need to purchase seperately.** | ||
1059 | |||
1060 | |||
1061 | **Reference Model for current sensor:** | ||
1062 | |||
1063 | * (% style="color:red" %)**SCT013G-D-100**(%%): 100A/50mA | ||
1064 | |||
1065 | = 10. Packing Info = | ||
1066 | |||
1067 | |||
1068 | (% style="color:#037691" %)**Package Includes**: | ||
1069 | |||
1070 | * CS01-NB/NS LoRaWAN 4 Channels Current Sensor Converter | ||
1071 | |||
1072 | (% style="color:#037691" %)**Dimension and weight**: | ||
1073 | |||
1074 | * Device Size: cm | ||
1075 | |||
1076 | * Device Weight: g | ||
1077 | |||
1078 | * Package Size / pcs : cm | ||
1079 | |||
1080 | * Weight / pcs : g | ||
1081 | |||
1082 | = 11. Support = | ||
1083 | |||
1084 | |||
1085 | * 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. | ||
1086 | |||
1087 | * 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]]. |