nrf53: getaddrinfo() failed

Hi,

I am adapting the Azure IoT example for use with the nRF5340DK and nRF7002EK.

The configuration is:

- sdk: nvs 2.6.0

- example Azure IoT hub

Initially, the getaddrinfo() function returns a failure code of -101 when called in the broker_init.

After that, I implemented the DNS resolver, dns_resolve_init(), which changed the return error to -11.

Could you please assist me in resolving this issue?

prj.conf

CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=n


# Enable Sockets support
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y

# Enable the DNS resolver
CONFIG_DNS_RESOLVER=y
# Enable additional buffers
CONFIG_DNS_RESOLVER_ADDITIONAL_BUF_CTR=5
# Enable additional queries
CONFIG_DNS_RESOLVER_ADDITIONAL_QUERIES=2
# Enable mDNS support
CONFIG_MDNS_RESOLVER=y
# Enable LLMNR support
CONFIG_LLMNR_RESOLVER=n

CONFIG_DNS_RESOLVER_MAX_SERVERS=1
CONFIG_DNS_SERVER_IP_ADDRESSES=y
CONFIG_DNS_NUM_CONCUR_QUERIES=5
CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG=y

# Google DNS IPv4 and IPv6 servers
CONFIG_DNS_SERVER1="8.8.8.8"
# CONFIG_DNS_SERVER2="2001:4860:4860::8888"

CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_NEED_IPV6=n
CONFIG_NET_CONFIG_NEED_IPV4=y
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.0.2.1"
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="192.0.2.2"

Terminal

*** Booting nRF Connect SDK v3.5.99-ncs1 ***


[00:00:00.014,862] <inf> wifi_nrf_bus: SPIM spi@a000: freq = 8 MHz
[00:00:00.014,923] <inf> wifi_nrf_bus: SPIM spi@a000: latency = 0
*** Booting nRF Connect SDK v3.5.99-ncs1 ***
[00:00:30.272,857] <inf> main: Azure IoT Hub sample started
[00:00:30.272,857] <inf> main: Bringing network interface up and connecting to the network
[00:00:31.832,885] <inf> wifi_mgmt_ext: Connection requested
[00:00:36.031,585] <inf> main: Network connectivity established and IP address assigned
[00:00:36.032,226] <inf> main: Connected to network
[00:00:36.032,257] <inf> main: Device ID: device-02
[00:00:36.032,287] <inf> main: Starting DPS
[00:00:36.032,623] <inf> main: DPS registration status: AZURE_IOT_HUB_DPS_REG_STATUS_NOT_STARTED
[00:00:36.032,836] <err> mqtt_helper: getaddrinfo() failed, error -11
[00:00:36.032,867] <err> azure_iot_hub_dps: mqtt_helper_connect failed, error: 11
[00:00:36.032,867] <err> main: DPS failed to start, error: 11
[00:00:36.032,867] <err> main: Failed to run DPS, error: 11, terminating connection attempt

Parents
  • Hi, 

    Are you able to connect to the Azure IoT hub without issue before modifying the Azure IoT hub example?

  • Initially, the getaddrinfo() function returns a failure code of -101 when called in the broker_init.

    No, before the modification, I received error code -101.

  • Hi,

    "<inf> main: Connected to network". This log shows that my device can connect to the internet, doesn't it?

    the DNS server is not reachable or not working correctly.

    Can you help clarify the important configurations that I should check?

    Additional findings from my investigation:

    - The error code -11 occurs when CONFIG_NET_DHCPV4=y.
    - When CONFIG_NET_DHCPV4=n, the error code is -101.

  • Hi!

    Amanda is out of office, so I'm replying instead.

    We don't see any DNS-related logs, despite you setting CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG, probably missed CONFIG_NET_LOG

    Make sure you enable:

    CONFIG_NET_LOG=y
    CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG=y
    CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y # (for gettaddrinfo logs)

    Now as for the failures:

    1. w/o DHCPv4 your configuration won't work (unless you ommited some essential configs in the snippet you provided) as you configure DNS server to an external server (8.8.8.8), but doesn't set the GW address ( DCONFIG_NET_CONFIG_MY_IPV4_GW) - the server won't be reachable. Although I wouldn't personally recommend static address configuration
    2. w/ DHCPv4 - would be good to see the log output with the configs I've mentioned above. Personally, I'd also enable CONFIG_NET_SHELL=y and see what DNS server address gets configured with DHCPv4 ( net dns command), whether it's a valid one and whether you can execute simple queries ( net dns google.com ) for instance.


    BR,

    Sigurd

  • Hi,

    Thanks for your suggestion. I already enable log and make some test.

    The Test1 and 2 are used my old configuration to see the logs.

    In Test 3, I tried to fix the DHCPv4 initialization after the getaddrinfo() call. This test resolved the getaddrinfo() error, but the error has shifted to the next process, mqtt_connect.

    So, I need your help to fix the following issues:

    1. Which configuration am I missing to bring the network up before calling the getaddrinfo() function?

    2. If my understanding is correct, will my issue be that mqtt_connect returns error -2? What is the root cause of this issue, and could it be related to the certification?

    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    Test1: I keep my old configuration. 

    After that, I implemented the DNS resolver, dns_resolve_init(), which changed the return error to -11.

    - Found the DNS resolve already called in the background thread, and timeout while waiting network interface (-115).
    - getaddrinfo() return error code -11.
    - DHCPv4 solved after call getaddrinfo(). Can ping 8.8.8.8.

    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    
    
    [00:00:00.014,892] <inf> wifi_nrf_bus: SPIM spi@a000: freq = 8 MHz
    [00:00:00.014,953] <inf> wifi_nrf_bus: SPIM spi@a000: latency = 0
    [00:00:00.270,568] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
    [00:00:00.271,484] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
    [00:00:00.272,003] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [2] 224.0.0.251:5353 mDNS
    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    [00:00:00.275,299] <inf> net_config: Initializing network
    [00:00:00.275,329] <inf> net_config: Waiting interface 1 (0x2000cd10) to be up...
    [00:00:30.276,153] <inf> net_config: IPv4 address: 192.0.2.1
    [00:00:30.276,214] <inf> net_config: Running dhcpv4 client...
    [00:00:30.276,489] <err> net_config: Timeout while waiting network interface
    [00:00:30.276,519] <err> net_config: Network initialization failed (-115)
    [00:00:30.277,374] <inf> main: Azure IoT Hub sample started
    [00:00:30.277,374] <inf> main: Bringing network interface up and connecting to the network
    [00:00:31.837,951] <inf> wifi_mgmt_ext: Connection requested
    [00:00:36.146,942] <inf> main: Network connectivity established and IP address assigned
    [00:00:36.147,583] <inf> main: Connected to network
    [00:00:36.147,766] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
    [00:00:36.147,857] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
    [00:00:36.147,949] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [2] 224.0.0.251:5353 mDNS
    [00:00:36.148,529] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): Cannot get net_context (-2)
    [00:00:36.148,529] <wrn> net_dns_resolve: Cannot initialize DNS resolver (-2)
    [00:00:36.149,444] <inf> azureHubConnection: Device ID: device-02
    [00:00:36.149,444] <inf> azureHubConnection: Starting DPS
    [00:00:36.149,780] <inf> azureHubConnection: DPS registration status: AZURE_IOT_HUB_DPS_REG_STATUS_NOT_STARTED
    [00:00:36.149,963] <err> mqtt_helper: getaddrinfo() failed, error -11
    [00:00:36.149,993] <err> azure_iot_hub_dps: mqtt_helper_connect failed, error: 11
    [00:00:36.149,993] <err> azureHubConnection: DPS failed to start, error: 11
    [00:00:36.149,993] <err> azureHubConnection: Failed to run DPS, error: 11, terminating connection attempt
    [00:00:36.225,311] <dbg> net_dns_resolve: dns_resolve_init_locked: (rx_q[0]): Cannot get net_context (-2)
    [00:00:40.227,966] <inf> net_dhcpv4: Received: 192.168.1.61
    [00:00:40.228,118] <inf> net_config: IPv4 address: 192.168.1.61
    [00:00:40.228,118] <inf> net_config: Lease time: 21600 seconds
    [00:00:40.228,149] <inf> net_config: Subnet: 255.255.255.0
    [00:00:40.228,210] <inf> net_config: Router: 192.168.1.254
    uart:~$ net ping 8.8.8.8
    PING 8.8.8.8
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=1 ttl=113 time=59 ms
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=2 ttl=113 time=47 ms
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=3 ttl=113 time=52 ms
    [00:00:53.966,491] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:55.880,645] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:56.701,110] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:57.417,816] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:59.566,253] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:01:00.285,003] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    uart:~$

    Test2: Remove the dns_resolve_init() in my code.

    - Found timeout while waiting network interface(-115).
    - Error: Gateway not set for iface 0x2000cd10.
    - getaddrinfo() return error code -101.
    - DHCPv4 solved after call getaddrinfo(). Can ping 8.8.8.8.

    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    
    
    [00:00:00.014,862] <inf> wifi_nrf_bus: SPIM spi@a000: freq = 8 MHz
    [00:00:00.014,923] <inf> wifi_nrf_bus: SPIM spi@a000: latency = 0
    [00:00:00.270,507] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
    [00:00:00.271,392] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
    [00:00:00.271,942] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [2] 224.0.0.251:5353 mDNS
    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    [00:00:00.275,238] <inf> net_config: Initializing network
    [00:00:00.275,268] <inf> net_config: Waiting interface 1 (0x2000cd10) to be up...
    [00:00:30.276,062] <inf> net_config: IPv4 address: 192.0.2.1
    [00:00:30.276,123] <inf> net_config: Running dhcpv4 client...
    [00:00:30.276,397] <err> net_config: Timeout while waiting network interface
    [00:00:30.276,428] <err> net_config: Network initialization failed (-115)
    [00:00:30.277,252] <inf> main: Azure IoT Hub sample started
    [00:00:30.277,282] <inf> main: Bringing network interface up and connecting to the network
    [00:00:30.277,282] <inf> main: state 0
    [00:00:31.836,914] <inf> wifi_mgmt_ext: Connection requested
    [00:00:36.038,574] <inf> main: Network connectivity established and IP address assigned
    [00:00:36.039,184] <inf> main: Connected to network
    [00:00:36.040,069] <inf> azureHubConnection: Device ID: device-02
    [00:00:36.040,100] <inf> azureHubConnection: Starting DPS
    [00:00:36.040,405] <inf> azureHubConnection: DPS registration status: AZURE_IOT_HUB_DPS_REG_STATUS_NOT_STARTED
    [00:00:36.040,802] <dbg> net_dns_resolve: dns_resolve_name: (main): DNS id will be 27168
    [00:00:36.040,954] <dbg> net_dns_resolve: dns_write: (main): [0] submitting work to server idx 0 for id 27168 hash 36583
    [00:00:36.041,168] <err> net_arp: Gateway not set for iface 0x2000cd10
    [00:00:36.048,187] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:36.061,767] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:36.112,274] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:36.112,548] <dbg> net_sock_addr: dns_resolve_cb: (rx_q[0]): dns status: -101
    [00:00:36.115,234] <err> mqtt_helper: getaddrinfo() failed, error -101
    [00:00:36.115,264] <err> azure_iot_hub_dps: mqtt_helper_connect failed, error: 101
    [00:00:36.115,264] <err> azureHubConnection: DPS failed to start, error: 101
    [00:00:36.115,264] <err> azureHubConnection: Failed to run DPS, error: 101, terminating connection attempt
    [00:00:36.122,650] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:36.122,863] <inf> net_dhcpv4: Received: 192.168.1.61
    [00:00:36.122,985] <inf> net_config: IPv4 address: 192.168.1.61
    [00:00:36.123,016] <inf> net_config: Lease time: 21600 seconds
    [00:00:36.123,046] <inf> net_config: Subnet: 255.255.255.0
    [00:00:36.123,107] <inf> net_config: Router: 192.168.1.254
    uart:~$ net ping 8.8.8.8
    PING 8.8.8.8
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=1 ttl=113 time=67 ms
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=2 ttl=113 time=38 ms
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=3 ttl=113 time=39 ms
    [00:00:52.389,099] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:52.390,777] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:52.621,948] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:53.206,512] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:54.230,682] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:54.333,892] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:55.256,439] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:56.178,558] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)

    Test3: Due to the timeout while waiting for the network interface, I investigated the code and found that -115 is returned when the network IP does not come up.
    To address this problem, I tried changing the configuration from NET_IF_NO_AUTO_START to NET_IF_UP.

    This change solved the getaddrinfo() error, but the error has now shifted to mqtt_helper_connect instead.

    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    
    
    [00:00:00.014,862] <inf> wifi_nrf_bus: SPIM spi@a000: freq = 8 MHz
    [00:00:00.014,923] <inf> wifi_nrf_bus: SPIM spi@a000: latency = 0
    [00:00:00.268,280] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
    [00:00:00.269,165] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
    [00:00:00.269,714] <dbg> net_dns_resolve: dns_resolve_init_locked: (main): [2] 224.0.0.251:5353 mDNS
    *** Booting nRF Connect SDK v3.5.99-ncs1 ***
    [00:00:00.273,010] <inf> net_config: Initializing network
    [00:00:00.273,010] <err> net_config: Network initialization failed (-115)
    [00:00:00.273,834] <inf> main: Azure IoT Hub sample started
    [00:00:00.273,834] <inf> main: Bringing network interface up and connecting to the network
    [00:00:00.273,864] <inf> main: state 0
    [00:00:01.858,886] <inf> wifi_mgmt_ext: Connection requested
    [00:00:06.073,425] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:06.085,205] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:06.120,971] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:06.131,408] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:06.131,622] <inf> net_dhcpv4: Received: 192.168.1.61
    [00:00:06.131,805] <inf> main: Network connectivity established and IP address assigned
    [00:00:06.132,446] <inf> main: Connected to network
    [00:00:06.133,300] <inf> azureHubConnection: Device ID: device-02
    [00:00:06.133,331] <inf> azureHubConnection: Starting DPS
    [00:00:06.133,636] <inf> azureHubConnection: DPS registration status: AZURE_IOT_HUB_DPS_REG_STATUS_NOT_STARTED
    [00:00:06.134,063] <dbg> net_dns_resolve: dns_resolve_name: (main): DNS id will be 40166
    [00:00:06.134,185] <dbg> net_dns_resolve: dns_write: (main): [0] submitting work to server idx 0 for id 40166 hash 36583
    [00:00:06.215,972] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:06.216,247] <dbg> net_sock_addr: dns_resolve_cb: (rx_q[0]): dns status: -100
    [00:00:06.216,308] <dbg> net_sock_addr: dns_resolve_cb: (rx_q[0]): dns status: -103
    [00:00:06.217,163] <dbg> net_sock_tls: tls_alloc: (main): Allocated TLS context, 0x2000dc78
    [00:00:06.217,681] <dbg> net_sock: zsock_socket_internal: (main): socket: ctx=0x2000eb30, fd=10
    [00:00:06.261,932] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
    [00:00:06.264,892] <dbg> net_sock: z_impl_zsock_close: (main): close: ctx=0x2000dc78, fd=9
    [00:00:06.265,075] <dbg> net_sock: z_impl_zsock_close: (main): close: ctx=0x2000eb30, fd=10
    [00:00:06.265,716] <err> mqtt_helper: mqtt_connect, error: -2
    [00:00:06.265,747] <err> azure_iot_hub_dps: mqtt_helper_connect failed, error: -2
    [00:00:06.265,777] <err> azureHubConnection: DPS failed to start, error: -2
    [00:00:06.265,777] <err> azureHubConnection: Failed to run DPS, error: -2, terminating connection attempt
    uart:~$ net ping 8.8.8.8
    PING 8.8.8.8
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=1 ttl=113 time=44 ms
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=2 ttl=113 time=64 ms
    28 bytes from 8.8.8.8 to 192.168.1.61: icmp_seq=3 ttl=113 time=48 ms
    [00:00:06.309,997] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
    [00:00:06.311,462] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
    [00:00:08.513,519] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
    [00:00:08.515,991] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:11.585,693] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
    [00:00:11.588,623] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:13.331,787] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
    [00:00:14.962,493] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
    [00:00:16.398,406] <dbg> net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)

  • Hi!

    I got some more input from our developers on this. A general tip - don't set CONFIG_NET_CONFIG_SETTINGS=y in the sample, it isn't present in the default sample configuration for a reason. Specifically setting a static IP address confuses the sample's logic (NET_EVENT_L4_CONNECTED event triggered to early), the sample assumes it's "good to go" w/o waiting for the DHCP-assigned address, and this causes problems with DNS for instance (the gateway address is received in DHCP reply).

    As for the mqtt_connect() returning -2 (ENOENT), this suggests that the TLS credentials haven't been configured properly in the system, you should follow this closely: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/networking/azure_iot_hub.html#prereq-connect-to-azure-iot-hub

  • Thanks for your help.

    I can get the address info after config CONFIG_NET_CONFIG_SETTINGS=n

Reply Children
No Data
Related