[riot-notifications] [RIOT-OS/RIOT] net/lorawan : Expose configurations to Kconfig (#15507)

Leandro Lanzieri notifications at github.com
Wed Jan 6 14:13:46 CET 2021


@leandrolanzieri commented on this pull request.



>   */
-#ifndef LORAMAC_DEFAULT_PUBLIC_NETWORK
-#define LORAMAC_DEFAULT_PUBLIC_NETWORK         (true)
-#endif
-/**
- * @brief   Default datarate
- */
-#ifndef LORAMAC_DEFAULT_DR
-#define LORAMAC_DEFAULT_DR                     (LORAMAC_DR_0)
+#ifdef DOXYGEN
+#define CONFIG_LORAMAC_DEFAULT_PUBLIC_NETWORK

This is changing the current default, I think we should keep the current behaviour.

> +    int "NET ID"
+    depends on LORAMAC_ADVANCED_OPTIONS

To only hide the configuration to the user:
```suggestion
    int "NET ID" if LORAMAC_ADVANCED_OPTIONS
```

> +    help
+        Configure the default device address for ABP.
+
+config LORAMAC_NWK_SKEY_DEFAULT
+    string "Network session key"
+    default "00000000000000000000000000000000"
+    help
+        Configure the default network session key for ABP.
+
+config LORAMAC_APP_SKEY_DEFAULT
+    string "Application session key"
+    default "00000000000000000000000000000000"
+    help
+        Configure the default application session key for ABP.
+
+config LORAMAC_DEFAULT_NETID

Why does depend on `LORAMAC_DEFAULT_JOIN_PROCEDURE_ABP`?

> +        the network.
+
+config LORAMAC_DEFAULT_ADR
+    bool "Enable ADR" if LORAMAC_ADVANCED_OPTIONS
+    depends on USEPKG_SEMTECH_LORAMAC || USEMODULE_RN2XX3
+    help
+        Enable or disable Adaptive Data Rate (ADR). If enabled the end node will
+        inform the network server about the status of ADR using the ADR field in
+        uplink data packet. The network server will then optimize the data rate
+        and the transmission power of the end node based on the information
+        collected from the network.
+
+config LORAMAC_DEFAULT_LINKCHK
+    int "Link check interval (in seconds)" if LORAMAC_ADVANCED_OPTIONS
+    depends on USEMODULE_RN2XX3
+    default 0

Is there a range that could be added?

> +    depends on USEMODULE_RN2XX3
+    default 0
+    help
+        Configure the default link check interval (in seconds). 0 means the link
+        check process is disabled. The link check process is used by an
+        end-device to validate its connectivity with the network. The frame has
+        no payload. When a `LinkCheckReq` is received by the network server via
+        one or multiple gateways, it responds with a `LinkCheckAns` MAC command.
+
+config LORAMAC_DEFAULT_RX1_DELAY
+    int "RX1 window delay (in milliseconds)" if LORAMAC_ADVANCED_OPTIONS
+    depends on USEMODULE_GNRC_LORAWAN || USEMODULE_RN2XX3
+    default 1000
+    help
+        Configure the RX1 window delay (in milliseconds). This configuration
+        specifies the delay in seconds to open the RX1 window after the end of

```suggestion
        specifies the delay to open the RX1 window after the end of
```

> +choice
+    bool "Join procedure"
+    depends on USEMODULE_GNRC_LORAWAN
+    default LORAMAC_DEFAULT_JOIN_PROCEDURE_OTAA
+    help
+        Configure the join procedure for end node activation. There are two
+        options, Over The Air Activation (OTAA) results in device sending
+        join request to the network whereas in the case of Activation By
+        Personalization (ABP) the user enters the activation keys manually. OTAA
+        is the preferred and most secure way to connect to a LoRaWAN network.
+        For quick testing ABP is preferred as the device can transmit right
+        away without waiting for the network to provision the keys.
+
+config LORAMAC_DEFAULT_JOIN_PROCEDURE_OTAA
+    bool "Over the air activation (OTAA)"
+
+config LORAMAC_DEFAULT_JOIN_PROCEDURE_ABP
+    bool "Activation by personalization (ABP)"
+
+endchoice

During an offline discussion with @jia200x, we realized that this default join procedure option may be complicating things unnecessarily. Clearly it is an option specific for the GNRC LoRaWAN stack and is not needed on a 'standard' lorawan application. In the end it's up to the application to perform the join procedure.

I think we could make a menu containing all credentials (both OTAA and ABP) and let the user assign values to all of them, defaulting to `0000000...`. For user help comments or sub menus can be added to specify which are mandatory for each join type. 

> +        Personalization (ABP) the user enters the activation keys manually. OTAA
+        is the preferred and most secure way to connect to a LoRaWAN network.
+        For quick testing ABP is preferred as the device can transmit right
+        away without waiting for the network to provision the keys.
+
+config LORAMAC_DEFAULT_JOIN_PROCEDURE_OTAA
+    bool "Over the air activation (OTAA)"
+
+config LORAMAC_DEFAULT_JOIN_PROCEDURE_ABP
+    bool "Activation by personalization (ABP)"
+
+endchoice
+
+if LORAMAC_DEFAULT_JOIN_PROCEDURE_OTAA || USEPKG_SEMTECH_LORAMAC
+
+config LORAMAC_DEV_EUI_DEFAULT

I think the rn2xx3 modules don't allow compile-time configuration of credentials.

> +
+config LORAMAC_DEFAULT_LINKCHK
+    int "Link check interval (in seconds)" if LORAMAC_ADVANCED_OPTIONS
+    depends on USEMODULE_RN2XX3
+    default 0
+    help
+        Configure the default link check interval (in seconds). 0 means the link
+        check process is disabled. The link check process is used by an
+        end-device to validate its connectivity with the network. The frame has
+        no payload. When a `LinkCheckReq` is received by the network server via
+        one or multiple gateways, it responds with a `LinkCheckAns` MAC command.
+
+config LORAMAC_DEFAULT_RX1_DELAY
+    int "RX1 window delay (in milliseconds)" if LORAMAC_ADVANCED_OPTIONS
+    depends on USEMODULE_GNRC_LORAWAN || USEMODULE_RN2XX3
+    default 1000

Is there a range that could be added?

> +config LORAMAC_DEFAULT_RX2_DR_13
+    bool "DR13"
+
+config LORAMAC_DEFAULT_RX2_DR_14
+    bool "DR14"
+
+config LORAMAC_DEFAULT_RX2_DR_15
+    bool "DR15"
+
+endif # LORAMAC_REGION_US_915
+
+endchoice
+
+config LORAMAC_DEFAULT_RX2_FREQ
+    int "RX2 Frequency (in Hz)" if LORAMAC_ADVANCED_OPTIONS
+    depends on USEMODULE_RN2XX3 || USEMODULE_GNRC_LORAWAN

Should this depend on the selected frequency plan?
Can we apply ranges for the different plans? (`range <min> <max> if <region>`)

> +    help
+        Configure the maximum wait time in end node to receive the `join-accept`
+        message sent by the network in the second receive window. This is
+        similar to the operation of RX2 window.
+
+config LORAMAC_DEFAULT_MAX_FCNT_GAP
+    int "Max frame counter deviation" if LORAMAC_ADVANCED_OPTIONS
+    depends on USEMODULE_GNRC_LORAWAN
+    default 16384
+    help
+        Configure the maximum frame counter deviation which is the difference
+        between the frame counter values transmitted by the End Node and the
+        value stored in Network Server (NS).
+
+config LORAMAC_DEFAULT_SYSTEM_MAX_RX_ERROR
+    int "Max system timing error ( in milliseconds)" if LORAMAC_ADVANCED_OPTIONS

```suggestion
    int "Max system timing error (in milliseconds)" if LORAMAC_ADVANCED_OPTIONS
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15507#pullrequestreview-562667827
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210106/fea944c9/attachment-0001.htm>


More information about the notifications mailing list