Wiki source code of Got a raw LoRa packet from LoRaWAN gateway
Last modified by Kilight Cao on 2023/09/14 09:29
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | **Table of** **Contents:** | ||
2 | |||
3 | {{toc/}} | ||
4 | |||
5 | |||
6 | |||
7 | = 1. Below list the support products and Requirements: = | ||
8 | |||
9 | |||
10 | 1. LoRaWAN Gateway model: [[LIG16>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/171-lig16.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]] [[LPS8>>url:http://www.dragino.com/products/lora-lorawan-gateway/item/148-lps8.html]] | ||
11 | 1. Firmware version since : [[lgw~~-~~-build-v5.4.1644658774>>url:http://www.dragino.com/downloads/index.php?dir=LoRa_Gateway/LIG16/Firmware/Release/]] | ||
12 | |||
13 | |||
14 | = 2. Introduction = | ||
15 | |||
16 | |||
17 | ((( | ||
18 | By default, the LoRaWAN gateway cannot receive LoRa Packet, If the user needs to receive the raw LoRa Packet, the user can modify the file. | ||
19 | ))) | ||
20 | |||
21 | ((( | ||
22 | Here are two ways to modify the received raw LoRa package. | ||
23 | |||
24 | |||
25 | ))) | ||
26 | |||
27 | == 2.1 Method 1: == | ||
28 | |||
29 | |||
30 | ((( | ||
31 | (% style="color:blue" %)**root@dragino-1d178c:~~# vim /usr/bin/generate-config.sh** | ||
32 | ))) | ||
33 | |||
34 | (% class="box" %) | ||
35 | ((( | ||
36 | ((( | ||
37 | ((( | ||
38 | gen_cus_cfg() { | ||
39 | json_init | ||
40 | json_add_object SX130x_conf | ||
41 | json_add_string "spidev_path" "/dev/spidev0.0" | ||
42 | json_add_boolean "full_duplex" 0 | ||
43 | json_add_boolean "lorawan_public" 0 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--> "1" proves receive LoRaWAN Packet,"0" proves receive non-LoRaWan Packet | ||
44 | json_add_int "clksrc" "1" | ||
45 | json_add_string "clksrc_desc" "radio_1 provides clock to concentrator" | ||
46 | json_add_int "antenna_gain" "0" | ||
47 | json_add_string "antenna_gain_desc" "antenna gain, in dBi" | ||
48 | ))) | ||
49 | ))) | ||
50 | ))) | ||
51 | |||
52 | ((( | ||
53 | |||
54 | |||
55 | (% style="color:blue" %)**root@dragino-1d178c:~~# vim /etc/lora/global_conf.json** | ||
56 | ))) | ||
57 | |||
58 | (% class="box" %) | ||
59 | ((( | ||
60 | ((( | ||
61 | ((( | ||
62 | { | ||
63 | "SX130x_conf": { | ||
64 | "spidev_path": "/dev/spidev0.0", | ||
65 | "full_duplex": false, | ||
66 | "lorawan_public": false, ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~--> "true" proves receive LoRaWAN Packet,"false" proves receive non-LoRaWan Packet | ||
67 | "clksrc": 1, | ||
68 | "clksrc_desc": "radio_1 provides clock to concentrator for most devices except MultiTech. For MultiTech set to 0.", | ||
69 | "antenna_gain": 0, | ||
70 | "antenna_gain_desc": "antenna gain, in dBi", | ||
71 | "radio_0": { | ||
72 | ))) | ||
73 | ))) | ||
74 | ))) | ||
75 | |||
76 | ((( | ||
77 | and run (% style="color:#037691" %)**root@dragino-1d178c:~~# fwd** | ||
78 | |||
79 | |||
80 | ))) | ||
81 | |||
82 | == 2.2 Method 2: == | ||
83 | |||
84 | |||
85 | ((( | ||
86 | Modify /etc/lora/cfg-$chip/"frequency"-global_conf.json | ||
87 | ))) | ||
88 | |||
89 | ((( | ||
90 | view chip name : cat /tmp/iot/chip | ||
91 | ))) | ||
92 | |||
93 | ((( | ||
94 | Restart the device after the modification | ||
95 | ))) | ||
96 | |||
97 | ((( | ||
98 | [[image:image-20220527172224-1.png]] | ||
99 | ))) | ||
100 | |||
101 | ((( | ||
102 | modify /etc/lora/cfg-$chip/"frequency"-global_conf.json | ||
103 | |||
104 | |||
105 | ))) | ||
106 | |||
107 | ((( | ||
108 | (% style="color:red" %)**Note : User need to do that connect gateway command line via ssh.** | ||
109 | |||
110 | |||
111 | ))) | ||
112 | |||
113 | ((( | ||
114 | ((( | ||
115 | [[image:image-20220527172304-2.png]] | ||
116 | ))) | ||
117 | ))) | ||
118 | |||
119 | ((( | ||
120 | Checking LoRaWAN Gateway Log | ||
121 | |||
122 | |||
123 | ))) | ||
124 | |||
125 | ((( | ||
126 | Command line input (% style="color:#037691" %) **logread -f** | ||
127 | ))) | ||
128 | |||
129 | ((( | ||
130 | ((( | ||
131 | |||
132 | ))) | ||
133 | ))) | ||
134 | |||
135 | ((( | ||
136 | **Decoding verifies that the packet is correct** | ||
137 | |||
138 | [[image:image-20220722161946-1.png]] | ||
139 | ))) | ||
140 | |||
141 | |||
142 | Checking LoRa Packet | ||
143 | |||
144 |