CONFIG_NET_NATIVE needs to be enabled for nRF9151 LTE-M

Hello,

I am developing an LTE-M application on nRF9151, using offloaded sockets to modem, including DTLS.

Everything works great - can connect to network, and communicate with a server over CoAP.

However, in my prj.conf, CONFIG_NET_NATIVE=y (enabled).

I am aware that this should be disabled typically for offloaded socket configuration. However this does not work for me.

When I set CONFIG_NET_NATIVE=n, I get this error during the connect phase:

[00:00:00.745,208] <dbg> nrf_modem_lib_netif: lte_net_if_connect: Connecting to LTE
[00:00:03.404,663] <dbg> nrf_modem_lib_netif: pdn_event_handler: PDN connection activated
[00:00:03.405,670] <err> nrf_modem_lib_netif: ipv4_addr_add, error: -19
[00:00:03.405,700] <dbg> nrf_modem_lib_netif: lte_net_if_disconnect: Disconnecting from LTE

here is my full network config:

# Network Config
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_POSIX_API=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_NATIVE=y
CONFIG_NET_UDP=y
CONFIG_NET_IPV4=y

# Zephyr Network Connection Manager
CONFIG_NET_CONNECTION_MANAGER=y
CONFIG_NET_CONNECTION_MANAGER_MONITOR_STACK_SIZE=1024

# nRF91 Modem
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_NET_IF=y
CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=y

# Disable Duplicate Address Detection (DAD)
# due to not being properly implemented for offloaded interfaces.
CONFIG_NET_IPV6_NBR_CACHE=n
CONFIG_NET_IPV6_MLD=n

# Network status monitoring
CONFIG_INYO_LTE_NETWORK_AT_MONITOR=n

I believe having CONFIG_NET_UDP=y & CONFIG_NET_IPV4=y are actually not necessary but they are enabled for now.

Despite not setting CONFIG_NET_NATIVE=n, I can still see the sockets being offloaded to modem lib and things work fine.

I would just like to understand what causes this issue since it should work with CONFIG_NET_NATIVE=n.

(I am using NCS v3.1.0, modem firwmare = mfw_nrf91x1_2.0.2)

 

Thanks in advance,

Jason

Parents
  • Hi Jason,

    When offloading sockets into the modem, there should not be an error when specifying CONFIG_NET_NATIVE=n. Can you try to add the configuration options shown below? 

    CONFIG_HEAP_MEM_POOL_SIZE=4096
    CONFIG_MAIN_STACK_SIZE=4096

    Best regards,
    Dejan

  • Hi Dejan,

    Unfortunately those changes didn't fix the issue.

    The return code -19 *(ENODEV) comes from when the application tries to add an IPv4 address to the LTE network interface.

    See the call stack here:

    The API which returns an error is  `net_if_config_ipv4_get`.

    In this function, it checks if the NET_IF_IPV4 flag is set on the interface, which returns false.

    This error then leads to the -19 (ENODEV) error that is printed in my original question.

    This is what `iface` looks like when it checks if the flag is set. flags = 1545. NET_IF_IPV4 is not set.

    So it seems that IPV4 is not enabled on the LTE Network interface device for some reason. 

    CONFIG_NET_IPV4 is enabled in my app.

  • Hi Dejan,

    I use conn_mgr_all_if_up() and conn_mgr_all_if_connect() to bring the interface up and connect respectively.

    Jason

  • Hi Jason,

    Can you share your full application log and .config file from the build folder?

    Best regards,
    Dejan

  • Hi Dejan,

    The .config file in my build folder did not contain much - I have attached autoconf.h which shows all the Kconfig symbols in my build. Is this okay?

    7674.autoconf.h

    Full log:

    *** Booting nRF Connect SDK v3.1.0-6c6e5b32496e ***
    *** Using Zephyr OS v4.1.99-1612683d4010 ***
    [00:00:00.373,260] <inf> at_cmd_custom: Custom AT commands enabled with 5 entries.
    [00:00:00.373,321] <dbg> nrf_modem_lib_netif: lte_net_if_init: Connection timeout is disabled
    [00:00:00.373,382] <dbg> nrf_modem_lib_netif: lte_net_if_init: Connection persistence is enabled
    [00:00:00.373,413] <dbg> nrf_modem_lib_netif: lte_net_if_init: Modem network interface ready
    *** Starting Inyo LTE Firmware ***
    [00:00:00.730,651] <dbg> nrf_modem_lib_netif: lte_net_if_connect: Connecting to LTE
    [00:00:03.467,346] <dbg> nrf_modem_lib_netif: pdn_event_handler: PDN connection activated
    [00:00:03.468,292] <err> nrf_modem_lib_netif: ipv4_addr_add, error: -19
    [00:00:03.468,353] <dbg> nrf_modem_lib_netif: lte_net_if_disconnect: Disconnecting from LTE
    [00:00:03.468,475] <err> inyo_network: NET_EVENT_CONN_IF_FATAL_ERROR
    [00:00:03.526,275] <wrn> at_monitor: No heap space for incoming notification: +CGEV: ME DETACH
    
    [00:00:03.622,070] <wrn> at_monitor: No heap space for incoming notification: +CSCON: 0
    
    [00:00:03.701,385] <dbg> nrf_modem_lib_netif: pdn_event_handler: Event: PDP context 0, PDN type IPv4 only allowed
    [00:00:03.701,690] <dbg> nrf_modem_lib_netif: lte_reg_handler: Registered to serving cell
    [00:00:03.701,690] <dbg> nrf_modem_lib_netif: update_has_cell: Gained serving cell
    [00:00:03.701,843] <dbg> nrf_modem_lib_netif: lte_reg_handler: Not registered to serving cell
    [00:00:03.701,873] <dbg> nrf_modem_lib_netif: update_has_cell: Lost serving cell
    [00:00:05.374,145] <inf> coap_request: Waiting for network to connect..
    [00:00:10.374,237] <inf> coap_request: Waiting for network to connect..
    [00:00:15.374,328] <inf> coap_request: Waiting for network to connect..

  • Hi Jason,

    You have configured CONFIG_NET_CONNECTION_MANAGER=y, and you use conn_mgr_all_if_up() and conn_mgr_all_if_connect() from Connection Manager Connectivity API. In case when connection manager is used, it is required that you also have CONFIG_NET_NATIVE=y.

    Best regards,
    Dejan

  • Thanks Dejan - I can see that it works when I disable CONFIG_NET_CONNECTION_MANAGER. I will leave CONFIG_NET_NATIVE enabled and continue to use CONFIG_NET_CONNECTION_MANAGER.

    Thanks,

    Jason

Reply Children
Related