Changes for page SDI-12-LB/LS -- SDI-12 to LoRaWAN Converter User Manual
Last modified by Mengting Qiu on 2025/07/03 15:42
From version 144.2
edited by Mengting Qiu
on 2025/05/15 09:16
on 2025/05/15 09:16
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ting1 +XWiki.Xiaoling - Content
-
... ... @@ -1159,187 +1159,6 @@ 1159 1159 [[https:~~/~~/www.dropbox.com/sh/qrbgbikb109lkiv/AACBR-v_ZhZAMengcY7Nsa1ja?dl=0>>https://www.dropbox.com/sh/qrbgbikb109lkiv/AACBR-v_ZhZAMengcY7Nsa1ja?dl=0]] 1160 1160 1161 1161 1162 - 1163 -== 2.9 Datalog Feature(Since v1.3.0) == 1164 - 1165 - 1166 -((( 1167 -Datalog Feature is to ensure IoT Server can get all sampling data from Sensor even if the LoRaWAN network is down. For each sampling, SDI-12-LB will store the reading for future retrieving purposes. There are two ways for IoT servers to get datalog from SDI-12-LB. 1168 -))) 1169 - 1170 - 1171 -=== 2.9.1 Ways to get datalog via LoRaWAN === 1172 - 1173 - 1174 -There are two methods: 1175 - 1176 -(% style="color:blue" %)**Method 1:** (%%)IoT Server sends a downlink LoRaWAN command to [[poll the value>>||anchor="H2.8.4Pollsensorvalue"]] for specified time range. 1177 - 1178 - 1179 -(% style="color:blue" %)**Method 2: **(%%)Set PNACKMD=1, SDI-12-LB will wait for ACK for every uplink, when there is no LoRaWAN network, SDI-12-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. 1180 - 1181 - 1182 -(% style="color:red" %)**Note for method 2:** 1183 - 1184 -* a) SDI-12-LB will do an ACK check for data records sending to make sure every data arrive server. 1185 -* b) SDI-12-LB will send data in **CONFIRMED Mode** when PNACKMD=1, but SDI-12-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 SDI-12-LB gets a ACK, SDI-12-LB will consider there is a network connection and resend all NONE-ACK Message. 1186 - 1187 -=== 2.9.2 Unix TimeStamp === 1188 - 1189 - 1190 -SDI-12-LB uses Unix TimeStamp format based on 1191 - 1192 -[[image:https://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="image-20220523001219-11.png"]] 1193 - 1194 - 1195 -User can get this time from link: [[https:~~/~~/www.epochconverter.com/>>url:https://www.epochconverter.com/]] : 1196 - 1197 -Below is the converter example 1198 - 1199 -[[image:https://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="image-20220523001219-12.png"]] 1200 - 1201 -So, we can use AT+TIMESTAMP=1742889625 or downlink 3067E26299 to set the current time 2025 – March ~-~- 25 Tuesday 08:00:25 1202 - 1203 - 1204 -=== 2.9.3 Set Device Time === 1205 - 1206 - 1207 -((( 1208 -(% style="color:blue" %)**There are two ways to set device's time:** 1209 -))) 1210 - 1211 -((( 1212 -**1. Through LoRaWAN MAC Command (Default settings)** 1213 -))) 1214 - 1215 -((( 1216 -User need to set SYNCMOD=1 to enable sync time via MAC command. 1217 -))) 1218 - 1219 -((( 1220 -Once SDI-12-LB Joined LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to SDI-12-LB. If SDI-12-LB fails to get the time from the server, SDI-12-LB will use the internal time and wait for next time request (AT+SYNCTDC to set the time request period, default is 10 days). 1221 -))) 1222 - 1223 -((( 1224 -(% 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.** 1225 -))) 1226 - 1227 - 1228 -((( 1229 -**2. Manually Set Time** 1230 -))) 1231 - 1232 -((( 1233 -User needs to set SYNCMOD=0 to manual time, otherwise, the user set time will be overwritten by the time set by the server. 1234 -))) 1235 - 1236 - 1237 -=== 2.9.4 Poll sensor value === 1238 - 1239 - 1240 -User can poll sensor value based on timestamps from the server. Below is the downlink command. 1241 - 1242 -(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:438.778px" %) 1243 -|(% style="background-color:#4f81bd; color:white; width:59px" %)**1byte**|(% style="background-color:#4f81bd; color:white; width:123px" %)**4bytes**|(% style="background-color:#4f81bd; color:white; width:114px" %)**4bytes**|(% style="background-color:#4f81bd; color:white; width:142.778px" %)**1byte** 1244 -|(% style="width:58px" %)31|(% style="width:123px" %)Timestamp start|(% style="width:114px" %)Timestamp end|(% style="width:137px" %)((( 1245 -Uplink Interval(range 5~~255s) 1246 -))) 1247 - 1248 -Timestamp start and Timestamp end use Unix TimeStamp format as mentioned above. Devices will reply with all data log during this time period, use the uplink interval. 1249 - 1250 -For example, downlink command (% _mstmutation="1" %)**31 67E24660 67E26280 05**(%%) 1251 - 1252 -Is to check 2025/03/25 06:00:00 to 2025/03/25 08:00:00's data 1253 - 1254 -Uplink Internal =5s, means SDI-12-LB will send one packet every 5s. 1255 - 1256 - 1257 -=== 2.9.5 Datalog Uplink payload === 1258 - 1259 - 1260 -The Datalog poll reply uplink will use below payload format. 1261 - 1262 -**Retrieval data payload:** 1263 - 1264 -(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:480px" %) 1265 -|=(% style="width: 60px;background-color:#4F81BD;color:white" %)((( 1266 -**Size(bytes)** 1267 -)))|=(% style="width: 100px; background-color: rgb(79, 129, 189); color: white;" %)**4**|=(% style="width: 100px; background-color: rgb(79, 129, 189); color: white;" %)**1**|=(% style="width: 220px; background-color: rgb(79, 129, 189); color: white;" %)**Length depends on the return from the commands** 1268 -|(% style="width:97px" %)Value|(% style="width:104px" %)Unix Time Stamp|(% style="width:109px" %)Payload Length|(% style="width:165px" %)Data returned by the sensor 1269 - 1270 -**Example:** 1271 - 1272 -If SDI-12-LB has below data inside Flash: 1273 - 1274 -(Soil sensors using the SDI-12 protocol are used for testing.) 1275 - 1276 -(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) 1277 -|=(% style="width: 88px; background-color:#4F81BD;color:white" %)Flash Add|=(% style="width: 98px; background-color: rgb(79, 129, 189); color: white;" %)**Unix Time**|=(% style="width: 82px; background-color: rgb(79, 129, 189); color: white;" %)Payload Length|=(% style="width: 86px; background-color: rgb(79, 129, 189); color: white;" %)**BAT voltage**|=(% style="width: 92px; background-color: rgb(79, 129, 189); color: white;" %)Payload Version|=(% style="width: 64px; background-color:#4F81BD;color:white" %)**Value** 1278 -|(% style="width:89px" %)((( 1279 -0001 1280 -)))|(% style="width:98px" %)((( 1281 -2025/3/25 08:09:30 1282 -)))|(% style="width:82px" %)5|(% style="width:86px" %)((( 1283 -0c a8 1284 -)))|(% style="width:92px" %)01|(% style="width:131px" %)((( 1285 -08 21 1286 -))) 1287 -|(% style="width:89px" %)0002|(% style="width:98px" %)((( 1288 -2025/3/25 08:10:30 1289 -)))|(% style="width:82px" %)5|(% style="width:86px" %)((( 1290 -0c ae 1291 -)))|(% style="width:92px" %)01|(% style="width:131px" %)((( 1292 -08 22 1293 -))) 1294 -|(% style="width:89px" %)0003|(% style="width:98px" %)((( 1295 -2025/3/25 08:11:30 1296 -)))|(% style="width:82px" %)5|(% style="width:86px" %)0c ae|(% style="width:92px" %)01|(% style="width:131px" %)08 22 1297 -|(% style="width:89px" %)0004|(% style="width:98px" %)((( 1298 -2025/3/25 08:12:30 1299 -)))|(% style="width:82px" %)5|(% style="width:86px" %)0c ae|(% style="width:92px" %)01|(% style="width:131px" %)08 22 1300 -|(% style="width:89px" %)0005|(% style="width:98px" %)((( 1301 -2025/3/25 08:13:30 1302 -)))|(% style="width:82px" %)5|(% style="width:86px" %)((( 1303 -0c b4 1304 -)))|(% style="width:92px" %)01|(% style="width:131px" %)08 23 1305 -|(% style="width:89px" %)0006|(% style="width:98px" %)((( 1306 -2025/3/25 08:14:30 1307 -)))|(% style="width:82px" %)5|(% style="width:86px" %)0c ae|(% style="width:92px" %)01|(% style="width:131px" %)08 22 1308 -|(% style="width:89px" %)0007|(% style="width:98px" %)((( 1309 -2025/3/25 08:15:30 1310 -)))|(% style="width:82px" %)5|(% style="width:86px" %)0c b4|(% style="width:92px" %)01|(% style="width:131px" %)08 23 1311 -|(% style="width:89px" %)0008|(% style="width:98px" %)((( 1312 -2025/3/25 08:16:30 1313 -)))|(% style="width:82px" %)5|(% style="width:86px" %)0c ae|(% style="width:92px" %)01|(% style="width:131px" %)08 22 1314 - 1315 -If user sends below downlink command: (% style="background-color:yellow" %)3167E264BA67E2665E05 1316 - 1317 -Where : Start time: 67E264BA = time 2025/3/25 08:09:30 1318 - 1319 - Stop time: 67E2665E= time 2025/3/25 08:16:30 1320 - 1321 - 1322 -**SDI-12-LB will uplink this payload.** 1323 - 1324 -**67E264BA 05 0CA8 01 0821** 67E264F6050CAE01082267E26532050CAE01082267E2656E050CAE01082267E265AA050CB401082367E265E6050CAE01082267E26622050CB401082367E2665E050CAE010822 1325 - 1326 - 1327 -Where the first 10 bytes is for the first entry: 1328 - 1329 -67E264BA050CA8010821 1330 - 1331 -Unix Time Stamp: 67E264BA(H)=1742890170(D) ~-~-> time=2025-03-25 8:09:30 1332 - 1333 -Payload Length: 0x05(H)=5 bytes 1334 - 1335 -Battery voltage: 0x0CA8(H)=3240 mV 1336 - 1337 -Payload Version: 01 1338 - 1339 -Value: For the distance sensor used for testing, this value is the mm distance value, 0x0821(H)=2081mm. 1340 - 1341 - 1342 - 1343 1343 = 3. Configure SDI-12-LB/LS via AT Command or LoRaWAN Downlink = 1344 1344 1345 1345 ... ... @@ -1575,119 +1575,6 @@ 1575 1575 * Example 1: Downlink Payload: AE 01 ~/~/ AT+PAYVER=1 1576 1576 * Example 2: Downlink Payload: AE 05 ~/~/ AT+PAYVER=5 1577 1577 1578 - 1579 -=== 3.7 Print data entries base on page === 1580 - 1581 - 1582 -Feature: Print the sector data from start page to stop page (max is 416 pages). 1583 - 1584 -(% style="color:#4f81bd" %)**AT Command: AT+PDTA** 1585 - 1586 -(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) 1587 -|(% style="background-color:#4f81bd; color:white; width:158px" %)**Command Example**|(% style="background-color:#4f81bd; color:white; width:352px" %)**Function** 1588 -|(% style="width:156px" %)((( 1589 -AT+PDTA=1,2 1590 -Print page 1 to 2 1591 -)))|(% style="width:311px" %)((( 1592 -Stop Tx events when read sensor data 1593 - 1594 -8032000 2025/3/25 06:36:49 5 0c a8 01 08 1e 1595 - 1596 -8032010 2025/3/25 06:37:49 5 0c ae 01 08 20 1597 - 1598 -8032020 2025/3/25 06:38:49 5 0c ae 01 08 24 1599 - 1600 -8032030 2025/3/25 06:39:49 5 0c ae 01 08 1f 1601 - 1602 -8032040 2025/3/25 06:40:49 5 0c a8 01 08 24 1603 - 1604 -8032050 2025/3/25 06:42:11 5 0c a8 01 08 22 1605 - 1606 -8032060 2025/3/25 06:43:11 5 0c a8 01 08 23 1607 - 1608 -8032070 2025/3/25 06:44:11 5 0c ae 01 08 22 1609 - 1610 -8032080 2025/3/25 06:45:11 5 0c ae 01 08 1e 1611 - 1612 -8032090 2025/3/25 06:46:11 5 0c b4 01 08 1e 1613 - 1614 -80320A0 2025/3/25 06:47:11 5 0c a8 01 08 1d 1615 - 1616 -80320B0 2025/3/25 06:48:11 5 0c ae 01 08 22 1617 - 1618 -80320C0 2025/3/25 06:49:11 5 0c b4 01 08 24 1619 - 1620 -80320D0 2025/3/25 06:50:11 5 0c a8 01 08 23 1621 - 1622 -80320E0 2025/3/25 06:51:11 5 0c a8 01 08 23 1623 - 1624 -80320F0 2025/3/25 06:52:11 5 0c ae 01 08 22 1625 - 1626 -Start Tx events 1627 - 1628 -OK 1629 -))) 1630 - 1631 -(% style="color:#4f81bd" %)**Downlink Command:** 1632 - 1633 -No downlink commands for feature 1634 - 1635 - 1636 -=== 3.8 Print last few data entries === 1637 - 1638 - 1639 -Feature: Print the last few data entries 1640 - 1641 -(% style="color:#4f81bd" %)**AT Command: AT+PLDTA** 1642 - 1643 -(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:510px" %) 1644 -|(% style="background-color:#4f81bd; color:white; width:158px" %)**Command Example**|(% style="background-color:#4f81bd; color:white; width:352px" %)**Function** 1645 -|(% style="width:156px" %)((( 1646 -AT+PLDTA=10 1647 -Print last 10 entries 1648 -)))|(% style="width:311px" %)((( 1649 -Stop Tx events when read sensor data 1650 - 1651 -0001-0002 2025/5/15 01:04:43 18 0c 72 01 f1 0d 30 2b 31 2e 31 34 2b 32 39 2e 34 0d 0a 1652 - 1653 -0003-0004 2025/5/15 01:06:43 18 0c 72 01 f1 0d 30 2b 31 2e 31 33 2b 33 30 2e 30 0d 0a 1654 - 1655 -0005-0006 2025/5/15 01:08:43 18 0c 7e 01 f1 0d 30 2b 31 2e 33 30 2b 33 30 2e 35 0d 0a 1656 - 1657 -0007-0008 2025/5/15 01:10:43 18 0c 72 01 f1 0d 30 2b 31 2e 33 30 2b 33 31 2e 30 0d 0a 1658 - 1659 -0009-0010 2025/5/15 01:12:43 18 0c 72 01 f1 0d 30 2b 31 2e 33 30 2b 33 31 2e 31 0d 0a 1660 - 1661 -Start Tx events 1662 - 1663 -OK 1664 -))) 1665 - 1666 -(% style="color:#4f81bd" %)**Downlink Command:** 1667 - 1668 -No downlink commands for feature 1669 - 1670 - 1671 -=== 3.9 Clear Flash Record === 1672 - 1673 - 1674 -Feature: Clear flash storage for data log feature. 1675 - 1676 -(% style="color:#4f81bd" %)**AT Command: AT+CLRDTA** 1677 - 1678 -(% border="1" cellspacing="3" style="background-color:#f2f2f2; width:503px" %) 1679 -|(% style="background-color:#4f81bd; color:white; width:157px" %)**Command Example**|(% style="background-color:#4f81bd; color:white; width:137px" %)**Function**|(% style="background-color:#4f81bd; color:white; width:209px" %)**Response** 1680 -|(% style="width:155px" %)AT+CLRDTA |(% style="width:134px" %)Clear date record|(% style="width:209px" %)((( 1681 -Clear all stored sensor data… 1682 - 1683 -OK 1684 -))) 1685 - 1686 -(% style="color:#4f81bd" %)**Downlink Command: 0xA3** 1687 - 1688 -* Example: 0xA301 ~/~/ Same as AT+CLRDTA 1689 - 1690 - 1691 1691 = 4. Battery & Power Consumption = 1692 1692 1693 1693