Show last authors
1
2
3 (% style="text-align:center" %)
4 [[image:image-20230830100139-1.png||height="524" width="333"]]
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 NB-IoT Analog Sensor ==
24
25
26 The Dragino PS-NB-NA is a (% style="color:blue" %)**NB-IoT Analog Sensor**(%%) for Internet of Things solution. PS-NB-NA has 5v and 12v output, 4~~20mA, 0~~30v input interface to power and get value from Analog Sensor. PS-NB-NA will convert the Analog Value to NB-IoT wireless data and send to IoT platform via NB-IoT network.
27
28 PS-NB-NA supports different uplink methods including (% style="color:blue" %)**MQTT, MQTTs, UDP & TCP**(%%) for different application requirement, and support uplinks to various IoT Servers.
29
30 PS-NB-NA (% style="color:blue" %)**supports BLE configure **(%%)and(% style="color:blue" %)** OTA update**(%%) which make user easy to use.
31
32 PS-NB-NA is powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery**(%%), it is designed for long-term use up to several years.
33
34 PS-NB-NA has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration.
35
36 [[image:image-20230830110121-2.png||height="305" width="916"]]
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 * 1 x 0~~20mA input , 1 x 0~~30v input
45 * 5v and 12v output to power external sensor
46 * Multiply Sampling and one uplink
47 * Support Bluetooth v5.1 remote configure and update firmware
48 * Uplink on periodically
49 * Downlink to change configure
50 * 8500mAh Battery for long term use
51 * IP66 Waterproof Enclosure
52 * Uplink via MQTT, MQTTs, TCP, or UDP
53 * Nano SIM card slot for NB-IoT SIM
54
55 == 1.3 Specification ==
56
57
58 (% style="color:blue" %)**Common DC Characteristics:**
59
60 * Supply Voltage: 2.5v ~~ 3.6v
61 * Operating Temperature: -40 ~~ 85°C
62
63 (% style="color:blue" %)**Current Input (DC) Measuring :**
64
65 * Range: 0 ~~ 20mA
66 * Accuracy: 0.02mA
67 * Resolution: 0.001mA
68
69 (% style="color:blue" %)**Voltage Input Measuring:**
70
71 * Range: 0 ~~ 30v
72 * Accuracy: 0.02v
73 * Resolution: 0.001v
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 == 1.4 Applications ==
113
114
115 * Smart Buildings & Home Automation
116 * Logistics and Supply Chain Management
117 * Smart Metering
118 * Smart Agriculture
119 * Smart Cities
120 * Smart Factory
121
122 == 1.5 Sleep mode and working mode ==
123
124
125 (% 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.
126
127 (% 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.
128
129
130 == 1.6 Button & LEDs ==
131
132
133 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675071855856-879.png]]
134
135 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %)
136 |=(% 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**
137 |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)(((
138 If sensor has already attached to NB-IoT network, sensor will send an uplink packet, (% style="color:blue" %)**blue led** (%%)will blink once.
139 Meanwhile, BLE module will be active and user can connect via BLE to configure device.
140 )))
141 |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)(((
142 (% 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.
143 (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network.
144 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.
145 )))
146 |(% 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.
147
148 (% 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.**
149
150
151 == 1.7 BLE connection ==
152
153
154 PS-NB-NA support BLE remote configure and firmware update.
155
156
157 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:
158
159 * Press button to send an uplink
160 * Press button to active device.
161 * Device Power on or reset.
162
163 If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
164
165
166 == 1.8 Pin Definitions , Switch & SIM Direction ==
167
168
169 PS-NB-NA use the mother board which as below.
170
171 [[image:image-20230913113836-1.png||height="330" width="545"]]
172
173
174 === 1.8.1 Jumper JP2 ===
175
176
177 Power on Device when put this jumper.
178
179
180 === 1.8.2 BOOT MODE / SW1 ===
181
182
183 **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.
184
185 **2)** (% style="color:blue" %)**Flash**(%%): work mode, device starts to work and send out console output for further debug
186
187
188 === 1.8.3 Reset Button ===
189
190
191 Press to reboot the device.
192
193
194 === 1.8.4 SIM Card Direction ===
195
196
197 See this link. [[How to insert SIM Card>>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]].
198
199
200 = 2. Use PS-NB-NA to communicate with IoT Server =
201
202 == 2.1 Send data to IoT server via NB-IoT network ==
203
204
205 The PS-NB-NA is equipped with a NB-IoT module, the pre-loaded firmware in PS-NB-NA 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 PS-NB-NA.
206
207
208 Below shows the network structure:
209
210 [[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-20230830110121-2.png?width=916&height=305&rev=1.1||alt="image-20230830110121-2.png"]]
211
212
213 There are two version: (% style="color:blue" %)**-GE**(%%) and (% style="color:blue" %)**-1D**(%%) version of PS-NB-NA.
214
215
216 (% 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 PS-NB-NA send data to IoT server.
217
218 * 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]].
219
220 * 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]]. 
221
222 Below shows result of different server as a glance.
223
224 (% border="1" cellspacing="3" style="width:515px" %)
225 |(% 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**
226 |(% 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" %)(((
227 (% style="text-align:center" %)
228 [[image:image-20230819113244-8.png||height="183" width="367"]]
229 )))|(% style="width:170px" %)
230 |(% 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" %)(((
231 (% style="text-align:center" %)
232 [[image:image-20230819113244-9.png||height="119" width="367"]]
233 )))|(% style="width:170px" %)
234 |(% 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" %)
235 |(% 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" %)
236 |(% 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" %)
237 |(% 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" %)(((
238 (% style="text-align:center" %)
239 [[image:image-20230819113244-10.png||height="104" width="367"]]
240 )))|(% style="width:170px" %)
241 |(% 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" %)(((
242 (% style="text-align:center" %)
243 [[image:image-20230819113244-11.png||height="141" width="367"]]
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 PS-NB-NA 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]].
247
248
249 == 2.2 ​Payload Types ==
250
251
252 To meet different server requirement, PS-NB-NA 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,0**  (%%) ~/~/ Use MQTT Connection & hex Payload
271
272 (% style="color:#037691" %)**AT+PRO=3,1           **(%%)~/~/ Use MQTT Connection & ThingSpeak
273
274 (% style="color:#037691" %)**AT+PRO=3,3           **(%%)~/~/ Use MQTT Connection & ThingsBoard
275
276 (% style="color:#037691" %)**AT+PRO=3,5 ** (%%) ~/~/ Use MQTT Connection & Json Payload
277
278 (% style="color:#037691" %)**AT+PRO=4,0**  (%%) ~/~/ Use TCP Connection & hex Payload
279
280 (% style="color:#037691" %)**AT+PRO=4,5**   (%%) ~/~/ Use TCP Connection & Json Payload
281
282
283 === 2.2.1 General Json Format(Type~=5) ===
284
285
286 This is the General Json Format. As below:
287 \\(% style="color:#4472c4" %)**{"IMEI":"866207053462705","Model":"PS-NB","idc_intput":0.000,"vdc_intput":0.000,"battery":3.513,"signal":23,"1":{0.000,5.056,2023/09/13 02:14:41},"2":{0.000,3.574,2023/09/13 02:08:20},"3":{0.000,3.579,2023/09/13 02:04:41},"4":{0.000,3.584,2023/09/13 02:00:24},"5":{0.000,3.590,2023/09/13 01:53:37},"6":{0.000,3.590,2023/09/13 01:50:37},"7":{0.000,3.589,2023/09/13 01:47:37},"8":{0.000,3.589,2023/09/13 01:44:37}}**
288
289
290 (% style="color:red" %)**Notice, from above payload:**
291
292 * Idc_input , Vdc_input , Battery & Signal are the value at uplink time.
293
294 * 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): Idc_input , Vdc_input, Sampling time.
295
296 === 2.2.2 HEX format Payload(Type~=0) ===
297
298
299 This is the HEX Format. As below:
300
301 (% style="color:#4472c4" %)**f866207053462705 0165 0dde 13 0000 00 00 00 00 0fae 0000 64e2d74f 10b2 0000 64e2d69b 0fae 0000 64e2d5e7 10b2 0000 64e2d47f 0fae 0000 64e2d3cb 0fae 0000 64e2d263 0fae 0000 64e2d1af 011a 01e8 64d494ed 0118 01e8 64d4943**
302
303 [[image:image-20230904115628-4.png||height="233" width="1290"]]
304
305
306 (% style="color:blue" %)**Version:**
307
308 These bytes include the hardware and software version.
309
310 (% style="color:#037691" %)**Higher byte:**(%%) Specify Sensor Model: 0x01 for PS-NB-NA
311
312 (% style="color:#037691" %)**Lower byte:**(%%) Specify the software version: 0x65=101, means firmware version 1.0.1
313
314
315 (% style="color:blue" %)**BAT (Battery Info):**
316
317 Check the battery voltage for PS-NB-NA.
318
319 Ex1: 0x0dde = 3550mV
320
321 Ex2: 0x0B49 = 2889mV
322
323
324 (% style="color:blue" %)**Signal Strength:**
325
326 NB-IoT Network signal Strength.
327
328 **Ex1: 0x13 = 19**
329
330 **0**  -113dBm or less
331
332 **1**  -111dBm
333
334 **2...30** -109dBm... -53dBm
335
336 **31**   -51dBm or greater
337
338 **99**    Not known or not detectable
339
340
341 (% style="color:blue" %)**Probe Model:**
342
343 PS-NB-NA might connect to different kind of probes, 4~~20mA represent the full scale of the measuring range. So a 12mA output means different meaning for different probe. 
344
345 **For example.**
346
347 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:500px" %)
348 |(% style="background-color:#4f81bd; color:white; width:150px" %)**Probe Type**|(% style="background-color:#4f81bd; color:white; width:150px" %)**4~~20mA scale for this probe**|(% style="background-color:#4f81bd; color:white; width:200px" %)**Example: 12mA actually meaning for this probe**
349 |(% style="background-color:#f2f2f2; width:206px" %)PH Combination Electrodes|(% style="background-color:#f2f2f2; width:222px" %)0 ~~ 14 pH|(% style="background-color:#f2f2f2; width:356px" %)PH Value: 7
350 |(% style="background-color:#f2f2f2; width:206px" %)Water Pressure Sensor|(% style="background-color:#f2f2f2; width:222px" %)0~~5 meters|(% style="background-color:#f2f2f2; width:356px" %)2.5 meters pure water
351 |(% style="background-color:#f2f2f2; width:206px" %)Pressure transmitter probe|(% style="background-color:#f2f2f2; width:222px" %)0~~1MPa|(% style="background-color:#f2f2f2; width:356px" %)0.5MPa air / gas or water pressure
352
353 User can set different probe model for above probes. So IoT server is able to se identical how it should parse the 4~~20mA or 0~~30v sensor value and get the correct value.
354
355
356 (% style="color:blue" %)**IN1 & IN2:   **
357
358 IN1 and IN2 are used as Digital input pins.
359
360 (% style="color:#037691" %)**Example**:
361
362 01 (H):  IN1 or  IN2 pin is high level.
363
364 00 (L):  IN1 or  IN2 pin is low level.(% style="color:blue" %)** **
365
366
367 (% style="color:blue" %)**GPIO_EXTI Level:**
368
369 GPIO_EXTI is used as Interrupt Pin.
370
371 (% style="color:#037691" %)**Example**:
372
373 01 (H):  GPIO_EXTI pin is high level.
374
375 00 (L):  GPIO_EXTI pin is low level.
376
377
378 (% style="color:blue" %)**GPIO_EXTI Flag:**
379
380 This data field shows if this packet is generated by (% style="color:blue" %)**Interrupt Pin** (%%)or not. 
381
382 Note: The Interrupt Pin is a separate pin in the screw terminal.
383
384 (% style="color:#037691" %)**Example:**
385
386 0x00: Normal uplink packet.
387
388 0x01: Interrupt Uplink Packet.
389
390
391 (% style="color:blue" %)**0~~20mA:**
392
393 (% style="color:#037691" %)**Example**:
394
395 27AE(H) = 10158 (D)/1000 = 10.158mA.
396
397 [[image:image-20230904112121-3.png||height="219" width="552"]]
398
399 **Connect to a 2 wire 4~~20mA sensor.**
400
401 [[image:http://8.211.40.43/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/PS-NB_NB-IoT_AirWater_Pressure_Sensor_User_Manual/WebHome/image-20230913150648-2.png?width=559&height=304&rev=1.1||alt="image-20230913150648-2.png"]]
402
403
404 (% style="color:blue" %)**0~~30V:**
405
406 Measure the voltage value. The range is 0 to 30V.
407
408 (% style="color:#037691" %)**Example**:
409
410 138E(H) = 5006(D)/1000= 5.006V
411
412
413 (% style="color:blue" %)**TimeStamp:   **
414
415 Unit TimeStamp Example: 64e2d74f(H) = 1692587855(D)
416
417 Put the decimal value into this link([[https:~~/~~/www.epochconverter.com)>>https://www.epochconverter.com]])to get the time.
418
419
420 === 2.2.3 ThingsBoard Payload(Type~=3) ===
421
422
423 Type3 payload special design for ThingsBoard, it will also configure other default server to ThingsBoard.
424
425 (% style="color:blue" %)**{"IMEI": "866207053462705","Model": "PS-NB","idc_intput": 0.0,"vdc_intput": 3.577,"battery": 3.55,"signal": 22}**
426
427 [[image:image-20230913113900-2.png||height="606" width="1040"]]
428
429
430 === 2.2.4 ThingSpeak Payload(Type~=1) ===
431
432
433 This payload meets ThingSpeak platform requirement. It includes only four fields. Form 1~~4 are:
434
435 Idc_input , Vdc_input , Battery & Signal. This payload type only valid for ThingsSpeak Platform
436
437 As below:
438
439 (% style="color:blue" %)**field1=idc_intput value&field2=vdc_intput value&field3=battery value&field4=signal value**
440
441 [[image:image-20230913113919-3.png||height="760" width="1044"]]
442
443
444 == 2.3 Test Uplink and Change Update Interval ==
445
446
447 By default, Sensor will send uplinks (% style="color:blue" %)**every 2 hours**(%%) & AT+NOUD=8
448
449 User can use below commands to change the (% style="color:blue" %)**uplink interval**.
450
451 (% style="color:#037691" %)**AT+TDC=600 ** (%%) ~/~/ Set Update Interval to 600s
452
453 User can also push the button for more than 1 seconds to activate an uplink.
454
455
456 == 2.4 Multi-Samplings and One uplink ==
457
458 (% style="color:red" %)Notice: The AT+NOUD feature is upgraded to Clock Logging, please refer [[Clock Logging Feature>>||anchor="H2.8A0Clocklogging28Sincefirmwareversionv1.0.529"]]
459
460 To save battery life, PS-NB-NA will sample Idc_input & Vdc_input 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:
461
462 * (% 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)
463
464 * (% 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.
465
466 The diagram below explains the relationship between TR, NOUD, and TDC more clearly:
467
468 [[image:1692424376354-959.png]]
469
470
471 == 2.5 Trggier an uplink by external interrupt ==
472
473
474 PS-NB-NA has an external trigger interrupt function. Users can use the GPIO_EXTI pin to trigger the upload of data packets.
475
476 (% style="color:blue" %)**AT command:**
477
478 * (% style="color:#037691" %)**AT+INTMOD **(%%) ~/~/ Set the trigger interrupt mode
479
480 * (% style="color:#037691" %)**AT+INTMOD=0 **(%%) ~/~/ Disable Interrupt,as a digital input pin
481
482 * (% style="color:#037691" %)**AT+INTMOD=1 **(%%) ~/~/ Trigger by rising and falling edge
483
484 * (% style="color:#037691" %)**AT+INTMOD=2 **(%%) ~/~/ Trigger by falling edge
485
486 * (% style="color:#037691" %)**AT+INTMOD=3  **(%%) ~/~/ Trigger by rising edge
487
488 == 2.6 Set Power Output Duration ==
489
490
491 Control the output duration 3V3 , 5V or 12V. Before each sampling, device will
492
493 ~1. first enable the power output to external sensor,
494
495 2. keep it on as per duration, read sensor value and construct uplink payload
496
497 3. final, close the power output.
498
499
500 (% style="color:blue" %)**AT Command: AT+3V3T**
501
502 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:471px" %)
503 |=(% style="width: 154px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 201px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 116px;background-color:#4F81BD;color:white" %)**Response**
504 |(% style="background-color:#f2f2f2; width:154px" %)AT+3V3T=?|(% style="background-color:#f2f2f2; width:201px" %)Show 3V3 open time.|(% style="background-color:#f2f2f2; width:116px" %)(((
505 0
506 OK
507 )))
508 |(% style="background-color:#f2f2f2; width:154px" %)AT+3V3T=0|(% style="background-color:#f2f2f2; width:201px" %)Normally open 3V3 power supply.|(% style="background-color:#f2f2f2; width:116px" %)(((
509 OK
510 default setting
511 )))
512 |(% style="background-color:#f2f2f2; width:154px" %)AT+3V3T=1000|(% style="background-color:#f2f2f2; width:201px" %)Close after a delay of 1000 milliseconds.|(% style="background-color:#f2f2f2; width:116px" %)(((
513 OK
514 )))
515 |(% style="background-color:#f2f2f2; width:154px" %)AT+3V3T=65535|(% style="background-color:#f2f2f2; width:201px" %)Normally closed 3V3 power supply.|(% style="background-color:#f2f2f2; width:116px" %)(((
516 OK
517 )))
518
519 (% style="color:blue" %)**AT Command: AT+5VT**
520
521 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:465px" %)
522 |=(% style="width: 155px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 196px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 114px;background-color:#4F81BD;color:white" %)**Response**
523 |(% style="background-color:#f2f2f2; width:155px" %)AT+5VT=?|(% style="background-color:#f2f2f2; width:196px" %)Show 5V open time.|(% style="background-color:#f2f2f2; width:114px" %)(((
524 0
525 OK
526 )))
527 |(% style="background-color:#f2f2f2; width:155px" %)AT+5VT=0|(% style="background-color:#f2f2f2; width:196px" %)Normally closed 5V power supply.|(% style="background-color:#f2f2f2; width:114px" %)(((
528 OK
529 default setting
530 )))
531 |(% style="background-color:#f2f2f2; width:155px" %)AT+5VT=1000|(% style="background-color:#f2f2f2; width:196px" %)Close after a delay of 1000 milliseconds.|(% style="background-color:#f2f2f2; width:114px" %)(((
532 OK
533 )))
534 |(% style="background-color:#f2f2f2; width:155px" %)AT+5VT=65535|(% style="background-color:#f2f2f2; width:196px" %)Normally open 5V power supply.|(% style="background-color:#f2f2f2; width:114px" %)(((
535 OK
536 )))
537
538 (% style="color:blue" %)**AT Command: AT+12VT**
539
540 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:438px" %)
541 |=(% style="width: 156px;background-color:#4F81BD;color:white" %)**Command Example**|=(% style="width: 199px;background-color:#4F81BD;color:white" %)**Function**|=(% style="width: 83px;background-color:#4F81BD;color:white" %)**Response**
542 |(% style="background-color:#f2f2f2; width:156px" %)AT+12VT=?|(% style="background-color:#f2f2f2; width:199px" %)Show 12V open time.|(% style="background-color:#f2f2f2; width:83px" %)(((
543 0
544 OK
545 )))
546 |(% style="background-color:#f2f2f2; width:156px" %)AT+12VT=0|(% style="background-color:#f2f2f2; width:199px" %)Normally closed 12V power supply.|(% style="background-color:#f2f2f2; width:83px" %)OK
547 |(% style="background-color:#f2f2f2; width:156px" %)AT+12VT=500|(% style="background-color:#f2f2f2; width:199px" %)Close after a delay of 500 milliseconds.|(% style="background-color:#f2f2f2; width:83px" %)(((
548 OK
549 )))
550
551 == 2.7 Set the Probe Model ==
552
553
554 Users need to configure this parameter according to the type of external probe. In this way, the server can decode according to this value, and convert the current value output by the sensor into water depth or pressure value.
555
556 (% style="color:blue" %)**AT Command: AT** **+PROBE**
557
558 AT+PROBE=aabb
559
560 When aa=00, it is the water depth mode, and the current is converted into the water depth value; bb is the probe at a depth of several meters.
561
562 When aa=01, it is the pressure mode, which converts the current into a pressure value;
563
564 bb represents which type of pressure sensor it is.
565
566 (% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %)
567 |(% style="background-color:#4f81bd; color:white; width:154px" %)**Command Example**|(% style="background-color:#4f81bd; color:white; width:269px" %)**Function**|(% style="background-color:#4f81bd; color:white" %)**Response**
568 |(% style="background-color:#f2f2f2; width:154px" %)AT +PROBE =?|(% style="background-color:#f2f2f2; width:269px" %)Get or Set the probe model.|(% style="background-color:#f2f2f2" %)0
569 OK
570 |(% style="background-color:#f2f2f2; width:154px" %)AT +PROBE =0003|(% style="background-color:#f2f2f2; width:269px" %)Set water depth sensor mode, 3m type.|(% style="background-color:#f2f2f2" %)OK
571 |(% style="background-color:#f2f2f2; width:154px" %)(((
572 AT +PROBE =000A
573
574
575 )))|(% style="background-color:#f2f2f2; width:269px" %)Set water depth sensor mode, 10m type.|(% style="background-color:#f2f2f2" %)OK
576 |(% style="background-color:#f2f2f2; width:154px" %)AT +PROBE =0101|(% style="background-color:#f2f2f2; width:269px" %)Set pressure transmitters mode, first type.|(% style="background-color:#f2f2f2" %)OK
577 |(% style="background-color:#f2f2f2; width:154px" %)AT +PROBE =0000|(% style="background-color:#f2f2f2; width:269px" %)Initial state, no settings.|(% style="background-color:#f2f2f2" %)OK
578
579 == 2.8 Clock logging (Since firmware version v1.0.5) ==
580
581
582 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.
583
584 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.
585
586 * (% style="color:blue" %)**AT Command: AT** **+CLOCKLOG=a,b,c,d**
587
588 (% style="color:blue" %)**a:**(%%)** 0:** Disable Clock logging.  ** 1: **Enable Clock Logging
589
590 (% 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.
591
592 (% style="color:blue" %)**c: **(%%)Specify the sampling interval: range **(0 ~~ 255 minutes)**
593
594 (% style="color:blue" %)**d:**(%%)** **How many entries should be uplink on every TDC **(max 32)**
595
596 [[image:image-20240408084118-1.png]]
597
598 **Example:**
599
600 **AT+CLOCKLOG=1,65535,1,3**
601
602 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 3 memory records (payload + timestamp).
603
604 (% class="wikigeneratedid" %)
605 [[image:image-20240407191613-1.png||height="538" width="1128"]]
606
607 (% class="wikigeneratedid" %)
608 (% 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.**
609
610
611 == 2.9 Example Query saved historical records ==
612
613
614 * (% style="color:blue" %)**AT Command: AT** **+CDP**
615
616 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.
617
618 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/TS01-NB_NB-IoT_Tilting_Sensor_User_Manual/WebHome/image-20240316163550-2.png?width=829&height=638&rev=1.1||alt="image-20240316163550-2.png" height="638" width="829"]]
619
620
621 == 2.10 Uplink log query ==
622
623
624 * (% style="color:blue" %)**AT Command: AT** **+GETLOG**
625
626 This command can be used to query upstream logs of data packets.
627
628 [[image:image-20240407191922-2.png||height="631" width="903"]]
629
630
631 == 2.11 Scheduled domain name resolution ==
632
633 This command is used to set up scheduled domain name resolution
634
635 (% style="color:blue" %)**AT Command:**
636
637 * (% style="color:blue" %)**AT+DNSTIMER=XX**(%%)** **~/~/Unit: hour
638
639 After setting this command, domain name resolution will be performed regularly.
640
641
642
643 = 3. Configure PS-NB-NA =
644
645 == 3.1 Configure Methods ==
646
647
648 PS-NB-NA supports below configure method:
649
650 * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]].
651
652 * 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]].
653
654 == 3.2 AT Commands Set ==
655
656
657 AT+<CMD>?        : Help on <CMD>
658
659 AT+<CMD>         : Run <CMD>
660
661 AT+<CMD>=<value> : Set the value
662
663 AT+<CMD>=?       : Get the value
664
665
666 (% style="color:blue" %)**General Commands**      
667
668 AT                    : Attention       
669
670 AT?  : Short Help     
671
672 ATZ  : MCU Reset    
673
674 AT+TDC  : Application Data Transmission Interval
675
676 AT+CFG  : Print all configurations
677
678 AT+MODEL  :Get module information
679
680 AT+SLEEP  :Get or set the sleep status
681
682 AT+DEUI  : Get or set the Device ID
683
684 AT+INTMOD            : Set the trigger interrupt mode
685
686 AT+APN : Get or set the APN
687
688 AT+3V3T  : Set extend the time of 3V3 power  
689
690 AT+5VT           : Set extend the time of 5V power  
691
692 AT+12VT           : Set extend the time of 12V power  
693
694 AT+PROBE : Get or Set the probe model
695
696 AT+PRO          : Choose agreement
697
698 AT+RXDL  : Extend the sending and receiving time
699
700 AT+TR : Get or set data record time
701
702 AT+CDP     : Read or Clear cached data
703
704 AT+NOUD  : Get or Set the number of data to be uploaded
705
706 AT+DNSCFG  : Get or Set DNS Server
707
708 AT+CSQTIME : Get or Set the time to join the network
709
710 AT+DNSTIMER : Get or Set the NDS timer
711
712 AT+TLSMOD : Get or Set the TLS mode
713
714 AT+GETSENSORVALUE   : Returns the current sensor measurement
715
716 AT+SERVADDR :  Server Address
717
718
719 (% style="color:blue" %)**MQTT Management**
720
721 AT+CLIENT               : Get or Set MQTT client
722
723 AT+UNAME              : Get or Set MQTT Username
724
725 AT+PWD                  : Get or Set MQTT password
726
727 AT+PUBTOPIC  : Get or Set MQTT publish topic
728
729 AT+SUBTOPIC  : Get or Set MQTT subscription topic
730
731
732 (% style="color:blue" %)**Information**          
733
734 AT+FDR  : Factory Data Reset
735
736 AT+PWORD  : Serial Access Password
737
738 AT+LDATA  : Get the last upload data
739
740 AT+CDP  : Read or Clear cached data
741
742
743 = 4. Battery & Power Consumption =
744
745
746 PS-NB-NA use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace.
747
748 [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] .
749
750
751 = 5. Firmware update =
752
753
754 User can change device firmware to::
755
756 * Update with new features.
757
758 * Fix bugs.
759
760 Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/exywhfmnnrpd015/AACIrHmxRVllAL32mgitOfpBa?dl=0]]**
761
762 Methods to Update Firmware:
763
764 * (Recommended way) OTA firmware update via BLE: [[**Instruction**>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE_Firmware_Update_NB_Sensors_BC660K-GL/]].
765
766 * Update through UART TTL interface : **[[Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/UART_Access_for_NB_ST_BC660K-GL/#H4.2UpdateFirmware28Assumethedevicealreadyhaveabootloader29]]**.
767
768 = 6. FAQ =
769
770 == 6.1 How can I access t BC660K-GL AT Commands? ==
771
772
773 User can access to BC660K-GL directly and send AT Commands.
774
775 [[See BC660K-GL AT Command set>>url:https://www.dropbox.com/sh/5f6ssda5fum8rvs/AABT68l8ZzWOvZ5eg2qwOoFda?dl=0]]
776
777
778 == 6.2 How to configure the device through the MQTT subscription function?(Since version v1.0.3) ==
779
780
781 Subscription content: {AT COMMAND}
782
783 (% style="color:#037691" %)**Example:**
784
785 Setting AT+5VT=500 through Node-RED requires MQTT to send the content {AT+5VT=500}.
786
787 [[image:image-20231025162946-2.png]]
788
789 The serial port displays:
790
791 [[image:image-20231025162958-3.png]]
792
793
794 = 7. Order Info =
795
796
797 Part Number: (% style="color:blue" %)**PS-NB-NA-XX-YY**
798
799 (% style="color:red" %)**XX:**
800
801 * (% style="color:#037691" %)**GE**(%%): General version ( Exclude SIM card)
802
803 * (% style="color:#037691" %)**1D**(%%): with 1NCE* 10 years 500MB SIM card and Pre-configure to DataCake server
804
805 (% style="color:blue" %)**YY: The grand connector hole size**
806
807 * M12: M12 hole
808
809 * M16: M16 hole
810
811 * M20: M20 hole
812
813 = 8. ​Packing Info =
814
815
816 (% style="color:#037691" %)**Package Includes**:
817
818 * PS-NB-NA NB-IoT Analog Sensor x 1
819
820 * External antenna x 1
821
822 (% style="color:#037691" %)**Dimension and weight**:
823
824 * Device Size: cm
825
826 * Device Weight: g
827
828 * Package Size / pcs : cm
829
830 * Weight / pcs : g
831
832 = 9. Support =
833
834
835 * 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.
836
837 * 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]].
838
839 (% style="display:none" %) (%%)
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0