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