This tool allows the create and manage multiple instances of packet forwarder to connect a gateway to multiple LNS.
Following features are available in lorafwd_instance_manager
tool:
add <instance_name>
)delete <instance_name>
)check <instance_name>
)list
)Only UDP/GWMP packet forwarder instances can be created but they can be used at the same time as a Kerlink Basic Station Packet forwarder.
Note also that the last instance of lorafwd will define the radio parameters of your gateway
If you want to connect your gateway to a second LNS, you will need to create a new instance of lorafwd. To do this, use the following command:
lorafwd_instance_manager add second_instance
It will create all the files needed for its configuration.
List of generated files:
/ |-- etc | |-- lorafwd_second_instance.toml | |-- default | | `-- lorafwd_second_instance | |-- init.d | | `-- lorafwd_second_instance | |-- monit.d | | `-- lorafwd_second_instance | |-- rcK.d | | `-- K52lorafwd_second_instance -> /etc/init.d/lorafwd_second_instance | |-- rcU.d | | `-- S51lorafwd_second_instance -> /etc/init.d/lorafwd_second_instance | |-- rsyslog.d | | `-- lorafwd_second_instance | `-- sysupgrade.d | `-- lorafwd_second_instance.conf |-- run | `-- lora | `-- lorafwd_second_instance.pid # Created each time it is started |-- tmp | `-- lorafwd_second_instance_version # Created each time it is started |-- usr | `-- sbin | `-- lorafwd_second_instance -> /usr/sbin/lorafwd `-- var `-- lib `-- lorafwd_second_instance `-- database.sqlite # Created at first start
Then, to configure the new instance, you will need to use the klk_apps_config as follow:
klk_apps_config --activate-lorafwd -i second_instance --lns-server second_instance.url --lns-dport 1700 --lns-uport 1700
All lorafwd instances will write into the same log file /var/log/lora.log
, and are distinguished by their names, for example:
2021-05-20T14:17:11.588309+00:00 klk-wifc-03001D lorad[10784]: <6> Sent 1 uplink message 2021-05-20T14:17:11.631126+00:00 klk-wifc-03001D lorafwd_foo[11880]: <6> Heartbeat (F938) sent 2021-05-20T14:17:11.633762+00:00 klk-wifc-03001D lorafwd_foo[11880]: <6> Heartbeat (F938) acknowledged in 2.6289 ms 2021-05-20T14:17:13.446644+00:00 klk-wifc-03001D lorafwd[11552]: <6> Heartbeat (9FC3) sent 2021-05-20T14:17:13.449302+00:00 klk-wifc-03001D lorafwd[11552]: <6> Heartbeat (9FC3) acknowledged in 2.6239 ms 2021-05-20T14:17:14.179913+00:00 klk-wifc-03001D lorafwd[11552]: <6> Received uplink message: 2021-05-20T14:17:14.180028+00:00 klk-wifc-03001D lorafwd[11552]: <6> | lora uplink (1F70167D), payload 25 B, channel 868.1 MHz, crc ok, bw 125 kHz, sf 7, cr 4/5 2021-05-20T14:17:14.180093+00:00 klk-wifc-03001D lorafwd[11552]: <6> | Unconfirmed Data Up, DevAddr 00430024, FCnt 467, FPort 25 2021-05-20T14:17:14.180139+00:00 klk-wifc-03001D lorafwd[11552]: <6> | - radio (00000105) 2021-05-20T14:17:14.180233+00:00 klk-wifc-03001D lorafwd[11552]: <6> | - demodulator counter 3502620444, UTC time 2021-05-20T14:17:14.173866Z, rssi -64 dB, snr 7.5< 10 <12.5 dB 2021-05-20T14:17:14.181910+00:00 klk-wifc-03001D lorafwd[11552]: <6> Uplink message (ABD8) sent 2021-05-20T14:17:14.183471+00:00 klk-wifc-03001D lorafwd_second_instance[11880]: <6> Received uplink message: 2021-05-20T14:17:14.183584+00:00 klk-wifc-03001D lorafwd_second_instance[11880]: <6> | lora uplink (1F70167D), payload 25 B, channel 868.1 MHz, crc ok, bw 125 kHz, sf 7, cr 4/5 2021-05-20T14:17:14.183651+00:00 klk-wifc-03001D lorafwd_second_instance[11880]: <6> | Unconfirmed Data Up, DevAddr 00430024, FCnt 467, FPort 25 2021-05-20T14:17:14.183695+00:00 klk-wifc-03001D lorafwd_second_instance[11880]: <6> | - radio (00000105) 2021-05-20T14:17:14.183786+00:00 klk-wifc-03001D lorafwd_second_instance[11880]: <6> | - demodulator counter 3502620444, UTC time 2021-05-20T14:17:14.173866Z, rssi -64 dB, snr 7.5< 10 <12.5 dB 2021-05-20T14:17:14.185793+00:00 klk-wifc-03001D lorafwd[11552]: <6> Uplink message (ABD8) acknowledged in 3.85701 ms 2021-05-20T14:17:14.186798+00:00 klk-wifc-03001D lorafwd_second_instance[11880]: <6> Uplink message (FB49) sent 2021-05-20T14:17:14.187286+00:00 klk-wifc-03001D lorad[10784]: <6> Sent 1 uplink message 2021-05-20T14:17:14.189619+00:00 klk-wifc-03001D lorafwd_second_instance[11880]: <6> Uplink message (FB49) acknowledged in 2.80792 ms