Wiki source code of LoRaWAN IoT Kit v3 User Manual

Version 14.1 by Xiaoling on 2022/11/21 16:45

Hide last authors
Xiaoling 6.2 1 (% style="text-align:center" %)
2 [[image:1669017918121-199.png||height="359" width="358"]]
3
4
5
6
7
8
9
10
11
12
13
14 = 1. Overview =
15
16 == 1.1 What is Dragino LoRaWAN IoT Kit v3? ==
17
18
19 (((
20 (% style="color:blue" %)**Dragino LoRaWAN IoT Kit v3**(%%) is designed to facilitate beginners and developers to quickly learn and demonstrate LoRa/LoRaWAN and IoT technology. It helps users to turn the idea into a practical application and make the Internet of Things a reality.
21 )))
22
23 (((
24 The LoRaWAN IoT Kit v3 can be used to evaluate the multi-channel LoRaWAN solution and single-channel private LoRa solution. Users can also use LoRaWAN IoT Kit v3 to test different network structure solutions and find the best for their IoT solution.
25 )))
26
27 (((
28 The LoRaWAN IoT kit v3 (% style="color:blue" %)**shows how to build a LoRaWAN network**(%%), and (% style="color:blue" %)**how to use the network to send data from a LoRa sensor node to the cloud server.** (%%)Depends on the actually use environment, the LoRaWAN gateway will connect your other LoRa nodes up to 500 ~~ 5,000 meters.
29 )))
30
31
32 == 1.2 Features ==
33
34 * Open Source LoRa/LoRaWAN kits
35
36 * Support multi-channels LoRaWAN and Single-Channel LoRa
37
38 * Support various network structures
39
40
41
42 == 1.3 What can you learn from the kit? ==
43
44
45 (% style="color:blue" %)**The goals through this LoRaWAN IoT kit v3**:
46
47 * Understand the structure of an Internet of Things network, and how does an IoT network works
48
49 * Learn coding method for Arduino micro controller
50
51 * Learn some common sensors.
52
53 * Learn some basic commands for Linux
54
55 * Learn about LoRaWAN and how to set up a LoRaWAN network.
56
57 * Learn about Node-Red and how to set up it as IoT server and plot data.
58
59 * Learn different way to connect LoRaWAN network to IoT Server and compare their advantages / disadvantages.
60
61
62 == 1.4 What parts Dragino LoRa IoT v3 includes? ==
63
64
65 [[image:1669019631002-626.png]]
66
67
68
69 (% style="color:blue" %)**LoRaWAN IoT Kit v3 Packing List**:
70
71 * [[LPS8v2>>url:https://www.dragino.com/products/lora-lorawan-gateway/item/228-lps8v2.html]] LoRaWAN Gateway
72
73 * [[LA66 LoRaWAN Shield>>url:https://www.dragino.com/products/lora/item/231-la66-lorawan-shield.html]] for Arduino
74
75 * [[LA66 USB LoRaWAN Adapter>>url:https://www.dragino.com/products/lora/item/232-la66-usb-lorawan-adapter.html]] for PC/Mobile/RPi
76
77 * 1 x DHT11 Temperature & Humidity Sensor
78
79 * 1 x RGB LED
80
81 * 20 x dupont cable (male to male)
82
83 * 20 x dupont cable (female to female)
84
85 * 20 x dupont cable (male to female)
86
87
88
89 = 2. Example 1: Test a LoRaWAN network =
90
91
92 This example describes how to use LPS8v2, LA66 Shield & LA66 USB to set up a LoRaWAN network and connect it to [[TTNv3 LoRaWAN Server>>url:https://accounts.thethingsindustries.com/]]. It also shows how to use external application server to monitor / manage the LoRa Nodes.
93
94 The network structure of this example is as below.
95
96
97 [[image:1669019691933-772.png]]
98
99
100 (% style="color:blue" %)**STEPS:**
101
102 ~1. Register LPS8v2 gateway to TTN so provide a LoRaWAN coverage. See section “[[Gateway Registration for Semtech UDP ~~-~~-~> Primary LoRaWAN Server>>url:http://wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20TTN/#H2.A0GatewayRegistrationforSemtechUDP]]” 
103
104 2. Register LA66 Shield to TTN and uplink Temperature to TTN. See section “[[Example: Log Temperature Sensor(DHT11) and send data to TTN, show it in Node-RED>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/#H1.7A0Example:LogTemperatureSensor28DHT1129andsenddatatoTTN2CshowitinNode-RED.]].”
105
106 3. Register LA66 USB to TTN and track people location. See “[[Example: Use of LA66 USB LoRaWAN Adapter and mobile APP>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20USB%20LoRaWAN%20Adapter%20User%20Manual/#H1.9A0Example:UseofA0LA66USBLoRaWANAdapterandmobileAPP]]”
107
108
109 (% style="color:blue" %)**Result:**
110
111 [[image:1669019732684-677.png]]
112
113
114
115 = 3. Example 2: Test Built-In LoRaWAN Server =
116
117 This example describes how to use LPS8v2, LA66 Shield & LA66 USB to set up a LoRaWAN network and connect it to built-in LoRaWAN Server in. It also shows how to use external application server to monitor / manage the LoRa Nodes.
118
119 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image005.png]]
120
121 This example is almost the same as Example1, the difference is that this example use the built-in LoRaWAN server (TTNv3 Stack) in LPS8v2. While Example 1 use the public TTN server.
122
123
124 TTN v3 stack has the same configure method as the public TTN server. When user test example 2 here. User need to log in the TTNv3 stack in LPS8v2 as per below:
125
126
127 Input URL( __http:~/~/<hostname>:8080 or http:~/~/<local-IPV4-address> __) in your browser.
128
129 Such as  __http:~/~/dragino-54ff12:8080  or http:~/~/<Local-IPV4-Address>__
130
131 (% style="color:blue" %)**Login account:**
132
133 User ID:  admin
134
135 Password:  dragino
136
137 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image006.png||alt="image-20220725171719-1.png"]]
138
139
140
141 = 4. Example 3: Test Built-in LoRaWAN server and Application server =
142
143 This example describes how to use LPS8v2, LA66 Shield & LA66 USB to set up a LoRaWAN network and connect it to built-in LoRaWAN Server in. It also shows how to use external application server to monitor / manage the LoRa Nodes.
144
145
146 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image007.png]]
147
148 This example is quite similiar as Example2, the difference is that this example use the built-in Application server (Node-Red) in LPS8v2. While Example 2 use the public Node-Red
149
150
151 Below is the Node-Red access instruction of LPS8v2:
152
153 You can access the gateway's built-in AS server of Node-Red via the URL(__http:~/~/<hostname>:1880 or http:~/~/<local-IPV4-address>__) in your browser.
154
155 Such as __http:~/~/dragino-54ff12:1880  or http:~/~/<Local-IPV4-Address>__
156
157 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image008.png||alt="image-20220725172124-3.png"]]
158
159
160
161 = 5. Example 4: Peer to Peer Test on end node =
162
163 This example describes how to test peer to peer communicate between LoRa End Node.
164
165 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image009.png]]
166
167 In this example, the end nodes LA66 Shield and LA66 USB are not use LoRaWAN protocol. Users need to flash them with the firmware support private LoRa.
168
169 * Software Location: [[LA66 Peer to Peer firmware>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/Instruction%20for%20LA66%20Peer%20to%20Peer%20firmware/]]
170
171 * How to Flash Firmware: [[For LA66 Shield>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/#H1.9A0UpgradeFirmwareofLA66LoRaWANShield]] , For [[LA66 USB>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20USB%20LoRaWAN%20Adapter%20User%20Manual/#H1.10A0UpgradeFirmwareofLA66USBLoRaWANAdapter]].
172
173 This example will show how to get Temperature sensor value from LA66 Shield and send it to LA66 USB. LA66 USB is connected to mobile phone. So user can see the temperature value in mobile phone directly . User can also send message from mobile phone to LA66 to control the RGB LED.
174
175
176
177 == 5.1 Set Up LA66 Shield + UNO ==
178
179 === 5.1.1 Set up LA66 Module ===
180
181 LA66 Module is loaded with the firmware [[LA66 Peer to Peer firmware>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/Instruction%20for%20LA66%20Peer%20to%20Peer%20firmware/]] and user can use AT Command to set up LA66 with below parameters:
182
183
184 AT+FRE=904.100,904.100  ~-~--> TX and RX frequency set: 9041100000
185
186 AT+BW=0,0  ~-~--> TX and RX Bandwidth set: 125kHz
187
188 AT+SF=12,12  ~-~--> TX and RX Spreading Factor set: SF10
189
190 AT+CRC=1,1  ~-~--> 0: CRC OFF ,1: CRC ON
191
192 AT+HEADER=0,0  ~-~--> Header Type: explicit, explicit
193
194 AT+CR=1,1  ~-~--> CR: 4/5, 4/5
195
196 AT+IQ=0,0  ~-~--> Invert IQ: 0,0
197
198 AT+PREAMBLE=8,8  ~-~--> TX and RX Preamble Length set: 8
199
200 AT+SYNCWORD=0  ~-~--> Syncword**(0: private,1: public)**
201
202 AT+RXMOD=6,0  ~-~--> Rx Timeout and Reply mode
203
204
205
206 === 5.1.2 Hardware Connection ===
207
208 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image010.png]]
209
210 There is a sensor DHT11 (Temperature & Humidity sensor) and LED RGB connected to LA66 Shield + UNO. Please use the connection as we show in the photo.
211
212
213
214
215 === 5.1.3 Set up Arduino UNO ===
216
217 The sketch for this example is [[Log-Temperature-Sensor-and- Control-RBG-LED.ino>>url:https://www.dropbox.com/sh/r5l3h5fhifrqbxn/AACgNoQ-aYnvWOxGwUDWxNlFa?dl=0]]
218
219
220 Upload the code to UNO:
221
222 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image011.png]]
223
224
225 Check the LA66 Shield data: [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image012.png]]
226
227
228 == 5.2 Set Up LA66 USB ==
229
230 LA66 USB is loaded with the firmware [[LA66 Peer to Peer firmware>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/Instruction%20for%20LA66%20Peer%20to%20Peer%20firmware/]] and user can use AT Command to set up LA66 USB with below parameters:
231
232
233 AT+FRE=904.100,904.100  ~-~->TX and RX frequency set: 904100000 
234
235 AT+BW=0,0     ~-~->TX and RX Bandwidth set: 125kHz
236
237 AT+SF=10,10   ~-~->TX and RX Spreading Factor set: SF10 
238
239 AT+CRC=1,1     ~-~->0: CRC OFF ,1: CRC ON
240
241 AT+HEADER=0,0     ~-~->Header Type: explicit, explicit
242
243 AT+CR=1,1       ~-~->CR: 4/5, 4/5
244
245 AT+IQ=0,0       ~-~->Invert IQ: 0,0
246
247 AT+PREAMBLE=8,8 ~-~->TX and RX Preamble Length set: 8
248
249 AT+SYNCWORD=0  ~-~->Syncword**(0: private,1: public)**
250
251 AT+RXMOD=65535,0      ~-~->Set the receive mode
252
253 AT+RXDAFORM=1  ~-~->ASCII to string
254
255 Users using USB to Type-C adapter is needed to connect to a Mobile phone, Users need to download the USB Serial APP in their phones.
256
257 For example, [[USB Serial Console>>url:https://play.google.com/store/apps/details?id=jp.sugnakys.usbserialconsole]] (Android Version Only)
258
259
260 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image013.png]]
261
262
263 The serial port configuration for LA66 USB is as follows:
264
265 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image014.jpg]] [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image015.jpg]]
266
267
268
269 == 5.3 Test result ==
270
271 Users can view the temperature and humidity information received by LA66 USB in the mobile APP
272
273 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image016.png]] [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image017.jpg]]
274
275 Send a message to the LA66 USB control LA66 Shield + UNO external RBG LED through the mobile phone:
276
277
278 For example, if you send AT+SEND=1,000101,2,0 the RBG LED will light up red.
279
280 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image018.png]]
281
282 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image019.jpg]]
283
284
285
286
287 = 6. Example 5: Peer to Peer Test and plot the data in LPS8v2 =
288
289 This example describes how to test peer to peer communicate between LoRa End Node and LoRa Gateway.
290
291 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image020.png]]
292
293 In this example, the end nodes LA66 Shield and LA66 USB are not use LoRaWAN protocol. Users need to flash them with the firmware support private LoRa.
294
295 * (% style="color:blue" %)Software Location(%%): [[LA66 Peer to Peer firmware>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/Instruction%20for%20LA66%20Peer%20to%20Peer%20firmware/]]
296
297 * (% style="color:blue" %)How to Flash Firmware(%%): [[For LA66 Shield>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/#H1.9A0UpgradeFirmwareofLA66LoRaWANShield]] , For [[LA66 USB>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20USB%20LoRaWAN%20Adapter%20User%20Manual/#H1.10A0UpgradeFirmwareofLA66USBLoRaWANAdapter]].
298
299 This example will show how to get Temperature sensor value from LA66 Shield and send it to LA66 USB. LA66 USB is connected to LPS8v2. LPS8v2 will receive the data from LA66 USB and plot the data in the built-in Node-Red server.
300
301 (% style="color:red" %)**Notice:**
302
303 1. LPS8v2 has LoRaWAN concentrator which doesn’t do anything in this example. This example doesn’t need this SX1302 concentrator.
304 2. For mass deployment, user can use the LG01v2 instead of LPS8v2+LA66 USB. LG01v2 already include LA66 module inside.
305
306 Use can check [[THIS LINK>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/LG01v2/#H5.2Example:LG01v2]] for an instruction of this example. In the link it uses LG01v2 as example, the use for LPS8v2+LA66 USB is the same as LG01v2.
307
308
309
310
311 = 7. Example 6: Limited LoRaWAN relay =
312
313
314 This example describes a limited LoRaWAN relay method with the use of LA66 module.
315
316
317 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image021.png]]
318
319
320 In this example, the end nodes LA66 Shield and LA66 USB are not use LoRaWAN protocol. Users need to flash them with the firmware support private LoRa.
321
322 * (% style="color:blue" %)**Software Location**(%%): [[LA66 USB use LoRaWAN firmware>>url:https://www.dropbox.com/sh/els49fz9rd6fu1y/AAAt-kKIvXu1ZOK0hWysq97na?dl=0]], [[LA66 Shield use Point to Point firmware>>url:https://www.dropbox.com/sh/els49fz9rd6fu1y/AAAt-kKIvXu1ZOK0hWysq97na?dl=0]].
323
324 * (% style="color:blue" %)**How to Flash Firmware**(%%): [[For LA66 Shield>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/#H1.9A0UpgradeFirmwareofLA66LoRaWANShield]] , For [[LA66 USB>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20USB%20LoRaWAN%20Adapter%20User%20Manual/#H1.10A0UpgradeFirmwareofLA66USBLoRaWANAdapter]].
325
326 (% style="color:red" %)Note: LA66 USB use a LoRaWAN version firmware and user need to set it to work in fix frequency, fix DR and ABP mode. LA66 already register to TTNv3 in ABP mode.
327
328
329 == 7.1 Set up LA66 USB ==
330
331 LA66 USB is loaded with the firmware [[LA66 USB use LoRaWAN firmware>>url:https://www.dropbox.com/sh/els49fz9rd6fu1y/AAAt-kKIvXu1ZOK0hWysq97na?dl=0]] and user can use AT Command to set up LA66 with below parameters:
332
333 AT+CHS=904100000    ~-~-> Fix frequency
334
335 AT+NJM=0            ~-~->Set the ABP mode
336
337 AT+ADR=0            ~-~->Close ADR
338
339 AT+DR=0             ~-~-> Fix DR=0
340
341 Set up LA66 USB t work in ABP mode, use fix frequency(904100000) and fix DR0(SF10) to transmit data.
342
343
344
345 == 7.2 Set up LA66 Shield ==
346
347 LA66 Shield is loaded with the firmware [[LA66 Shield use Point to Point firmware>>url:https://www.dropbox.com/sh/els49fz9rd6fu1y/AAAt-kKIvXu1ZOK0hWysq97na?dl=0]], LA66 Shield as Relay needs to be configured as follows:
348
349 AT+FRE=904.100,904.100  ~-~->TX and RX frequency set: 904100000 
350
351 AT+BW=0,0     ~-~->TX and RX Bandwidth set: 125kHz
352
353 AT+SF=10,10   ~-~->TX and RX Spreading Factor set: SF10(corresponding toDR=0)
354
355 AT+CRC=1,1     ~-~->0: CRC OFF ,1: CRC ON
356
357 AT+HEADER=0,0     ~-~->Header Type: explicit, explicit
358
359 AT+CR=1,1       ~-~->CR: 4/5, 4/5
360
361 AT+IQ=0,0       ~-~->Invert IQ: 0,0
362
363 AT+PREAMBLE=8,8 ~-~->TX and RX Preamble Length set: 8
364
365 AT+SYNCWORD=1  ~-~->Syncword**(0: private,1: public)**
366
367 AT+RXMOD=65535,1      ~-~->Set the Relay mode
368
369 AT+WAITTIME=1000      ~-~->Relay wait time 1000ms
370
371
372
373 == 7.3 Uplink test ==
374
375 Users can connect to the LA66 USB using the serial port tool and enter the AT command: AT+SENDB=01,02,8,05820802581ea0a5
376
377 Command format:  AT+SENDB=<confirn_status>,<Fport>,<data_len>,<data>
378
379 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image022.png]]
380
381
382 In addition, users can also access LA66 USB using the mobile app [[Download Link for Android apk >>url:https://www.dropbox.com/sh/zxwx16qb777uvkz/AABE_P8coGCQ4DAC8enH4bUya?dl=0]] (Android Version Only)
383
384 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image023.jpg]]
385
386
387
388 == 7.4 Test result ==
389
390 See two duplicate messages on Gateway Traffic.
391
392 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image024.png]]
393
394
395 Bring LA66 USB and walk to a remote location to get the max distance. At this point,RSSi=-134 SNR=13.8, Go back 100 meters and put the LA66 Shield (Relay) in the location, Due to the following examples, there may be errors in the test in the urban area.
396
397 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image025.png]]
398
399
400
401 Without Relay, the LA66 USB can reach about 833meters. [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image026.png]]
402
403 With Relay, the LA66 USB can reach around 2km.
404
405 [[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image027.jpg]]
406
407
408
409
410
411
412 = 8. Technical Support =
413
414 * 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.
415
416 * 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
417
418 [[support@dragino.com>>url:file:///D:/市场资料/说明书/LoRa/LG02/support@dragino.com]]
419
420
421
422 = 9. Reference =
423
424 1. [[LoRaWAN official website. And Technicel document for LoRaWAN.>>url:https://lora-alliance.org/lorawan-for-developers]]
425
426 2. [[LoRa Low Energy design guide>>url:https://www.semtech.com/uploads/documents/LoraLowEnergyDesign_STD.pdf]] and [[Calculator Tool>>url:https://www.semtech.com/uploads/documents/SX1272LoRaCalculatorSetup1_1.zip]].
427
428 3. About Distance: [[LoRa Modem Design Guide>>url:https://www.semtech.com/uploads/documents/LoraDesignGuide_STD.pdf]]
429
430 4. User Manual: [[LPS8v2>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/HP0C/]], [[LA66 LoRaWAN Shield>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20LoRaWAN%20Shield%20User%20Manual/]] , [[LA66 USB LoRaWAN Adapter>>url:http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LA66%20USB%20LoRaWAN%20Adapter%20User%20Manual/]]
431