User Tools

Site Tools


Sidebar

Kerlink Wiki Home Page

Home

Setups

General information

Wirnet™ iBTS information

Wirnet™ iFemtoCell information

Wirnet™ iFemtoCell-evolution information

Wirnet™ iStation information

System management

Network management

LoRa Features

KerOS customization

Support and resources



www.kerlink.com

wiki:loraloc

This is an old revision of the document!


LoRa Modem management

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 a IP/UDP link, and emits RF packets that are sent by the server.

Every X seconds the program display statistics on the RF packets received and sent, and the network datagrams received and sent. The program also send 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 here

Installing the packet forwarder

You can download the packet forwarder package from the resource page.
Follow the instructions of the update page to install it. Just replace the “.ipk” file of this example by your own.

Make sure your FPGA firmware version is compatible with the packet forwarder you want to install. Refer to the resource page to know which packet forwarder is compatible whith which FPGA.

Configuring the packet forwarder

  • Pick the config.json file from the resource page that fits with your platform, region and feature need.
  • Update the JSON configuration file, as explained below.
  • The way the program takes configuration files into account is the following:
    1. if there is a config.json parse it, look for the next file
    2. if there is a local.json parse it. If some parameters are defined in both config and local configuration files, the local definition overwrites the global config definition.
    3. in our case the local.conf is automatically generated at boot time. It contains antenna configuration. Do not change this file.
  • In each configuration file, the program looks for a JSON object named:
  1. “SX1301_array_conf” that should contain the parameters for the Lora concentrator board (RF channels definition, modem parameters, etc)
  2. “gateway_conf” that should contain the gateway parameters (gateway MAC address, IP address of the server, keep-alive time, etc).
  3. “gps_conf”

There are many configuration fields among these files, but most of them are by default correctly filled. The configuration you might want to change are the following:

Radio Frequencies configurations

Each LoRaLoc module contains two SX1301. Each SX1301 can be configured to use 10 different frequencies. However, these channels needs to be contained within a 2 Mhz bandwidth.

  • “chip_enable” enable/disable SX1301
  • “chip_center_freq” is used to define the center frequency of the SX1301. All 10 channels will be around this particular frequency (+/- 1Mhz).
  • “chan_rx_freq” are used to define each channel frequencies.
  • “chip_rf_chain”: define the rf chain used by the SX1301. The front-end board integrates two duplicated TX and Rx paths (RF1 path and RF2 path). Each TX/RX path is connected to one SMB antenna port, referenced as RF1 and RF2 (Installation manual 1.5.4.4 Front-end boards).
"SX1301_conf":[
{
	"chip_enable": true,
	"chip_center_freq": 907800000,
	"chip_rf_chain": 0,
	"chan_multiSF_0": { "chan_rx_freq": 907100000 , "spread_factor": "7-10" },
	"chan_multiSF_1": { "chan_rx_freq": 907300000 , "spread_factor": "7-10" },
	"chan_multiSF_2": { "chan_rx_freq": 907500000 , "spread_factor": "7-10" },
	"chan_multiSF_3": { "chan_rx_freq": 907700000 , "spread_factor": "7-10" },
	"chan_multiSF_4": { "chan_rx_freq": 907900000 , "spread_factor": "7-10" },
	"chan_multiSF_5": { "chan_rx_freq": 908100000 , "spread_factor": "7-10" },
	"chan_multiSF_6": { "chan_rx_freq": 908300000 , "spread_factor": "7-10" },
	"chan_multiSF_7": { "chan_rx_freq": 908500000 , "spread_factor": "7-10" },
	"chan_LoRa_std" : { "chan_rx_freq": 907800000 , "bandwidth": 500000, "spread_factor": 8 },
	"chan_FSK"      : { "chan_rx_freq": 907800000 , "bandwidth": 125000, "bit_rate": 50000 }
},{
	"chip_enable": true,
	"chip_center_freq": 909400000,
	"chip_rf_chain": 0,
	"chan_multiSF_0": { "chan_rx_freq": 908700000 , "spread_factor": "7-10" },
	"chan_multiSF_1": { "chan_rx_freq": 908900000 , "spread_factor": "7-10" }, 
	"chan_multiSF_2": { "chan_rx_freq": 909100000 , "spread_factor": "7-10" },
	"chan_multiSF_3": { "chan_rx_freq": 909300000 , "spread_factor": "7-10" },
	"chan_multiSF_4": { "chan_rx_freq": 909500000 , "spread_factor": "7-10" },
	"chan_multiSF_5": { "chan_rx_freq": 909700000 , "spread_factor": "7-10" },
	"chan_multiSF_6": { "chan_rx_freq": 909900000 , "spread_factor": "7-10" },
	"chan_multiSF_7": { "chan_rx_freq": 910100000 , "spread_factor": "7-10" },
	"chan_LoRa_std" : { "chan_rx_freq": 909400000 , "bandwidth": 500000, "spread_factor": 8 },
	"chan_FSK"      : { "chan_rx_freq": 909400000 , "bandwidth": 125000, "bit_rate": 50000 }
}],

Antennas configuration

To understand all antennas configuration possibilities read the chapter 4.6.2.4 of the Installation manual.

  • “tx_lut”, “rssi_offset”, “rssi_offset_coeff_a” and “rssi_offset_coeff_b” fields are used to calibrate the antennas. These values are overwritten by the local.json. No need to change them.
  • “rx_enable” and “tx_enable” are used to enable or disable emission and reception of the antennas. In case you only have one antenna, disable both these values for one antenna.
"rf_chain_conf":[
        {
            "rx_enable": true,
            "tx_enable": true,
            "rssi_offset": -202.5,
            "rssi_offset_coeff_a": 20,
            "rssi_offset_coeff_b": 2925,
            "tx_lut":[
                { "rf_power":  2, "fpga_dig_ ...
                 ...
                 ...                            }]
        },{
            "rx_enable": true,
            "tx_enable": true,
            "rssi_offset": -202.5,
            "rssi_offset_coeff_a": 20,
            "rssi_offset_coeff_b": 2925,
            "tx_lut":[
                { "rf_power": ...  
                 ...
                 ...                          }]
        }],

Gateway Configuration

  • “server_address” is the address of the server to which the packets will be forwarded
  • “serv_port_up” and “serv_port_down” are the ports used by the packet forwarder to communicate with the LoRa server
  • “stat_interval” is the period (in second) at which the statistics of the packet forwarder are logged.
  • “forward_crc_valid”, “forward_crc_error” and “forward_crc_disabled” are Boolean that defines whether invalids packets should be forwarded to the server or not.
  • “keepalive_interval” is the period (in second) at which the packet forwarder will send a PUSH_DATA frame to the server
  "gateway_conf": {
    "gateway_ID": "00AEAEFFFE000000",
    "server_address": "iotbeta.semtech.com",
    "serv_port_up": 1690,
    "serv_port_down": 1690,
    "keepalive_interval": 10,
    "stat_interval": 30,
    "push_timeout_ms": 100,
    "forward_crc_valid": true,
    "forward_crc_error": false,
    "forward_crc_disabled": false,
    "link_mote": "00CC01AF"
  },

HALv2 (Loraloc / sx1301 array)

The downloadable source tarball is available in dedicated resources page.

The HAL provided by Kerlink is based on new Semtech HAL lora_gateway_v2.
Main modifications aim to adapt HAL to Kerlink boards:

  • Multi-board support
  • Calibration parameters can now be parsed as an overload config file (similarly to local_conf.json) named /tmp/calib_loraloc.json

As Loraloc architecture is much more complex, this HAL is quite different from HAL v1.

Compilation

To simplify deployment on board, Kerlink provides a script called build_package.sh. It must be modified to set correct the toolchain according to the platform used: Change the YOCTO_TOOLCHAIN_ENV variable at begin of this script.
This tool script make all tools and prepare an OPKG package including them.

HALv2 v3.3.0

To compile it, please use following commands:

cd lora_gateway_v2
source /opt/toolchains/loraV2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
make SPI_HOST=imx

HALv2 v3.5.0

To compile it, please use following commands:

cd lora_gateway_v2_3.5.0-klk5
source /opt/toolchains/loraV2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
make

Usage

The main modification in tools since HALv1 is the '-d' argument.
As this HAL is mainly designed to handle multiple RF chips, this optional argument allows to specify which spidevice to use.

Kerlink provides a automatic discovery script at startup to handle correctly plugged boards.

By default, if a WAN module is provided, loraloc modules are mapped from slot 2.

So to use tools with this Loraloc module, please specify on tool's command-line -d /dev/slot/2/spidev0.
For example:

./pkt_logger -d /dev/slot/2/spidev0

Configuration

Due to architecture, the configuration is quite more complex than HAL v1:

  • board keyword means “Loraloc board” or “LoraLoc module” (one “board” by slot)
  • each board includes 2 chip configs (i.e. sx1301 configs)
  • each board includes 2 rfchain configs

Chip config

This configuration must include SX1301 channel config.
These channels can be configured through “sx1301ar_conf_chan” function.
Please note that this function takes as “channel number” the concatenation of chip number and channel. (see function description in sx1301ar_hal.h)

RF Chain config

This configuration is mainly used to correct RSSI and TX power values.
Corresponding calibration values are set in Production by Kerlink and extracted during board startup in /tmp/calib_loraloc.json file.

Thanks to ad9361 transceiver chip. We are able to get +-0.25 dBm precision on real TX power.
As a consequence, up to 32 power steps (tx_lut) are generated and calibrated in production.

JSON Config

The JSON configuration file has been improved to simplify software by using JSON tables.
Indeed:

  • The main Radio config object “SX1301_array_conf” is now a table to support multiple boards
  • “rf_chain_conf” is also a 2-objects-sized table
  • “SX1301_conf” is a 2-objects-sized table
  • “tx_lut” is a variable table (up to 32 objects)
wiki/loraloc.1491840467.txt.gz · Last modified: 2019/01/17 10:01 (external edit)