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