Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/lorawan : Expose configurations to Kconfig #15507

Merged
merged 30 commits into from
Jan 26, 2021

Conversation

akshaim
Copy link
Member

@akshaim akshaim commented Nov 25, 2020

Contribution description

This PR exposes compile configurations in net/lorawan to Kconfig.

--Update--

Deprecated LORAMAC_DEFAULT_PUBLIC_NETWORK, introduced CONFIG_LORAMAC_DEFAULT_PRIVATE_NETWORK

Summary of CONFIGurations

CONFIG GNRC_XX SEMTECH_XX RN2XX3 Advanced Option
LORAMAC_REGION_XX_XXX X - - -
LORAMAC_DEFAULT_JOIN_PROCEDURE_ABP X - - -
LORAMAC_DEFAULT_JOIN_PROCEDURE_OTAA X X - -
LORAMAC_DEV_EUI_DEFAULT X X - -
LORAMAC_APP_EUI_DEFAULT X X - -
LORAMAC_APP_KEY_DEFAULT X X - -
LORAMAC_APP_SKEY_DEFAULT X - - -
LORAMAC_NWK_SKEY_DEFAULT X - - -
LORAMAC_DEV_ADDR_DEFAULT X - - -
LORAMAC_DEFAULT_NETID X X - -
LORAMAC_DEFAULT_DEVICE_CLASS_A X X - -
LORAMAC_DEFAULT_DEVICE_CLASS_B - X - -
LORAMAC_DEFAULT_DEVICE_CLASS_C - X - -
LORAMAC_DEFAULT_PUBLIC_NETWORK X X - -
LORAMAC_DEFAULT_DR X X X -
LORAMAC_DEFAULT_TX_POWER X X X -
LORAMAC_DEFAULT_TX_PORT X X X -
LORAMAC_DEFAULT_TX_MODE X X X -
LORAMAC_DEFAULT_RETX X - X X
LORAMAC_DEFAULT_ADR - X X X
LORAMAC_DEFAULT_LINKCHK - - X X
LORAMAC_DEFAULT_RX1_DELAY X - X X
LORAMAC_DEFAULT_RX2_DR X - X X
LORAMAC_DEFAULT_RX2_FREQ X - X X
LORAMAC_DEFAULT_JOIN_DELAY1 X - X X
LORAMAC_DEFAULT_JOIN_DELAY2 - - X X
LORAMAC_DEFAULT_MAX_FCNT_GAP X - - X
LORAMAC_DEFAULT_SYSTEM_MAX_RX_ERROR - X - X
LORAMAC_DEFAULT_MIN_RX_SYMBOLS - X - X

The following unused configurations were not removed as they may be necessary for future updates of gnrc_lorawan.
The following configurations were removed.
The following configurations were marked as not supported for the time being as support is expected soon.

LORAMAC_DEFAULT_ADR_ACK_LIMIT
LORAMAC_DEFAULT_ADR_ACK_DELAY
LORAMAC_DEFAULT_ADR_TIMEOUT 

Testing procedure

  1. New documentation was built using Doxygen

    The build works fine.

  2. Example in example/gnrc_lorawan was updated to display the macros.

    The updated example can be found here

    Compiled binaries for b-l072z-lrwan1

Default State:

Firmware Output ( without configurations in examples/gnrc_lorawan/Makefile )
2020-11-26 12:29:25,633 #  main(): This is RIOT! (Version: 2021.01-devel-1028-g58c0f-Kconfig_LoRaWAN_tests)
2020-11-26 12:29:25,637 # CONFIG_LORAMAC_DEV_EUI_DEFAULT="0000000000000000"
2020-11-26 12:29:25,642 # CONFIG_LORAMAC_APP_EUI_DEFAULT="0000000000000000"
2020-11-26 12:29:25,661 # CONFIG_LORAMAC_APP_KEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:29:25,667 # CONFIG_LORAMAC_APP_SKEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:29:25,673 # CONFIG_LORAMAC_NWK_SKEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:29:25,677 # CONFIG_LORAMAC_DEV_ADDR_DEFAULT="00000000"
2020-11-26 12:29:25,682 # CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS=(LORAMAC_CLASS_A)
2020-11-26 12:29:25,685 # CONFIG_LORAMAC_DEFAULT_NETID=(1U)
2020-11-26 12:29:25,692 # CONFIG_LORAMAC_DEFAULT_PUBLIC_NETWORK=CONFIG_LORAMAC_DEFAULT_PUBLIC_NETWORK
2020-11-26 12:29:25,695 # CONFIG_LORAMAC_DEFAULT_DR=(LORAMAC_DR_0)
2020-11-26 12:29:25,700 # CONFIG_LORAMAC_DEFAULT_TX_POWER=(LORAMAC_TX_PWR_1)
2020-11-26 12:29:25,703 # CONFIG_LORAMAC_DEFAULT_TX_PORT=(2U)
2020-11-26 12:29:25,708 # CONFIG_LORAMAC_DEFAULT_TX_MODE=(LORAMAC_TX_CNF)
2020-11-26 12:29:25,712 # CONFIG_LORAMAC_DEFAULT_ADR=CONFIG_LORAMAC_DEFAULT_ADR
2020-11-26 12:29:25,715 # CONFIG_LORAMAC_DEFAULT_RETX=(5U)
2020-11-26 12:29:25,719 # CONFIG_LORAMAC_DEFAULT_LINKCHK=(0U)
2020-11-26 12:29:25,722 # CONFIG_LORAMAC_DEFAULT_RX1_DELAY=(1000U)
2020-11-26 12:29:25,727 # CONFIG_LORAMAC_DEFAULT_AR=CONFIG_LORAMAC_DEFAULT_AR
2020-11-26 12:29:25,731 # CONFIG_LORAMAC_DEFAULT_RX2_DR=(LORAMAC_DR_0)
2020-11-26 12:29:25,735 # CONFIG_LORAMAC_DEFAULT_RX2_FREQ=(869525000UL)
2020-11-26 12:29:25,741 # CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE=(LORAMAC_JOIN_OTAA)
2020-11-26 12:29:25,744 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY1=(5U)
2020-11-26 12:29:25,748 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY2=(6U)
2020-11-26 12:29:25,752 # CONFIG_LORAMAC_DEFAULT_MAX_FCNT_GAP=(16384U)
2020-11-26 12:29:25,756 # CONFIG_LORAMAC_DEFAULT_SYSTEM_MAX_RX_ERROR=(50)
2020-11-26 12:29:25,760 # CONFIG_LORAMAC_DEFAULT_MIN_RX_SYMBOLS=(12)
2020-11-26 12:29:25,765 # Initialization successful - starting the shell now
Firmware Output ( with configurations in examples/gnrc_lorawan/Makefile)
2020-11-26 12:34:18,819 #  main(): This is RIOT! (Version: 2021.01-devel-1028-g58c0f-Kconfig_LoRaWAN_tests)
2020-11-26 12:34:18,824 # CONFIG_LORAMAC_DEV_EUI_DEFAULT="CCCCCCCCCCCCCCCC"
2020-11-26 12:34:18,828 # CONFIG_LORAMAC_APP_EUI_DEFAULT="BBBBBBBBBBBBBBBB"
2020-11-26 12:34:18,847 # CONFIG_LORAMAC_APP_KEY_DEFAULT="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
2020-11-26 12:34:18,853 # CONFIG_LORAMAC_APP_SKEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:34:18,859 # CONFIG_LORAMAC_NWK_SKEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:34:18,862 # CONFIG_LORAMAC_DEV_ADDR_DEFAULT="00000000"
2020-11-26 12:34:18,867 # CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS=(LORAMAC_CLASS_A)
2020-11-26 12:34:18,874 # CONFIG_LORAMAC_DEFAULT_NETID=(1U)
2020-11-26 12:34:18,874 # CONFIG_LORAMAC_DEFAULT_PUBLIC_NETWORK=1
2020-11-26 12:34:18,878 # CONFIG_LORAMAC_DEFAULT_DR=(LORAMAC_DR_5)
2020-11-26 12:34:18,882 # CONFIG_LORAMAC_DEFAULT_TX_POWER=(LORAMAC_TX_PWR_1)
2020-11-26 12:34:18,885 # CONFIG_LORAMAC_DEFAULT_TX_PORT=(2U)
2020-11-26 12:34:18,890 # CONFIG_LORAMAC_DEFAULT_TX_MODE=(LORAMAC_TX_UNCNF)
2020-11-26 12:34:18,895 # CONFIG_LORAMAC_DEFAULT_ADR=CONFIG_LORAMAC_DEFAULT_ADR
2020-11-26 12:34:18,898 # CONFIG_LORAMAC_DEFAULT_RETX=(5U)
2020-11-26 12:34:18,901 # CONFIG_LORAMAC_DEFAULT_LINKCHK=(0U)
2020-11-26 12:34:18,905 # CONFIG_LORAMAC_DEFAULT_RX1_DELAY=(1000U)
2020-11-26 12:34:18,910 # CONFIG_LORAMAC_DEFAULT_AR=CONFIG_LORAMAC_DEFAULT_AR
2020-11-26 12:34:18,914 # CONFIG_LORAMAC_DEFAULT_RX2_DR=(LORAMAC_DR_0)
2020-11-26 12:34:18,918 # CONFIG_LORAMAC_DEFAULT_RX2_FREQ=(869525000UL)
2020-11-26 12:34:18,923 # CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE=(LORAMAC_JOIN_OTAA)
2020-11-26 12:34:18,927 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY1=(5U)
2020-11-26 12:34:18,930 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY2=(6U)
2020-11-26 12:34:18,934 # CONFIG_LORAMAC_DEFAULT_MAX_FCNT_GAP=(16384U)
2020-11-26 12:34:18,939 # CONFIG_LORAMAC_DEFAULT_SYSTEM_MAX_RX_ERROR=(50)
2020-11-26 12:34:18,942 # CONFIG_LORAMAC_DEFAULT_MIN_RX_SYMBOLS=(12)
2020-11-26 12:34:18,947 # Initialization successful - starting the shell now

Usage with menuconfig :

make menuconfig

Default Firmware Output ( with Kconfig and configurations in examples/gnrc_lorawan/Makefile)
 2020-11-26 12:41:03,302 #  main(): This is RIOT! (Version: 2021.01-devel-1028-g58c0f-Kconfig_LoRaWAN_tests)
2020-11-26 12:41:03,307 # CONFIG_LORAMAC_DEV_EUI_DEFAULT="0000000000000000"
2020-11-26 12:41:03,310 # CONFIG_LORAMAC_APP_EUI_DEFAULT="0000000000000000"
2020-11-26 12:41:03,331 # CONFIG_LORAMAC_APP_KEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:41:03,337 # CONFIG_LORAMAC_APP_SKEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:41:03,342 # CONFIG_LORAMAC_NWK_SKEY_DEFAULT="00000000000000000000000000000000"
2020-11-26 12:41:03,346 # CONFIG_LORAMAC_DEV_ADDR_DEFAULT="00000000"
2020-11-26 12:41:03,352 # CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS=(LORAMAC_CLASS_A)
2020-11-26 12:41:03,354 # CONFIG_LORAMAC_DEFAULT_NETID=(1U)
2020-11-26 12:41:03,357 # CONFIG_LORAMAC_DEFAULT_PUBLIC_NETWORK=1
2020-11-26 12:41:03,361 # CONFIG_LORAMAC_DEFAULT_DR=(LORAMAC_DR_0)
2020-11-26 12:41:03,367 # CONFIG_LORAMAC_DEFAULT_TX_POWER=(LORAMAC_TX_PWR_1)
2020-11-26 12:41:03,369 # CONFIG_LORAMAC_DEFAULT_TX_PORT=2
2020-11-26 12:41:03,373 # CONFIG_LORAMAC_DEFAULT_TX_MODE=(LORAMAC_TX_CNF)
2020-11-26 12:41:03,378 # CONFIG_LORAMAC_DEFAULT_ADR=CONFIG_LORAMAC_DEFAULT_ADR
2020-11-26 12:41:03,381 # CONFIG_LORAMAC_DEFAULT_RETX=5
2020-11-26 12:41:03,384 # CONFIG_LORAMAC_DEFAULT_LINKCHK=(0U)
2020-11-26 12:41:03,387 # CONFIG_LORAMAC_DEFAULT_RX1_DELAY=1000
2020-11-26 12:41:03,392 # CONFIG_LORAMAC_DEFAULT_AR=CONFIG_LORAMAC_DEFAULT_AR
2020-11-26 12:41:03,396 # CONFIG_LORAMAC_DEFAULT_RX2_DR=(LORAMAC_DR_0)
2020-11-26 12:41:03,400 # CONFIG_LORAMAC_DEFAULT_RX2_FREQ=869525000
2020-11-26 12:41:03,405 # CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE=(LORAMAC_JOIN_OTAA)
2020-11-26 12:41:03,409 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY1=5
2020-11-26 12:41:03,412 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY2=(6U)
2020-11-26 12:41:03,416 # CONFIG_LORAMAC_DEFAULT_MAX_FCNT_GAP=16384
2020-11-26 12:41:03,420 # CONFIG_LORAMAC_DEFAULT_SYSTEM_MAX_RX_ERROR=50
2020-11-26 12:41:03,424 # CONFIG_LORAMAC_DEFAULT_MIN_RX_SYMBOLS=12
2020-11-26 12:41:03,428 # Initialization successful - starting the shell now
Configured Firmware Output ( with Kconfig configured and with configurations in examples/gnrc_lorawan/Makefile)
2020-11-26 12:39:12,711 #  main(): This is RIOT! (Version: 2021.01-devel-1028-g58c0f-Kconfig_LoRaWAN_tests)
2020-11-26 12:39:12,715 # CONFIG_LORAMAC_DEV_EUI_DEFAULT="CCCCCCCCCCCCCCCC"
2020-11-26 12:39:12,720 # CONFIG_LORAMAC_APP_EUI_DEFAULT="BBBBBBBBBBBBBBBB"
2020-11-26 12:39:12,739 # CONFIG_LORAMAC_APP_KEY_DEFAULT="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
2020-11-26 12:39:12,745 # CONFIG_LORAMAC_APP_SKEY_DEFAULT="00000000000000000000000000000AAA"
2020-11-26 12:39:12,751 # CONFIG_LORAMAC_NWK_SKEY_DEFAULT="00000000000000000000000000000BBB"
2020-11-26 12:39:12,754 # CONFIG_LORAMAC_DEV_ADDR_DEFAULT="00000CCC"
2020-11-26 12:39:12,759 # CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS=(LORAMAC_CLASS_A)
2020-11-26 12:39:12,762 # CONFIG_LORAMAC_DEFAULT_NETID=1
2020-11-26 12:39:12,766 # CONFIG_LORAMAC_DEFAULT_PUBLIC_NETWORK=1
2020-11-26 12:39:12,769 # CONFIG_LORAMAC_DEFAULT_DR=(LORAMAC_DR_2)
2020-11-26 12:39:12,774 # CONFIG_LORAMAC_DEFAULT_TX_POWER=(LORAMAC_TX_PWR_1)
2020-11-26 12:39:12,777 # CONFIG_LORAMAC_DEFAULT_TX_PORT=2
2020-11-26 12:39:12,782 # CONFIG_LORAMAC_DEFAULT_TX_MODE=(LORAMAC_TX_UNCNF)
2020-11-26 12:39:12,786 # CONFIG_LORAMAC_DEFAULT_ADR=CONFIG_LORAMAC_DEFAULT_ADR
2020-11-26 12:39:12,789 # CONFIG_LORAMAC_DEFAULT_RETX=6
2020-11-26 12:39:12,792 # CONFIG_LORAMAC_DEFAULT_LINKCHK=(0U)
2020-11-26 12:39:12,796 # CONFIG_LORAMAC_DEFAULT_RX1_DELAY=2000
2020-11-26 12:39:12,801 # CONFIG_LORAMAC_DEFAULT_AR=CONFIG_LORAMAC_DEFAULT_AR
2020-11-26 12:39:12,805 # CONFIG_LORAMAC_DEFAULT_RX2_DR=(LORAMAC_DR_2)
2020-11-26 12:39:12,808 # CONFIG_LORAMAC_DEFAULT_RX2_FREQ=900550000
2020-11-26 12:39:12,814 # CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE=(LORAMAC_JOIN_OTAA)
2020-11-26 12:39:12,817 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY1=10
2020-11-26 12:39:12,821 # CONFIG_LORAMAC_DEFAULT_JOIN_DELAY2=(6U)
2020-11-26 12:39:12,824 # CONFIG_LORAMAC_DEFAULT_MAX_FCNT_GAP=500
2020-11-26 12:39:12,828 # CONFIG_LORAMAC_DEFAULT_SYSTEM_MAX_RX_ERROR=20
2020-11-26 12:39:12,832 # CONFIG_LORAMAC_DEFAULT_MIN_RX_SYMBOLS=5
2020-11-26 12:39:12,837 # Initialization successful - starting the shell now

MACROS were successfully configured.

Issues/PRs references

#15007
#12888

@akshaim akshaim changed the title net/lorawan : Expose to Kconfig net/lorawan : Expose configurations to Kconfig Nov 26, 2020
@akshaim akshaim marked this pull request as ready for review November 26, 2020 11:59
@leandrolanzieri leandrolanzieri added Area: Kconfig Area: Kconfig integration Area: LoRa Area: LoRa radio support CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Nov 26, 2020
Copy link
Contributor

@leandrolanzieri leandrolanzieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments. Maybe @jia200x could take a look at some of the specific options which he knows better

sys/net/link_layer/lorawan/Kconfig Outdated Show resolved Hide resolved
examples/lorawan/README.md Outdated Show resolved Hide resolved
examples/lorawan/Makefile Outdated Show resolved Hide resolved
examples/gnrc_lorawan/README.md Show resolved Hide resolved
examples/gnrc_lorawan/Makefile Outdated Show resolved Hide resolved
sys/net/link_layer/lorawan/Kconfig Outdated Show resolved Hide resolved
Copy link
Member

@jia200x jia200x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments

@akshaim
Copy link
Member Author

akshaim commented Dec 2, 2020

Is it okay to squash @leandrolanzieri @jia200x ?

@leandrolanzieri
Copy link
Contributor

This needs rebasing

examples/lorawan/Makefile Show resolved Hide resolved
examples/gnrc_lorawan/Makefile Outdated Show resolved Hide resolved
examples/gnrc_lorawan/Makefile Outdated Show resolved Hide resolved
makefiles/pseudomodules.inc.mk Outdated Show resolved Hide resolved
sys/net/link_layer/Kconfig.lorawan Outdated Show resolved Hide resolved
sys/net/link_layer/Kconfig.lorawan Outdated Show resolved Hide resolved
sys/net/link_layer/Kconfig.lorawan Show resolved Hide resolved
sys/net/link_layer/Kconfig.lorawan Outdated Show resolved Hide resolved
Introduced a bool 'LORAMAC_DEFAULT_PRIVATE_NETWORK' to invert
the semantics of 'LORAMAC_DEFAULT_PUBLIC_NETWORK'. Move
'LORAMAC_DEFAULT_PRIVATE_NETWORK' to 'CONFIG_' namespace.
Move 'LORAMAC_DEFAULT_DR' to 'CONFIG_' and enable options for
Kconfig
Move 'LORAMAC_DEFAULT_TX_POWER' to 'CONFIG_' namespace and
assign choices for Kconfig exposure
Move 'LORAMAC_DEFAULT_TX_MODE' to 'CONFIG_' and added symbols
for Kconfig exposure
Move 'LORAMAC_DEFAULT_ADR' to 'CONFIG_' namespace and model
'CONFIG_LORAMAC_DEFAULT_ADR' as BOOL for Kconfig
Added symbols 'CONFIG_LORAMAC_DEFAULT_RX2_DR_XX' to define
choice in Kconfig
Added symbols 'CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE_XXX'
for Kconfig exposure
Updates macros to allow for changes via Kconfig
Marked as non-supported:
LORAMAC_DEFAULT_ADR_ACK_LIMIT
LORAMAC_DEFAULT_ADR_ACK_DELAY
LORAMAC_DEFAULT_ADR_TIMEOUT
Translate Kconfigs and CFLAGS
@akshaim
Copy link
Member Author

akshaim commented Jan 26, 2021

Rebased to current master.

Copy link
Member

@jia200x jia200x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@jia200x
Copy link
Member

jia200x commented Jan 26, 2021

Thanks for the test output and the contribution!!

@jia200x jia200x merged commit 41caa86 into RIOT-OS:master Jan 26, 2021
@kaspar030 kaspar030 added this to the Release 2021.04 milestone Apr 23, 2021
@leandrolanzieri leandrolanzieri added the Release notes: added Set on PRs that have been processed into the release notes for the current release. label Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Kconfig Area: Kconfig integration Area: LoRa Area: LoRa radio support CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Release notes: added Set on PRs that have been processed into the release notes for the current release. Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants