Wiki source code of Notes for TTN

Version 243.4 by Xiaoling on 2025/08/04 14:50

Show last authors
1 **~ Table of Contents:**
2
3 {{toc/}}
4
5
6
7 = 1. The Things Network-V3 =
8
9 == 1.1  Introduction ==
10
11 === 1.1.1  What is The Things Network ===
12
13
14 (((
15 The Things Network is a global collaborative Internet of Things ecosystem that creates networks, devices and solutions using LoRaWAN.
16 )))
17
18 (((
19 The Things Network runs The Things Stack Community Edition, which is a crowdsourced, open and decentralized LoRaWAN network. This network is a great way to get started testing devices, applications, and integrations, and get familiar with LoRaWAN.
20
21
22 )))
23
24 === 1.1.2  Login or crate an account ===
25
26
27 (((
28 [[Login or create an account>>url:https://console.cloud.thethings.network/]] to get started with The Things Network and start using The Things Stack Console.
29 )))
30
31 (((
32 Once you have an account,get started by following steps for adding Gateway,Device and Intergrations.
33
34
35 )))
36
37 === 1.1.3  List the support products and Requirements ===
38
39
40 LoRaWAN Gateway model: Existing Gateway
41
42
43 = 2.  Gateway Registration for Semtech UDP =
44
45
46 (% style="color:red" %)**Note: Steps 2 and 3 are different connection methods, the user only needs to choose one of them**
47
48
49 == 2.1  Primary LoRaWAN Server ==
50
51
52 [[image:image-20220526134633-2.png||_mstalt="430196" height="540" width="1160"]]
53
54 Register Gateway
55
56
57 [[image:image-20231121092510-1.png||height="617" width="1157"]]
58
59
60 Put Gateway ID
61
62
63 [[image:image-20231121092543-2.png||height="613" width="1159"]]
64
65
66 Choose Frequency Band
67
68
69
70 (% style="color:red" %)**Note:**
71
72 DRAGINO - Frequency Plan list  ~-~-~-~-~-~-~-~-~-~-~-~-~-~--  The Thing Network Frequency Plan List
73
74 AS923-1 (920-923)  (% style="display:none" %) (%%) ~-~-~-~-~-~-~-~-~-~-~-~-~-~--  Asia 920-923 Mhz
75
76 AS923-1 (923-925)  ~-~-~-~-~-~-~-~-~-~-~-~-~-~--  Asia 915-928 Mhz (AS923 Group 1)with only default channels
77
78 AS923-2 (921.4-922.8)  ~-~-~-~-~-~-~-~-~-~-~-~-~-~--  Asia 920-923 Mhz (AS923 Group 2)with only default channels
79
80 AS923-3 (916.6-918.2)  ~-~-~-~-~-~-~-~-~-~-~-~-~-~--  Asia 915-921 Mhz (AS923 Group 3)with only default channels
81
82 AS923-4 (917.3-918.7)  ~-~-~-~-~-~-~-~-~-~-~-~-~-~--  Asia 917-920 Mhz (AS923 Group 4)with only default channels
83
84
85 [[image:image-20220726134642-1.png||_mstalt="430287" height="344" width="660"]][[image:image-20220726135827-3.png||_mstalt="432978" height="214" width="394"]][[image:image-20220726135759-2.png||_mstalt="433953" height="218" width="554"]]
86
87 [[image:image-20231121092627-3.png||height="617" width="1174"]]
88
89
90 [[image:image-20220526134919-5.png||_mstalt="433602"]]
91
92 Show Status
93
94
95 == 2.2  Secondary LoRaWAN Server ==
96
97 === 2.2.1  Introduction ===
98
99
100 The Dragino gateway has supports the Secondary server settings.
101
102
103 === 2.2.2  Below list the support products and Requirements: ===
104
105
106 (((
107 1.  LoRaWAN Gateway model:  [[LIG16>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/171-lig16.html]],[[LG308N>>url:https://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/LG308N%20-%20LoRaWAN%20Gateway%20User%20Manual/]], [[DLOS8N>>url:https://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/DLOS8N/]],[[LPS8N>>url:https://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/LPS8N%20-%20LoRaWAN%20Gateway%20User%20Manual/]]
108 )))
109
110 (((
111 2.  Firmware version since :  [[lgw~~-~~-build-v5.4.1644658774>>url:http://www.dragino.com/downloads/index.php?dir=LoRa_Gateway/LIG16/Firmware/Release/]]
112 )))
113
114
115 === 2.2.3  Example ===
116
117
118 The following takes Helium as a Secondary LoRaWAN server as an example
119
120
121 === 2.2.4  Step 1: Download and Install the helium gateway-rs ===
122
123
124 The users is needing to download and install the helium gateway-rs then click the button of (% style="color:blue" %)**Save&Apply.**
125
126
127 [[image:image-20220526135049-6.png||_mstalt="432432"]]
128
129 Download and Install gateway-rs
130
131
132 === 2.2.5  Step 2: Back to Semtech UDP page ===
133
134
135 Back to the page of Semtech UDP check the secondary server settings and click the button of (% style="color:blue" %)**Save&Apply.**
136
137
138 ​​​​[[image:image-20220526135125-7.png||_mstalt="431106"]]
139
140 Configuration of helium
141
142
143 = 3.  Gateway Registration for Basics Station =
144
145 == 3.1  Introduction ==
146
147
148 (((
149 (((
150 The LoRa Basics™ Station protocol simplifies the management of large-scale LoRaWAN networks. LoRa Basics™ Station is the preferred way of connecting Gateways to The Things Stack. [[The LoRa Basics Station doc>>url:https://www.thethingsindustries.com/docs/gateways/lora-basics-station/]]
151
152 (% style="color:red" %)**Note: Steps 2 and 3 are different connection methods, the user only needs to choose one of them**
153
154
155 )))
156 )))
157
158 (((
159 (% style="color:blue" %)**Below list the support products and Requirements:**
160 )))
161
162 (((
163 (((
164 1. LoRaWAN Gateway model:  [[LIG16>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/171-lig16.html]], [[LG308N>>url:https://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/LG308N%20-%20LoRaWAN%20Gateway%20User%20Manual/]], [[DLOS8N>>url:https://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/DLOS8N/]],[[LPS8N>>url:https://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20All%20Gateway%20models/LPS8N%20-%20LoRaWAN%20Gateway%20User%20Manual/]]ccccccccccc
165 )))
166
167 (((
168 2.  Firmware version since :  [[lgw~~-~~-build-v5.4.1640315898>>url:https://www.dragino.com/downloads/index.php?dir=LoRa_Gateway/LPS8/Firmware/Release/]]
169
170
171 )))
172 )))
173
174 (((
175 (% style="color:blue" %)**What do you need to prepare?**
176 )))
177
178 (((
179 (((
180 A gateway that can access the internet normally
181
182
183 )))
184 )))
185
186 == 3.2  Step 1: Register Gateway ==
187
188
189 (((
190 (((
191 (% style="color:blue" %)**The example for**(%%)** the (% style="color:red" %)EU:(%%)**
192 )))
193 )))
194
195 (((
196 (((
197 Click the 'Register Gateway' button will get this page to register the gateway from The Thing Network Console gateway page.
198
199 [[image:image-20230728144218-7.png||_mstalt="433290" height="128" width="836"]]
200 )))
201 )))
202
203 [[image:image-20230728143449-2.png||_mstalt="433108"]]
204
205 Register Gateway
206
207
208 == 3.3  Step 2: Create the API key ==
209
210
211 **API Key can be created manually**  ~-~-->  if users forgot to check the check box or switch to basic station mode from the Semtech UDP mode
212
213
214
215
216 **or generate by TTN by checking the check box when registering the gateway** ~-~-->[[image:image-20230728143505-3.png||_mstalt="431132"]]
217
218
219 === **1.) Generated by TTH** ===
220
221
222 Users need to download these two key files and fill them into the gateway's TTN Basics Station configuration,
223
224 [[image:image-20230728150521-2.png||height="664" width="1019"]]
225
226
227 (% style="color:red" %)**Note:**(%%) The "**Authorization: Bearer** " field should not be entered in the TTN Basics Station configuration of the gateway
228
229 [[image:image-20230728151807-3.png||height="423" width="1024"]]
230
231
232 === **2.) Manually create API KEY: ** ===
233
234
235 ==== CUPS API KEY ====
236
237 [[image:image-20220526135349-9.png||_mstalt="434460"]]
238
239
240
241 ==== LNS API KEY ====
242
243 [[image:image-20220526135428-10.png||_mstalt="453791"]]
244
245
246 (% style="color:red" %)**Note: If your API is generated by yourself you have to update the key to the gateway setting.**
247
248
249 ==== Update the gateway setting ====
250
251
252 In the LoRa Basics Station LNS Authentication Key field, paste the API key you generated in the previous step.
253
254
255 [[image:image-20220526135528-11.png||_mstalt="454480"]]
256
257 paste the API key
258
259
260 == 3.5  Step 4: Access the gateway GUI ==
261
262
263 User need to update the API key and install the Certificate
264
265 [[image:image-20220526135601-12.png||_mstalt="452153"]]
266
267 Access the gateway GUI
268
269
270 == 3.6  Step 5: Configure Station ==
271
272
273 User need to input Server URI, Server CUPS Key and LNS Key, as well as install CUPS certificate.
274
275
276 (% style="color:blue" %)**just to clarify:**
277
278 (% class="box" %)
279 (((
280 CUPS Server URI  ~-~->  Server Address, Example: https:~/~/eu1.cloud.thethings.network:443
281 CUPS Authorization Key         ~-~->  Server CUPS API Key
282 LNS Authorization Key  ~-~->  Server LNS API Key
283 CUPS certificate  ~-~->  Server CA(user can use the button to install the certificate by default)
284 )))
285
286 [[image:image-20220526135654-13.png||_mstalt="455169"]]
287
288 Congfigure Station
289
290
291 == 3.7  Start Station ==
292
293
294 (((
295 When the user has finished the configuration,Please click Sace&Apply to start station to connect The Things Network.
296
297
298 )))
299
300 == 3.8  Successful Connection ==
301
302
303 If user completes the above steps,which will see live date in the TTN.
304
305
306 [[image:image-20220526135734-14.png||_mstalt="455208"]]
307
308 Station live date
309
310
311 == 3.9  Trouble Shooting ==
312
313
314 User can check the station log in the** (% style="color:blue" %)LogRead ~-~-> System Log (%%)**page.
315
316
317 [[image:image-20220526135845-15.png||_mstalt="456560"]]
318
319 Station Log
320
321
322
323 and recode the station log in the** (% style="color:blue" %)LogRead  ~-~->  Recode Log(%%)** page.
324
325 [[image:image-20220526135940-16.png||_mstalt="455559"]]
326
327 Recore Log
328
329
330 = 4.  Configure node connection to TTNv3 =
331
332
333 (((
334 (((
335 Following is an example for how to join the TTN v3 LoRaWAN Network.
336 )))
337 )))
338
339 (((
340 (((
341 The gateway is already set up to connect to the TTN network, so we now need to configure the TTNv3 server.
342 )))
343 )))
344
345 (((
346 (((
347 (% style="color:#037691" %)**We take LES01 as an example.**
348
349
350 )))
351 )))
352
353 == 4.1  Step 1 ==
354
355
356 (((
357 (((
358 Create a device in TTN with the OTAA keys from LSE01.
359 )))
360 )))
361
362 (((
363 (((
364 Each LSE01 is shipped with a sticker with the default device EUI as below:
365 )))
366 )))
367
368 (((
369 (((
370 You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
371 )))
372 )))
373
374 [[image:image-20230221135445-1.png||_mstalt="428714" height="356" width="777"]]
375
376 First create an application and fill in the custom information in it
377
378 [[image:image-20230221135520-2.png||_mstalt="427050" height="52" width="974"]]
379
380 [[image:image-20230221135810-3.png||_mstalt="428025" height="400" width="638"]]
381
382
383 Add a node device to the application
384
385
386 [[image:image-20220526140044-18.png||_mstalt="453648"]]
387
388
389 == 4.2  Step 2 ==
390
391
392 (((
393 (((
394 There are all our nodes in the repository. Users can choose the corresponding brand, model, firmware version and frequency.The decoder and configuration information of the node are pre-configured.Users do not need to configure them.
395
396 [[image:image-20230221164809-2.png||_mstalt="430937" height="525" width="617"]]
397 )))
398 )))
399
400
401 == 4.3  Step 3 ==
402
403
404 Add APP EUI in the application:
405
406
407 [[image:image-20230221140131-4.png||_mstalt="425984" height="569" width="674"]]
408
409
410 == 4.4  Step 4 ==
411
412
413 **Add APP KEY and DEV EUI:**
414
415
416 [[image:image-20230221140448-6.png||_mstalt="430339" height="535" width="647"]]
417
418
419 = 5.  TTN V3 integrated into MQTT server =
420
421 == 5.1  Introduction ==
422
423
424 (((
425 (((
426 The Application Server exposes an MQTT server to work with streaming events. In order to use the MQTT server you need to create a new API key, which will function as connection password. You can also use an existing API key, as long as it has the necessary rights granted.
427
428
429 )))
430 )))
431
432 == 5.2  Create device steps at MQTT ==
433
434
435 (((
436 (((
437 The user creates a new API KEY after creating a device on TTN V3.
438 )))
439 )))
440
441 (((
442 (((
443 Then copy the password and open MQTT.fx.
444 )))
445 )))
446
447 (((
448 (((
449 Fill in Broker Address and Broker port.
450
451
452 )))
453 )))
454
455 [[image:image-20220526140347-22.png||_mstalt="453700"]]
456
457 Fill in the username and password into MQTT.
458
459
460
461 [[image:image-20220526140420-23.png||_mstalt="451373"]]
462
463
464 The Application Server publishes uplink traffic on the following topics:
465
466 (% class="box" %)
467 (((
468 v3/{application id}@{tenant id}/devices/{device id}/join
469 v3/{application id}@{tenant id}/devices/{device id}/up
470 v3/{application id}@{tenant id}/devices/{device id}/down/queued
471 v3/{application id}@{tenant id}/devices/{device id}/down/sent
472 v3/{application id}@{tenant id}/devices/{device id}/down/ack
473 v3/{application id}@{tenant id}/devices/{device id}/down/nack
474 v3/{application id}@{tenant id}/devices/{device id}/down/failed
475 v3/{application id}@{tenant id}/devices/{device id}/service/data
476 v3/{application id}@{tenant id}/devices/{device id}/location/solved
477 )))
478
479 (((
480
481
482 (((
483 (% style="color:red" %)**Note**: **Remember that the format of these topics for The Things Stack Open Source would contain {application id} instead of {application id}@{tenant id}.**
484
485
486 )))
487 )))
488
489 [[image:image-20220526140452-24.png||_mstalt="453401"]]
490
491
492 (((
493 (((
494 While you could subscribe to all of these topics separately, for the simplicity of this tutorial we use # to subscribe to all topics, i.e. to receive all uplink traffic.
495 )))
496 )))
497
498 [[image:image-20220526140708-25.png||_mstalt="455117"]]
499
500 (((
501 (((
502 Downlinks can be scheduled by publishing the message to the topic v3/{application id}@{tenant id}/devices/{device id}/down/push.
503 )))
504 )))
505
506 (((
507 (((
508
509
510 (% style="color:red" %)**Note**: **Remember that the format of this topic for The Things Stack Open Source deployment would be v3/{application id}/devices/{device id}/down/push.**
511
512
513 )))
514 )))
515
516 (((
517 (((
518 Instead of /push, you can also use /replace to replace the downlink queue. Replacing with an empty array clears the downlink queue. Example:
519 )))
520 )))
521
522 [[image:image-20220526140856-26.png||_mstalt="456755"]]
523
524 (((
525 To send an unconfirmed downlink message to the device dev1 in application app1 in tenant tenant1 with the hexadecimal payload BE EF on FPort 15 with normal priority, use the topic v3/app1@tenant1/devices/dev1/down/push with the following contents: **vu8=**, which is the Base64 format for Hex BE EF  . **[[HEX to Base64 online converter tool>>https://base64.guru/converter/encode/hex]]**.
526
527 [[image:image-20240325082631-1.png||height="393" width="815"]]
528
529
530 Below is the TTN output for this downlink command.
531 )))
532
533 [[image:image-20220526140936-27.png||_mstalt="456794"]]
534
535
536 == 5.3  Send Downlink message ==
537
538
539 (((
540 How to configure downlink in TTN V3?
541 )))
542
543 (((
544 A few examples: set the transmission interval to 90 seconds.
545 )))
546
547 (((
548 (% style="color:blue" %)**Downlink command: 01 00 00 5A**
549
550
551 )))
552
553 [[image:image-20220526141021-28.png||_mstalt="452647"]]
554
555 downlink
556
557
558
559 After sending, you can view it in live data.
560
561 [[image:image-20220526141052-29.png||_mstalt="454337"]]
562
563 downlink
564
565
566
567 (((
568 When downlink is successfully sent, the downlink information can be received on the serial port.
569 )))
570
571 (((
572 (% style="color:red" %)**Note**:** If the downlink byte sent is longer, the number of bytes will be displayed.**
573
574
575 )))
576
577 [[image:image-20220526141116-30.png||_mstalt="451672"]]
578
579 downlink
580
581
582 (((
583 (((
584 If you want to get a successful reply to send downlink in TTN v3. You need to set the response level.
585 )))
586 )))
587
588 (((
589 (((
590 If the equipment uses (% style="color:blue" %)**CLASS A**(%%). You can set (% style="color:red" %)**AT+RPL=2** (%%)or send the downlink command: (% style="color:red" %)**2102**
591 )))
592 )))
593
594 (((
595 (((
596 If the equipment uses (% style="color:blue" %)**CLASS C**(%%). You can set** (% style="color:red" %)AT+RPL=4(%%)** or send the downlink command: (% style="color:red" %)**2104**
597 )))
598 )))
599
600 (((
601 (((
602 When the device successfully receives the downlink, the server will receive a confirmation packet of 00.
603
604
605 )))
606 )))
607
608 [[image:image-20220526141149-31.png||_mstalt="454038"]]
609
610 downlink
611
612
613 = 6.  Route TTN data to Node-Red =
614
615
616 Users can create an MQTT integration by following the steps described in "[[5.TTN V3 Integrated into MQTT Server>>http://wiki.dragino.com/xwiki/bin/view/Main/Notes%20for%20TTN/#H5.A0TTNV3integratedintoMQTTserver||_mstmutation="1"]]"
617
618
619 == 6.1  Edit mqtt-broker node ==
620
621
622 Users need to configure the TTN MQTT server address and port, Such as:
623
624 (% class="box infomessage" %)
625 (((
626 **Server :** eu1.cloud.thethings.network
627
628 **Port  :** 1883
629 )))
630
631 [[image:image-20220829160224-187.jpeg||_mstalt="526292" height="569" width="1128"]]
632
633
634 **Enter Username and Password**
635
636 [[image:image-20220829164358-188.png||_mstalt="486174" height="570" width="1130"]]
637
638
639 == 6.2  Debug ==
640
641
642 Users can check logs by adding debug.
643
644 [[image:image-20220829164652-189.png||_mstalt="485472" height="572" width="1134"]]
645
646
647 == 6.3  Example: Use Local Server TTN and Node-Red in LPS8v2 ==
648
649
650 LPS8v2 includes a local TTN Server and Node-Red. This example shows how to configure LHT65N to use with the local Node-Red server. This example assumes users already have:
651
652 * LHT65N register on LPS8v2 Built-In TTN server already
653 * The user is able to see the data on the built-in TTN server device page.
654
655 Below are the steps to plot the sensor data on LPS8v2 Node-Red.
656
657
658 === 6.3.1 Link Node-Red to Local TTN ===
659
660
661 Users can download the Node-Red decoder from this link and import it into the Node-Red platform:  **[[dragino-end-node-decoder/LHT65N.json (github.com)>>url:https://github.com/dragino/dragino-end-node-decoder/blob/main/Node-RED/LHT65N.json]]**
662
663 For more information on importing Input Flow, check out this link: **[[Import Input Flow for Dragino Sensors>>http://wiki.dragino.com/xwiki/bin/view/Main/Node-RED/#H3.A0ImportInputFlowforDraginoSensors||style="background-color: rgb(255, 255, 255);"]]**
664
665
666 After importing the Input Flow is complete, the user needs to edit the MQTT in the node
667
668
669 (% style="color:blue" %)**1. Change the Topic**
670
671
672 Topic modifies it to the following format:
673
674 **v3/(% style="color:red" %)Application ID(%%)/devices/(% style="color:red" %)End device ID(%%)/up**
675
676 [[image:image-20221018100743-1.png||_mstalt="427739" height="573" width="1120"]](% style="display:none" %)
677
678
679
680 (% style="color:blue" %)**2. Enter the MQTT configuration information**
681
682
683 [[image:image-20221018100947-2.png||_mstalt="430079" height="560" width="1123"]](% style="display:none" %)
684
685
686
687 [[image:image-20221018101102-3.png||_mstalt="425256" height="580" width="1121"]]
688
689 (% class="wikigeneratedid" %)
690 (% style="color:blue" %)**Finally, click "Update" and Deploy**
691
692
693 (% class="wikigeneratedid" %)
694 "Connected" indicates that the Link Node-red to Local TTN is normal.
695
696 (% class="wikigeneratedid" %)
697 [[image:image-20220914140918-5.png||_mstalt="432523" height="602" width="1121"]]
698
699
700 === 6.3.2 Check result. ===
701
702
703 Users can check logs by adding debug.
704
705 [[image:image-20220914140841-4.png||_mstalt="430456" height="600" width="1119"]]
706
707
708 In addition,Users can access the lps8v2 gateway's built-in as server of **Node-Red Chart UI **via the URL((% style="background-color:yellow" %)__**//http:~/~/<hostname>:1880/ui or http:~/~/<local-IPV4-address>:1880/ui//**__(%%)) in your browser.
709
710
711 [[image:image-20220914142021-7.png||_mstalt="429000" height="439" width="1143"]](% style="display:none" %)
712
713
714 = 7.  Request Remote Support =
715
716
717 (((
718 These pages are useful to check what is wrong on the Join process. Below shows the four steps that we can check the Join Process.
719 \\If problem not solve, and you need dragino remote support, please follow to this document: [[TTN Support instruction>>url:https://www.dragino.com/downloads/index.php?dir=&file=TTNv3_Support_Guide.pdf]](% style="color:red" %) **If user has checked below steps and still can't solve the problem, please send us (support @ dragino.com) the screenshots for each step to check. They include:**
720 )))
721
722 * End node is connected to serial port to show the Join frequency and DR. (If possible)
723
724 * Gateway (from gateway UI) traffic to show the packet got from end node and receive from Server. (If possible)
725
726 * Gateway traffic (from server UI) to shows the data exchange between gateway and server. (Normally possible)
727
728 * End Node traffic (from server UI) to shows end node activity in server. (Normally possible)
729
730 * End Node Keys screen shot shows in end node and server. so we can check if the keys are correct. (In most case, we found keys doesn't match, especially APP EUI)
731
732 (% style="color:blue" %)**1. End Device Join Screen shot, we can check:**
733
734 * If the device is sending join request to server?
735
736 * What frequency the device is sending?
737
738 [[image:image-20220526141308-33.png||_mstalt="453778"]]
739
740 Console Output from End device to see the transmit frequency
741
742
743 User can run (% style="color:blue" %)**AT+CFG **(%%)command to print configuration information.
744
745 * Is the device in OTAA mode or ABP mode? (% style="color:red" %)**AT+NJM=1** (%%)(OTAA mode), (% style="color:red" %)**AT+NJM=0**(%%) (ABP mode)
746
747 [[image:image-20220526141612-36.png||_mstalt="454142"]]
748
749
750 Console Output from End device to see the transmit frequency
751
752
753
754 (% style="color:blue" %)**2. Gateway packet traffic in gateway web or ssh. we can check:**
755
756 * (((
757 If the gateway receive the Join request packet from sensor? (If this fail, check if the gateway and sensor works on the match frequency)
758 )))
759 * (((
760 If the gateway gets the Join Accept message from server and transmit it via LoRa?
761
762
763
764 )))
765
766 [[image:image-20220526141739-37.png||_mstalt="457847"]]
767
768 Console Output from Gateway to see packets between end node and server.
769
770
771
772 (% style="color:blue" %)**3. Gateway Traffic Page in LoRaWAN Server**
773
774 * (((
775 If the Join Request packet arrive the gateway traffic in server? If not, check the internet connection and gateway LoRaWAN server settings.
776 )))
777 * (((
778 If the server send back a Join Accept for the Join Request? if not, check if the keys from the device match the keys you put in the server, or try to choose a different server route for this end device.
779 )))
780 * (((
781 If the Join Accept message are in correct frequency? If you set the server to use US915 band, and your end node and gateway is EU868, you will see the Join Accept message are in US915 band so no possible to Join success.
782
783
784
785 )))
786
787 [[image:image-20220526141823-38.png||_mstalt="456183" height="501" width="1144"]]
788
789 The Traffic for the End node in the server, use TTNv3 as example
790
791
792
793 [[image:image-20220526141917-39.png||_mstalt="457899"]]
794
795 The Traffic for the End node in the server, use TTNv3 as example
796
797
798
799 (% style="color:blue" %)**4. Data Page in LoRaWAN server**
800
801 (((
802 (((
803 (((
804 If this data page shows the Join Request message from the end node? If not, most properly you have wrong settings in the keys. Keys in the server doesn't match the keys in End Node.
805
806
807 [[image:image-20220526141956-40.png||_mstalt="455832"]]
808 )))
809 )))
810 )))
811
812 The data for the end device set in server
813
814
815
816 [[image:image-20220526142033-41.png||_mstalt="452036"]]
817
818 Check if OTAA Keys match the keys in device
819
820
821 = 8.  FAQ =
822
823 == 8.1 How to import devices keys to TTN. ==
824
825
826 **For TTS in LPS8v2**
827
828 Open your application and click the button **Import end devices**
829
830 [[image:image-20230423154012-1.png||_mstalt="426738" height="472" width="755"]]
831
832
833 Select the **File format** and upload the file (e.g. or ).devices/jsondevices.csv
834
835 You can specify **Fallback values** for Frequency plan and LoRaWAN and Regional Parameters version, in case the import file does not specify these settings for the device.
836
837 You can also expand the **Advanced claiming and component settings** to set targeted components, and set the claim authentication code to be generated.
838
839 Start the import by clicking the **Import end devices** button.
840
841 [[image:image-20230423154040-2.png||_mstalt="427401" height="470" width="749"]]
842
843
844 Wait for the end devices to be successfully imported. In case any device fails, you will see a relevant error message in the console.
845
846 [[image:image-20230423154105-3.png||_mstalt="428467" height="478" width="763"]]
847
848
849 If the import was successful, your devices are added to the list of end devices in your application.
850
851 [[image:image-20230423154125-4.png||_mstalt="429481" height="480" width="766"]]
852
853 Devices are now registered on The Things Stack.
854
855
856 === **JSON File Reference** ===
857
858
859 The Things Stack allows you to import end devices from V2, ChirpStack and other LoRaWAN networks using a JSON file describing those devices.
860
861 Using JSON file with device descriptions, you can migrate end devices with or without their existing sessions.
862
863 Here is an example of an OTAA device description in the file:devices.json
864
865 {{{{
866 "ids": {
867 "device_id": "my-device",
868 "dev_eui": "0102030405060708",
869 "join_eui": "0102030405060708"
870 },
871 "name": "My Device",
872 "description": "Living room temperature sensor",
873 "lorawan_version": "MAC_V1_0_2",
874 "lorawan_phy_version": "PHY_V1_0_2_REV_B",
875 "frequency_plan_id": "EU_863_870_TTN",
876 "supports_join": true,
877 "root_keys": {
878 "app_key": {
879 "key": "01020304050607080102030405060708"
880 }
881 }
882 }
883 }}}
884
885 Multiple end devices can also be contained in a single file like so:devices.json
886
887 {{{{
888 /* device 1 */
889 }
890 {
891 /* device 2 */
892 }
893 }}}
894
895 The format above is considered by the Console and CLI as a JSON stream, processing one object at a time. For more details in how to use the file
896
897
898 === **CSV File Reference** ===
899
900
901 The Things Stack has support for importing end devices from CSV (comma-separated values) files. This is useful when batches of end devices are managed in Microsoft Excel or any other spreadsheet or database that can export to CSV file.
902
903 The CSV import in The Things Stack uses the following settings:
904
905 * Semicolon () as field delimiter. This makes working with Microsoft Excel and other spreadsheets convenient;
906
907 * Header row is required
908
909 * On each row, the same number of fields as on the header line
910
911 * Use quotes to use in a field value;
912
913 * Use double quotes to escape quotes
914
915 * Unknown header columns are permitted and ignored
916
917 * Name and id cannot have capital letters and special characters
918
919 * Example column lorawan_phy_version is not needed
920
921 (% style="display:none" %)
922
923
924
925 === **Example** ===
926
927
928 Minimal example:
929
930 {{{dev_eui;join_eui;frequency_plan_id;lorawan_version;lorawan_phy_version;app_key
931 1111111111111111;1111111111111111;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;11111111111111111111111111111111
932 2222222222222222;2222222222222222;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;22222222222222222222222222222222
933 3333333333333333;3333333333333333;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;33333333333333333333333333333333
934 }}}
935
936 All columns for a LoRaWAN 1.0.4 device:
937
938 {{{id;dev_eui;join_eui;name;frequency_plan_id;lorawan_version;lorawan_phy_version;brand_id;model_id;hardware_version;firmware_version;band_id;app_key
939 test-one;1111111111111111;1111111111111111;Device 1;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;the-things-industries;generic-node-sensor-edition;1.0.4;1.0;EU_863_870;11111111111111111111111111111111
940 test-two;2222222222222222;2222222222222222;Device 2;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;the-things-industries;generic-node-sensor-edition;1.0.4;1.0;EU_863_870;22222222222222222222222222222222
941 test-three;3333333333333333;3333333333333333;Device 3;EU_863_870_TTN;MAC_V1_0_4;RP002_V1_0_3;the-things-industries;generic-node-sensor-edition;1.0.4;1.0;EU_863_870;33333333333333333333333333333333
942 }}}
943
944
945 (% style="display:none" %) (%%)
946
947 === **Excel Template** ===
948
949
950 [[Download the Excel template>>url:https://www.thethingsindustries.com/docs/getting-started/migrating/tts-end-devices-csv-template.xlsx]]. You can remove all columns that are not required (see above).
951
952
953 == 8.2 How to download and analyze End Device's log?(% style="display:none" %) (%%) ==
954
955
956 ~1. Get information about a single node
957
958 Download this file in the node's live data interface
959
960 [[image:http://wiki.dragino.com/xwiki/bin/download/Main/User%20Manual%20of%20Dragino%20LoRaWAN%20Packet%20Analyze%20Tool/WebHome/image-20230928163751-2.png?width=1278&height=506&rev=1.1||alt="image-20230928163751-2.png" height="506" width="1278"]]
961
962
963 2. Get information about the entire Application
964
965 Click the "See all activity" button on the main interface of the application
966
967 [[image:image-20231019113039-1.png||height="678" width="1312"]]
968
969
970 Download this file in application  live data interface
971
972 [[image:image-20231019113212-4.png||height="567" width="1277"]]
973
974
975 After the data collection is completed, you can send this file directly to our technical support personnel for analysis.
976
977
978 You can also use the packet analysis tool developed by our company to check it yourself. Please refer to the following [[link>>http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20of%20Dragino%20LoRaWAN%20Packet%20Analyze%20Tool/#H3.ThethingsNetwork]] to use this tool.
979
980 [[image:image-20240117170517-1.png]]
981
982
983
984 = 9. Trouble Shooting. =
985
986 == 9.1 How to solve the problem of MIC Mismatch? ==
987
988
989 Please refer to the link below:
990
991 [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/LoRaWAN%20Communication%20Debug/#H9.WhydoIseea22MICMismatch22errormessagefromtheserver3F>>url:http://wiki.dragino.com/xwiki/bin/view/Main/LoRaWAN%20Communication%20Debug/#H9.WhydoIseea22MICMismatch22errormessagefromtheserver3F]]
992
993
994 == 9.2 Why node join succeeds but detailed data cannot be observed in the live data interface? ==
995
996
997 The live data interface on the TTN platform is more orientated towards real-time observations, so if you don't click on the observations in time, you will not be able to see the previous details if you click on the interface again after a period of time.
998
999 TTN has no fixed official explanation for how long this data refreshes, but actual tests show it to be around 10 minutes.
1000
1001
1002 Users can see the time of the last activity of a node inside one of the Applications:
1003
1004 [[image:image-20240820171935-1.png||height="714" width="1358"]]
1005
1006 For example:
1007
1008 * After 6 minutes of the last activity, click on the **live data** interface to observe the data.
1009
1010 [[image:image-20240820172327-2.png||height="439" width="1365"]]
1011
1012 * The last activity of a node that has not been clicked for a long time was more than ten minutes ago, and you cannot observe the previous detailed data by clicking on the live data interface at this time.
1013
1014 [[image:image-20240820172513-3.png]]
1015
1016 In addition, if one stays in the LIVE DATA screen for a node, several previous details have been observed. If the node is inactive for a long time to come, and the interface is refreshed at this point, the details of the previously active data may be refreshed and no longer displayed.
1017
1018
1019 If the user needs to view the data uplinked from a previous node, the data can be retrieved through the endpoint given by **Storage Integration**. The data can then be distinguished between different nodes based on **device_id**.
1020
1021 [[image:image-20240820172909-4.png||height="524" width="954"]]
1022
1023
1024 [[image:image-20240820172925-5.png||height="533" width="1318"]]
1025
1026
1027
1028
1029