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
113 == 1.5 Sleep mode and working mode ==
114
115
116 (% 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.
117
118 (% 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.
119
120
121 == 1.6 Button & LEDs ==
122
123
124 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675071855856-879.png]]
125
126
127 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
128 |=(% 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**
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 device is in Deep Sleep Mode.
139
140
141
142 == 1.7 BLE connection ==
143
144
145 SPH01-LB support BLE remote configure.
146
147
148 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:
149
150 * Press button to send an uplink
151 * Press button to active device.
152 * Device Power on or reset.
153
154 If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
155
156
157 == 1.8 Mechanical ==
158
159
160 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143884058-338.png]]
161
162
163 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143899218-599.png]]
164
165
166 [[image:Main.User Manual for LoRaWAN End Nodes.D20-LBD22-LBD23-LB_LoRaWAN_Temperature_Sensor_User_Manual.WebHome@1675143909447-639.png]]
167
168
169 = 2. Configure SPH01-LB to connect to LoRaWAN network =
170
171 == 2.1 How it works ==
172
173
174 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.
175
176 (% style="display:none" %) (%%)
177
178 == 2.2 ​Quick guide to connect to LoRaWAN server (OTAA) ==
179
180
181 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.
182
183 [[image:image-20230530180406-2.png||height="408" width="806"]]
184
185 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.
186
187 (% style="display:none" %)
188
189
190 (% style="color:blue" %)**Step 1:**(%%) Create a device in TTN with the OTAA keys from SPH01-LB.
191
192 Each SPH01-LB is shipped with a sticker with the default device EUI as below:
193
194 [[image:image-20230426084152-1.png||alt="图片-20230426084152-1.png" height="233" width="502"]]
195
196
197 You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
198
199
200 (% style="color:blue" %)**Register the device**
201
202 [[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"]]
203
204
205 (% style="color:blue" %)**Add APP EUI and DEV EUI**
206
207 [[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"]]
208
209
210 (% style="color:blue" %)**Add APP EUI in the application**
211
212
213 [[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"]]
214
215
216 (% style="color:blue" %)**Add APP KEY**
217
218 [[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"]]
219
220
221 (% style="color:blue" %)**Step 2:**(%%) Activate on SPH01-LB
222
223
224 Press the button for 5 seconds to activate the SPH01-LB.
225
226 (% 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.
227
228 After join success, it will start to upload messages to TTN and you can see the messages in the panel.
229
230
231 == 2.3 ​Uplink Payload ==
232
233
234 (((
235 SPH01-LB will uplink payload via LoRaWAN with below payload format: 
236 )))
237
238 (((
239 Uplink payload includes in total 11 bytes.
240 )))
241
242 (((
243 Normal uplink payload:
244 )))
245
246 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:470px" %)
247 |=(% style="width: 60px;background-color:#D9E2F3;color:#0070C0" %)(((
248 **Size(bytes)**
249 )))|=(% 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**
250 |(% style="width:62.5px" %)Value|(% style="width:62.5px" %)[[BAT>>||anchor="H2.3.1BatteryInfo"]]|(% style="width:62.5px" %)(((
251 [[Temperature (Optional)>>||anchor="H2.3.2DS18B20Temperaturesensor"]]
252 )))|[[Soil pH>>||anchor="H2.3.3SoilpH"]]|[[Soil Temperature>>||anchor="H2.3.4SoilTemperature"]]|(((
253 [[Digital Interrupt (Optional)>>||anchor="H2.3.5InterruptPin"]]
254 )))|Reserve|(((
255 [[Message Type>>||anchor="H2.3.6MessageType"]]
256 )))
257
258 [[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"]]
259
260
261 === 2.3.1 Battery Info ===
262
263
264 Check the battery voltage for SPH01-LB.
265
266 Ex1: 0x0B45 = 2885mV
267
268 Ex2: 0x0B49 = 2889mV
269
270
271 === 2.3.2 DS18B20 Temperature sensor ===
272
273
274 This is optional, user can connect external DS18B20 sensor to the +3.3v, 1-wire and GND pin . and this field will report temperature.
275
276
277 **Example**:
278
279 If payload is: 0105H:  (0105 & FC00 == 0), temp = 0105H /10 = 26.1 degree
280
281 If payload is: FF3FH :  (FF3F & FC00 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees.
282
283
284 === 2.3.3 Soil pH ===
285
286
287 Range: 0 ~~ 14 pH
288
289 **Example:**
290
291 (% style="color:#037691" %)** 0x02B7(H) = 695(D) = 6.95pH**
292
293
294 === 2.3.4 Soil Temperature ===
295
296
297 Get Soil Temperature 
298
299
300 **Example**:
301
302 If payload is: **0105H**:  (0105 & FC00 == 0), temp = 0105H /10 = 26.1 degree
303
304 If payload is: **FF3FH** :  (FF3F & FC00 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees.
305
306
307 === 2.3.5 Interrupt Pin ===
308
309
310 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.
311
312
313 **Example:**
314
315 0x00: Normal uplink packet.
316
317 0x01: Interrupt Uplink Packet.
318
319
320 === 2.3.6 Message Type ===
321
322
323 (((
324 For a normal uplink payload, the message type is always 0x01.
325 )))
326
327 (((
328 Valid Message Type:
329 )))
330
331 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:496px" %)
332 |=(% 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**
333 |(% style="width:160px" %)0x01|(% style="width:163px" %)Normal Uplink|(% style="width:173px" %)[[Normal Uplink Payload>>||anchor="H2.3200BUplinkPayload"]]
334 |(% style="width:160px" %)0x02|(% style="width:163px" %)Reply configures info|(% style="width:173px" %)[[Configure Info Payload>>||anchor="H3.4GetFirmwareVersionInfo"]]
335 |(% style="width:160px" %)0x03|(% style="width:163px" %)Reply Calibration Info|(% style="width:173px" %)[[Calibration Payload>>||anchor="H2.7Calibration"]]
336
337
338
339 === 2.3.7 Decode payload in The Things Network ===
340
341
342 While using TTN network, you can add the payload format to decode the payload.
343
344 [[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"]]
345
346 (((
347 The payload decoder function for TTN is here:
348 )))
349
350 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]]
351
352
353 == 2.4 Uplink Interval ==
354
355
356 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"]]
357
358
359 == 2.5 Datalog Feature ==
360
361
362 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.
363
364
365 === 2.5.1 Ways to get datalog via LoRaWAN ===
366
367
368 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.
369
370 * (((
371 a) SPH01-LB will do an ACK check for data records sending to make sure every data arrive server.
372 )))
373 * (((
374 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.
375 )))
376
377 Below is the typical case for the auto-update datalog feature (Set PNACKMD=1)
378
379 [[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"]]
380
381
382 === 2.5.2 Unix TimeStamp ===
383
384
385 SPH01-LB uses Unix TimeStamp format based on
386
387 [[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"]]
388
389 User can get this time from link:  [[https:~~/~~/www.epochconverter.com/>>url:https://www.epochconverter.com/]] :
390
391 Below is the converter example
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-12.png?width=720&height=298&rev=1.1||alt="图片-20220523001219-12.png" height="298" width="720"]]
394
395
396 So, we can use AT+TIMESTAMP=1611889405 or downlink 3060137afd00 to set the current time 2021 – Jan ~-~- 29 Friday 03:03:25
397
398
399 === 2.5.3 Set Device Time ===
400
401
402 User need to set (% style="color:blue" %)**SYNCMOD=1**(%%) to enable sync time via MAC command.
403
404 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).
405
406 (% 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.**
407
408
409 === 2.5.4 Datalog Uplink payload (FPORT~=3) ===
410
411
412 The Datalog uplinks will use below payload format.
413
414 **Retrieval data payload:**
415
416 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:500px" %)
417 |=(% 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**
418 |(% style="width:95px" %)Value|(% style="width:220px" %)PH|(((
419 Temperature
420 )))|DS18B20_Temperature|Level of PA8|Unix Time Stamp
421
422 (% style="color:blue" %)**Poll Message Flag**(%%): 1: This message is a poll message reply.
423
424 * Poll Message Flag is set to 1.
425
426 * Each data entry is 11 bytes, to save airtime and battery, devices will send max bytes according to the current DR and Frequency bands.
427
428 For example, in US915 band, the max payload for different DR is:
429
430 (% style="color:blue" %)**a) DR0:**(%%) max is 11 bytes so one entry of data
431
432 (% style="color:blue" %)**b) DR1:**(%%) max is 53 bytes so devices will upload 4 entries of data (total 44 bytes)
433
434 (% style="color:blue" %)**c) DR2:**(%%) total payload includes 11 entries of data
435
436 (% style="color:blue" %)**d) DR3: **(%%)total payload includes 22 entries of data.
437
438 If devise doesn't have any data in the polling time. Device will uplink 11 bytes of 0   
439
440
441 **Example:**
442
443 If SPH01-LB has below data inside Flash:
444
445 [[image:image-20230606170132-1.png]]
446
447 If user sends below downlink command: 31646D84E1646D856C05
448
449 Where : Start time: 646D84E1 = time 23/5/24 03:30:41
450
451 Stop time: 646D856C= time 23/5/24 03:33:00
452
453
454 === 2.5.5 Poll sensor value ===
455
456
457 Users can poll sensor values based on timestamps. Below is the downlink command.
458
459 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:425.818px" %)
460 |(% colspan="4" style="background-color:#d9e2f3; color:#0070c0; width:423px" %)**Downlink Command to poll Open/Close status (0x31)**
461 |(% style="width:58px" %)**1byte**|(% style="width:127px" %)**4bytes**|(% style="width:124px" %)**4bytes**|(% style="width:114px" %)**1byte**
462 |(% style="width:58px" %)31|(% style="width:127px" %)Timestamp start|(% style="width:124px" %)Timestamp end|(% style="width:114px" %)Uplink Interval
463
464 (((
465 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.
466 )))
467
468 (((
469 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"]]
470 )))
471
472 (((
473 Is to check 2021/11/12 12:00:00 to 2021/11/12 15:00:00's data
474 )))
475
476 (((
477 Uplink Internal =5s,means SPH01-LB will send one packet every 5s. range 5~~255s.
478 )))
479
480
481 == 2.6 Installation and Maintain ==
482
483 === 2.6.1 Before measurement ===
484
485
486 (((
487 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. 
488 )))
489
490
491 === 2.6.2 Measurement ===
492
493
494 (((
495 (% style="color:blue" %)**Measurement the soil surface:**
496 )))
497
498 (((
499 [[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"]]
500 )))
501
502 (((
503 Choose the proper measuring position. Split the surface soil according to the measured deep.
504 )))
505
506 (((
507 Put pure water, or rainwater to make the soil of measurement point to moist mud. Remove rocks or hard things.
508 )))
509
510 (((
511 Slowly insert the probe to the measure point. Don't use large force which will break the probe. Make sure not shake when inserting.
512 )))
513
514 (((
515 Put soil over the probe after insert. And start to measure.
516 )))
517
518
519 (((
520 (% style="color:blue" %)**Measurement inside soil:**
521 )))
522
523 (((
524 Dig a hole with diameter > 20CM.
525 )))
526
527 (((
528 Insert the probe inside, method like measure the surface.
529 )))
530
531
532 === 2.6.3 Maintain Probe ===
533
534
535 (((
536 ~1. pH probe electrode is fragile and no strong. User must avoid strong force or hitting it.
537 )))
538
539 (((
540 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.
541 )))
542
543 (((
544 3. Probe reference electrode is also no strong, need to avoid strong force or hitting.
545 )))
546
547 (((
548 4. User should keep reference electrode wet while not use.
549 )))
550
551 (((
552 5. Avoid the probes to touch oily matter. Which will cause issue in accuracy.
553 )))
554
555 (((
556 6. The probe is IP68 can be put in water.
557
558
559 )))
560
561 == 2.7 Calibration ==
562
563
564 (% style="color:blue" %)**Step1 :**(%%)** Clean probe**
565
566 user can use high grade sandpaper to polish it or put in 5% hydrochloric acid for several minutes. After the metal probe looks new, users can clean it to remove hydrochloric acid or other liquids from the surface.
567
568 (% style="color:blue" %)**Step2 :**(%%)** Immerse the sensor in ph buffer solution to make the sensor values stable**
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 (% style="color:red" %)**Note:Only one ph buffer with one of the ph values needs to be calibrated during calibration. Wait for the sensor measurement value to be stable, it does not need to be the same as the ph marked by the ph buffer**
574
575
576 (% style="color:blue" %)**Step3 :**(%%)** The numerically stable sensors were calibrated using commands**
577 )))
578
579 (((
580 User can use below command to calibrate.
581
582 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:520px" %)
583 |(% 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**
584 |(% style="width:149px" %)4.00|(% style="width:197px" %)AT+PHCAL=4|(% style="width:206px" %)(((
585 0x13 04
586 Reply with Calibrate payload
587 )))|(% style="width:136px" %)(((
588 AT+PHCAL=?
589 Example 41,61,91
590 )))
591 |(% style="width:149px" %)6.86|(% style="width:197px" %)AT+PHCAL=6|(% style="width:206px" %)(((
592 0x13 06
593 Reply with Calibrate payload
594 )))|(% style="width:136px" %)AT+PHCAL=?
595 |(% style="width:149px" %)9.18|(% style="width:197px" %)AT+PHCAL=9|(% style="width:206px" %)(((
596 0x13 09
597 Reply with Calibrate payload
598 )))|(% style="width:136px" %)AT+PHCAL=?
599 |(% style="width:149px" %)Factory Default|(% style="width:197px" %)AT+PHCAL=15|(% style="width:206px" %)(((
600 0x13 15
601 Reply with Calibrate payload
602 )))|(% style="width:136px" %)(((
603 AT+PHCAL=?
604 Example 151
605 )))
606 )))
607
608 To use the AT COMMAND, refer to this link:
609
610 * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]].
611
612 * AT Command via UART Connection : See [[UART Connection>>url:http://wiki.dragino.com/xwiki/bin/view/Main/UART%20Access%20for%20LoRa%20ST%20v4%20base%20model/#H2.3UARTConnectionforSN50v3basemotherboard]].
613
614 To use Downlink, take TTN as an example, please refer to this link:
615
616 * LoRaWAN Downlink.  Instruction for different platforms: See [[IoT LoRaWAN Server>>url:http://wiki.dragino.com/xwiki/bin/view/Main/]] section.
617
618 When the command is successfully used, the node sends a uplink.
619 This is the payload for uplink
620
621 (% style="color:#037691" %)**Calibration Payload**
622
623 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:500px" %)
624 |=(% style="width: 60px;background-color:#D9E2F3;color:#0070C0" %)(((
625 **Size(bytes)**
626 )))|=(% 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**
627 |Value|(((
628 PH4 Calibrate value
629 )))|PH6.86 Calibrate value|(((
630 PH9.18 Calibrate value
631 )))|Reserve|(((
632 [[Message Type>>||anchor="H2.3.6MessageType"]]
633 Always 0x03
634 )))
635
636 User can also send 0x14 downlink command to poll the current calibration payload.
637
638 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:480px" %)
639 |=(% 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)**
640 |(% style="width:183px" %)Get Calibration Version Info|(% style="width:55px" %)Any|(% style="width:93px" %)14|(% style="width:146px" %)2
641
642 * Reply to the confirmation package: 14 01
643
644 * Reply to non-confirmed packet: 14 00
645
646 (% style="color:blue" %)**Step4:**(%%)**After the calibration is completed, its measurement results in this ph buffer solution should be consistent with the numerical value of the command used in the calibration.**
647
648 Examples:
649 After using the command AT+PH=9 in 9.18ph buffer
650 The readout returned by the sensor in 9.18ph buffer should be pH=9
651
652
653 == 2.8 Frequency Plans ==
654
655
656 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.
657
658 [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/>>http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/]]
659
660
661 = 3. Configure SPH01-LB =
662
663 == 3.1 Configure Methods ==
664
665
666 SPH01-LB supports below configure method:
667
668 * AT Command via Bluetooth Connection (**Recommended**): [[BLE Configure Instruction>>http://wiki.dragino.com/xwiki/bin/view/Main/BLE%20Bluetooth%20Remote%20Configure/]].
669
670 * 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]].
671
672 * LoRaWAN Downlink.  Instruction for different platforms: See [[IoT LoRaWAN Server>>http://wiki.dragino.com/xwiki/bin/view/Main/]] section.
673
674
675
676 == 3.2 General Commands ==
677
678
679 These commands are to configure:
680
681 * General system settings like: uplink interval.
682
683 * LoRaWAN protocol & radio related command.
684
685 They are same for all Dragino Devices which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki:
686
687 [[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/]]
688
689
690 == 3.3 Commands special design for SPH01-LB ==
691
692
693 These commands only valid for SPH01-LB, as below:
694
695
696 === 3.3.1 Set Transmit Interval Time ===
697
698
699 (((
700 Feature: Change LoRaWAN End Node Transmit Interval.
701 )))
702
703 (((
704 (% style="color:blue" %)**AT Command: AT+TDC**
705 )))
706
707 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
708 |=(% 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**
709 |(% style="width:156px" %)AT+TDC=?|(% style="width:137px" %)Show current transmit Interval|(((
710 30000
711 OK
712 the interval is 30000ms = 30s
713 )))
714 |(% style="width:156px" %)AT+TDC=60000|(% style="width:137px" %)Set Transmit Interval|(((
715 OK
716 Set transmit interval to 60000ms = 60 seconds
717 )))
718
719 (((
720 (% style="color:blue" %)**Downlink Command: 0x01**
721 )))
722
723 (((
724 Format: Command Code (0x01) followed by 3 bytes time value.
725 )))
726
727 (((
728 If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01.
729 )))
730
731 * (((
732 Example 1: Downlink Payload: 0100001E  ~/~/ Set Transmit Interval (TDC) = 30 seconds
733 )))
734
735 * (((
736 Example 2: Downlink Payload: 0100003C  ~/~/ Set Transmit Interval (TDC) = 60 seconds
737
738
739
740 )))
741
742 === 3.3.2 Set Interrupt Mode ===
743
744
745 Feature, Set Interrupt mode for GPIO_EXTI of pin.
746
747 When AT+INTMOD=0 is set, GPIO_EXTI is used as a digital input port.
748
749 (% style="color:blue" %)**AT Command: AT+INTMOD**
750
751 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %)
752 |=(% 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**
753 |(% style="width:154px" %)AT+INTMOD=?|(% style="width:196px" %)Show current interrupt mode|(% style="width:157px" %)(((
754 0
755 OK
756 the mode is 0 =Disable Interrupt
757 )))
758 |(% style="width:154px" %)AT+INTMOD=2|(% style="width:196px" %)(((
759 Set Transmit Interval
760 0. (Disable Interrupt),
761 ~1. (Trigger by rising and falling edge)
762 2. (Trigger by falling edge)
763 3. (Trigger by rising edge)
764 )))|(% style="width:157px" %)OK
765
766 (% style="color:blue" %)**Downlink Command: 0x06**
767
768 Format: Command Code (0x06) followed by 3 bytes.
769
770 This means that the interrupt mode of the end node is set to 0x000003=3 (rising edge trigger), and the type code is 06.
771
772 * Example 1: Downlink Payload: 06000000  ~/~/  Turn off interrupt mode
773
774 * Example 2: Downlink Payload: 06000003  ~/~/  Set the interrupt mode to rising edge trigger
775
776
777
778 === 3.3.3 Calibrate Sensor ===
779
780
781 Detail See [[Calibration Guide>>||anchor="H2.7Calibration"]] for the user of 0x13 and 0x14 downlink commands
782
783
784 === 3.3.4 Get Firmware Version Info ===
785
786
787 Feature: use downlink to get firmware version.
788
789 (% style="color:#037691" %)**Downlink Command: 0x26**
790
791 (% border="1" cellspacing="5" style="background-color:#f2f2f2; width:500px" %)
792 |(% 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)**
793 |(% style="width:193px" %)Get Firmware Version Info|(% style="width:57px" %)Any|(% style="width:91px" %)26|(% style="width:149px" %)2
794
795 * Reply to the confirmation package: 26 01
796
797 * Reply to non-confirmed packet: 26 00
798
799 Device will send an uplink after got this downlink command. With below payload:
800
801 Configures info payload:
802
803 (% border="1" cellspacing="4" style="background-color:#f2f2f2; width:470px" %)
804 |(% style="background-color:#d9e2f3; color:#0070c0; width:70px" %)**Size(bytes)**|(% style="background-color:#d9e2f3; color:#0070c0; width:70px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:100px" %)**2**|(% style="background-color:#d9e2f3; color:#0070c0; width:100px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:70px" %)**1**|(% style="background-color:#d9e2f3; color:#0070c0; width:60px" %)**2**
805 |Value|Sensor Model|Firmware Version|Frequency Band|Sub-band|BAT
806
807 (% style="color:#037691" %)**Software Type**(%%): Always 0x2C for SPH01-LB
808
809 (% style="color:#037691" %)**Firmware Version**(%%): 0x0100, Means: v1.0.0 version
810
811 (% style="color:#037691" %)**Frequency Band**:
812
813 0x01: EU868
814
815 0x02: US915
816
817 0x03: IN865
818
819 0x04: AU915
820
821 0x05: KZ865
822
823 0x06: RU864
824
825 0x07: AS923
826
827 0x08: AS923-1
828
829 0x09: AS923-2
830
831 0x0a: AS923-3
832
833 0x0b: CN470
834
835 0x0c: EU433
836
837 0x0d: KR920
838
839 0x0e: MA869
840
841
842 (% style="color:#037691" %)**Sub-Band**(%%):
843
844 AU915 and US915: value 0x00 ~~ 0x08
845
846 CN470: value 0x0B ~~ 0x0C
847
848 Other Bands: Always 0x00
849
850
851 (% style="color:#037691" %)**Battery Info**:
852
853 Check the battery voltage.
854
855 Ex1: 0x0B45 = 2885mV
856
857 Ex2: 0x0B49 = 2889mV
858
859
860 = 4. Battery & Power Consumption =
861
862
863 SPH01-LB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace.
864
865 [[**Battery Info & Power Consumption Analyze**>>http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20calculate%20the%20battery%20life%20of%20Dragino%20sensors%3F/]] .
866
867
868 = 5. OTA Firmware update =
869
870
871 (% class="wikigeneratedid" %)
872 User can change firmware SPH01-LB to:
873
874 * Change Frequency band/ region.
875
876 * Update with new features.
877
878 * Fix bugs.
879
880 Firmware and changelog can be downloaded from : **[[Firmware download link>>https://www.dropbox.com/sh/p1tiy43naiyy75u/AACzHWEGlYNeHDjMe2bkxotUa?dl=0]]**
881
882 Methods to Update Firmware:
883
884 * (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/]]
885
886 * 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]]**.
887
888
889
890 = 6. FAQ =
891
892 == 6.1  AT Commands input doesn't work ==
893
894
895 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.
896
897
898 = 7. Order Info =
899
900
901 Part Number: (% style="color:blue" %)**SPH01-LB-XXX**
902
903 (% style="color:red" %)**XXX**(%%): The default frequency band
904
905 * (% style="color:red" %)**AS923**(%%): LoRaWAN AS923 band
906
907 * (% style="color:red" %)**AU915**(%%): LoRaWAN AU915 band
908
909 * (% style="color:red" %)**EU433**(%%): LoRaWAN EU433 band
910
911 * (% style="color:red" %)**EU868**(%%): LoRaWAN EU868 band
912
913 * (% style="color:red" %)**KR920**(%%): LoRaWAN KR920 band
914
915 * (% style="color:red" %)**US915**(%%): LoRaWAN US915 band
916
917 * (% style="color:red" %)**IN865**(%%): LoRaWAN IN865 band
918
919 * (% style="color:red" %)**CN470**(%%): LoRaWAN CN470 band
920
921
922
923 = 8. ​Packing Info =
924
925
926 (% style="color:#037691" %)**Package Includes**:
927
928 * SPH01-LB LoRaWAN Soil Ph Sensor x 1
929
930 (% style="color:#037691" %)**Dimension and weight**:
931
932 * Device Size: cm
933
934 * Device Weight: g
935
936 * Package Size / pcs : cm
937
938 * Weight / pcs : g
939
940
941
942 = 9. Support =
943
944
945 * 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.
946
947 * 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