Show last authors
1 (% style="text-align:center" %)
2 [[image:image-20230530181207-3.jpeg||height="552" width="552"]]
3
4
5
6
7
8
9 **Table of Contents:**
10
11 {{toc/}}
12
13
14
15
16
17
18 = 1. Introduction =
19
20 == 1.1 What is LoRaWAN Soil pH Sensor ==
21
22
23 The Dragino SPH01-LB is a (% style="color:blue" %)**LoRaWAN Soil pH Sensor**(%%) for IoT of Agriculture. It is designed to measure the soil PH and soil temperature, so to send to the platform to analyze the soil acid or alkali level. The probe is IP68 waterproof.
24
25 SPH01-LB probe is made by Solid AgCl reference electrode and Pure metal pH sensitive electrode. It can detect(% style="color:blue" %) **soil's pH **(%%)with high accuracy and stable value. The SPH01-LB probe can be buried into soil for long time use.
26
27 The LoRa wireless technology used in SPH01-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.
28
29 SPH01-LB (% style="color:blue" %)**supports BLE configure**(%%) and (% style="color:blue" %)**wireless OTA update**(%%) which make user easy to use.
30
31 SPH01-LB is powered by (% style="color:blue" %)**8500mAh Li-SOCI2 battery**(%%), it is designed for long term use up to 5 years.
32
33 Each SPH01-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.
34
35
36 [[image:image-20230530180339-1.png||height="408" width="806"]]
37
38
39 == 1.2 ​Features ==
40
41
42 * LoRaWAN 1.0.3 Class A
43 * Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865
44 * Ultra-low power consumption
45 * Monitor soil pH with temperature compensation.
46 * Monitor soil temperature
47 * Monitor Battery Level
48 * Support pH calibration by end user
49 * Support Bluetooth v5.1 and LoRaWAN remote configure
50 * Support wireless OTA update firmware
51 * IP66 Waterproof Enclosure
52 * IP68 rate for the Sensor Probe
53 * AT Commands to change parameters
54 * Downlink to change configure
55 * 8500mAh Battery for long term use
56
57
58
59 == 1.3 Specification ==
60
61
62 (% style="color:blue" %)**Common DC Characteristics:**
63
64 * Supply Voltage: built in 8500mAh Li-SOCI2 battery , 2.5v ~~ 3.6v
65 * Operating Temperature: -40 ~~ 85°C
66
67 (% style="color:blue" %)**Soil pH:**
68
69 * Range: 3 ~~ 10 pH
70 * Resolution: 0.01 pH
71 * Accuracy: ±2% under (0~~50 ℃, Accuracy will poor under 0 due to frozen)
72 * Temperature Compensation Range: 0 ~~ 50℃
73 * IP68 Protection
74 * Length: 3.5 meters
75
76 (% style="color:blue" %)**Soil Temperature:**
77
78 * Range -40℃~85℃
79 * Resolution: 0.1℃
80 * Accuracy: <±0.5℃(-10℃~40℃),<±0.8℃ (others)
81 * IP68 Protection
82 * Length: 3.5 meters
83
84 (% style="color:blue" %)**LoRa Spec:**
85
86 * Frequency Range,  Band 1 (HF): 862 ~~ 1020 Mhz
87 * Max +22 dBm constant RF output vs.
88 * RX sensitivity: down to -139 dBm.
89 * Excellent blocking immunity
90
91 (% style="color:blue" %)**Battery:**
92
93 * Li/SOCI2 un-chargeable battery
94 * Capacity: 8500mAh
95 * Self-Discharge: <1% / Year @ 25°C
96 * Max continuously current: 130mA
97 * Max boost current: 2A, 1 second
98
99 (% style="color:blue" %)**Power Consumption**
100
101 * Sleep Mode: 5uA @ 3.3v
102 * LoRa Transmit Mode: 125mA @ 20dBm, 82mA @ 14dBm
103
104
105
106 == 1.4 Applications ==
107
108
109 * Smart Agriculture
110
111
112 == 1.5 Sleep mode and working mode ==
113
114
115 (% style="color:blue" %)**Deep Sleep Mode: **(%%)Sensor doesn't have any LoRaWAN activate. This mode is used for storage and shipping to save battery life.
116
117 (% style="color:blue" %)**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:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675071855856-879.png]]
124
125
126 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
127 |=(% style="width: 167px;background-color:#D9E2F3;color:#0070C0" %)**Behavior on ACT**|=(% style="width: 117px;background-color:#D9E2F3;color:#0070C0" %)**Function**|=(% style="width: 225px;background-color:#D9E2F3;color:#0070C0" %)**Action**
128 |(% style="width:167px" %)Pressing ACT between 1s < time < 3s|(% style="width:117px" %)Send an uplink|(% style="width:225px" %)(((
129 If sensor is already Joined to LoRaWAN network, sensor will send an uplink packet, (% style="color:blue" %)**blue led** (%%)will blink once.
130 Meanwhile, BLE module will be active and user can connect via BLE to configure device.
131 )))
132 |(% style="width:167px" %)Pressing ACT for more than 3s|(% style="width:117px" %)Active Device|(% style="width:225px" %)(((
133 (% 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.
134 (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network.
135 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.
136 )))
137 |(% 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.
138
139
140
141 == 1.7 BLE connection ==
142
143
144 SPH01-LB support BLE remote configure.
145
146
147 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:
148
149 * Press button to send an uplink
150 * Press button to active device.
151 * Device Power on or reset.
152
153 If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
154
155
156 == 1.8 Pin Definitions ==
157
158 [[image:image-20230523174230-1.png]]
159
160
161 == 1.9 Mechanical ==
162
163
164 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143884058-338.png]]
165
166
167 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143899218-599.png]]
168
169
170 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143909447-639.png]]
171
172
173 = 2. Configure SPH01-LB to connect to LoRaWAN network =
174
175 == 2.1 How it works ==
176
177
178 The SPH01-LB is configured as (% style="color:#037691" %)**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 press the button to activate the SPH01-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 (% style="display:none" %) (%%)
181
182 == 2.2 ​Quick guide to connect to LoRaWAN server (OTAA) ==
183
184
185 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.
186
187 [[image:image-20230530180406-2.png||height="408" width="806"]]
188
189 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.
190
191 (% style="display:none" %)
192
193
194 (% style="color:blue" %)**Step 1:**(%%) Create a device in TTN with the OTAA keys from SPH01-LB.
195
196 Each SPH01-LB is shipped with a sticker with the default device EUI as below:
197
198 [[image:image-20230426084152-1.png||alt="图片-20230426084152-1.png" height="233" width="502"]]
199
200
201 You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
202
203
204 (% style="color:blue" %)**Register the device**
205
206 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/1654935135620-998.png?rev=1.1||alt="1654935135620-998.png"]]
207
208
209 (% style="color:blue" %)**Add APP EUI and DEV EUI**
210
211 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/image-20220611161308-4.png?width=753&height=551&rev=1.1||alt="图片-20220611161308-4.png"]]
212
213
214 (% style="color:blue" %)**Add APP EUI in the application**
215
216
217 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/image-20220611161308-5.png?width=742&height=601&rev=1.1||alt="图片-20220611161308-5.png"]]
218
219
220 (% style="color:blue" %)**Add APP KEY**
221
222 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSN50v2-S31-S31B%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20User%20Manual/WebHome/image-20220611161308-6.png?width=744&height=485&rev=1.1||alt="图片-20220611161308-6.png"]]
223
224
225 (% style="color:blue" %)**Step 2:**(%%) Activate on SPH01-LB
226
227
228 Press the button for 5 seconds to activate the SPH01-LB.
229
230 (% style="color:green" %)**Green led**(%%) will fast blink 5 times, device will enter (% style="color:blue" %)**OTA mode**(%%) for 3 seconds. And then start to JOIN LoRaWAN network. (% style="color:green" %)**Green led**(%%) will solidly turn on for 5 seconds after joined in network.
231
232 After join success, it will start to upload messages to TTN and you can see the messages in the panel.
233
234
235 == 2.3 ​Uplink Payload ==
236
237
238 (((
239 SPH01-LB will uplink payload via LoRaWAN with below payload format: 
240 )))
241
242 (((
243 Uplink payload includes in total 11 bytes.
244 )))
245
246 (((
247 Normal uplink payload:
248 )))
249
250 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:470px" %)
251 |=(% style="width: 60px;background-color:#D9E2F3;color:#0070C0" %)(((
252 **Size(bytes)**
253 )))|=(% style="width: 30px;background-color:#D9E2F3;color:#0070C0" %)**2**|=(% style="width: 70px;background-color:#D9E2F3;color:#0070C0" %)**2**|=(% style="width: 50px;background-color:#D9E2F3;color:#0070C0" %)**2**|=(% style="width: 60px;background-color:#D9E2F3;color:#0070C0" %)**2**|=(% style="width: 70px;background-color:#D9E2F3;color:#0070C0" %)**1**|=(% style="width: 50px;background-color:#D9E2F3;color:#0070C0" %)**1**|=(% style="width: 80px;background-color:#D9E2F3;color:#0070C0" %)**1**
254 |(% style="width:62.5px" %)Value|(% style="width:62.5px" %)[[BAT>>||anchor="H2.3.1BatteryInfo"]]|(% style="width:62.5px" %)(((
255 [[Temperature (Optional)>>||anchor="H2.3.2DS18B20Temperaturesensor"]]
256 )))|[[Soil pH>>||anchor="H2.3.3SoilpH"]]|[[Soil Temperature>>||anchor="H2.3.4SoilTemperature"]]|(((
257 [[Digital Interrupt (Optional)>>||anchor="H2.3.5InterruptPin"]]
258 )))|Reserve|(((
259 [[Message Type>>||anchor="H2.3.6MessageType"]]
260 )))
261
262 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSPH01-LoRaWAN%20Soil%20pH%20Sensor%20User%20Manual/WebHome/1654592721645-318.png?rev=1.1||alt="1654592721645-318.png"]]
263
264
265 === 2.3.1 Battery Info ===
266
267
268 Check the battery voltage for SPH01-LB.
269
270 Ex1: 0x0B45 = 2885mV
271
272 Ex2: 0x0B49 = 2889mV
273
274
275 === 2.3.2 DS18B20 Temperature sensor ===
276
277
278 This is optional, user can connect external DS18B20 sensor to the +3.3v, 1-wire and GND pin . and this field will report temperature.
279
280
281 **Example**:
282
283 If payload is: 0105H:  (0105 & FC00 == 0), temp = 0105H /10 = 26.1 degree
284
285 If payload is: FF3FH :  (FF3F & FC00 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees.
286
287
288 === 2.3.3 Soil pH ===
289
290
291 Range: 0 ~~ 14 pH
292
293 **Example:**
294
295 (% style="color:#037691" %)** 0x02B7(H) = 695(D) = 6.95pH**
296
297
298 === 2.3.4 Soil Temperature ===
299
300
301 Get Soil Temperature 
302
303
304 **Example**:
305
306 If payload is: **0105H**:  (0105 & FC00 == 0), temp = 0105H /10 = 26.1 degree
307
308 If payload is: **FF3FH** :  (FF3F & FC00 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees.
309
310
311 === 2.3.5 Interrupt Pin ===
312
313
314 This data field shows if this packet is generated by interrupt or not. [[Click here>>||anchor="H3.3.2SetInterruptMode"]] for the hardware and software set up.
315
316
317 **Example:**
318
319 0x00: Normal uplink packet.
320
321 0x01: Interrupt Uplink Packet.
322
323
324 === 2.3.6 Message Type ===
325
326
327 (((
328 For a normal uplink payload, the message type is always 0x01.
329 )))
330
331 (((
332 Valid Message Type:
333 )))
334
335
336 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:496px" %)
337 |=(% style="width: 160px;background-color:#D9E2F3;color:#0070C0" %)**Message Type Code**|=(% style="width: 163px;background-color:#D9E2F3;color:#0070C0" %)**Description**|=(% style="width: 173px;background-color:#D9E2F3;color:#0070C0" %)**Payload**
338 |(% style="width:160px" %)0x01|(% style="width:163px" %)Normal Uplink|(% style="width:173px" %)[[Normal Uplink Payload>>||anchor="H2.3200BUplinkPayload"]]
339 |(% style="width:160px" %)0x02|(% style="width:163px" %)Reply configures info|(% style="width:173px" %)[[Configure Info Payload>>||anchor="H3.4GetFirmwareVersionInfo"]]
340 |(% style="width:160px" %)0x03|(% style="width:163px" %)Reply Calibration Info|(% style="width:173px" %)[[Calibration Payload>>||anchor="H2.7Calibration"]]
341
342
343
344 === 2.3.7 Decode payload in The Things Network ===
345
346
347 While using TTN network, you can add the payload format to decode the payload.
348
349
350 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSPH01-LoRaWAN%20Soil%20pH%20Sensor%20User%20Manual/WebHome/1654592762713-715.png?rev=1.1||alt="1654592762713-715.png"]]
351
352 (((
353 The payload decoder function for TTN is here:
354 )))
355
356 In the page (% style="color:#037691" %)**Applications ~-~-> Payload Formats ~-~-> Custom ~-~-> decoder**(%%) to add the decoder from: [[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>https://github.com/dragino/dragino-end-node-decoder]]
357
358
359 == 2.4 Uplink Interval ==
360
361
362 The SPH01-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: [[Change Uplink Interval>>doc:Main.End Device AT Commands and Downlink Command.WebHome||anchor="H4.1ChangeUplinkInterval"]]
363
364
365 == 2.5 Datalog Feature ==
366
367
368 Datalog Feature is to ensure IoT Server can get all sampling data from Sensor even if the LoRaWAN network is down. For each sampling, SPH01-LB will store the reading for future retrieving purposes.
369
370
371 === 2.5.1 Ways to get datalog via LoRaWAN ===
372
373
374 Set PNACKMD=1, SPH01-LB will wait for ACK for every uplink, when there is no LoRaWAN network,SPH01-LB will mark these records with non-ack messages and store the sensor data, and it will send all messages (10s interval) after the network recovery.
375
376 * (((
377 a) SPH01-LB will do an ACK check for data records sending to make sure every data arrive server.
378 )))
379 * (((
380 b) SPH01-LB will send data in **CONFIRMED Mode** when PNACKMD=1, but SPH01-LB won't re-transmit the packet if it doesn't get ACK, it will just mark it as a NONE-ACK message. In a future uplink if SPH01-LB gets a ACK, SPH01-LB will consider there is a network connection and resend all NONE-ACK messages.
381 )))
382
383 Below is the typical case for the auto-update datalog feature (Set PNACKMD=1)
384
385 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LHT65N%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20Manual/WebHome/image-20220703111700-2.png?width=1119&height=381&rev=1.1||alt="图片-20220703111700-2.png" height="381" width="1119"]]
386
387
388 === 2.5.2 Unix TimeStamp ===
389
390
391 SPH01-LB uses Unix TimeStamp format based on
392
393 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LHT65N%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20Manual/WebHome/image-20220523001219-11.png?width=627&height=97&rev=1.1||alt="图片-20220523001219-11.png" height="97" width="627"]]
394
395 User can get this time from link:  [[https:~~/~~/www.epochconverter.com/>>url:https://www.epochconverter.com/]] :
396
397 Below is the converter example
398
399 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LHT65N%20LoRaWAN%20Temperature%20%26%20Humidity%20Sensor%20Manual/WebHome/image-20220523001219-12.png?width=720&height=298&rev=1.1||alt="图片-20220523001219-12.png" height="298" width="720"]]
400
401
402 So, we can use AT+TIMESTAMP=1611889405 or downlink 3060137afd00 to set the current time 2021 – Jan ~-~- 29 Friday 03:03:25
403
404
405 === 2.5.3 Set Device Time ===
406
407
408 User need to set (% style="color:blue" %)**SYNCMOD=1**(%%) to enable sync time via MAC command.
409
410 Once SPH01-LB Joined LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to SPH01-LB. If SPH01-LB fails to get the time from the server, SPH01-LB will use the internal time and wait for next time request (AT+SYNCTDC to set the time request period, default is 10 days).
411
412 (% style="color:red" %)**Note: LoRaWAN Server need to support LoRaWAN v1.0.3(MAC v1.0.3) or higher to support this MAC command feature, Chirpstack,TTN V3 v3 and loriot support but TTN V3 v2 doesn't support. If server doesn't support this command, it will through away uplink packet with this command, so user will lose the packet with time request for TTN V3 v2 if SYNCMOD=1.**
413
414
415 === 2.5.4 Datalog Uplink payload (FPORT~=3) ===
416
417
418 The Datalog uplinks will use below payload format.
419
420 **Retrieval data payload:**
421
422 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:500px" %)
423 |=(% style="width: 60px;background-color:#D9E2F3;color:#0070C0" %)**Size(bytes)**|=(% style="width:30px;background-color:#D9E2F3;color:#0070C0" %)**2**|=(% style="width: 80px;background-color:#D9E2F3;color:#0070C0" %)**2**|=(% style="width: 120px;background-color:#D9E2F3;color:#0070C0" %)**2**|=(% style="width: 90px;background-color:#D9E2F3;color:#0070C0" %)**1**|=(% style="width: 120px;background-color:#D9E2F3;color:#0070C0" %)**4**
424 |(% style="width:95px" %)Value|(% style="width:220px" %)PH|(((
425 Temperature
426 )))|DS18B20_Temperature|Level of PA8|Unix Time Stamp
427
428 (% style="color:blue" %)**Poll Message Flag**(%%): 1: This message is a poll message reply.
429
430 * Poll Message Flag is set to 1.
431
432 * Each data entry is 11 bytes, to save airtime and battery, devices will send max bytes according to the current DR and Frequency bands.
433
434 For example, in US915 band, the max payload for different DR is:
435
436 (% style="color:blue" %)**a) DR0:**(%%) max is 11 bytes so one entry of data
437
438 (% style="color:blue" %)**b) DR1:**(%%) max is 53 bytes so devices will upload 4 entries of data (total 44 bytes)
439
440 (% style="color:blue" %)**c) DR2:**(%%) total payload includes 11 entries of data
441
442 (% style="color:blue" %)**d) DR3: **(%%)total payload includes 22 entries of data.
443
444 If devise doesn't have any data in the polling time. Device will uplink 11 bytes of 0   
445
446
447 **Example:**
448
449 If SPH01-LB has below data inside Flash:
450
451 [[image:image-20230606170132-1.png]]
452
453 If user sends below downlink command: 31646D84E1646D856C05
454
455 Where : Start time: 646D84E1 = time 23/5/24 03:30:41
456
457 Stop time: 646D856C= time 23/5/24 03:33:00
458
459
460 === 2.5.5 Poll sensor value ===
461
462
463 Users can poll sensor values based on timestamps. Below is the downlink command.
464
465 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:425.818px" %)
466 |(% colspan="4" style="background-color:#d9e2f3; color:#0070c0; width:423px" %)**Downlink Command to poll Open/Close status (0x31)**
467 |(% style="width:58px" %)**1byte**|(% style="width:127px" %)**4bytes**|(% style="width:124px" %)**4bytes**|(% style="width:114px" %)**1byte**
468 |(% style="width:58px" %)31|(% style="width:127px" %)Timestamp start|(% style="width:124px" %)Timestamp end|(% style="width:114px" %)Uplink Interval
469
470 (((
471 Timestamp start and Timestamp end-use Unix TimeStamp format as mentioned above. Devices will reply with all data logs during this period, using the uplink interval.
472 )))
473
474 (((
475 For example, downlink command [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/CPL01%20LoRaWAN%20Outdoor%20PulseContact%20%20Sensor%20Manual/WebHome/image-20220518162852-1.png?rev=1.1||alt="image-20220518162852-1.png"]]
476 )))
477
478 (((
479 Is to check 2021/11/12 12:00:00 to 2021/11/12 15:00:00's data
480 )))
481
482 (((
483 Uplink Internal =5s,means SPH01-LB will send one packet every 5s. range 5~~255s.
484 )))
485
486
487 == 2.6 Installation and Maintain ==
488
489 === 2.6.1 Before measurement ===
490
491
492 (((
493 If the SPH01-LB has more than 7 days not use or just clean the pH probe. User should put the probe inside pure water for more than 24 hours for activation. If no put in water, user need to put inside soil for more than 24 hours to ensure the measurement accuracy. 
494 )))
495
496
497 === 2.6.2 Measurement ===
498
499
500 (((
501 (% style="color:blue" %)**Measurement the soil surface:**
502 )))
503
504 (((
505 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LSPH01-LoRaWAN%20Soil%20pH%20Sensor%20User%20Manual/WebHome/1654592946732-634.png?rev=1.1||alt="1654592946732-634.png"]]
506 )))
507
508 (((
509 Choose the proper measuring position. Split the surface soil according to the measured deep.
510 )))
511
512 (((
513 Put pure water, or rainwater to make the soil of measurement point to moist mud. Remove rocks or hard things.
514 )))
515
516 (((
517 Slowly insert the probe to the measure point. Don't use large force which will break the probe. Make sure not shake when inserting.
518 )))
519
520 (((
521 Put soil over the probe after insert. And start to measure.
522 )))
523
524
525 (((
526 (% style="color:blue" %)**Measurement inside soil:**
527 )))
528
529 (((
530 Dig a hole with diameter > 20CM.
531 )))
532
533 (((
534 Insert the probe inside, method like measure the surface.
535 )))
536
537
538 === 2.6.3 Maintain Probe ===
539
540
541 (((
542 ~1. pH probe electrode is fragile and no strong. User must avoid strong force or hitting it.
543 )))
544
545 (((
546 2. After long time use (3~~ 6  months). The probe electrode needs to be clean; user can use high grade sandpaper to polish it or put in 5% hydrochloric acid for several minutes. After the metal probe looks like new, user can use pure water to wash it.
547 )))
548
549 (((
550 3. Probe reference electrode is also no strong, need to avoid strong force or hitting.
551 )))
552
553 (((
554 4. User should keep reference electrode wet while not use.
555 )))
556
557 (((
558 5. Avoid the probes to touch oily matter. Which will cause issue in accuracy.
559 )))
560
561 (((
562 6. The probe is IP68 can be put in water.
563
564
565 )))
566
567 == 2.7 Calibration ==
568
569
570 (((
571 User can do calibration for the probe. It is limited to use below pH buffer solution to calibrate: 4.00, 6.86, 9.18. When calibration, user need to clean the electrode and put the probe in the pH buffer solution to wait the value stable ( a new clean electrode might need max 24 hours to be stable).
572 )))
573
574 (((
575 After stable, user can use below command to calibrate.
576
577 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:520px" %)
578 |(% style="background-color:#d9e2f3; color:#0070c0; width:120px" %)**pH buffer solution**|(% style="background-color:#d9e2f3; color:#0070c0; width:150px" %)**AT Command to calibrate**|(% style="background-color:#d9e2f3; color:#0070c0; width:150px" %)**Downlink Command**|(% style="background-color:#d9e2f3; color:#0070c0; width:100px" %)**Read Cal Value**
579 |(% style="width:149px" %)4.00|(% style="width:197px" %)AT+PHCAL=4|(% style="width:206px" %)(((
580 0x13 04
581 Reply with Calibrate payload
582 )))|(% style="width:136px" %)(((
583 AT+PHCAL=?
584 Example 41,61,91
585 )))
586 |(% style="width:149px" %)6.86|(% style="width:197px" %)AT+PHCAL=6|(% style="width:206px" %)(((
587 0x13 06
588 Reply with Calibrate payload
589 )))|(% style="width:136px" %)AT+PHCAL=?
590 |(% style="width:149px" %)9.18|(% style="width:197px" %)AT+PHCAL=9|(% style="width:206px" %)(((
591 0x13 09
592 Reply with Calibrate payload
593 )))|(% style="width:136px" %)AT+PHCAL=?
594 |(% style="width:149px" %)Factory Default|(% style="width:197px" %)AT+PHCAL=15|(% style="width:206px" %)(((
595 0x13 15
596 Reply with Calibrate payload
597 )))|(% style="width:136px" %)(((
598 AT+PHCAL=?
599 Example 151
600 )))
601 )))
602
603
604 (% style="color:#037691" %)**Calibration Payload**
605
606 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:500px" %)
607 |=(% style="width: 60px;background-color:#D9E2F3;color:#0070C0" %)(((
608 **Size(bytes)**
609 )))|=(% style="width: 100px;background-color:#D9E2F3;color:#0070C0" %)**1**|=(% style="width: 100px;background-color:#D9E2F3;color:#0070C0" %)**1**|=(% style="width: 100px;background-color:#D9E2F3;color:#0070C0" %)**1**|=(% style="width: 50px;background-color:#D9E2F3;color:#0070C0" %)**7**|=(% style="width: 90px;background-color:#D9E2F3;color:#0070C0" %)**1**
610 |Value|(((
611 PH4 Calibrate value
612 )))|PH6.86 Calibrate value|(((
613 PH9.18 Calibrate value
614 )))|Reserve|(((
615 [[Message Type>>||anchor="H2.3.6MessageType"]]
616 Always 0x03
617 )))
618
619 User can also send 0x14 downlink command to poll the current calibration payload.
620
621 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:480px" %)
622 |=(% style="width: 183px; background-color:#D9E2F3;color:#0070C0" %)**Downlink Control Type**|=(% style="width: 55px; background-color:#D9E2F3;color:#0070C0" %)FPort|=(% style="width: 93px; background-color:#D9E2F3;color:#0070C0" %)**Type Code**|=(% style="width: 146px; background-color: rgb(217, 226, 243); color: rgb(0, 112, 192);" %)**Downlink payload size(bytes)**
623 |(% style="width:183px" %)Get Calibration Version Info|(% style="width:55px" %)Any|(% style="width:93px" %)14|(% style="width:146px" %)2
624
625 * Reply to the confirmation package: 14 01
626
627 * Reply to non-confirmed packet: 14 00
628
629
630
631 == 2.8 Frequency Plans ==
632
633
634 The SPH01-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.
635
636 [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/>>http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/]]
637
638
639 = 3. Configure SPH01-LB =
640
641 == 3.1 Configure Methods ==
642
643
644 SPH01-LB supports below configure method:
645
646 * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]].
647
648 * 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]].
649
650 * LoRaWAN Downlink.  Instruction for different platforms: See [[IoT LoRaWAN Server>>http://wiki.dragino.com/xwiki/bin/view/Main/]] section.
651
652
653
654 == 3.2 General Commands ==
655
656
657 These commands are to configure:
658
659 * General system settings like: uplink interval.
660
661 * LoRaWAN protocol & radio related command.
662
663 They are same for all Dragino Devices which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki:
664
665 [[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/]]
666
667
668 == 3.3 Commands special design for SPH01-LB ==
669
670
671 These commands only valid for SPH01-LB, as below:
672
673
674 === 3.3.1 Set Transmit Interval Time ===
675
676
677 (((
678 Feature: Change LoRaWAN End Node Transmit Interval.
679 )))
680
681 (((
682 (% style="color:blue" %)**AT Command: AT+TDC**
683 )))
684
685 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
686 |=(% style="width: 156px;background-color:#D9E2F3; color:#0070c0" %)**Command Example**|=(% style="width: 137px;background-color:#D9E2F3; color:#0070c0" %)**Function**|=(% style="background-color:#D9E2F3; color:#0070c0" %)**Response**
687 |(% style="width:156px" %)AT+TDC=?|(% style="width:137px" %)Show current transmit Interval|(((
688 30000
689 OK
690 the interval is 30000ms = 30s
691 )))
692 |(% style="width:156px" %)AT+TDC=60000|(% style="width:137px" %)Set Transmit Interval|(((
693 OK
694 Set transmit interval to 60000ms = 60 seconds
695 )))
696
697 (((
698 (% style="color:blue" %)**Downlink Command: 0x01**
699 )))
700
701 (((
702 Format: Command Code (0x01) followed by 3 bytes time value.
703 )))
704
705 (((
706 If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01.
707 )))
708
709 * (((
710 Example 1: Downlink Payload: 0100001E  ~/~/ Set Transmit Interval (TDC) = 30 seconds
711 )))
712
713 * (((
714 Example 2: Downlink Payload: 0100003C  ~/~/ Set Transmit Interval (TDC) = 60 seconds
715
716
717
718 )))
719
720 === 3.3.2 Set Interrupt Mode ===
721
722
723 Feature, Set Interrupt mode for PA8 of pin.
724
725 When AT+INTMOD=0 is set, PA8 is used as a digital input port.
726
727 (% style="color:blue" %)**AT Command: AT+INTMOD**
728
729 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
730 |=(% style="width: 155px;background-color:#D9E2F3;color:#0070C0" %)**Command Example**|=(% style="width: 197px;background-color:#D9E2F3;color:#0070C0" %)**Function**|=(% style="width: 158px;background-color:#D9E2F3;color:#0070C0" %)**Response**
731 |(% style="width:154px" %)AT+INTMOD=?|(% style="width:196px" %)Show current interrupt mode|(% style="width:157px" %)(((
732 0
733 OK
734 the mode is 0 =Disable Interrupt
735 )))
736 |(% style="width:154px" %)AT+INTMOD=2|(% style="width:196px" %)(((
737 Set Transmit Interval
738 0. (Disable Interrupt),
739 ~1. (Trigger by rising and falling edge)
740 2. (Trigger by falling edge)
741 3. (Trigger by rising edge)
742 )))|(% style="width:157px" %)OK
743
744 (% style="color:blue" %)**Downlink Command: 0x06**
745
746 Format: Command Code (0x06) followed by 3 bytes.
747
748 This means that the interrupt mode of the end node is set to 0x000003=3 (rising edge trigger), and the type code is 06.
749
750 * Example 1: Downlink Payload: 06000000  ~/~/  Turn off interrupt mode
751
752 * Example 2: Downlink Payload: 06000003  ~/~/  Set the interrupt mode to rising edge trigger
753
754
755
756 === 3.3.3 Calibrate Sensor ===
757
758
759 Detail See [[Calibration Guide>>||anchor="H2.7Calibration"]] for the user of 0x13 and 0x14 downlink commands
760
761
762 === 3.3.4 Get Firmware Version Info ===
763
764
765 Feature: use downlink to get firmware version.
766
767 (% style="color:#037691" %)**Downlink Command: 0x26**
768
769 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:500px" %)
770 |(% style="background-color:#d9e2f3; color:#0070c0; width:193px" %)**Downlink Control Type**|(% style="background-color:#d9e2f3; color:#0070c0; width:57px" %)**FPort**|(% style="background-color:#d9e2f3; color:#0070c0; width:91px" %)**Type Code**|(% style="background-color:#d9e2f3; color:#0070c0; width:159px" %)**Downlink payload size(bytes)**
771 |(% style="width:193px" %)Get Firmware Version Info|(% style="width:57px" %)Any|(% style="width:91px" %)26|(% style="width:149px" %)2
772
773 * Reply to the confirmation package: 26 01
774
775 * Reply to non-confirmed packet: 26 00
776
777 Device will send an uplink after got this downlink command. With below payload:
778
779 Configures info payload:
780
781 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:520px" %)
782 |(% style="background-color:#d9e2f3; color:#0070c0; width:50px" %)**Size(bytes)**|(% style="background-color:#d9e2f3; color:#0070c0; width:70px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:70px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:50px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:70px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:60px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:50px" %)**5**|(% style="background-color:#d9e2f3; color:#0070c0; width:100px" %)**1**
783 |Value|Software Type|(((
784 Frequency
785 Band
786 )))|Sub-band|(((
787 Firmware
788 Version
789 )))|Sensor Type|Reserve|(((
790 [[Message Type>>||anchor="H2.3.6MessageType"]]
791 Always 0x02
792 )))
793
794 (% style="color:#037691" %)**Software Type**(%%): Always 0x03 for SPH01-LB
795
796 (% style="color:#037691" %)**Frequency Band**:
797
798 *0x01: EU868
799
800 *0x02: US915
801
802 *0x03: IN865
803
804 *0x04: AU915
805
806 *0x05: KZ865
807
808 *0x06: RU864
809
810 *0x07: AS923
811
812 *0x08: AS923-1
813
814 *0x09: AS923-2
815
816 *0xa0: AS923-3
817
818
819 (% style="color:#037691" %)**Sub-Band**(%%): value 0x00 ~~ 0x08
820
821 (% style="color:#037691" %)**Firmware Version**(%%): 0x0100, Means: v1.0.0 version
822
823 (% style="color:#037691" %)**Sensor Type**:
824
825 0x01: LSE01
826
827 0x02: LDDS75
828
829 0x03: LDDS20
830
831 0x04: LLMS01
832
833 0x05: LSPH01
834
835 0x06: LSNPK01
836
837 0x07: LDDS12
838
839
840 = 4. Battery & Power Consumption =
841
842
843 SPH01-LB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace.
844
845 [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] .
846
847
848 = 5. OTA Firmware update =
849
850
851 (% class="wikigeneratedid" %)
852 User can change firmware SPH01-LB to:
853
854 * Change Frequency band/ region.
855
856 * Update with new features.
857
858 * Fix bugs.
859
860 Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/p1tiy43naiyy75u/AACzHWEGlYNeHDjMe2bkxotUa?dl=0]]**
861
862 Methods to Update Firmware:
863
864 * (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/]]
865
866 * 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]]**.
867
868
869
870 = 6. FAQ =
871
872 == 6.1  AT Commands input doesn't work ==
873
874
875 In the case if user can see the console output but can't type input to the device. Please check if you already include the (% style="color:green" %)**ENTER**(%%) while sending out the command. Some serial tool doesn't send (% style="color:green" %)**ENTER**(%%) while press the send key, user need to add ENTER in their string.
876
877
878 = 7. Order Info =
879
880
881 Part Number: (% style="color:blue" %)**SPH01-LB-XXX**
882
883 (% style="color:red" %)**XXX**(%%): The default frequency band
884
885 * (% style="color:red" %)**AS923**(%%): LoRaWAN AS923 band
886
887 * (% style="color:red" %)**AU915**(%%): LoRaWAN AU915 band
888
889 * (% style="color:red" %)**EU433**(%%): LoRaWAN EU433 band
890
891 * (% style="color:red" %)**EU868**(%%): LoRaWAN EU868 band
892
893 * (% style="color:red" %)**KR920**(%%): LoRaWAN KR920 band
894
895 * (% style="color:red" %)**US915**(%%): LoRaWAN US915 band
896
897 * (% style="color:red" %)**IN865**(%%): LoRaWAN IN865 band
898
899 * (% style="color:red" %)**CN470**(%%): LoRaWAN CN470 band
900
901
902
903 = 8. ​Packing Info =
904
905
906 (% style="color:#037691" %)**Package Includes**:
907
908 * SPH01-LB LoRaWAN Soil Ph Sensor x 1
909
910 (% style="color:#037691" %)**Dimension and weight**:
911
912 * Device Size: cm
913
914 * Device Weight: g
915
916 * Package Size / pcs : cm
917
918 * Weight / pcs : g
919
920
921
922 = 9. Support =
923
924
925 * 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.
926
927 * 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]].
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0