User Tools

Site Tools


wiki:lora:multiforwarder

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:lora:multiforwarder [2022/08/30 16:08]
mbi created
wiki:lora:multiforwarder [2022/12/20 17:11] (current)
ehe [Creation of the instance]
Line 1: Line 1:
 ====== Multi Packet Forwarder ​ ====== ====== Multi Packet Forwarder ​ ======
  
 +<note important>​**This functionnality is only available for Keros version 5.5.1 and above**</​note>​
  
-===== Multi lorafwd instance management ===== 
  
-=== Compatibility === 
-This feature is available from KerOS version 5.1. 
  
-=== Features ​=== +===== lorafwd_instance_manager =====
-Following features are available:+
  
-  *  Add new instance of lorafwd +This tool allows the create and manage multiple instances of packet forwarder to connect ​gateway to multiple LNS.
-  *  Delete an instance of lorafwd +
-  *  Check if an instance exists +
-  *  List all added instances+
  
-=== How does it work? === +Following features are available in ''​lorafwd_instance_manager''​ tool:
-KerOS firmware contains lorafwd template files located in /​etc/​lorafwd/​templates/​. These files must not be deleted or modified.+
  
-Each time lorafwd is added, these templates files are copied, modified and suffixed with new lorafwd instance ​name.+  *  Add a new instance of lorafwd ​(''​add <​instance_name>''​) 
 +  *  Delete an instance ​of lorafwd (''​delete <​instance_name>''​) 
 +  *  Check if an instance exists ​  ​(''​check <​instance_name>''​) 
 +  *  List all added instances ​     (''​list''​)
  
-For example, if lorafwd instance "​foo"​ is added and runs, it leads to the following ​created ​files:+  
 +Only UDP/GWMP packet forwarder instances can be created ​but they can be used at the same time as a [[basic_station_forwarder|Kerlink Basic Station Packet forwarder]].
  
-  * /​etc/​default/​lorafwd_foo # Created with lorafwd_instance_manager script 
-  * /​etc/​init.d/​lorafwd_foo # Created with lorafwd_instance_manager script 
-  * /​etc/​monit.d/​lorafwd_foo # Created with lorafwd_instance_manager script 
-  * /​etc/​rcK.d/​K52lorafwd_foo # Created with lorafwd_instance_manager script 
-  * /​etc/​rcU.d/​S51lorafwd_foo # Created with lorafwd_instance_manager script 
-  * /​etc/​rsyslog.d/​lorafwd_foo # Created with lorafwd_instance_manager script 
-  * /​etc/​sysupgrade.d/​lorafwd_foo.conf # Created at first start 
-  * /​etc/​lorafwd_foo.toml # Created with lorafwd_instance_manager script 
-  * /​run/​lora/​lorafwd_foo.pid # Created each time it is started 
-  * /​tmp/​lorafwd_foo_version # Created each time it is started 
-  * /​usr/​sbin/​lorafwd_foo -> /​usr/​sbin/​lorafwd # Created with lorafwd_instance_manager script 
-  * /​var/​lib/​lorafwd_foo/​database.sqlite # Created at first start 
-  * Configuration files, sqlite database and pid files are duplicated. That means all lorafwd instances are separated. 
  
-=== lorafwd_instance_manager commands ===+<note important>​When using the multi-packet forwarder feature, usage of netid filtering is highly recommended to avoid downlink collision.
  
-**add command** +**Note also that the last instance ​of lorafwd will define ​the radio parameters of your gateway**</​note>​
-Add lorafwd ​instance. The arguments are the following:+
  
-  * instance_name:​ unique lorafwd instance name ("​foo"​ in previous example) 
  
-Example: 
-''​lorafwd_instance_manager add foo''​ 
  
 +===== How to create and configure multiple instances =====
 +==== Creation of the instance ====
 +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:
 +<​code>​lorafwd_instance_manager add second_instance</​code>​
 +<​note>​ In the example the instance is named "​second_instance"​ but you can name it as you like.</​note>​
  
-**delete command** +It will create all the files needed for its configuration.
-Delete additional lorafwd instance. The arguments are the following:​ +
- +
-  * instance_name:​ unique lorafwd instance name ("​foo"​ in previous example) +
-  +
-Example: +
-''​lorafwd_instance_manager delete foo''​+
  
-**check command** +**List of generated files:** 
-Check if additional lorafwd instance existsThe arguments are the following:+<code bash> 
 +
 +|-- 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 
 +</​code>​
  
-  * instance_name:​ unique lorafwd instance name ("​foo"​ in previous example) 
  
-Example: 
-''​lorafwd_instance_manager check foo''​ 
  
-**list command** +==== Configuration of the instance ==== 
-List additional lorafwd instances.​+Then, to configure the new instance, you will need to use the [[wiki:​keros_custo:​keros_applications_configuration|klk_apps_config]] as follow:
  
-Example: +<​code>​klk_apps_config --activate-lorafwd -i second_instance --lns-server second_instance.url --lns-dport 1700 --lns-uport 1700</​code>​
-''​lorafwd_instance_manager list''​+
  
-===== Logs Example===== +<​note>​After //​--lns-server --lns-dport --lns-uport//​ enter your own informations according to [[wiki:keros_custo:​keros_applications_configuration|klk_apps_config]] parameters</​note>​
  
 +===== Logs =====
  
-Logs 
-All lorafwd instances write to the same log file (like lorad) /​var/​log/​lora.log,​ but each lorafwd is suffixed, for example: 
  
-  * 2021-05-20T14:​17:​11.588309+00:​00 klk-wifc-03001D lorad[10784]:​ <6> Sent 1 uplink message +All lorafwd ​instances will write into the same log file ''/​var/​log/lora.log''​and are distinguished by their namesfor example:
-  * 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/+
-  * 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_foo[11880]:​ <6> Received uplink message:  +
-  * 2021-05-20T14:​17:​14.183584+00:​00 klk-wifc-03001D lorafwd_foo[11880]:​ <6> | lora uplink (1F70167D), payload 25 B, channel 868.1 MHzcrc okbw 125 kHz, sf 7, cr 4/5 +
-  * 2021-05-20T14:17:​14.183651+00:​00 klk-wifc-03001D lorafwd_foo[11880]:​ <6> | Unconfirmed Data Up, DevAddr 00430024, FCnt 467, FPort 25 +
-  * 2021-05-20T14:​17:​14.183695+00:​00 klk-wifc-03001D lorafwd_foo[11880]:​ <6> |  - radio (00000105) +
-  * 2021-05-20T14:​17:​14.183786+00:​00 klk-wifc-03001D lorafwd_foo[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_foo[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_foo[11880]:​ <6> Uplink message (FB49) acknowledged in 2.80792 ms+
  
 +<​code>​
 +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
 +</​code>​
wiki/lora/multiforwarder.1661868515.txt.gz · Last modified: 2022/08/30 16:08 by mbi