Wiki source code of TTN Stack 3

Version 1.4 by Xiaoling on 2022/05/17 09:35

Hide last authors
Xiaoling 1.3 1 Contents:
Xiaoling 1.1 2
Xiaoling 1.3 3
4 = 1. Introduction =
5
Xiaoling 1.2 6 Notes for using Dragino Devices with TTN Stack3.
Xiaoling 1.1 7
Xiaoling 1.3 8 = 2. Downlink =
Xiaoling 1.1 9
Xiaoling 1.2 10 Use MQTT API for downlink: Reference: [[TTN Stack v3 MQTT reference>>url:https://thethingsstack.io/v3.1.0/guides/getting-started/mqtt/]]
Xiaoling 1.1 11
12
Xiaoling 1.2 13 **Download command is:**
Xiaoling 1.1 14
Xiaoling 1.3 15 (% class="box" %)
16 (((
Xiaoling 1.2 17 mosquitto_pub -h eu1.cloud.thethings.industries -p 1883 -t v3/akXXXXXps@XXXXXX/devices/lsn50/down/push -u akXXXXXps@XXXXXX -P NNSXS.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.LVQZECLX5FZ3XO5ACOW47IZ6HM54DMBBU776C53ZQHPLPQALIXYA -m '{"downlinks":[{"f_port": 2,"frm_payload":"AwAA","priority": "HIGH","confirmed": true}]}'
Xiaoling 1.3 18 )))
Xiaoling 1.1 19
20
Xiaoling 1.3 21 The MQTT command use (% style="color:#4f81bd" %)**-h,-p,-u,-P** (%%)options. We can find them in the website.
Xiaoling 1.1 22
Xiaoling 1.3 23 [[image:https://wiki.dragino.com/images/thumb/2/2f/Stack_v3_downlink_1.png/600px-Stack_v3_downlink_1.png||height="375" width="600"]]
Xiaoling 1.1 24
Xiaoling 1.2 25 find -h : broker address , -p port and -u: user name
Xiaoling 1.1 26
Xiaoling 1.3 27 [[image:https://wiki.dragino.com/images/thumb/a/a6/Stack_v3_downlink_2.png/600px-Stack_v3_downlink_2.png||height="395" width="600"]]
Xiaoling 1.1 28
Xiaoling 1.2 29 find -P : Password
Xiaoling 1.1 30
31
Xiaoling 1.2 32 User MQTT.FX to simulate a downlink
Xiaoling 1.1 33
Xiaoling 1.3 34 [[image:https://wiki.dragino.com/images/thumb/5/5c/Stack_v3_downlink_3.png/600px-Stack_v3_downlink_3.png||height="439" width="600"]]
Xiaoling 1.2 35
36 Use MQTT.FX to simulate downlink
37
38
39 Input connection info
40
Xiaoling 1.3 41 [[image:https://wiki.dragino.com/images/thumb/4/44/Stack_v3_downlink_4.png/600px-Stack_v3_downlink_4.png||height="437" width="600"]]
Xiaoling 1.2 42
43 Input MQTT connection info
44
45
46 Send a downstream
47
Xiaoling 1.3 48 [[image:https://wiki.dragino.com/images/thumb/e/ec/Stack_v3_downlink_5.png/600px-Stack_v3_downlink_5.png||alt="Stack v3 downlink 5.png" height="438" width="600"]]
Xiaoling 1.2 49
50 Gateway traffic for downstream
51
Xiaoling 1.3 52 [[image:https://wiki.dragino.com/images/thumb/8/8a/Stack_v3_downlink_8.png/600px-Stack_v3_downlink_8.png||alt="Stack v3 downlink 8.png" height="235" width="600"]]
Xiaoling 1.2 53
54
55 Downstream data flow will like below:
56
Xiaoling 1.3 57 [[image:https://wiki.dragino.com/images/thumb/d/d1/Stack_v3_downlink_6.png/600px-Stack_v3_downlink_6.png||alt="Stack v3 downlink 6.png" height="233" width="600"]]
Xiaoling 1.2 58
Xiaoling 1.3 59 [[image:https://wiki.dragino.com/images/1/1f/Stack_v3_downlink_7.png||alt="Stack v3 downlink 7.png" height="371" width="453"]]
Xiaoling 1.2 60
Xiaoling 1.3 61 = 3. Trouble Shooting =
Xiaoling 1.2 62
Xiaoling 1.3 63 == 3.1 Problem when register a device to TTNv3 if it is already register to TTNv2 ==
Xiaoling 1.2 64
65 When you register the device in V2 and V3 with the same key and EUI, the device can only connect to V2.
66
Xiaoling 1.3 67 [[image:https://wiki.dragino.com/images/thumb/0/0d/V3v2.png/600px-V3v2.png||alt="V3v2.png" height="403" width="600"]]
Xiaoling 1.2 68
Xiaoling 1.3 69 [[image:https://wiki.dragino.com/images/thumb/b/b9/V2v3.png/600px-V2v3.png||alt="V2v3.png" height="352" width="600"]]
Xiaoling 1.2 70
71 If you want the device to connect to V3. You must change your key and EUI, or delete the device registered on V2.
72
Xiaoling 1.3 73 == 3.2 MIC Mismatch or MIC Failed ==
Xiaoling 1.2 74
Xiaoling 1.3 75 (((
Xiaoling 1.4 76 (((
Xiaoling 1.2 77 When the device is registered or the device is working normally, the problem of MIC mismatch and MIC failed occurs.
Xiaoling 1.3 78 )))
Xiaoling 1.4 79 )))
Xiaoling 1.2 80
Xiaoling 1.3 81 (((
Xiaoling 1.4 82 (((
Xiaoling 1.2 83 Under normal circumstances, users need to change the APPKEY to solve this problem.
Xiaoling 1.3 84 )))
Xiaoling 1.4 85 )))
Xiaoling 1.2 86
Xiaoling 1.3 87 [[image:https://wiki.dragino.com/images/thumb/d/dd/MIC_mismatch.png/600px-MIC_mismatch.png||height="208" width="600"]]
Xiaoling 1.2 88
89 MIC Mismatch