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