Show last authors
1 (% style="text-align:center" %)
2 [[image:image-20230131183542-1.jpeg||height="694" width="694"]]
3
4 **Table of Contents:**
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 = 1. Introduction =
20
21 == 1.1 ​What is SDI-12 to LoRaWAN Converter ==
22
23
24 The Dragino **SDI-12-LB** is a **SDI-12 to LoRaWAN Converter **designed for Smart Agriculture solution.
25
26 SDI-12 (Serial Digital Interface at 1200 baud) is an asynchronous [[serial communications>>url:https://en.wikipedia.org/wiki/Serial_communication]] protocol for intelligent sensors that monitor environment data. SDI-12 protocol is widely used in Agriculture sensor and Weather Station sensors.
27
28 **SDI-12-LB** has SDI-12 interface and support 12v output to power external SDI-12 sensor. It can get the environment data from SDI-12 sensor and sends out the data via LoRaWAN wireless protocol.
29
30 The LoRa wireless technology used in **SDI-12-LB** allows device to send data and reach extremely long ranges at low data-rates. It provides ultra-long range spread spectrum communication and high interference immunity whilst minimizing current consumption.
31
32 **SDI-12-LB** is powered by **8500mAh Li-SOCI2 battery**, it is designed for long term use up to 5 years.
33
34 Each **SDI-12-LB** is pre-load with a set of unique keys for LoRaWAN registrations, register these keys to local LoRaWAN server and it will auto connect after power on.
35
36
37 [[image:image-20230201084414-1.png||height="464" width="1108"]]
38
39
40
41
42
43
44 == ​1.2 Features ==
45
46
47 * LoRaWAN 1.0.3 Class A
48 * Ultra-low power consumption
49 * Controllable 5v and 12v output to power external sensor
50 * SDI-12 Protocol to connect to SDI-12 Sensor
51 * Monitor Battery Level
52 * Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865
53 * Support Bluetooth v5.1 and LoRaWAN remote configure.
54 * Support wireless OTA update firmware
55 * Uplink on periodically
56 * Downlink to change configure
57 * 8500mAh Battery for long term use
58
59 == 1.3 Specification ==
60
61
62 **Micro Controller:**
63
64 * MCU: 48Mhz ARM
65 * Flash: 256KB
66 * RAM: 64KB
67
68 **Common DC Characteristics:**
69
70 * Supply Voltage: 2.5v ~~ 3.6v
71 * Operating Temperature: -40 ~~ 85°C
72
73 **LoRa Spec:**
74
75 * Frequency Range,  Band 1 (HF): 862 ~~ 1020 Mhz
76 * Max +22 dBm constant RF output vs.
77 * RX sensitivity: down to -139 dBm.
78 * Excellent blocking immunity
79
80 **Current Input Measuring :**
81
82 * Range: 0 ~~ 20mA
83 * Accuracy: 0.02mA
84 * Resolution: 0.001mA
85
86 **Voltage Input Measuring:**
87
88 * Range: 0 ~~ 30v
89 * Accuracy: 0.02v
90 * Resolution: 0.001v
91
92 **Battery:**
93
94 * Li/SOCI2 un-chargeable battery
95 * Capacity: 8500mAh
96 * Self-Discharge: <1% / Year @ 25°C
97 * Max continuously current: 130mA
98 * Max boost current: 2A, 1 second
99
100 **Power Consumption**
101
102 * Sleep Mode: 5uA @ 3.3v
103 * LoRa Transmit Mode: 125mA @ 20dBm, 82mA @ 14dBm
104
105 == 1.4 Connect to SDI-12 Sensor ==
106
107
108
109 [[image:1675212538524-889.png]]
110
111
112 == 1.5 Sleep mode and working mode ==
113
114
115 **Deep Sleep Mode: **Sensor doesn't have any LoRaWAN activate. This mode is used for storage and shipping to save battery life.
116
117 **Working Mode: **In this mode, Sensor will work as LoRaWAN Sensor to Join LoRaWAN 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.
118
119
120 == 1.6 Button & LEDs ==
121
122
123 [[image:1675212633011-651.png]]
124
125
126
127 (% border="1" cellspacing="4" style="background-color:#f7faff; color:black; width:510px" %)
128 |=(% style="width: 167px;" %)**Behavior on ACT**|=(% style="width: 117px;" %)**Function**|=(% style="width: 225px;" %)**Action**
129 |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)(((
130 If sensor is already Joined to LoRaWAN network, sensor will send an uplink packet, (% style="color:blue" %)**blue led** (%%)will blink once.
131 Meanwhile, BLE module will be active and user can connect via BLE to configure device.
132 )))
133 |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)(((
134 (% 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 JOIN LoRaWAN network.
135 (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network.
136 Once sensor is active, BLE module will be active and user can connect via BLE to configure device, no matter if device join or not join LoRaWAN network.
137 )))
138 |(% 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 PS-LB is in Deep Sleep Mode.
139
140 == 1.7 Pin Mapping ==
141
142
143 [[image:1675213198663-754.png]]
144
145
146 == 1.8 BLE connection ==
147
148
149 SDI-12-LB support BLE remote configure.
150
151 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:
152
153 * Press button to send an uplink
154 * Press button to active device.
155 * Device Power on or reset.
156
157 If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
158
159
160 == 1.9 Mechanical ==
161
162
163
164
165
166 [[image:image-20230201090139-2.png]]
167
168 [[image:image-20230201090139-3.png]]
169
170 [[image:image-20230201090139-4.png]]
171
172
173 = 2. Configure SDI-12 to connect to LoRaWAN network =
174
175 == 2.1 How it works ==
176
177
178 The SDI-12-LB is configured as **LoRaWAN OTAA Class A** mode by default. It has OTAA keys to join LoRaWAN network. To connect a local LoRaWAN network, you need to input the OTAA keys in the LoRaWAN IoT server and activate the SDI-12-LB. It will automatically join the network via OTAA and start to send the sensor value. The default uplink interval is 20 minutes.
179
180
181 == 2.2 Quick guide to connect to LoRaWAN server (OTAA) ==
182
183
184 Following is an example for how to join the [[TTN v3 LoRaWAN Network>>url:https://console.cloud.thethings.network/]]. Below is the network structure; we use the [[LPS8v2>>url:https://www.dragino.com/products/lora-lorawan-gateway/item/228-lps8v2.html]] as a LoRaWAN gateway in this example.
185
186
187 [[image:image-20230201090528-5.png||height="465" width="1111"]]
188
189
190 The LPS8V2 is already set to connected to [[TTN network >>url:https://console.cloud.thethings.network/]], so what we need to now is configure the TTN server.
191
192
193 **Step 1**: Create a device in TTN with the OTAA keys from SDI-12-LB.
194
195 Each SDI-12-LB is shipped with a sticker with the default device EUI as below:
196
197
198 [[image:image-20230131134744-2.jpeg]]
199
200
201
202
203
204 You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
205
206
207 **Register the device**
208
209 [[image:1675213652444-622.png]]
210
211
212 **Add APP EUI and DEV EUI**
213
214
215 [[image:1675213661769-223.png]]
216
217
218 **Add APP EUI in the application**
219
220
221 [[image:1675213675852-577.png]]
222
223
224 **Add APP KEY**
225
226 [[image:1675213686734-883.png]]
227
228
229 **Step 2**: Activate on SDI-12-LB
230
231
232 Press the button for 5 seconds to activate the SDI-12-LB.
233
234
235 **Green led** will fast blink 5 times, device will enter **OTA mode** for 3 seconds. And then start to JOIN LoRaWAN network. **Green led** will solidly turn on for 5 seconds after joined in network.
236
237
238 [[image:1675213704414-644.png]]
239
240
241 == ​2.3 SDI-12 Related Commands ==
242
243
244 User need to configure SDI-12-LB to communicate with SDI-12 sensors otherwise the uplink payload will only include a few bytes.
245
246
247 === 2.3.1 Basic SDI-12 debug command ===
248
249
250 User can run some basic SDI-12 command to debug the connection to the SDI-12 sensor. These commands can be sent via AT Command or LoRaWAN downlink command.
251
252 If SDI-12 sensor return value after get these commands, //SDI-12-LB// will uplink the return on FPORT=100, otherwise, if there is no response from SDI-12 sensor. //SDI-12-LB// will uplink NULL (0x 4E 55 4C 4C) to server.
253
254 The following is the display information on the serial port and the server.
255
256
257
258 [[image:image-20230201091027-6.png]]
259
260
261 [[image:image-20230201091027-7.png||height="261" width="1179"]]
262
263
264 ==== **al!  ~-~- Get SDI-12 sensor Identification** ====
265
266
267 * AT Command: AT+ADDRI=aa
268 * LoRaWAN Downlink(prefix 0xAA00): AA 00 aa
269
270 **Parameter:  **aa: ASCII value of SDI-12 sensor address in downlink or HEX value in AT Command)
271
272 **Example :  **AT+ADDRI=0 ( Equal to downlink: 0x AA 00 30)
273
274
275 The following is the display information on the serial port and the server.
276
277
278 [[image:image-20230201091257-8.png]]
279
280
281 [[image:image-20230201091257-9.png||height="225" width="1242"]]
282
283
284 ==== **aM!,aMC!, aM1!- aM9!, aMC1!- aMC9!** ====
285
286
287 **aM! **: Start Non-Concurrent Measurement
288
289 **aMC! **: Start Non-Concurrent Measurement – Request CRC
290
291 **aM1!- aM9! **: Additional Measurements
292
293 **aMC1!- aMC9!** : Additional Measurements – Request CRC
294
295
296 * AT Command : AT+ADDRM=0,1,0,1
297 * LoRaWAN Downlink(prefix 0xAA01): 0xAA 01 30 01 00 01
298
299 Downlink:AA 01 aa bb cc dd
300
301 **aa**: SDI-12 sensor address.
302
303 **bb**: 0: no CRC, 1: request CRC
304
305 **cc**: 1-9: Additional Measurement, 0: no additional measurement
306
307 **dd**: delay (in second) to send **aD0!** to get return.
308
309
310 The following is the display information on the serial port and the server.
311
312
313 [[image:image-20230201091630-10.png]]
314
315
316 [[image:image-20230201091630-11.png||height="247" width="1165"]]
317
318
319
320 ==== **aC!, aCC!,  aC1!- aC9!,  aCC1!- aCC9! ** ====
321
322
323 **aC!** : Start Concurrent Measurement
324
325 **aCC!** : Start Concurrent Measurement – Request CRC
326
327 **aC1!- aC9!** : Start Additional Concurrent Measurements
328
329 **aCC1!- aCC9!** : Start Additional Concurrent Measurements – Request CRC
330
331
332 * AT Command : AT+ADDRC=0,1,0,1 
333
334 * LoRaWAN Downlink(0xAA02): 0xAA 02 30 01 00 01
335
336 Downlink: AA 02 aa bb cc dd
337
338 **aa**: SDI-12 sensor address.
339
340 **bb**: 0: no CRC, 1: request CRC
341
342 **cc**: 1-9: Additional Measurement, 0: no additional measurement
343
344 **dd**: delay (in second) to send **aD0!** to get return.
345
346
347 The following is the display information on the serial port and the server.
348
349
350 [[image:image-20230201091954-12.png]]
351
352
353 [[image:image-20230201091954-13.png||height="203" width="1117"]]
354
355
356 (% style="display:none" %) (%%)
357
358 ==== **aR0!- aR9!,  aRC0!- aRC9!** ====
359
360
361 Start Continuous Measurement
362
363 Start Continuous Measurement – Request CRC
364
365
366 * AT Command : AT+ADDRR=0,1,0,1 
367 * LoRaWAN Downlink (0xAA 03): 0xAA 03 30 01 00 01
368
369 Downlink: AA 03 aa bb cc dd
370
371 **aa**: SDI-12 sensor address.
372
373 **bb**: 0: no CRC, 1: request CRC
374
375 **cc**: 1-9: Additional Measurement, 0: no additional measurement
376
377 **dd**: delay (in second) to send **aD0!** to get return.
378
379
380 The following is the display information on the serial port and the server.
381
382
383
384 [[image:image-20230201092208-14.png]]
385
386
387 [[image:image-20230201092208-15.png||height="214" width="1140"]]
388
389
390 === ​​​​​​​2.3.2 Advance SDI-12 Debug command ===
391
392
393 This command can be used to debug all SDI-12 command.
394
395
396 LoRaWAN Downlink: A8 aa xx xx xx xx bb cc
397
398 **aa **: total SDI-12 command length
399
400 **xx **: SDI-12 command
401
402 **bb **: Delay to wait for return
403
404 **cc **: 0: don't uplink return to LoRaWAN, 1: Uplink return to LoRaWAN on FPORT=100
405
406
407 **Example: **AT+CFGDEV =0RC0!,1
408
409 **0RC0! **: SDI-12 Command,
410
411 **1 **: Delay 1 second.  ( 0: 810 mini-second)
412
413 Equal Downlink: 0xA8 05 30 52 43 30 21 01 01
414
415
416 The following is the display information on the serial port and the server.
417
418
419 [[image:image-20230201092355-16.png]]
420
421
422 ​​​​​​​[[image:image-20230201092355-17.png||height="426" width="1135"]]
423
424
425 ​​​​​​​
426
427 === 2.3.3 Convert ASCII to String ===
428
429
430 This command is used to convert between ASCII and String format.
431
432 AT+CONVFORM ( Max length: 80 bytes)
433
434
435 **Example:**
436
437 1) AT+CONVFORM=0, string Convert String from String to ASCII
438
439 [[image:1675214845056-885.png]]
440
441
442 2) AT+CONVFORM=1, ASCII Convert ASCII to String.
443
444 [[image:1675214856590-846.png]]
445
446
447
448
449 ​​​​​​​
450
451 === 2.3.4 Define periodically SDI-12 commands and uplink. ===
452
453
454 AT+COMMANDx & AT+DATACUTx
455
456 User can define max 15 SDI-12 Commands (AT+COMMAND1 ~~ AT+COMMANDF). On each uplink period (TDC time, default 20 minutes), SDI-12-LB will send these SDI-12 commands and wait for return from SDI-12 sensors. SDI-12-LB will then combine these returns and uplink via LoRaWAN.
457
458
459 * ** AT Command:**
460
461 **AT+COMMANDx=var1,var2,var3,var4.**
462
463 **var1**: SDI-12 command , for example: 0RC0!
464
465 **var2**: Wait timeout for return. (unit: second)
466
467 **var3**: Whether to send //addrD0!// to get return after var2 timeout. 0: Don't Send //addrD0! //; 1: Send //addrD0!//.
468
469 **var4**: validation check for return. If return invalid, SDI-12-LB will resend this command. Max 2 retries.
470
471 **0 ** No validation check;
472
473 **1**  Check if return chars are printable char(0x20 ~~ 0x7E);
474
475 **2**  Check if there is return from SDI-12 sensor
476
477 **3**  Check if return pass CRC check ( SDI-12 command var1 must include CRC request);
478
479
480 Each AT+COMMANDx is followed by a **AT+DATACUT** command. AT+DATACUT command is used to take the useful string from the SDI-12 sensor so the final payload will have the minimum length to uplink.
481
482
483 **AT+DATACUTx** : This command defines how to handle the return from AT+COMMANDx, max return length is 100 bytes.
484
485 (% border="1" style="background-color:#f7faff; width:436px" %)
486 |(% style="width:433px" %)(((
487 AT+DATACUTx=a,b,c
488
489 **a**:  length for the return of AT+COMMAND
490
491 **b**: 1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections.
492
493 **c**:  define the position for valid value. 
494 )))
495
496 For example, if return from AT+COMMAND1 is “013METER   TER12 112T12-00024895” ,. Below AT+DATACUT1 will get different result to combine payload:
497
498
499 |AT+DATACUT1 value|Final Result to combine Payload
500 |34,1,1+2+3|0D 00 01 30 31 33
501 |34,2,1~~8+12~~16|0D 00 01 30 31 33 4D 45 54 45 52 54 45 52 31 32
502 |34,2,1~~34|0D 00 01 30 31 33 4D 45 54 45 52 20 20 20 54 45 52 31 32 20 31 31 32 54 31 32 2D 30 30 30 32 34 38 39 35 0D 0A
503
504 * ** Downlink Payload:**
505
506 **0xAF**  downlink command can be used to set AT+COMMANDx or AT+DATACUTx.
507
508
509 **Note : if user use AT+COMMANDx to add a new command, he also need to send AT+DATACUTx downlink.**
510
511
512 Format: ** AF MM NN LL XX XX XX XX YY**
513
514 Where:
515
516 * MM: the AT+COMMAND or AT+DATACUT to be set. Value from 01 ~~ 0F,
517 * NN:  1: set the AT+DATACUT value ; 2: set the AT+DATACUT value.
518 * LL:  The length of AT+COMMAND or AT+DATACUT command
519 * XX XX XX XX: AT+COMMAND or AT+DATACUT command
520 * YY:  If YY=0, RS485-LN will execute the downlink command without uplink; if YY=1, RS485-LN will execute an uplink after got this command. 
521
522 Example:
523
524 **AF 03 01 07 30 4D 43 21 01 01 01 00**: Same as AT+COMMAND3=**0MC!**,** 1**,** 1**,** 1**
525
526 **AF 03 02 06 10 01 05 06 09 0A 00**: Same as AT+DATACUT3=**16**,**1**,**5+6+9+10**
527
528 **AF 03 02 06 0B 02 05 07 08 0A 00**: Same as AT+DATACUT3=**11**,**2**,**5~~7+8~~10**
529
530
531 **Clear SDI12 Command**
532
533 The AT+COMMANDx and AT+DATACUTx settings are stored in special location, user can use below command to clear them.
534
535
536 * ** AT Command:**
537
538 **~ AT+CMDEAR=mm,nn**   mm: start position of erase ,nn: stop position of erase
539
540
541 Etc. AT+CMDEAR=1,10 means erase AT+COMMAND1/AT+DATACUT1 to AT+COMMAND10/AT+DATACUT10
542
543
544 * ** Downlink Payload:**
545
546 **~ 0x09 aa bb**  same as AT+CMDEAR=aa,bb
547
548
549
550
551 **command combination**
552
553 Below shows a screen shot how the results combines together to a uplink payload.
554
555 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image029.png]]
556
557
558 If user don’t want to use DATACUT for some command, he simply want to uplink all returns. AT+ALLDATAMOD can be set to 1.
559
560 **AT+ALLDATAMOD** will simply get all return and don’t do CRC check as result for SDI-12 command. AT+DATACUTx command has higher priority, if AT+DATACUTx has been set, AT+ALLDATAMOD will be ignore for this SDI-12 command.
561
562
563 For example: as below photo, AT+ALLDATAMOD=1, but AT+DATACUT1 has been set, AT+DATACUT1 will be still effect the result.
564
565
566 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image030.png]]
567
568
569 If AT+ALLDATAMOD=1, **FX,X** will be added in the payload, FX specify which command is used and X specify the length of return. for example in above screen, F1 05 means the return is from AT+COMMAND1 and the return is 5 bytes.
570
571
572
573 **Compose Uplink**
574
575 **AT+DATAUP=0**
576
577 Compose the uplink payload with value returns in sequence and send with A SIGNLE UPLINK.
578
579 Final Payload is Battery Info+PAYVER + VALID Value from RETURN1 + Valid Value from RETURN2 + … + RETURNx
580
581 Where PAYVER is defined by AT+PAYVER, below is an example screen shot.
582
583
584 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image031.png]]
585
586
587 **AT+DATAUP=1**
588
589 Compose the uplink payload with value returns in sequence and send with Multiply UPLINKs.
590
591 Final Payload is
592
593 **Battery Info+PAYVER + PAYLOAD COUNT + PAYLOAD# + DATA**
594
595 1. Battery Info (2 bytes): Battery voltage
596 1. PAYVER (1 byte): Defined by AT+PAYVER
597 1. PAYLOAD COUNT (1 byte): Total how many uplinks of this sampling.
598 1. PAYLOAD# (1 byte): Number of this uplink. (from 0,1,2,3…,to PAYLOAD COUNT)
599 1. DATA: Valid value: max 6 bytes(US915 version here, Notice*!) for each uplink so each uplink <= 11 bytes. For the last uplink, DATA will might less than 6 bytes
600
601 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image032.png]]
602
603
604 **Notice: the Max bytes is according to the max support bytes in different Frequency Bands for lowest SF. As below:**
605
606 ~* For AU915/AS923 bands, if UplinkDwell time=0, max 51 bytes for each uplink ( so 51 -5 = 46 max valid date)
607
608 * For AU915/AS923 bands, if UplinkDwell time=1, max 11 bytes for each uplink ( so 11 -5 = 6 max valid date).
609
610 * For US915 band, max 11 bytes for each uplink ( so 11 -5 = 6 max valid date).
611
612 ~* For all other bands: max 51 bytes for each uplink  ( so 51 -5 = 46 max valid date).
613
614 *** When AT+DATAUP=1, the maximum number of segments is 15, and the maximum total number of bytes is 1500;**
615
616 **~ When AT+DATAUP=1 and AT+ADR=0, the maximum number of bytes of each payload is determined by the DR value.**
617
618 1.
619 11. Uplink Payload
620
621 Uplink payloads have two types:
622
623 * Distance Value: Use FPORT=2
624 * Other control commands: Use other FPORT fields.
625
626 The application server should parse the correct value based on FPORT settings.
627
628
629 1.
630 11.
631 111. Device Payload, FPORT=5
632
633 Include device configure status. Once SDI-12-LB Joined the network, it will uplink this message to the server.
634
635
636 Users can also use the downlink command(0x26 01) to ask SDI-12-LB to resend this uplink.
637
638
639 |(% colspan="6" %)**Device Status (FPORT=5)**
640 |**Size (bytes)**|**1**|**2**|**1**|**1**|**2**
641 |**Value**|Sensor Model|Firmware Version|Frequency Band|Sub-band|BAT
642
643 Example parse in TTNv3
644
645 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image033.png]]
646
647 **Sensor Model**: For SDI-12-LB, this value is 0x17
648
649 **Firmware Version**: 0x0100, Means: v1.0.0 version
650
651 **Frequency Band**:
652
653 *0x01: EU868
654
655 *0x02: US915
656
657 *0x03: IN865
658
659 *0x04: AU915
660
661 *0x05: KZ865
662
663 *0x06: RU864
664
665 *0x07: AS923
666
667 *0x08: AS923-1
668
669 *0x09: AS923-2
670
671 *0x0a: AS923-3
672
673 *0x0b: CN470
674
675 *0x0c: EU433
676
677 *0x0d: KR920
678
679 *0x0e: MA869
680
681
682 **Sub-Band**:
683
684 AU915 and US915:value 0x00 ~~ 0x08
685
686 CN470: value 0x0B ~~ 0x0C
687
688 Other Bands: Always 0x00
689
690
691 **Battery Info**:
692
693 Check the battery voltage.
694
695 Ex1: 0x0B45 = 2885mV
696
697 Ex2: 0x0B49 = 2889mV
698
699
700 1.
701 11.
702 111. Uplink Payload, FPORT=2
703
704 There are different cases for uplink. See below
705
706 * SDI-12 Debug Command return: FPORT=100
707
708 * Periodically Uplink: FPORT=2
709
710 |(((
711 **Size**
712
713 **(bytes)**
714 )))|**2**|**1**|**Length depends on the return from the commands**
715 |**Value**|(((
716 Battery(mV)
717
718 &
719
720 Interrupt_Flag
721 )))|[[PAYLOAD_VER>>path:#Probe_Model]]|(((
722 If the valid payload is too long and exceed the maximum support
723
724 Payload length in server,server will show payload not provided in the LoRaWAN server.
725 )))
726
727 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image034.png]]
728
729
730
731 1.
732 11.
733 111. Battery Info
734
735 Check the battery voltage for SDI-12-LB.
736
737 Ex1: 0x0B45 = 2885mV
738
739 Ex2: 0x0B49 = 2889mV
740
741
742 1.
743 11.
744 111. Interrupt Pin
745
746 This data field shows if this packet is generated by **Interrupt Pin** or not. [[Click here>>path:#Int_mod]] for the hardware and software set up. Note: The Internet Pin is a separate pin in the screw terminal. See [[pin mapping>>path:#pins]].
747
748
749 Example:
750
751 Ex1: 0x0B45:0x0B&0x80= 0x00    Normal uplink packet.
752
753 Ex2: 0x8B49:0x8B&0x80= 0x80    Interrupt Uplink Packet.
754
755
756 1.
757 11.
758 111. Payload version
759
760
761
762
763
764 1.
765 11.
766 111. ​Decode payload in The Things Network
767
768 While using TTN network, you can add the payload format to decode the payload.
769
770 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image035.png]]
771
772
773 There is no fix payload decoder in LoRaWAN server because the SDI-12 sensors returns are different. User need to write the decoder themselves for their case.
774
775
776 下面的解码生成超链接放进去.
777
778 function Decoder(bytes, port) {
779
780 if(port==5)
781
782 {
783
784 var freq_band;
785
786 var sub_band;
787
788 var sensor;
789
790
791 if(bytes[0]==0x17)
792
793 sensor= "SDI12-LB";
794
795
796 var firm_ver= (bytes[1]&0x0f)+'.'+(bytes[2]>>4&0x0f)+'.'+(bytes[2]&0x0f);
797
798
799 if(bytes[3]==0x01)
800
801 freq_band="EU868";
802
803 else if(bytes[3]==0x02)
804
805 freq_band="US915";
806
807 else if(bytes[3]==0x03)
808
809 freq_band="IN865";
810
811 else if(bytes[3]==0x04)
812
813 freq_band="AU915";
814
815 else if(bytes[3]==0x05)
816
817 freq_band="KZ865";
818
819 else if(bytes[3]==0x06)
820
821 freq_band="RU864";
822
823 else if(bytes[3]==0x07)
824
825 freq_band="AS923";
826
827 else if(bytes[3]==0x08)
828
829 freq_band="AS923_1";
830
831 else if(bytes[3]==0x09)
832
833 freq_band="AS923_2";
834
835 else if(bytes[3]==0x0A)
836
837 freq_band="AS923_3";
838
839 else if(bytes[3]==0x0F)
840
841 freq_band="AS923_4";
842
843 else if(bytes[3]==0x0B)
844
845 freq_band="CN470";
846
847 else if(bytes[3]==0x0C)
848
849 freq_band="EU433";
850
851 else if(bytes[3]==0x0D)
852
853 freq_band="KR920";
854
855 else if(bytes[3]==0x0E)
856
857 freq_band="MA869";
858
859
860 if(bytes[4]==0xff)
861
862 sub_band="NULL";
863
864 else
865
866 sub_band=bytes[4];
867
868
869 var bat= (bytes[5]<<8 | bytes[6])/1000;
870
871
872 return {
873
874 SENSOR_MODEL:sensor,
875
876 FIRMWARE_VERSION:firm_ver,
877
878 FREQUENCY_BAND:freq_band,
879
880 SUB_BAND:sub_band,
881
882 BAT:bat,
883
884 }
885
886 }
887
888 else if(port==100)
889
890 {
891
892 var datas_sum={};
893
894 for(var j=0;j<bytes.length;j++)
895
896 {
897
898 var datas= String.fromCharCode(bytes[j]);
899
900 if(j=='0')
901
902 datas_sum.datas_sum=datas;
903
904 else
905
906 datas_sum.datas_sum+=datas;
907
908 }
909
910
911 return datas_sum;
912
913 }
914
915 else
916
917 {
918
919 var decode={};
920
921 decode.EXTI_Trigger= (bytes[0] & 0x80)? "TRUE":"FALSE";  
922
923 decode.BatV= ((bytes[0]<<8 | bytes[1])&0x7FFF)/1000;
924
925 decode.Payver= bytes[2];
926
927 for(var i=3;i<bytes.length;i++)
928
929 {
930
931 var data= String.fromCharCode(bytes[i]);
932
933 if(i=='3')
934
935 decode.data_sum=data;
936
937 else
938
939 decode.data_sum+=data;
940
941 }
942
943 return decode; 
944
945 }
946
947
948 }
949
950
951 1.
952 11. Uplink Interval
953
954 The SDI-12-LB by default uplink the sensor data every 20 minutes. User can change this interval by AT Command or LoRaWAN Downlink Command. See this link:
955
956 [[http:~~/~~/wiki.dragino.com/index.php?title=End_Device_AT_Commands_and_Downlink_Commands#Change_Uplink_Interval>>url:http://wiki.dragino.com/index.php?title=End_Device_AT_Commands_and_Downlink_Commands#Change_Uplink_Interval]]
957
958
959
960 1.
961 11. Frequency Plans
962
963 The SDI12-LB uses OTAA mode and below frequency plans by default. If user want to use it with different frequency plan, please refer the AT command sets.
964
965
966 [[https:~~/~~/wiki.dragino.com/index.php?title=End_Device_Frequency_Band>>url:https://wiki.dragino.com/index.php?title=End_Device_Frequency_Band]]
967
968
969
970 1.
971 11. Firmware Change Log
972
973 **Firmware download link:**
974
975 [[https:~~/~~/www.dropbox.com/sh/gf1glloczbzz19h/AABbuYI4WY6VdAmpXo6o1V2Ka?dl=0>>url:https://www.dropbox.com/sh/gf1glloczbzz19h/AABbuYI4WY6VdAmpXo6o1V2Ka?dl=0]]
976
977
978
979 1. Configure SDI-12-LB via AT Command or LoRaWAN Downlink
980
981 Use can configure SDI-12-LB via AT Command or LoRaWAN Downlink.
982
983 * AT Command Connection: See [[FAQ>>path:#AT_COMMAND]].
984 * LoRaWAN Downlink instruction for different platforms:
985
986 [[http:~~/~~/wiki.dragino.com/index.php?title=Main_Page#Use_Note_for_Server>>url:http://wiki.dragino.com/index.php?title=Main_Page#Use_Note_for_Server]]
987
988
989 There are two kinds of commands to configure SDI-12-LB, they are:
990
991 * **General Commands**.
992
993 These commands are to configure:
994
995 * General system settings like: uplink interval.
996 * LoRaWAN protocol & radio related command.
997
998 They are same for all Dragino Device which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki:
999
1000 [[http:~~/~~/wiki.dragino.com/index.php?title=End_Device_Downlink_Command>>url:http://wiki.dragino.com/index.php?title=End_Device_Downlink_Command]]
1001
1002
1003 * **Commands special design for SDI-12-LB**
1004
1005 These commands only valid for SDI-12-LB, as below:
1006
1007
1008
1009 1.
1010 11. Set Transmit Interval Time
1011
1012 Feature: Change LoRaWAN End Node Transmit Interval.
1013
1014 **AT Command: AT+TDC**
1015
1016 |**Command Example**|**Function**|**Response**
1017 |AT+TDC=?|Show current transmit Interval|(((
1018 30000
1019
1020 OK
1021
1022 the interval is 30000ms = 30s
1023 )))
1024 |AT+TDC=60000|Set Transmit Interval|(((
1025 OK
1026
1027 Set transmit interval to 60000ms = 60 seconds
1028 )))
1029
1030 **Downlink Command: 0x01**
1031
1032 Format: Command Code (0x01) followed by 3 bytes time value.
1033
1034 If the downlink payload=0100003C, it means set the END Node’s Transmit Interval to 0x00003C=60(S), while type code is 01.
1035
1036 * Example 1: Downlink Payload: 0100001E ~/~/ Set Transmit Interval (TDC) = 30 seconds
1037 * Example 2: Downlink Payload: 0100003C ~/~/ Set Transmit Interval (TDC) = 60 seconds
1038
1039 1.
1040 11. Set Interrupt Mode
1041
1042 Feature, Set Interrupt mode for GPIO_EXIT.
1043
1044 **AT Command: AT+INTMOD**
1045
1046 |**Command Example**|**Function**|**Response**
1047 |AT+INTMOD=?|Show current interrupt mode|(((
1048 0
1049
1050 OK
1051
1052 the mode is 0 = No interruption
1053 )))
1054 |AT+INTMOD=2|(((
1055 Set Transmit Interval
1056
1057 1. (Disable Interrupt),
1058 1. (Trigger by rising and falling edge),
1059 1. (Trigger by falling edge)
1060 1. (Trigger by rising edge)
1061 )))|OK
1062
1063 **Downlink Command: 0x06**
1064
1065 Format: Command Code (0x06) followed by 3 bytes.
1066
1067 This means that the interrupt mode of the end node is set to 0x000003=3 (rising edge trigger), and the type code is 06.
1068
1069 * Example 1: Downlink Payload: 06000000 ~/~/ Turn off interrupt mode
1070 * Example 2: Downlink Payload: 06000003 ~/~/ Set the interrupt mode to rising edge trigger
1071
1072 1.
1073 11. Set the output time
1074
1075 Feature, Control the output 3V3 , 5V or 12V.
1076
1077 **AT Command: AT+3V3T**
1078
1079 |**Command Example**|**Function**|**Response**
1080 |AT+3V3T=?|Show 3V3 open time.|(((
1081 0
1082
1083 OK
1084 )))
1085 |AT+3V3T=0|Normally open 3V3 power supply.|(((
1086 OK
1087
1088 default setting
1089 )))
1090 |AT+3V3T=1000|Close after a delay of 1000 milliseconds.|(((
1091 OK
1092
1093
1094 )))
1095 |AT+3V3T=65535|Normally closed 3V3 power supply.|(((
1096 OK
1097
1098
1099 )))
1100
1101 **AT Command: AT+5VT**
1102
1103 |**Command Example**|**Function**|**Response**
1104 |AT+5VT=?|Show 5V open time.|(((
1105 0
1106
1107 OK
1108 )))
1109 |AT+5VT=0|Normally closed 5V power supply.|(((
1110 OK
1111
1112 default setting
1113 )))
1114 |AT+5VT=1000|Close after a delay of 1000 milliseconds.|(((
1115 OK
1116
1117
1118 )))
1119 |AT+5VT=65535|Normally open 5V power supply.|(((
1120 OK
1121
1122
1123 )))
1124
1125 **AT Command: AT+12VT**
1126
1127 |**Command Example**|**Function**|**Response**
1128 |AT+12VT=?|Show 12V open time.|(((
1129 0
1130
1131 OK
1132 )))
1133 |AT+12VT=0|Normally closed 12V power supply.|OK
1134 |AT+12VT=500|Close after a delay of 500 milliseconds.|(((
1135 OK
1136
1137
1138 )))
1139
1140 **Downlink Command: 0x07**
1141
1142 Format: Command Code (0x07) followed by 3 bytes.
1143
1144 The first byte is which power, the second and third bytes are the time to turn on.
1145
1146 * Example 1: Downlink Payload: 070101F4  -> AT+3V3T=500
1147 * Example 2: Downlink Payload: 0701FFFF   -> AT+3V3T=65535
1148 * Example 3: Downlink Payload: 070203E8  -> AT+5VT=1000
1149 * Example 4: Downlink Payload: 07020000  -> AT+5VT=0
1150 * Example 5: Downlink Payload: 070301F4  -> AT+12VT=500
1151 * Example 6: Downlink Payload: 07030000  -> AT+12VT=0
1152
1153 1.
1154 11. Set the all data mode
1155
1156 Feature, Set the all data mode.
1157
1158 **AT Command: AT+ALLDATAMOD**
1159
1160 |**Command Example**|**Function**|**Response**
1161 |AT+ALLDATAMOD=?|Show current all data mode|(((
1162 0
1163
1164
1165 OK
1166 )))
1167 |AT+ALLDATAMOD=1|Set all data mode is 1.|OK
1168
1169 **Downlink Command: 0xAB**
1170
1171 Format: Command Code (0xAB) followed by 1 bytes.
1172
1173 * Example 1: Downlink Payload: AB 00 ~/~/ AT+ALLDATAMOD=0
1174 * Example 2: Downlink Payload: AB 01 ~/~/ AT+ALLDATAMOD=1
1175
1176 1.
1177 11. Set the splicing payload for uplink
1178
1179 Feature, splicing payload for uplink.
1180
1181 **AT Command: AT+DATAUP**
1182
1183 |**Command Example**|**Function**|**Response**
1184 |AT+DATAUP =?|Show current splicing payload for uplink mode|(((
1185 0
1186
1187
1188 OK
1189 )))
1190 |AT+DATAUP =0|(((
1191 Set splicing payload for uplink mode is 0.
1192
1193
1194 )))|(((
1195 OK
1196
1197
1198 )))
1199 |AT+DATAUP =1|Set splicing payload for uplink mode is 1 , and the each splice uplink is sent sequentially.|OK
1200 |AT+DATAUP =1,20000|(((
1201 Set splicing payload for uplink mode is 1, and the uplink interval of each splice to 20000 milliseconds.
1202
1203
1204 )))|OK
1205
1206 **Downlink Command: 0xAD**
1207
1208 Format: Command Code (0xAD) followed by 1 bytes or 5 bytes.
1209
1210 * Example 1: Downlink Payload: AD 00 ~/~/ AT+DATAUP=0
1211 * Example 2: Downlink Payload: AD 01 ~/~/ AT+DATAUP =1
1212 * Example 3: Downlink Payload: AD 01 00 00 14~/~/ AT+DATAUP =1,20000
1213
1214 This means that the interval is set to 0x000014=20S
1215
1216
1217 1.
1218 11. Set the payload version
1219
1220 Feature, Set the payload version.
1221
1222 **AT Command: AT+PAYVER**
1223
1224 |**Command Example**|**Function**|**Response**
1225 |AT+PAYVER=?|Show current payload version|(((
1226 1
1227
1228
1229 OK
1230 )))
1231 |AT+PAYVER=5|Set payload version is 5.|OK
1232
1233 **Downlink Command: 0xAE**
1234
1235 Format: Command Code (0xAE) followed by 1 bytes.
1236
1237 * Example 1: Downlink Payload: AE 01 ~/~/ AT+PAYVER=1
1238 * Example 2: Downlink Payload: AE 05 ~/~/ AT+PAYVER=5
1239
1240 1. Battery & how to replace
1241 11. Battery Type
1242
1243 SDI-12-LB is equipped with a [[8500mAH ER26500 Li-SOCI2 battery>>url:https://www.dragino.com/downloads/index.php?dir=datasheet/Battery/ER26500/]]. The battery is un-rechargeable battery with low discharge rate targeting for 8~~10 years use. This type of battery is commonly used in IoT target for long-term running, such as water meter.
1244
1245
1246 The discharge curve is not linear so can’t simply use percentage to show the battery level. Below is the battery performance.
1247
1248 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image036.png]]
1249
1250
1251 Minimum Working Voltage for the SDI-12-LB:
1252
1253 SDI-12-LB:  2.45v ~~ 3.6v
1254
1255
1256 1.
1257 11. Replace Battery
1258
1259 Any battery with range 2.45 ~~ 3.6v can be a replacement. We recommend to use Li-SOCl2 Battery.
1260
1261 And make sure the positive and negative pins match.
1262
1263
1264
1265 1.
1266 11. Power Consumption Analyze
1267
1268 Dragino Battery powered product are all runs in Low Power mode. We have an update battery calculator which base on the measurement of the real device. User can use this calculator to check the battery life and calculate the battery life if want to use different transmit interval.
1269
1270
1271 Instruction to use as below:
1272
1273
1274 Step 1: Downlink the up-to-date DRAGINO_Battery_Life_Prediction_Table.xlsx from:
1275
1276 [[https:~~/~~/www.dragino.com/downloads/index.php?dir=LoRa_End_Node/Battery_Analyze/>>url:https://www.dragino.com/downloads/index.php?dir=LoRa_End_Node/Battery_Analyze/]]
1277
1278
1279 Step 2: Open it and choose
1280
1281 * Product Model
1282 * Uplink Interval
1283 * Working Mode
1284
1285 And the Life expectation in difference case will be shown on the right.
1286
1287 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image037.png]]
1288
1289
1290 The battery related documents as below:
1291
1292 * [[Battery Dimension>>url:http://www.dragino.com/downloads/index.php?dir=datasheet/Battery/&file=LSN50-Battery-Dimension.pdf]],
1293 * [[Lithium-Thionyl Chloride Battery>>url:http://www.dragino.com/downloads/downloads/datasheet/Battery/ER18505_datasheet-EN.pdf]] datasheet, [[Tech Spec>>url:http://www.dragino.com/downloads/downloads/datasheet/Battery/ER18505_datasheet_PM-ER18505-S-02-LF_EN.pdf]]
1294 * [[Lithium-ion Battery-Capacitor datasheet>>url:http://www.dragino.com/downloads/downloads/datasheet/Battery/SPC_1520_datasheet.jpg]], [[Tech Spec>>url:http://www.dragino.com/downloads/downloads/datasheet/Battery/SPC1520%20Technical%20Specification20171123.pdf]]
1295
1296 |(((
1297 JST-XH-2P connector
1298 )))
1299
1300 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image038.png]]
1301
1302
1303
1304 1.
1305 11.
1306 111. ​Battery Note
1307
1308 The Li-SICO battery is designed for small current / long period application. It is not good to use a high current, short period transmit method. The recommended minimum period for use of this battery is 5 minutes. If you use a shorter period time to transmit LoRa, then the battery life may be decreased.
1309
1310
1311 1.
1312 11.
1313 111. ​Replace the battery
1314
1315 You can change the battery in the SDI-12-LB.The type of battery is not limited as long as the output is between 3v to 3.6v. On the main board, there is a diode (D1) between the battery and the main circuit. If you need to use a battery with less than 3.3v, please remove the D1 and shortcut the two pads of it so there won’t be voltage drop between battery and main board.
1316
1317
1318 The default battery pack of SDI-12-LB includes a ER26500 plus super capacitor. If user can’t find this pack locally, they can find ER26500 or equivalence, which will also work in most case. The SPC can enlarge the battery life for high frequency use (update period below 5 minutes)
1319
1320
1321
1322
1323
1324
1325 1. Remote Configure device
1326 11. Connect via BLE
1327
1328 Please see this instruction for how to configure via BLE:
1329
1330 [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]]
1331
1332
1333 1.
1334 11. AT Command Set
1335
1336 1. OTA firmware update
1337
1338 Please see this link for how to do OTA firmware update.
1339
1340 [[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/]]
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352 1. ​Order Info
1353
1354 **Package Includes**:
1355
1356 * SDI-12-LB SDI-12 to LoRaWAN Converter
1357
1358 **Dimension and weight**:
1359
1360 * Device Size: cm
1361 * Device Weight: g
1362 * Package Size / pcs : cm
1363 * Weight / pcs : g
1364
1365
1366
1367 1. ​Support
1368
1369 * 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.
1370 * 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
1371
1372 [[support@dragino.com>>url:http://../../../../../../D:%5C%E5%B8%82%E5%9C%BA%E8%B5%84%E6%96%99%5C%E8%AF%B4%E6%98%8E%E4%B9%A6%5CLoRa%5CLT%E7%B3%BB%E5%88%97%5Csupport@dragino.com]]
1373
1374
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0