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 Reply Children
Related