<
From version < 1.4 >
edited by Xiaoling
on 2022/05/12 17:51
To version < 1.9 >
edited by Xiaoling
on 2022/05/12 18:02
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,6 +1,8 @@
1 -Contents:
1 + **Contents:**
2 2  
3 +{{toc/}}
3 3  
5 +
4 4  = 1. Introduction =
5 5  
6 6  The Dragino LoRaWAN gateway can commuicate with LoRaWAN ABP End Node without the need of LoRaWAN server. It can be used in some cases such as:
... ... @@ -8,8 +8,10 @@
8 8  * No internet connection.
9 9  * User wants to get data forward in gateway and forward to their server base on MQTT/HTTP, etc. (Combine ABP communication method and [[MQTT forward together>>url:https://wiki.dragino.com/index.php/MQTT_Forward_Instruction]]).
10 10  
13 +(((
11 11  
12 -The basic of this feature is the decoding of LoRaWAN ABP End Node. Requirements:
15 +The basic of this feature is the decoding of **LoRaWAN ABP End Node**. Requirements:
16 +)))
13 13  
14 14  1. LoRaWAN End Node in ABP mode. Make sure your end node works in this mode. End node most are default set to OTAA mode
15 15  1. LoRaWAN Gateway model: [[LPS8>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/148-lps8.html]], [[LG308>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/140-lg308.html]], [[DLOS8>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/160-dlos8.html]] ,[[LIG16>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/171-lig16.html]]
... ... @@ -19,16 +19,20 @@
19 19  = 2. How it works =
20 20  
21 21  
22 -Video Instruction: [[https:~~/~~/youtu.be/ZBjXwmp7rwM>>url:https://youtu.be/ZBjXwmp7rwM]]
26 +**Video Instruction**: [[https:~~/~~/youtu.be/ZBjXwmp7rwM>>url:https://youtu.be/ZBjXwmp7rwM]]
23 23  
24 24  Assume we have the LoRaWAN tracker LGT92 which works in ABP mode and US915 band. It has below keys:
25 25  
26 -{{{AT+NWKSKEY=72 32 63 95 dd 8f e2 b2 13 66 e4 35 93 8f 55 df
30 +(% class="box infomessage" %)
31 +(((
32 +AT+NWKSKEY=72 32 63 95 dd 8f e2 b2 13 66 e4 35 93 8f 55 df
27 27  AT+APPSKEY=b3 17 f8 14 7a 43 27 8a 6a 31 c4 47 3d 55 5d 33
28 28  AT+DADDR=2602111D
29 -}}}
35 +)))
30 30  
37 +(((
31 31  and we have the LG308 works and US915 band and support ABP decryption. User can input these keys in LG308 so the LG308 can communicate with LGT92.
39 +)))
32 32  
33 33  We need to input above keys in LG308 and enable ABP decryption.
34 34  
... ... @@ -41,7 +41,9 @@
41 41  
42 42  Now when this End Node (Dev Addr=2602111D) send a uplink packet. When this packet arrive LG308, LG308 will decode it and put the decode data on the file /var/iot/channels/2602111D . So we have this data for further process with other applications in LG308.
43 43  
52 +(((
44 44  We can see the log of LG308 to know this packet arrive
54 +)))
45 45  
46 46  [[image:https://wiki.dragino.com/images/thumb/1/16/ABP_DECODE_2.png/600px-ABP_DECODE_2.png||height="205" width="600"]]
47 47  
... ... @@ -50,54 +50,65 @@
50 50  
51 51  The data of End Node is stored in the file /var/iot/channels/2602111D. We can use hexdump command to check it.
52 52  
53 -{{{root@dragino-1d25dc:~# hexdump /var/iot/channels/2602111D
54 -0000000 4646 4646 4646 3946 3030 3030 3030 3546 --> Got RSSI and SNR
55 -0000010 cc0c 0b63 0266 017f ff7f ff00 --> Payload
63 +(% class="box" %)
64 +(((
65 +root@dragino-1d25dc:~~# hexdump /var/iot/channels/2602111D
66 +0000000 (% class="mark" %)**4646 4646 4646 3946 3030 3030 3030 3546**(%%)      ~-~-> Got RSSI and SNR    
67 +0000010 (% class="mark" %)**cc0c 0b63 0266 017f ff7f ff00 **(%%) ~-~-> Payload
56 56  000001c
57 -}}}
69 +)))
58 58  
59 59  * RSSI: 4646 4646 4646 3946 = 0xFFFF FF9F : So RSSI = (0xFFFF FF9F - 0x100000000) = -97
60 60  * SNR: 3030 3030 3030 3546 = 0x0000 005F = 95, need to divide 10 so SNR is 9.5
61 61  * Payload: 0xcc0c 0b63 0266 017f ff7f ff00
62 62  
63 -
64 -{{{Notice 1: The data file stored in LG308 for the end node is bin file. If the end node sends ASCII string to gateway, the output will as below:
65 -in LGT92, use AT+SEND=12:hello world to send ASCII string
66 -root@dragino-1d25dc:~# hexdump /var/iot/channels/2602111D
75 +(% class="box" %)
76 +(((
77 +(% class="mark" %)**Notice 1**(%%): The data file stored in LG308 for the end node is bin file. If the end node sends ASCII string to gateway, the output will as below:
78 +in LGT92, use **AT+SEND=12**:hello world to send ASCII string
79 +root@dragino-1d25dc:~~# hexdump /var/iot/channels/2602111D
67 67  0000000 4646 4646 4646 3946 3030 3030 3030 3546
68 -0000010 6865 6c6c 6f20 776f 726c 6400 --> Got ASCII code "hello world"
81 +0000010 6865 6c6c 6f20 776f 726c 6400      ~-~-> Got ASCII code "hello world"    
69 69  000001c
70 -}}}
83 +)))
71 71  
72 -{{{Notice 2: The upstream payload length should match the LoRaWAN length requirement (max length depends on Frequency and DR), otherwise the gateway can't decode the payload.
73 -}}}
85 +(% class="box" %)
86 +(((
87 +(% class="mark" %)**Notice 2**(%%): The upstream payload length should match the LoRaWAN length requirement (max length depends on Frequency and DR), otherwise the gateway can't decode the payload.
88 +)))
74 74  
75 75  === 2.2.1 Decode Method ===
76 76  
77 -The decode methods: ASCII String, Decode_LHT65 doesn't affect how the sensor data is stored, they are to define how should the sensor data to be sent.
92 +The decode methods: **ASCII String, Decode_LHT65** doesn't affect how the sensor data is stored, they are to define how should the sensor data to be sent.
78 78  
79 79  For example we have a LHT65 , works in ABP mode and gateway successful get the data, which are:
80 80  
81 -{{{root@dragino-1baf44:~# hexdump /var/iot/channels/01826108
96 +(% class="box" %)
97 +(((
98 +root@dragino-1baf44:~~# hexdump /var/iot/channels/01826108
82 82  0000000 4646 4646 4646 4537 3030 3030 3030 3438
83 -0000010 ccd1 7fff 7fff 017f ff7f ff00
100 +0000010 ccd1 7fff 7fff 017f ff7f ff00         
84 84  000001c
85 -}}}
102 +)))
86 86  
87 87  If we choose ASCII decoder, the MQTT process will send out with mqtt-data:
88 88  
89 -{{{Sun Sep 27 04:33:16 2020 user.notice root: [IoT.MQTT]:pub_topic[-t]: dragino-1baf44/01826108/data
106 +(% class="box" %)
107 +(((
108 +Sun Sep 27 04:33:16 2020 user.notice root: [IoT.MQTT]:pub_topic[-t]: dragino-1baf44/01826108/data
90 90  Sun Sep 27 04:33:16 2020 user.notice root: [IoT.MQTT]:decoder: ASCII
91 91  Sun Sep 27 04:33:16 2020 user.notice root: [IoT.MQTT]:mqtt_data[-m]: ffffffe700000048ccd17fff7fff017fff7fff00
92 -}}}
111 +)))
93 93  
94 94  If we choose Decode_LHT65, the MQTT process will send out with mqtt-data
95 95  
96 -{{{Sun Sep 27 04:36:45 2020 user.notice root: [IoT.MQTT]:pub_topic[-t]: dragino-1baf44/01826108/data
115 +(% class="box" %)
116 +(((
117 +Sun Sep 27 04:36:45 2020 user.notice root: [IoT.MQTT]:pub_topic[-t]: dragino-1baf44/01826108/data
97 97  Sun Sep 27 04:36:45 2020 user.notice root: [IoT.MQTT]:decoder: Dragino_LHT65
98 98  Sun Sep 27 04:36:45 2020 user.notice root: [IoT.MQTT]:mqtt_data[-m]: {"Hum_SHT":32.7,"BatV":3.281,"TempC_DS":32.9,
99 99  "EXT":"Temperature Sensor","RSSI":-24,"TempC_SHT":85.0,"SNR":8.2,"ext_sensor":0}
100 -}}}
121 +)))
101 101  
102 102  Above scripts are store in /etc/lora/decoder/. User can put their scripts here and select it in the UI.
103 103  
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0