User Tools

Site Tools


wiki:lora:basic_station_forwarder

Differences

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

Link to this comparison view

Next revision
Previous revision
wiki:lora:basic_station_forwarder [2022/12/08 12:02]
ehe created
wiki:lora:basic_station_forwarder [2024/04/11 12:09] (current)
ehe
Line 11: Line 11:
 It implements the same protocols and authentication methods than [[https://​lora-developers.semtech.com/​build/​software/​lora-basics/​lora-basics-for-gateways/​|Semtech LoRa Basics™ Station]] reference implementation. It implements the same protocols and authentication methods than [[https://​lora-developers.semtech.com/​build/​software/​lora-basics/​lora-basics-for-gateways/​|Semtech LoRa Basics™ Station]] reference implementation.
  
-{{:playground:​lora:​basicstation_overview.png?​800|}}+{{:wiki:​lora:​basicstation_overview.png?​800|}}
  
  
Line 43: Line 43:
 to [[wiki:​resources:​resources|resources section]] to upgrade to 5.x </​note>​ to [[wiki:​resources:​resources|resources section]] to upgrade to 5.x </​note>​
  
 +
 +<note important>​For gateways configured with version 4.4.1 for AWS, it's necessary to install [[https://​wikikerlink.fr/​wirnet-productline/​doku.php?​id=wiki:​firmware:​lastversion#​download|Liveburner IPK 5.X]] and [[https://​wikikerlink.fr/​wirnet-productline/​doku.php?​id=wiki:​lora:​bspf_ressources#​download|Basic Station Packet Forwarder]]. \\
 +Please see on [[wiki:​lora:​aws|AWS IoT Core for LoRaWAN - Kerlink documentation]] for more information</​note> ​
  
 ==== Installation ==== ==== Installation ====
Line 76: Line 79:
         ├── bin         ├── bin
         │   ├── klk_bs_config         │   ├── klk_bs_config
 +        │   ├── klk_loriot_config
 +        │   ├── klk_ttn_config
         │   └── station         │   └── station
         ├── etc         ├── etc
Line 158: Line 163:
 </​note>​ </​note>​
  
 +=== LNS Connection Status ===
 +
 +Since version 2.5.0, the [[wiki:​systeme_mana:​peripherals#​other_leds|backhaul LEDs]] (Wirnet iFemtocell/​iZeptocell) indicate the status of the LNS connection :
 +  * a green LED indicates that connection to the LNS has been established
 +  * a red LED indicates that connection has been either lost or not yet established
 +
 +<​note>​
 +When WMC is used at the same time than Basic Station Packet Forwarder, the backhaul LED's behavior is unreliable.
 +</​note>​
  
 ===== Advanced configuration ===== ===== Advanced configuration =====
 +
 +==== LBT/CCA specific case ====
 +
 +<​note>​Only available since [[bspf_v2.4.1|version 2.4]] ( for "Land Mobile Station"​ use cases, please contact Kerlink support)</​note>​
 +
 +For LNS which doesn'​t embed AS923-1 with LBT, it needs to be activated manually by using following commands:
 +
 +<code bash>
 +# Disable current config
 +klk_bs_config --disable
 +
 +# Use "​Japan"​ lorad configuration explicitly and prevent from reconfiguration from LNS 
 +klk_bs_config --enable --loradconf AS923-1-JP.json --ignore-reconf
 +</​code>​
 +
 +
  
 ==== Kerlink Basic Station Packet Forwarder configuration ==== ==== Kerlink Basic Station Packet Forwarder configuration ====
Line 172: Line 202:
   * Change CUPS request interval   * Change CUPS request interval
   * Activate packet buffering (database)   * Activate packet buffering (database)
 +  * Activate or disable websockets ping functionality (and set the ping interval)
  
 An example of this configuration file is provided in ''/​user/​basic_station/​etc/​station.conf.example''​. An example of this configuration file is provided in ''/​user/​basic_station/​etc/​station.conf.example''​.
Line 188: Line 219:
  
  
-==== Packet buffering ​(Beta version) ​====+==== Packet buffering ====
  
-Packet buffering allows to store all uplink packets not correctly ​transmitted to LNS server.+Packet buffering allows to store uplink packets not transmitted to the LNS server ​when the link between gateway and server is broken.
  
-Application ​will then retry periodically to re-connect to LNS Server and as soon as the connection is back, all stored packets will be pushed in FIFO mode (First In, First Out) to respect packets chronology.+The application ​will then retry periodically to re-connect to the LNS Server and as soon as the connection is back, all stored packets will be pushed in FIFO mode (First In, First Out) to respect packets chronology.
  
 In order to activate it: In order to activate it:
   - Copy ''/​user/​basic_station/​etc/​station.conf.example''​ to ''/​user/​basic_station/​etc/​station.conf''​   - Copy ''/​user/​basic_station/​etc/​station.conf.example''​ to ''/​user/​basic_station/​etc/​station.conf''​
-  - Edit ''/​user/​basic_station/​etc/​station.conf''​ and locate ''​[database]''​ section+  - Edit ''/​user/​basic_station/​etc/​station.conf''​ and locate ​the ''​[database]''​ section
   - Un-comment ''​enable = True''​ line   - Un-comment ''​enable = True''​ line
   - Save file   - Save file
   - Restart application ''/​etc/​init.d/​station restart''​   - Restart application ''/​etc/​init.d/​station restart''​
  
 +==== Local DevAddr Filtering ====
 +
 +In the case the LNS does not provide any NetID filter in the router_config message, it is possible to set local filters in order to only forward LoRa uplinks provided by a subset of devices.
 +
 +To configure this feature, use the '​-f'​ option of the klk_bs_config tool, and provide inclusive and/or exclusive filters to indicate the sets of DevAddr to be kept and/or rejected.
 +
 +( see https://​wikikerlink.fr/​wirnet-productline/​doku.php?​id=wiki:​lora:​advanced_features#​lorawan_frame_filtering for more details about filters values )
 +
 +++++Example:​|
 +
 +<code bash>
 +klk_bs_config -e -f "​24abcdef/​7"​ -f "​!24abcdef/​12"​
 +</​code>​
 +Will configure basic station to forward messages provided by devices with DevAddr between 0x24000000 and 0x249fffff , or between 0x24b00000 and 0x25ffffff .
 +
 +++++
 +<note info>
 +The lead "​0x"​ is not required before the base address of the filter.
 +</​note>​
 +
 +==== TTN LNS configuration tool ====
 +
 +To ease declaration of a gateway on the TTN (thethings.network),​ TTI (thethings.industries) or TTS (The Things Stack Enterprise / Open Source) LNS, use the ''​klk_ttn_config''​ tool.\\
 +This tool adds the gateway on the server and creates its associated CUPS and LNS keys.\\
 +\\
 +To use this tool, you need:
 +  * an API token
 +  * the API server URL
 +  * the chose frequency plan
 +
 +<note warning>''​klk_bs_config''​ is still required after this to complete the Basic Station configuration.</​note>​
 +
 +<note important>​
 +  * On TTN ''​klk_ttn_config''​ can only be used one time per gateway due to certain TTN restrictions (even after removing the gateway from TTN)\\
 +  * On TTI the gateway needs to be remove and purged in order to reuse ''​klk_ttn_config''​
 +</​note>​
 +
 +++++Example:​|
 +<note warning>
 +Take care to the URL format, it will not work if there is a trailing slash at the end.
 +</​note>​
 +<code bash>
 +# Use TTN configuration tool for TTN LNS
 +klk_ttn_config -u https://​eu1.cloud.thethings.network -t NNSXS.R6D3ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI.ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIABCDEFGHIJKLMNOPQ -f EU_863_870
 +
 +# Use TTN configuration tool for TTI LNS where tenant is your Tenant ID
 +klk_ttn_config -u https://​tenant.eu1.cloud.thethings.industries -t NNSXS.R6D3ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI.ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIABCDEFGHIJKLMNOPQ -f EU_863_870
 +</​code>​
 +++++
 +
 +<​note>​
 +The ''​klk_ttn_config''​ tool has been designed to be called from a [[wiki:​systeme_mana:​ztp|Zero Touch Provisioning]] job.
 +</​note>​
 +
 +++++How to generate an TTI API key?|
 +**Prerequisite:​** You have to create a TTI account \\
 +
 +To automatically connect Kerlink Gateways to TTI LNS, you have to delegate some rights to Kerlink thanks to an “API key”. Please follow those steps: \\ \\
 +Step 1 - Connect to your TTI user account \\
 +{{:​images:​1_tti_user_account.jpg?​250|}} \\
 +
 +Step 2 - Go to Personal API keys OR TTI organization API key \\
 +{{:​images:​2_personal_api_keys.jpg?​300|}} \\
 +
 +Step 3 - Add a new API key \\
 +{{:​images:​3_add_api_key.jpg?​900|}} \\
 + 
 +Step 4 - Create the API key with rights limited to GW creation and edition \\
 +{{:​images:​4_rights_limited.jpg?​450|}} ​ \\
 +
 +Step 5 - Save API key \\
 +{{:​images:​5_save_api_key.jpg?​450|}} \\
 +++++
 +==== Loriot LNS configuration tool ====
 +
 +To ease declaration of a gateway on the Loriot LNS, use the ''​klk_loriot_config''​ tool.
 +This tool creates the gateway on the server and installs the resulting LNS credentials on the gateway.
 +
 +To use this tool, you need:
 +  * an API key
 +  * the API server URL
 +  * a network ID
 +  * LoRaWAN region
 +  * Channel plans (1 to 8) comma separated (optional)
 +<note important>​
 +''​klk_bs_config''​ is still required after this to complete the Basic Station configuration.
 +</​note>​
 +
 +++++Example:​|
 +<code bash>
 +# Use Loriot configuration tool in region US902 with 3 channel plans (US915_CH16_23,​ US915_CH40_47 and US915_CH56_63)
 +klk_loriot_config -k ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJK-321abcdefgh -u https://​eu1.loriot.io/​1/​nwk -n ABCD1234 -r US902-928 -p 3,6,8
 +</​code>​
 +++++
 +<​note>​
 +The ''​klk_loriot_config''​ tool has been designed to be called from a [[wiki:​systeme_mana:​ztp|Zero Touch Provisioning]] job.
 +</​note>​
 +
 +++++How to generate an LORIOT API key?|
 +**Prerequisite:​** LORIOT account \\
 +
 +[[https://​docs.loriot.io/​display/​NMS/​Create+an+API+key|LORIOT - Create an API key]]
 +++++
 +==== AWS LNS configuration tool ====
 +
 +To ease declaration of a gateway on the AWS LNS, use the ''​klk_aws_config''​ tool.
 +This tool creates the gateway on the server and installs the resulting LNS credentials on the gateway.
 +
 +To use this tool, you need:
 +  * an API user ID
 +  * an API key ID
 +  * an API key secret
 +  * the region of the AWS server the gateway will be declared on
 +  * the LoRaWan region of the gateway
 +  * the Frequency Sub Band(s) to use (required for US915 and AU915)
 +<note important>​
 +''​klk_bs_config''​ is still required after this to complete the Basic Station configuration.
 +</​note>​
 +
 +++++Example:​|
 +<code bash>
 +# Use AWS configuration tool
 +klk_aws_config -u some_user -k ABCDEFGHIJKLMNOPQRST-s ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN-r eu-west-1 -l US915 -f 1 -b
 +</​code>​
 +++++
 +<​note>​
 +The ''​klk_aws_config''​ tool has been designed to be called from a [[wiki:​systeme_mana:​ztp|Zero Touch Provisioning]] job.
 +</​note>​
 +
 +++++How to generate an AWS API key?|
 +**Prerequisite:​** You have to create a AWS account \\
 +
 +To automatically connect Kerlink Gateways to AWS LNS, you have to delegate some rights to Kerlink thanks to an “API key”. Please follow those steps: \\ \\
 +Step 1 - Connect to your AWS server \\
 +
 +Step 2 - Go to Console > Services > IAM then hitting the Add users button to create a new AWS user \\
 +{{:​images:​1_aws_user_account.png?​800|}} \\
 +
 +Step 3 - Name the user (= user ID) and set the access type to Programmatic Access \\
 +<note important>​DO NOT check “AWS Management Console access”</​note>​
 +{{:​images:​2_aws_access_type.png?​500|}} \\
 + 
 +Step 4 - DO NOT add user to any group. Also SKIP other steps until creation \\
 +{{:​images:​3_aws_no_group.png?​500|}} ​ \\
 +
 +Step 5 - Select the new user \\
 +{{:​images:​4_aws_select_user.png?​500|}} \\
 +
 +Step 6 - In Security Credentials section: ​
 +  * Select Application running outside AWS
 +  * Give a tag value  (optional)
 +  * Copy Access Key ID and Secret
 + \\
 +{{:​images:​5_aws_security.png?​500|}} ​ \\
 +
 +Step 7 - Add a new inline policy \\
 +{{:​images:​6_aws_inline_policy.png?​500|}} \\
 +
 +Step 8 - Switch to the JSON view and add the following content \\
 +<​code>​
 +{
 +    "​Version":​ "​2012-10-17",​
 +    "​Statement":​ [
 +        {
 +            "​Sid":​ "​VisualEditor0",​
 +            "​Effect":​ "​Allow",​
 +            "​Action":​ [
 +                "​iot:​DeleteCertificate",​
 +                "​iot:​UpdateCertificate",​
 +                "​iotwireless:​GetWirelessGatewayCertificate",​
 +                "​iotwireless:​GetWirelessGateway",​
 +                "​iotwireless:​UpdateWirelessGateway",​
 +                "​iotwireless:​AssociateWirelessGatewayWithCertificate",​
 +                "​iotwireless:​ListWirelessGateways",​
 +                "​iotwireless:​GetServiceEndpoint",​
 +                "​iot:​CreateKeysAndCertificate",​
 +                "​iotwireless:​CreateWirelessGateway"​
 +            ],
 +            "​Resource":​ "​*"​
 +        }
 +    ]
 +}
 +</​code> ​ \\
 +
 +Step 9 - Review policy \\
 +This API user now has the minimum rights required
 + \\
 +
 +
 +++++
 +==== Actility LNS configuration tool ====
 +
 +To ease declaration of a gateway on the Actility LNS, use the ''​klk_actility_config''​ tool.
 +This tool creates the gateway on the server and installs the resulting LNS credentials on the gateway.
 +
 +To use this tool, you need:
 +  * an API Client ID and its secret
 +  * the API server URL
 +  * the actility LoRaWAN region ID ( see https://​oss-api.thingpark.com/​tpe/​7.3/​Things-Management/​network-manager/​documentation-network-manager.html#/​rf-regions )
 +<note important>​
 +''​klk_bs_config''​ is still required after this to complete the Basic Station configuration.
 +</​note>​
 +
 +++++Example:​|
 +<code bash>
 +# Use Actility configuration tool in region EU868 on 8 channels
 +klk_actility_config -i sub-123456789/​test -s Abcdef1234567890Ghijklm987654321 -u https://​community.thingpark.io -r EU868_8channels.448
 +</​code>​
 +++++
 +<​note>​
 +The ''​klk_actility_config''​ tool has been designed to be called from a [[wiki:​systeme_mana:​ztp|Zero Touch Provisioning]] job.
 +</​note>​
 +
 +++++How to generate an ACTILITY API key?|
 +
 +[[https://​community.thingpark.org/​index.php/​build-your-first-end-to-end-use-case/​|ACTILITY- Access ThingPark Community Platform]]
 +++++
 +==== Gateway name customization option ====
 +
 +This option can be used to customize the gateway name displayed on LNS.
 +
 +<code bash>
 +Optional parameters:
 +--naming ​        Set gateway naming strategy
 +                 ​prefix[/​scheme]
 +                   ​schemes:​
 +                     "​knet" ​  : prefix-EUI[:​-6] (default)
 +                     "​eui" ​   : prefix-EUI
 +                     "​serial"​ : prefix-board serial
 +                     "​model" ​ : model-EUI[:​-6]
 +</​code>​
 +
 +++++Examples:​|
 +<code bash>
 +# Use TTN configuration tool
 +klk_ttn_config -u https://​eu1.cloud.thethings.network -t NNSXS.R6D3ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI.ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIABCDEFGHIJKLMNOPQ -f EU_863_870 --naming ttn-test/​eui
 +</​code>​
 +{{:​images:​ttn.png?​nolink&​1000|}}
 +
 +<code bash>
 +# Use Loriot configuration tool
 +klk_loriot_config -k ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJK-321abcdefgh -u https://​eu1.loriot.io/​1/​nwk -n ABCD1234 -r US902-928 -p 3,6,8 --naming loriot-test/​serial
 +</​code>​
 +{{:​images:​loriot.png?​nolink&​1000|}}
 +
 +<code bash>
 +# Use AWS configuration tool
 +klk_aws_config -u some_user -k ABCDEFGHIJKLMNOPQRST-s ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN-r eu-west-1 -l US915 -f 1 -b --naming aws-test/​knet
 +</​code>​
 +{{:​images:​aws.png?​nolink&​1000|}}
 +
 +++++
wiki/lora/basic_station_forwarder.1670497339.txt.gz · Last modified: 2022/12/08 12:02 by ehe