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