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