Last modified by Mengting Qiu on 2025/07/03 15:42

From version 141.3
edited by Xiaoling
on 2025/04/25 08:56
Change comment: There is no comment for this version
To version 142.2
edited by Mengting Qiu
on 2025/05/14 19:35
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Xiaoling
1 +XWiki.ting
Content
... ... @@ -1159,6 +1159,187 @@
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 RS485-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 +
1162 1162  = 3. Configure SDI-12-LB/LS via AT Command or LoRaWAN Downlink =
1163 1163  
1164 1164