Wiki source code of Communicate with ABP End Node on the LPS8-V2 Gateway
Version 40.1 by Kilight Cao on 2022/08/06 15:29
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
3.2 | 1 | (% class="wikigeneratedid" %) |
![]() |
30.2 | 2 | **Table of Contents:** |
![]() |
3.2 | 3 | |
4 | {{toc/}} | ||
5 | |||
![]() |
2.1 | 6 | |
![]() |
3.2 | 7 | |
![]() |
30.2 | 8 | |
9 | = 1. Introduction = | ||
10 | |||
11 | |||
![]() |
3.1 | 12 | The LPS8-V2 of Dragino LoRaWAN gateway can communicate with LoRaWAN ABP End Node, the working is based on the built-in server TTN-Stack. |
![]() |
2.1 | 13 | |
![]() |
30.2 | 14 | **It can be used in some cases such as:** |
![]() |
3.1 | 15 | |
![]() |
2.1 | 16 | * No internet connection. |
17 | * Users want to get data forward in the gateway and forward it to their server based on MQTT/HTTP. | ||
![]() |
3.1 | 18 | * Forward the data to the built-in Application server Node-Red. |
19 | * Just storing the data on the gateway or external storage | ||
![]() |
2.1 | 20 | |
![]() |
30.2 | 21 | **The basic of this feature is the decoding of** (% style="color:blue" %)**LoRaWAN ABP End Node**(%%). **Requirements:** |
22 | |||
![]() |
2.1 | 23 | 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 |
24 | 1. LoRaWAN Gateway model: LPS8-V2 | ||
25 | 1. System version: Since V.12 | ||
26 | |||
27 | |||
![]() |
30.2 | 28 | = 2. Quick Start = |
29 | |||
30 | |||
31 | The default factory version of LPS8-V2 is installed with the Built-in LoRaWAN Server: (% style="color:blue" %)**The Things Network - Stack (Open Source 3.19 Version).** | ||
32 | |||
![]() |
12.1 | 33 | Once the gateway is DHCP an IPV4 address, and then you can access the build-in server TTN-Stack. |
![]() |
2.1 | 34 | |
![]() |
3.1 | 35 | |
36 | |||
![]() |
30.2 | 37 | == 2.1. Configure the gateway mode == |
![]() |
3.1 | 38 | |
39 | |||
![]() |
30.2 | 40 | You can access the gateway's Manage Web UI, via the URL ( (% style="color:blue" %)__**//http:~/~/<hostname> or http:~/~/<local-IPV4-address> //**__(%%)) in your browser |
![]() |
3.1 | 41 | |
![]() |
30.2 | 42 | |
43 | |||
44 | === (% style="color:#037691" %)**Selecting the right frequency band**(%%) === | ||
45 | |||
46 | |||
![]() |
12.1 | 47 | [[image:image-20220802142103-1.png]] |
![]() |
3.1 | 48 | |
49 | |||
![]() |
12.1 | 50 | |
![]() |
30.2 | 51 | === (% style="color:#037691" %)**Configure the Semtech UDP forwarder**(%%) === |
52 | |||
53 | |||
![]() |
12.1 | 54 | [[image:image-20220802142147-3.png]] |
55 | |||
56 | |||
57 | |||
58 | == 2.2. Login to the built-in server TTN-Stack == | ||
59 | |||
![]() |
30.2 | 60 | |
![]() |
12.1 | 61 | You can access the gateway's built-in server of **The Things Network - Stack **via the URL( __**//http:~/~/<hostname>:8080 or http:~/~/<local-IPV4-address:8080> //**__) in your browser. |
62 | |||
63 | Such as __**//http:~/~/dragino-54ff12:8080 or [[http:~~/~~/<Local-IPV4-Address~>>>http://<Local-IPV4-Address>]]//**__ | ||
64 | |||
65 | |||
66 | Login account: | ||
67 | |||
![]() |
30.2 | 68 | (% style="background-color:yellow" %)**User ID: ** ** admin** |
![]() |
12.1 | 69 | |
![]() |
30.2 | 70 | (% style="background-color:yellow" %)**Password: ** ** dragino** |
![]() |
12.1 | 71 | |
72 | |||
73 | [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/WebHome/image-20220725171719-1.png?width=769&height=570&rev=1.1||alt="image-20220725171719-1.png"]] | ||
74 | |||
75 | |||
76 | |||
![]() |
30.2 | 77 | == 2.3. Add the gateway & the sensor == |
78 | |||
79 | |||
![]() |
14.1 | 80 | Here only show the image of the finish, more details about how to add the gateway & sensor refer to this wiki: |
![]() |
12.1 | 81 | |
![]() |
14.1 | 82 | |
![]() |
12.1 | 83 | |
![]() |
30.3 | 84 | === (% style="color:#037691" %)**Add the gateway**(%%) === |
85 | |||
86 | |||
![]() |
12.1 | 87 | [[image:image-20220802142946-5.png]] |
88 | |||
89 | |||
90 | |||
![]() |
30.3 | 91 | === (% style="color:#037691" %)**Add the Sensor**(%%) === |
92 | |||
93 | |||
![]() |
12.1 | 94 | [[image:image-20220802143031-6.png||height="794" width="1375"]] |
95 | |||
96 | |||
97 | |||
![]() |
30.3 | 98 | == 2.4. Add the decoder == |
![]() |
12.1 | 99 | |
![]() |
30.3 | 100 | |
![]() |
14.1 | 101 | If you use dragino sensors then you can find the recorder on this URL: |
102 | |||
![]() |
30.3 | 103 | |
![]() |
12.1 | 104 | [[image:image-20220802143129-7.png]] |
105 | |||
106 | |||
107 | |||
![]() |
30.3 | 108 | == 2.5. Visual Data == |
![]() |
12.1 | 109 | |
![]() |
30.3 | 110 | |
![]() |
14.1 | 111 | In this section, you can be seen that the payload of the sensor has been interpreted as visual data. |
![]() |
12.1 | 112 | |
![]() |
14.1 | 113 | And the next part will discuss where to let the data flow。 |
114 | |||
![]() |
30.3 | 115 | |
![]() |
12.1 | 116 | [[image:image-20220802143214-8.png]] |
117 | |||
118 | |||
![]() |
3.1 | 119 | |
![]() |
30.3 | 120 | = 3. Forward the data or store the data = |
121 | |||
122 | |||
![]() |
14.1 | 123 | You are done most of the work, now you just need to plan the flow of data to where. |
![]() |
3.1 | 124 | |
125 | |||
126 | |||
![]() |
30.3 | 127 | == 3.1 Forward data to an external server based on MQTT/HTTP. == |
![]() |
14.1 | 128 | |
![]() |
30.3 | 129 | |
130 | |||
131 | === (% style="color:#037691" %)**MQTT**(%%) === | ||
132 | |||
133 | |||
![]() |
14.1 | 134 | You need to connect to this public address on your external server and subscribe to the topic **(v3/<application_name>/devices/<devices_name>/up)**. |
135 | |||
136 | |||
137 | [[image:image-20220802144754-9.png]] | ||
138 | |||
![]() |
17.1 | 139 | |
140 | **subscribe to the topic and get the data** | ||
141 | |||
142 | [[image:image-20220802145408-10.png]] | ||
143 | |||
144 | |||
145 | |||
146 | |||
![]() |
30.3 | 147 | === (% style="color:#037691" %)**HTTP**(%%) === |
![]() |
14.1 | 148 | |
![]() |
30.3 | 149 | |
![]() |
17.1 | 150 | [[image:image-20220802145450-11.png||height="676" width="1164"]] |
![]() |
14.1 | 151 | |
![]() |
17.1 | 152 | |
153 | |||
![]() |
30.3 | 154 | == 3.2 Forward data to the built-in application server Node-Red. == |
![]() |
3.1 | 155 | |
156 | |||
![]() |
19.1 | 157 | [[image:image-20220802150715-1.png||height="739" width="1171"]] |
![]() |
14.1 | 158 | |
159 | |||
![]() |
3.1 | 160 | |
![]() |
30.3 | 161 | == 3.3 Just storing the data on the gateway or external storage. == |
![]() |
3.1 | 162 | |
![]() |
14.1 | 163 | |
![]() |
36.1 | 164 | Data can be stored or read by subscribing to topics: (% style="color:#037691" %)**v3/<application_name>/devices/<devices_name>/up**. |
![]() |
17.1 | 165 | |
![]() |
35.1 | 166 | Then add the storage node **(write file)**, Users can download the Node-Red flowchart from this link to test data storage:[[attach:test_data_storage.json||target="_blank"]] |
![]() |
3.1 | 167 | |
![]() |
35.1 | 168 | After the configuration is complete, users can find the node logs in the root/ directory |
169 | |||
170 | [[image:image-20220806144426-2.jpeg||height="540" width="1099"]] | ||
171 | |||
172 | [[image:image-20220806144606-3.jpeg||height="676" width="1102"]] | ||
173 | |||
174 | [[image:image-20220806144336-1.jpeg]] | ||
175 | |||
![]() |
30.3 | 176 | = 4. Sent the downlink to the sensor = |
![]() |
3.1 | 177 | |
![]() |
23.1 | 178 | |
![]() |
30.3 | 179 | Downlinks can be scheduled by publishing the message to the topic (% style="color:#037691" %)** v3/<application_name>/devices/<devices_name>/down/push**. |
![]() |
23.1 | 180 | |
![]() |
30.3 | 181 | (% style="color:red" %)**Note**: **Remember that the format of this topic for The Things Stack Open Source deployment would be (v3/<application_name>/devices/<devices_name>/down/push).** |
182 | |||
![]() |
23.1 | 183 | [[MQTT Server ~| The Things Stack for LoRaWAN (thethingsindustries.com)>>url:https://www.thethingsindustries.com/docs/integrations/mqtt/]] |
184 | |||
185 | |||
186 | Instead of /push, you can also use /replace to replace the downlink queue. Replacing with an empty array clears the downlink queue. Example: | ||
187 | |||
![]() |
27.1 | 188 | (% class="box" %) |
189 | ((( | ||
190 | { | ||
191 | "downlinks": [{ | ||
192 | "f_port": 2, | ||
193 | "frm_payload": "AwAA", | ||
194 | "priority": "HIGH", | ||
195 | "confirmed": true | ||
196 | }] | ||
197 | } | ||
198 | ))) | ||
![]() |
23.1 | 199 | |
![]() |
27.1 | 200 | [[image:image-20220802170358-4.png||height="656" width="898"]] |
![]() |
23.1 | 201 | |
![]() |
27.1 | 202 | |
![]() |
23.1 | 203 | [[image:image-20220802164844-3.png||height="345" width="1131"]] |
204 | |||
![]() |
27.1 | 205 | |
206 | |||
![]() |
30.3 | 207 | **Node-red** |
208 | |||
![]() |
27.1 | 209 | Users can download the Node-Red flowchart for testing [[attach:mqtt-test.json||target="_blank"]] |
210 | |||
211 | |||
![]() |
29.1 | 212 | [[image:image-20220802172021-6.png||height="455" width="1240"]] |
213 | |||
![]() |
30.3 | 214 | |
215 | |||
216 | = 5. Trouble Shootings = | ||
217 | |||
218 | |||
219 |