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