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