This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
wiki:loraloc [2018/08/14 16:15] ghi removed |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== LoRa Modem management ====== | ||
- | This page describes information about Packet Forwarder and Semtech HAL: | ||
- | |||
- | * **Semtech packet forwarder** - Program that collects data from end-points. | ||
- | |||
- | * **Semtech HALv2** - A layer of programs to interact with Wirnet iBTS hardware modem. | ||
- | |||
- | Semtech packet forwarder is a ready to use content. The station can be interfaced with a LoRa Network Server and configured as a concentrator to retrieve end-devices data. | ||
- | |||
- | Semtech HAL is used to compile custom test tools or build its own solution. | ||
- | |||
- | |||
- | \\ \\ | ||
- | ===== Packet forwarder ===== | ||
- | |||
- | ==== What is the packet forwarder ==== | ||
- | |||
- | The packet forwarder is a program running on the host of a Lora gateway that forwards RF packets received by the gateway to a server through an IP/UDP link, and emits RF packets that are sent by the server.\\ | ||
- | |||
- | Every X seconds the program displays statistics on the RF packets received and sent, and the network datagrams received and sent. The program also sends some statistics to the server in JSON format.\\ | ||
- | |||
- | For a full packet forwarder description and the way it works, read the "Semtech readme file" available in each packet forwarder [[wiki:ressources#semtech_packet_forwarder_v2|resource page]]. | ||
- | |||
- | ==== How to install the packet forwarder ? ==== | ||
- | |||
- | <fc #4682b4>**Step 1** - Click on the packet forwarder link you wish to install from the [[wiki:ressources#semtech_packet_forwarder_v2|resource page]].</fc>\\ | ||
- | <fc #4682b4>**Step 2** - Mind about compatibility section on packet forwarder page:</fc> | ||
- | * **iBTS firmware**. | ||
- | * **FPGA version**. | ||
- | * The associated semtech HAL is indicated in the name of your ipk : | ||
- | * ''packet-forwarder-v2_<version>-**<HAL>**_klk_lpbs.ipk'' | ||
- | |||
- | <fc #4682b4>**Step 3** - Download the packet forwarder precompiled .ipk file.</fc>\\ | ||
- | <fc #4682b4>**Step 4** - Install the .ipk file using instructions of the [[wiki:upgrade|update page]].</fc> | ||
- | |||
- | |||
- | ==== How to configure and monitor the packet forwarder ? ==== | ||
- | |||
- | * [[wiki:loraloc_spf-5.1.0| iBTS Packet Forwarder v5.1.0 - instructions (February 2018)]] | ||
- | |||
- | * [[wiki:loraloc_spf-4.0.0| iBTS Packet Forwarder v4.0.0 - instructions (June 2017)]] | ||
- | |||
- | * [[wiki:loraloc_spf-3.3.1| iBTS Packet Forwarder v3.3.1 and lower - instructions (January 2017)]] | ||
- | |||
- | |||
- | \\ | ||
- | \\ | ||
- | ===== Semtech HALv2 (Optional) ===== | ||
- | |||
- | ==== What is the HALv2 ==== | ||
- | The HAL (Hardware Abstraction Layer) is a library aiming to use the LoRa RF hardware. This is similar to a driver. It contains the following elements: | ||
- | * **Static library** - Used when compiling the packet forwarder, acts as a modem driver. Required only if building packet forwarder from source. | ||
- | * **FPGA Binary** - modem microcode. Mandatory installation alongside Packet Forwarder binaries. | ||
- | * **Tools** - troubleshooting and analysis tools (spectral scan, packet logger, etc) Not required unless debugging. | ||
- | |||
- | |||
- | The HAL provided by Kerlink is based on Semtech HAL **lora_gateway_v2** and modified to work with Kerlink boards. | ||
- | The difference between HALv1 (used in Wirnet stations) and HALv2 (used in iBTS) comes from the architecture of the boards. \\ | ||
- | |||
- | Downloadable sources tarball are available in dedicated [[wiki:ressources#semtech_hal_v2|resources]] page. | ||
- | |||
- | ==== HAL instructions ==== | ||
- | |||
- | * [[wiki:loraloc_hal-5.1.0| iBTS HAL 5.1.0 - Instructions (Febryary 2018) ]] | ||
- | |||
- | * [[wiki:loraloc_hal-4.0.1| iBTS HAL 4.0.1 - Instructions (August 2017) ]] | ||
- | |||
- | * [[wiki:loraloc_hal-3.5.0| iBTS HAL 3.5.0 - Instructions (January 2017) ]] | ||
- | |||
- | * [[wiki:loraloc_hal-3.3.0| iBTS HAL 3.3.0 - Instructions (2016) ]] | ||
- | |||
- | |||
- | <ifauth @admin,@klk> | ||
- | ===== Radio scanning ====== | ||
- | |||
- | LOC modules (used to send/receive LoRa RF) contain a chip (sx1239) used as a radio scanner. | ||
- | |||
- | To use this radio scanner, the first step is to connect to the sx1239 through the ''microcom'' serial terminal. | ||
- | |||
- | The path of the sx1239 can be retrieved in the ''/tmp/sys_startup_status.json'' json file in the ''acm_path'' field. Depending on your gateway, there might be up to 4 paths. | ||
- | |||
- | <code bash> | ||
- | $ grep acm_path /tmp/sys_startup_status.json | ||
- | "acm_path": "/dev/slot/2/ttyACM", | ||
- | "acm_path": "/dev/slot/3/ttyACM", | ||
- | </code> | ||
- | |||
- | Once the slot of a modem is identified, the serial port can be opened with the ''microcom'' command, with one of the previously displayed paths as a parameter. To log the traces of the ''microcom'' command, a pipe to the ''tee'' command is used. | ||
- | |||
- | <code bash> | ||
- | $ microcom /dev/slot/2/ttyACM | tee /tmp/spectral_scan.log | ||
- | </code> | ||
- | |||
- | The command to start a spectrum scanning is ''sx1239'', with the following parameters: | ||
- | * scan mode : need to be fl | ||
- | * number of path : need to be 1 for Lora Dual modem | ||
- | * start frequency in Hertz | ||
- | * stop frequency in Hertz (a maximum bandwidth of 15MHz between the start and stop frequencies can be used) | ||
- | * frequency step in Hertz (should be 62500) | ||
- | * frequency bandwidth in Hertz (should be 62500) | ||
- | * bitrate (should be 600) | ||
- | * loop number, set to 0 for an infinite scanning | ||
- | |||
- | <code bash> | ||
- | $ sx1239 fl 1 863000000 865000000 62500 62500 600 10 | ||
- | 0:0:7C7C7B7B7B7C7C7A7B7B7A7B7B7B7B7B797B7A7A7B7A7A7A7A7A7A7B7C7B7B7B7B | ||
- | 0:216:7C7B7C7B7C7C7B7B7B7B7B7B7B7B7B7A747B7B7A7A7B7B7A7A7A7A7A7A7B7B7A7A | ||
- | 0:216:7B7C7B7B7B7B7B7B7B7B7B7B7B7A7B7B7A7A7A7A7A7A7A7A7A7A7A7B7A7B7B7B7B | ||
- | 0:216:7B7B7B7A7B7C7B7B7B7B7A7B7A7B7C7B757A7A7B7A7A7B7A7A7A7A7B7B7B7B7B7C | ||
- | 0:216:7B7B7B7C7C7B7C7A7B7B7B7B7B7C7A7B7A7B7B7A7B7A7A7A7A7A7A7A7A7A7B7A7B | ||
- | 0:216:7B7C7B7B7B7B7B7A7B7B7B7A7B7B7B7B777A7A7B7B7B7B7B7A7A7A7A7A7A7A7B7B | ||
- | 0:216:7B7B7B7B7B7B7C7B7B7B7A7B7B7C7B7B767A7A7A7B7A7A7A7A7A7B7A7B7A7C7B7B | ||
- | 0:216:7B7C7B7B7C7B7B7B7B7B7B7B7C7A7B7B767A7B7B7B7A7A7A7A7A7A7B7B7A7B7B7A | ||
- | 0:216:7C7C7B7C7B7B7C7B7B7C7B7B7A7B7B7B777A7A7B7A7A7A7B7B7A7B7B7B7A7B7B7B | ||
- | 0:216:7B7A7A7B7C7C7C7A7B7B7C7C7B7A7A7B797B7A7B7C7A7A7A7B7A7B7A7A7A7A7A7B | ||
- | |||
- | #press ctrl+x to exit microcom | ||
- | </code> | ||
- | |||
- | The spectrum data are returned line by line. Each line corresponds to a complete scan of the band. The format is ASCII and respects the following protocol: | ||
- | |||
- | <code> | ||
- | [PATH] : [DURATION] : [DATA] [END] | ||
- | </code> | ||
- | |||
- | Where: | ||
- | * [PATH]: radio path number : 0 or 1 (always 0 for Lora Dual modem) | ||
- | * [DURATION]: duration of the scan of the full band expressed in milli-seconds coded as a decimal | ||
- | * [DATA]: N x data coded as hexascii between 00 and FF, it expresses the opposite of the received power (-RSSI) | ||
- | * [END]: synchro character: \r\n (0x0D 0x0A) | ||
- | |||
- | The following command is an example of how to convert the raw data contained in the ''spectral_scan.log'' file to decimal RSSI values in dBm. (it requires gawk, therefore, it cannot be directly used on the iBTS) | ||
- | |||
- | <code bash> | ||
- | $ grep "0:" spectral_scan.log | sed 's/^[\0-9]:[0-9]*://g' | sed 's/.\{2\}/& /g' | awk --non-decimal-data '{for(i=1;i<=NF;i++) $i=sprintf("%d","0x"$i)}1' | sed 's/\([0-9]\+\)/-\1/g' | ||
- | -124 -124 -123 -123 -123 -124 -124 -122 -123 -123 -122 -123 -123 -123 -123 -123 -121 -123 -122 -122 -123 -122 -122 -122 -122 -122 -122 -123 -124 -123 -123 -123 -123 | ||
- | -124 -123 -124 -123 -124 -124 -123 -123 -123 -123 -123 -123 -123 -123 -123 -122 -116 -123 -123 -122 -122 -123 -123 -122 -122 -122 -122 -122 -122 -123 -123 -122 -122 | ||
- | -123 -124 -123 -123 -123 -123 -123 -123 -123 -123 -123 -123 -123 -122 -123 -123 -122 -122 -122 -122 -122 -122 -122 -122 -122 -122 -122 -123 -122 -123 -123 -123 -123 | ||
- | -123 -123 -123 -122 -123 -124 -123 -123 -123 -123 -122 -123 -122 -123 -124 -123 -117 -122 -122 -123 -122 -122 -123 -122 -122 -122 -122 -123 -123 -123 -123 -123 -124 | ||
- | -123 -123 -123 -124 -124 -123 -124 -122 -123 -123 -123 -123 -123 -124 -122 -123 -122 -123 -123 -122 -123 -122 -122 -122 -122 -122 -122 -122 -122 -122 -123 -122 -123 | ||
- | -123 -124 -123 -123 -123 -123 -123 -122 -123 -123 -123 -122 -123 -123 -123 -123 -119 -122 -122 -123 -123 -123 -123 -123 -122 -122 -122 -122 -122 -122 -122 -123 -123 | ||
- | -123 -123 -123 -123 -123 -123 -124 -123 -123 -123 -122 -123 -123 -124 -123 -123 -118 -122 -122 -122 -123 -122 -122 -122 -122 -122 -123 -122 -123 -122 -124 -123 -123 | ||
- | -123 -124 -123 -123 -124 -123 -123 -123 -123 -123 -123 -123 -124 -122 -123 -123 -118 -122 -123 -123 -123 -122 -122 -122 -122 -122 -122 -123 -123 -122 -123 -123 -122 | ||
- | -124 -124 -123 -124 -123 -123 -124 -123 -123 -124 -123 -123 -122 -123 -123 -123 -119 -122 -122 -123 -122 -122 -122 -123 -123 -122 -123 -123 -123 -122 -123 -123 -123 | ||
- | -123 -122 -122 -123 -124 -124 -124 -122 -123 -123 -124 -124 -123 -122 -122 -123 -121 -123 -122 -123 -124 -122 -122 -122 -123 -122 -123 -122 -122 -122 -122 -122 -123 | ||
- | </code> | ||
- | |||
- | |||
- | |||
- | </ifauth> |