====== CPF 1.2.1: Installation and configuration ======
===== How to install the Common Packet Forwarder? =====
- Choose the packet forwarder to install from the [[wiki:resources:resources#packet_forwarder|Wirnet products resource page]]. Choosing the latest version of the packet forwarder is recommended.
- Download the //"lorad"// and //"lorafwd"// ''.ipk'' packages files (see above).
- Install the ''.ipk'' files using the instructions of the [[wiki:keros_custo:sw_updates|software updates page]]. Packages can be installed simultaneously.
The installation of the //"lorad"// and //"lorafwd"// packages adds the following content on the file system:
├── etc
│ ├── default
│ │ ├── lorad # Overall lorad configuration
│ │ └── lorafwd # Overall lorafwd configuration
│ ├── init.d
│ │ ├── lorad # Script to start/stop lorad
│ │ └── lorafwd # Script to start/stop lorafwd
│ ├── logrotate.d
│ │ ├── lorad # Configuration file for lorad log rotation
│ │ └── lorafwd # Configuration file for lorafwd log rotation
│ ├── monit.d
│ │ ├── lorad # Configuration of the lorad monitoring
│ │ └── lorafwd # Configuration of the lorafwd monitoring
│ ├── profile.d
│ │ ├── lorad # Environment variables for lorad
│ │ └── lorafwd # Environment variables for lorafwd
│ ├── rcK.d
│ │ ├── K50lorad # autostop of lorad
│ │ └── K51lorafwd # autostop of lorafwd
│ ├── rcU.d
│ │ ├── S40lorad-fpga
│ │ ├── S50lorad # autostart of lorad
│ │ └── S51lorafwd # autostart of lorafwd
│ ├── rsyslog.d
│ │ ├── lorad # Configuration file for lorad log
│ │ └── lorafwd # Configuration file for lorafwd log
│ └── sysupgrade.d
│ ├── lorad.conf
│ └── lorafwd.conf
└── user
├── etc
│ ├── lorafwd
│ │ └── lorafwd.toml # LNS configuration
│ └── lorad
│ ├── fevo
│ │ ├── AS923-JP_8CH.json
│ │ ├── AS923-KR_8CH.json
│ │ ├── AS923-TH-SG-HK-TW_8CH.json
│ │ ├── AU915-AU_8CH.json
│ │ ├── EU868-FR_8CH.json
│ │ ├── IN865-IN_8CH.json
│ │ ├── RU864-RU_8CH.json
│ │ ├── RU864-RU_8CH_Legacy.json
│ │ └── US915-US_8CH.json
│ ├── ibts
│ │ ├── AS923-JP_16CH.json
│ │ ├── AU915-AU_16CH.json
│ │ ├── AU915-AU_64CH.json
│ │ ├── EU868-FR_16CH.json
│ │ ├── EU868-FR_2x8CH.json
│ │ ├── IN865-IN_8CH.json
│ │ ├── RU864-RU_16CH.json
│ │ ├── US915-US_16CH.json
│ │ └── US915-US_64CH.json
│ ├── misc
│ │ └── remote-api.json
│ ├── wifc
│ │ ├── AS923-JP_8CH.json
│ │ ├── AS923-KR_8CH.json
│ │ ├── AS923-TH-SG-HK-TW_8CH.json
│ │ ├── AU915-AU_8CH.json
│ │ ├── EU868-FR_8CH.json
│ │ ├── IN865-IN_8CH.json
│ │ ├── RU864-RU_8CH.json
│ │ ├── RU864-RU_8CH_Legacy.json
│ │ └── US915-US_8CH.json
│ └── wiis
│ ├── AS923-JP_8CH.json
│ ├── AS923-KR_8CH.json
│ ├── AS923-TH-SG-HK-TW_8CH.json
│ ├── AU915-AU_8CH.json
│ ├── EU868-FR_8CH.json
│ ├── IN865-IN_8CH.json
│ ├── RU864-RU_8CH.json
│ ├── RU864-RU_8CH_Legacy.json
│ └── US915-US_8CH.json
├── sbin
│ ├── lorad-ibts # lorad binary for iBTS
│ ├── lorad-wifc # lorad binary for iFemtoCell
│ ├── lorad-wiis # lorad binary for iStation
│ ├── lorad-fevo # lorad binary for iFemtoCell-evolution
│ ├── lorafwd # lorafwd binary
│ ├── lorafwdctl
│ └── loramodem # Only for Wirnet iBTS
└── share
└── lorad
└── fpga_v61.bin # Only for Wirnet iBTS
===== How to configure and monitor the packet forwarder? =====
The configuration is achieved in 3 steps:
* //lorad// configuration
* //lorafwd// configuration
* monitoring and auto-start configuration
==== lorad configuration ====
The goal of the lorad configuration is to define the frequency plan that will be used to receive packets from the end-devices, to enable the LBT feature and to configure the class B beacons.
* A few frequency plan templates are pre-installed on the gateway (under ''/user/etc/lorad/PLATFORM'' where //PLATFORM// equal to //ibts//, //wifc//, //wiis// or //fevo//): it is strongly recommended to copy the expected frequency plan templates in ''/user/etc/lorad/'' directory and create symlink ''/user/etc/lorad/lorad.json'' to this copied file. The goal is to keep templates unmodified.
* Edit ''/etc/default/lorad'' and make sure that the ''CONFIGURATION_FILE'' field links to the template you previously copied.
* Edit the template you copied to adapt it to your needs. Since the hardware between gateways is different, the configuration on each gateway differs (although it is quite similar).
++++ Wirnet iBTS|
Wirnet iBTS gateways cannot listen to all LoRa frequencies simultaneously. Up to 16 frequencies can be handled at the same time per LoRa board. There can be up to 4 LoRa boards in an iBTS.\\
\\
**Templates structure**\\
Each template contains an object and an array:
* ''SX1301_array_conf'' is an array that contains the configuration of each LoRa board.\\
* ''gateway_conf'' is an object that contains the class B configuration.\\
{
"SX1301_array_conf": [
{...}, # LoRa board 1
{...}, # LoRa board 2
...
],
"gateway_conf":{
... # Class B configuration
}
}
\\
There are many configuration fields among the templates, but most of them are by default correctly filled.\\
\\
**Antennas configuration**\\
The front-end board of each LoRa 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). A look at the [[wiki:lora:features#lora_specific_hardware|]] may help to understand.\\
To understand every possible antenna configurations, read chapter 4.6.2.5 of the Installation manual.
* ''rx_enable'': Is used to enable or disable emission of the antennas.
* ''tx_enable'': Is used to enable or disable reception of the antennas.
* ''antenna_gain'': Is used to define the gain of the antenna. This field has to be correctly filled, otherwise, the gateway will use more power to emits packets than what was initially planned by the LNS.
* ''insertion_loss'': Is used to define the attenuation due to the cable between the gateway and the antenna.
__Single antenna configuration:__
"rf_chain_conf": [
{
"rx_enable": true,
"tx_enable": true,
"antenna_gain": 3,
"insertion_loss": 0.5,
"tx_freq_min": 863000000,
"tx_freq_max": 870000000
}
],
__Dual antenna configuration:__
"rf_chain_conf": [
{
"rx_enable": true,
"tx_enable": true,
"antenna_gain": 3,
"insertion_loss": 0.5,
"tx_freq_min": 863000000,
"tx_freq_max": 870000000
},
{
"rx_enable": true,
"tx_enable": true,
"antenna_gain": 3,
"insertion_loss": 0.5,
"tx_freq_min": 863000000,
"tx_freq_max": 870000000
}
],
**Radio Frequencies configurations**\\
\\
Each LoRaLoc module contains two SX1301. Each SX1301 can be configured to use 10 different frequencies. However, these channels need to be contained within a 3 MHz bandwidth.
* ''chip_center_freq'': Is used to define the center frequency of the SX1301. All 10 channels will be around this particular frequency (+/- 1.5 MHz).
* ''chan_rx_freq'': Are used to define each channel's center frequency. In order to respect SX1301 bandwidth, maximum values are defined by ''chip_center_freq'' +/- 1.4 MHz.
* ''chip_rf_chain'': Defines which rf chain is used by the SX1301. See antenna configuration for more details.
"SX1301_conf":[
{
"chip_rf_chain": 0,
"chip_center_freq": 866000000,
"chan_multiSF_0": { "chan_rx_freq": 865500000, "spread_factor": "7-12" },
"chan_multiSF_1": { "chan_rx_freq": 865700000, "spread_factor": "7-12" },
"chan_multiSF_2": { "chan_rx_freq": 865900000, "spread_factor": "7-12" },
"chan_multiSF_3": { "chan_rx_freq": 866100000, "spread_factor": "7-12" },
"chan_multiSF_4": { "chan_rx_freq": 866300000, "spread_factor": "7-12" },
"chan_multiSF_5": { "chan_rx_freq": 866500000, "spread_factor": "7-12" },
"chan_multiSF_6": { "chan_rx_freq": 867100000, "spread_factor": "7-12" },
"chan_multiSF_7": { "chan_rx_freq": 867300000, "spread_factor": "7-12" },
"chan_LoRa_std" : { "chan_rx_freq": 867300000, "bandwidth": 250000, "spread_factor": 7 },
"chan_FSK" : { "chan_rx_freq": 866900000, "bandwidth": 125000, "bit_rate": 50000 }
},{
"chip_rf_chain": 1,
"chip_center_freq": 868000000,
"chan_multiSF_0": { "chan_rx_freq": 867500000, "spread_factor": "7-12" },
"chan_multiSF_1": { "chan_rx_freq": 867700000, "spread_factor": "7-12" },
"chan_multiSF_2": { "chan_rx_freq": 867900000, "spread_factor": "7-12" },
"chan_multiSF_3": { "chan_rx_freq": 868100000, "spread_factor": "7-12" },
"chan_multiSF_4": { "chan_rx_freq": 868300000, "spread_factor": "7-12" },
"chan_multiSF_5": { "chan_rx_freq": 868500000, "spread_factor": "7-12" },
"chan_multiSF_6": { "chan_rx_freq": 868700000, "spread_factor": "7-12" },
"chan_multiSF_7": { "chan_rx_freq": 868900000, "spread_factor": "7-12" },
"chan_LoRa_std" : { "chan_rx_freq": 868300000, "bandwidth": 250000, "spread_factor": 7 },
"chan_FSK" : { "chan_rx_freq": 869100000, "bandwidth": 125000, "bit_rate": 50000 }
}],
\\
**Listen Before Talk configuration**\\
\\
Listen Before Talk (LBT) is a technique used in radiocommunications whereby a radio transmitter first senses its radio environment before starting a transmission.\\
\\
This feature is mandatory in a few countries (such as Japan and Korea).
* ''enable'': Enable or disable LBT.
* ''rssi_target'': The RSSI threshold to detect if channels are busy or not (dBm).
* ''chan_cfg'':
* ''freq_hz'': The LBT channel frequency in Hz. These frequencies needs to be the same as the one in the ''SX1301_conf'' array.
* ''scan_time_us'': The LBT channel scan time to be used (only two available values: 128µs or 5ms).
* ''transmit_time_ms'': Maximum transmission delay allowed (only two available values: 4000ms or 400ms).
"lbt_conf":{
"enable": true,
"rssi_target": -80,
"chan_cfg":[
{ "freq_hz": 922000000, "scan_time_us": 5000, "transmit_time_ms": 4000 },
{ "freq_hz": 922200000, "scan_time_us": 5000, "transmit_time_ms": 4000 },
{ "freq_hz": 922400000, "scan_time_us": 5000, "transmit_time_ms": 400 },
{ "freq_hz": 922600000, "scan_time_us": 5000, "transmit_time_ms": 400 },
{ "freq_hz": 922800000, "scan_time_us": 5000, "transmit_time_ms": 400 },
{ "freq_hz": 923000000, "scan_time_us": 5000, "transmit_time_ms": 400 },
{ "freq_hz": 923200000, "scan_time_us": 5000, "transmit_time_ms": 400 },
{ "freq_hz": 923400000, "scan_time_us": 150008, "transmit_time_ms": 400 }
]
},
++++
++++ Wirnet iFemtoCell, iFemtoCell-evolution and Wirnet iStation|
Note that the class-B configuration does not apply to gateways Wirnet iFemtocell and iFemtoCell-evolution since they have no GPS.
The Wirnet iFemtoCell, iFemtoCell-evolution and Wirnet iStation cannot listen to all LoRa frequencies simultaneously. Up to 8 frequencies can be handled at the same time by the demodulator (SX1301).\\
\\
To understand how the frequency configuration works, it is necessary to know that the Wirnet iFemtoCell, Wirnet iFemtoCell-evolution and Wirnet iStation hardware contain an RF front-ends connected to 2 SX1257 chips. A look at the [[wiki:lora:features#lora_specific_hardware|]] may help to understand. Each of these chips has a 0.8 MHz Bandwidth. Thus, all 8 channels must be contained within these two 0.8 MHz intervals.\\
\\
To properly configure the Rx channels, the center frequencies of the chips must be defined.
\\
Once the center frequencies are defined, each channel can be configured.
\\
Here are a few rules/information to configure the frequencies:
* Both chips are not necessarily used.
* Both chips' bandwidth can overlap.
* Channels can overlap.
* All 8 frequencies can be contained within one single chip's bandwidth.
* Not all 8 frequencies are necessarily used.
* Avoid the use of the chip's center frequencies as a channel.
\\
There are many configuration fields among the templates, but most of them are by default correctly filled.\\
\\
**Front-end configuration**
* ''antenna_gain'': Is used to define the gain of the antenna. If you use the default Kerlink antenna don't change it. This field has to be correctly filled, otherwise, the gateway will use more power to emits packets than what was initially planned by the LNS.
* ''insertion_loss'': Is used to define the attenuation due to the cable between the gateway and the antenna. When there is no cable, the correct value is 0.
* ''radio_n''
* ''enable'': Enable/disable SX1257.
* ''freq'': Is used to define the center frequency of the SX1257. All channels will be around this particular frequency (+/- 0.4Mhz).
* ''tx_enable'': Enable/disable signal emission capabilities on the SX1257. Only radio_0 must be enabled.
"lorawan_public": true,
"antenna_gain": 3,
"antenna_gain_desc": "Antenna gain, in dBi",
"insertion_loss": 0,
"insertion_loss_desc": "Insertion loss, in dBi",
"radio_0": {
"enable": true,
"freq": 867500000,
"tx_enable": true,
"tx_freq_min": 863000000,
"tx_freq_max": 870000000,
},
"radio_1": {
"enable": true,
"freq": 868500000,
"tx_enable": false
},
**Radio frequencies configuration**
* ''chan_multiSF_X''
* ''enable'': Enable/disable the channel.
* ''radio'': Define which frontend (SX1257) is used by the channel (''0'' or ''1'' expected).
* ''if'': Intermediate frequency. Value that defines a channnel frequency (value added to the center frequency).
/* Lora MAC channels, 125kHz, all SF */
"chan_multiSF_0": { "enable": true, "radio": 0, "if": -400000 },
"chan_multiSF_1": { "enable": true, "radio": 0, "if": -200000 },
"chan_multiSF_2": { "enable": true, "radio": 0, "if": 0 },
"chan_multiSF_3": { "enable": true, "radio": 0, "if": 200000 },
"chan_multiSF_4": { "enable": true, "radio": 0, "if": 400000 },
"chan_multiSF_5": { "enable": true, "radio": 1, "if": -400000 },
"chan_multiSF_6": { "enable": true, "radio": 1, "if": -200000 },
"chan_multiSF_7": { "enable": true, "radio": 1, "if": 0 },
**Listen Before Talk configuration**\\
\\
Listen Before Talk (LBT) is a technique used in radiocommunications whereby a radio transmitter first senses its radio environment before starting a transmission.\\
\\
This feature is mandatory in a few countries (such as Japan and Korea).
* ''enable'': Enable or disable LBT.
* ''rssi_target'': The RSSI threshold to detect if the channel is busy or not (dBm).
* ''chan_cfg''
* ''freq_hz'': The LBT channel frequency in Hz. These frequencies need to be the same as the one in the ''chan_multiSF_X'' JSON arrays.
* ''scan_time_us'': The LBT channel scan time to be used (only two available values: 128µs or 5000µs).
/* Listen Before Talk */
"lbt_cfg": {
"enable": true,
"rssi_target": -80,
"chan_cfg": [
{ "freq_hz": 922000000, "scan_time_us": 5000 },
{ "freq_hz": 922200000, "scan_time_us": 5000 },
{ "freq_hz": 922400000, "scan_time_us": 5000 },
{ "freq_hz": 922600000, "scan_time_us": 5000 },
{ "freq_hz": 922800000, "scan_time_us": 5000 },
{ "freq_hz": 923000000, "scan_time_us": 5000 },
{ "freq_hz": 923200000, "scan_time_us": 5000 },
{ "freq_hz": 923400000, "scan_time_us": 5000 }
]
},
++++
==== lorafwd configuration ====
The goal of the lorafwd configuration is mainly to define to which LNS LoRa packets will be forwarded to.
* Edit ''/user/etc/lorafwd/lorafwd.toml''. This configuration file is formatted using the TOML v0.5.0 language:
* Most keys are pre-configured with correct values.
* The description of each key is directly written in the configuration file.
* Hereunder are the keys that must changed to chose your LNS:
* ''gwmp.node = "localhost"'': The address of the LNS.
* ''gwmp.service.uplink = 20000'': The uplink port of the LNS.
* ''gwmp.service.downlink = 20000'' : The downlink port of the LNS.
==== Monitoring and auto-start configuration ====
By default, both lorad and lorafwd are started at boot time. If for some reason, one of the daemons stops, it will be automatically restarted by ''monit''.
* The autostart behavior is handled by the symlinks ''/etc/rcU.d/S50lorad'' and ''/etc/rcU.d/S51lorafwd''.
* The monitoring behavior is handled by the ''/etc/monit.d/lorad'' and ''/etc/monit.d/lorafwd'' files.
The daemons can be started/stopped/rebooted and monitored with ''monit''. See [[wiki:systeme_mana:monitoring#monit_daemon|monit page]] for more details.
Both daemons are independent. If one is stopped/restarted, the other one does not need to be stopped/restarted.
==== Log managment ====
Both daemons generates logs in the ''/var/log/lora.log*'' files.
The verbosity of the daemons can be increased using the ''EXTRA_ARGS'' field under ''/etc/default/lorad''and ''/etc/default/lorafwd''.
__lorad:__
* NOTICE = ''-v'': displays start and stop traces
* INFO = ''-vv'':
* Displays the configuration of the hardware (frequencies, bandwidth, spreading factor, antenna, LBT, ...)
* Displays the number of uplinks and beacons sent.
* Displays TAI/PPS info
* ...
* DEBUG = ''-vvv'': Displays the hexdump of the packets
__lorafwd:__
* NOTICE = ''-v'': displays start and stop traces
* INFO = ''-vv'':
* Displays the configuration of the forwarder (gateway ID, LNS, uplink/downlink port, GWMP configuration, ...)
* Displays the uplinks and downlink meta-data
* Displays the acknowledge / heartbeat / drop traces
* ...
* DEBUG = ''-vvv'': Displays the hexdump of the packets