<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111251/nrf53-getaddrinfo-failed</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Jun 2024 04:22:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111251/nrf53-getaddrinfo-failed" /><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/487410?ContentTypeID=1</link><pubDate>Wed, 05 Jun 2024 04:22:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b010d4e3-4128-4ed8-bbb8-0d0e6622be20</guid><dc:creator>Rung</dc:creator><description>&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;I can get the address info after config&amp;nbsp;&lt;span&gt;CONFIG_NET_CONFIG_SETTINGS=n&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/486407?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 11:40:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9807cf7b-5928-4afd-bcf7-a17e1e1cc60c</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I got some more input from our developers on this.&amp;nbsp;&lt;span&gt;&lt;span dir="ltr"&gt;A general tip - don&amp;#39;t set &lt;code&gt;CONFIG_NET_CONFIG_SETTINGS=y&lt;/code&gt; in the sample, it isn&amp;#39;t present in the default sample configuration for a reason. Specifically setting a static IP address confuses the sample&amp;#39;s logic (NET_EVENT_L4_CONNECTED event triggered to early), the sample assumes it&amp;#39;s &amp;quot;good to go&amp;quot; w/o waiting for the DHCP-assigned address, and this causes problems with DNS for instance (the gateway address is received in DHCP reply).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;As for the mqtt_connect() returning -2 (ENOENT), this suggests that the TLS credentials haven&amp;#39;t been configured properly in the system,&amp;nbsp;you should follow this closely:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/networking/azure_iot_hub.html#prereq-connect-to-azure-iot-hub"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/networking/azure_iot_hub.html#prereq-connect-to-azure-iot-hub&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/486132?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 10:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a73025b9-3f0b-4a19-a3e6-6b7a112d639a</guid><dc:creator>Rung</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your suggestion. I already enable log and make some test.&lt;/p&gt;
&lt;p&gt;The Test1 and 2 are used my old configuration to see the logs.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, I need your help to fix the following issues:&lt;/p&gt;
&lt;p&gt;1. Which configuration am I missing to bring the network up before calling the getaddrinfo() function?&lt;br /&gt; &lt;br /&gt;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?&lt;/p&gt;
&lt;p&gt;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/p&gt;
&lt;p&gt;Test1: I keep my old configuration.&amp;nbsp;&lt;/p&gt;
[quote userid="114021" url="~/f/nordic-q-a/111251/nrf53-getaddrinfo-failed"]After that, I implemented the DNS resolver, dns_resolve_init(), which changed the return error to -11.[/quote]
&lt;p&gt;- Found the DNS resolve already called in the background thread, and timeout while waiting network interface (-115).&lt;br /&gt;- getaddrinfo() return error code -11.&lt;br /&gt;- DHCPv4 solved after call getaddrinfo(). Can ping 8.8.8.8.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1 ***


[00:00:00.014,892] &amp;lt;inf&amp;gt; wifi_nrf_bus: SPIM spi@a000: freq = 8 MHz
[00:00:00.014,953] &amp;lt;inf&amp;gt; wifi_nrf_bus: SPIM spi@a000: latency = 0
[00:00:00.270,568] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
[00:00:00.271,484] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
[00:00:00.272,003] &amp;lt;dbg&amp;gt; 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] &amp;lt;inf&amp;gt; net_config: Initializing network
[00:00:00.275,329] &amp;lt;inf&amp;gt; net_config: Waiting interface 1 (0x2000cd10) to be up...
[00:00:30.276,153] &amp;lt;inf&amp;gt; net_config: IPv4 address: 192.0.2.1
[00:00:30.276,214] &amp;lt;inf&amp;gt; net_config: Running dhcpv4 client...
[00:00:30.276,489] &amp;lt;err&amp;gt; net_config: Timeout while waiting network interface
[00:00:30.276,519] &amp;lt;err&amp;gt; net_config: Network initialization failed (-115)
[00:00:30.277,374] &amp;lt;inf&amp;gt; main: Azure IoT Hub sample started
[00:00:30.277,374] &amp;lt;inf&amp;gt; main: Bringing network interface up and connecting to the network
[00:00:31.837,951] &amp;lt;inf&amp;gt; wifi_mgmt_ext: Connection requested
[00:00:36.146,942] &amp;lt;inf&amp;gt; main: Network connectivity established and IP address assigned
[00:00:36.147,583] &amp;lt;inf&amp;gt; main: Connected to network
[00:00:36.147,766] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
[00:00:36.147,857] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
[00:00:36.147,949] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [2] 224.0.0.251:5353 mDNS
[00:00:36.148,529] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): Cannot get net_context (-2)
[00:00:36.148,529] &amp;lt;wrn&amp;gt; net_dns_resolve: Cannot initialize DNS resolver (-2)
[00:00:36.149,444] &amp;lt;inf&amp;gt; azureHubConnection: Device ID: device-02
[00:00:36.149,444] &amp;lt;inf&amp;gt; azureHubConnection: Starting DPS
[00:00:36.149,780] &amp;lt;inf&amp;gt; azureHubConnection: DPS registration status: AZURE_IOT_HUB_DPS_REG_STATUS_NOT_STARTED
[00:00:36.149,963] &amp;lt;err&amp;gt; mqtt_helper: getaddrinfo() failed, error -11
[00:00:36.149,993] &amp;lt;err&amp;gt; azure_iot_hub_dps: mqtt_helper_connect failed, error: 11
[00:00:36.149,993] &amp;lt;err&amp;gt; azureHubConnection: DPS failed to start, error: 11
[00:00:36.149,993] &amp;lt;err&amp;gt; azureHubConnection: Failed to run DPS, error: 11, terminating connection attempt
[00:00:36.225,311] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (rx_q[0]): Cannot get net_context (-2)
[00:00:40.227,966] &amp;lt;inf&amp;gt; net_dhcpv4: Received: 192.168.1.61
[00:00:40.228,118] &amp;lt;inf&amp;gt; net_config: IPv4 address: 192.168.1.61
[00:00:40.228,118] &amp;lt;inf&amp;gt; net_config: Lease time: 21600 seconds
[00:00:40.228,149] &amp;lt;inf&amp;gt; net_config: Subnet: 255.255.255.0
[00:00:40.228,210] &amp;lt;inf&amp;gt; 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] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:55.880,645] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:56.701,110] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:57.417,816] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:59.566,253] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:01:00.285,003] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
uart:~$&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Test2: Remove the dns_resolve_init() in my code.&lt;/p&gt;
&lt;p&gt;- Found timeout while waiting network interface(-115).&lt;br /&gt;- Error: Gateway not set for iface 0x2000cd10.&lt;br /&gt;- getaddrinfo() return error code -101.&lt;br /&gt;- DHCPv4 solved after call getaddrinfo(). Can ping 8.8.8.8.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1 ***


[00:00:00.014,862] &amp;lt;inf&amp;gt; wifi_nrf_bus: SPIM spi@a000: freq = 8 MHz
[00:00:00.014,923] &amp;lt;inf&amp;gt; wifi_nrf_bus: SPIM spi@a000: latency = 0
[00:00:00.270,507] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
[00:00:00.271,392] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
[00:00:00.271,942] &amp;lt;dbg&amp;gt; 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] &amp;lt;inf&amp;gt; net_config: Initializing network
[00:00:00.275,268] &amp;lt;inf&amp;gt; net_config: Waiting interface 1 (0x2000cd10) to be up...
[00:00:30.276,062] &amp;lt;inf&amp;gt; net_config: IPv4 address: 192.0.2.1
[00:00:30.276,123] &amp;lt;inf&amp;gt; net_config: Running dhcpv4 client...
[00:00:30.276,397] &amp;lt;err&amp;gt; net_config: Timeout while waiting network interface
[00:00:30.276,428] &amp;lt;err&amp;gt; net_config: Network initialization failed (-115)
[00:00:30.277,252] &amp;lt;inf&amp;gt; main: Azure IoT Hub sample started
[00:00:30.277,282] &amp;lt;inf&amp;gt; main: Bringing network interface up and connecting to the network
[00:00:30.277,282] &amp;lt;inf&amp;gt; main: state 0
[00:00:31.836,914] &amp;lt;inf&amp;gt; wifi_mgmt_ext: Connection requested
[00:00:36.038,574] &amp;lt;inf&amp;gt; main: Network connectivity established and IP address assigned
[00:00:36.039,184] &amp;lt;inf&amp;gt; main: Connected to network
[00:00:36.040,069] &amp;lt;inf&amp;gt; azureHubConnection: Device ID: device-02
[00:00:36.040,100] &amp;lt;inf&amp;gt; azureHubConnection: Starting DPS
[00:00:36.040,405] &amp;lt;inf&amp;gt; azureHubConnection: DPS registration status: AZURE_IOT_HUB_DPS_REG_STATUS_NOT_STARTED
[00:00:36.040,802] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_name: (main): DNS id will be 27168
[00:00:36.040,954] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_write: (main): [0] submitting work to server idx 0 for id 27168 hash 36583
[00:00:36.041,168] &amp;lt;err&amp;gt; net_arp: Gateway not set for iface 0x2000cd10
[00:00:36.048,187] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:36.061,767] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:36.112,274] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:36.112,548] &amp;lt;dbg&amp;gt; net_sock_addr: dns_resolve_cb: (rx_q[0]): dns status: -101
[00:00:36.115,234] &amp;lt;err&amp;gt; mqtt_helper: getaddrinfo() failed, error -101
[00:00:36.115,264] &amp;lt;err&amp;gt; azure_iot_hub_dps: mqtt_helper_connect failed, error: 101
[00:00:36.115,264] &amp;lt;err&amp;gt; azureHubConnection: DPS failed to start, error: 101
[00:00:36.115,264] &amp;lt;err&amp;gt; azureHubConnection: Failed to run DPS, error: 101, terminating connection attempt
[00:00:36.122,650] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:36.122,863] &amp;lt;inf&amp;gt; net_dhcpv4: Received: 192.168.1.61
[00:00:36.122,985] &amp;lt;inf&amp;gt; net_config: IPv4 address: 192.168.1.61
[00:00:36.123,016] &amp;lt;inf&amp;gt; net_config: Lease time: 21600 seconds
[00:00:36.123,046] &amp;lt;inf&amp;gt; net_config: Subnet: 255.255.255.0
[00:00:36.123,107] &amp;lt;inf&amp;gt; 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] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:52.390,777] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:52.621,948] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:53.206,512] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:54.230,682] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:54.333,892] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:55.256,439] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:56.178,558] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;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.&lt;/div&gt;
&lt;div&gt;To address this problem, I tried changing the configuration from NET_IF_NO_AUTO_START to NET_IF_UP.&lt;/div&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1716890161694v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This change solved the getaddrinfo() error, but the error has now shifted to mqtt_helper_connect instead.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1 ***


[00:00:00.014,862] &amp;lt;inf&amp;gt; wifi_nrf_bus: SPIM spi@a000: freq = 8 MHz
[00:00:00.014,923] &amp;lt;inf&amp;gt; wifi_nrf_bus: SPIM spi@a000: latency = 0
[00:00:00.268,280] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [0] 8.8.8.8
[00:00:00.269,165] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_init_locked: (main): [1] 8.8.8.8
[00:00:00.269,714] &amp;lt;dbg&amp;gt; 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] &amp;lt;inf&amp;gt; net_config: Initializing network
[00:00:00.273,010] &amp;lt;err&amp;gt; net_config: Network initialization failed (-115)
[00:00:00.273,834] &amp;lt;inf&amp;gt; main: Azure IoT Hub sample started
[00:00:00.273,834] &amp;lt;inf&amp;gt; main: Bringing network interface up and connecting to the network
[00:00:00.273,864] &amp;lt;inf&amp;gt; main: state 0
[00:00:01.858,886] &amp;lt;inf&amp;gt; wifi_mgmt_ext: Connection requested
[00:00:06.073,425] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:06.085,205] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:06.120,971] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:06.131,408] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:06.131,622] &amp;lt;inf&amp;gt; net_dhcpv4: Received: 192.168.1.61
[00:00:06.131,805] &amp;lt;inf&amp;gt; main: Network connectivity established and IP address assigned
[00:00:06.132,446] &amp;lt;inf&amp;gt; main: Connected to network
[00:00:06.133,300] &amp;lt;inf&amp;gt; azureHubConnection: Device ID: device-02
[00:00:06.133,331] &amp;lt;inf&amp;gt; azureHubConnection: Starting DPS
[00:00:06.133,636] &amp;lt;inf&amp;gt; azureHubConnection: DPS registration status: AZURE_IOT_HUB_DPS_REG_STATUS_NOT_STARTED
[00:00:06.134,063] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_resolve_name: (main): DNS id will be 40166
[00:00:06.134,185] &amp;lt;dbg&amp;gt; net_dns_resolve: dns_write: (main): [0] submitting work to server idx 0 for id 40166 hash 36583
[00:00:06.215,972] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:06.216,247] &amp;lt;dbg&amp;gt; net_sock_addr: dns_resolve_cb: (rx_q[0]): dns status: -100
[00:00:06.216,308] &amp;lt;dbg&amp;gt; net_sock_addr: dns_resolve_cb: (rx_q[0]): dns status: -103
[00:00:06.217,163] &amp;lt;dbg&amp;gt; net_sock_tls: tls_alloc: (main): Allocated TLS context, 0x2000dc78
[00:00:06.217,681] &amp;lt;dbg&amp;gt; net_sock: zsock_socket_internal: (main): socket: ctx=0x2000eb30, fd=10
[00:00:06.261,932] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
[00:00:06.264,892] &amp;lt;dbg&amp;gt; net_sock: z_impl_zsock_close: (main): close: ctx=0x2000dc78, fd=9
[00:00:06.265,075] &amp;lt;dbg&amp;gt; net_sock: z_impl_zsock_close: (main): close: ctx=0x2000eb30, fd=10
[00:00:06.265,716] &amp;lt;err&amp;gt; mqtt_helper: mqtt_connect, error: -2
[00:00:06.265,747] &amp;lt;err&amp;gt; azure_iot_hub_dps: mqtt_helper_connect failed, error: -2
[00:00:06.265,777] &amp;lt;err&amp;gt; azureHubConnection: DPS failed to start, error: -2
[00:00:06.265,777] &amp;lt;err&amp;gt; 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] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059de4, st=0, user_data=(nil)
[00:00:06.311,462] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
[00:00:08.513,519] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
[00:00:08.515,991] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:11.585,693] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
[00:00:11.588,623] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:13.331,787] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)
[00:00:14.962,493] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059da4, st=0, user_data=(nil)
[00:00:16.398,406] &amp;lt;dbg&amp;gt; net_sock_packet: zpacket_received_cb: (rx_q[0]): ctx=0x2000ea78, pkt=0x20059d64, st=0, user_data=(nil)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/486049?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 14:47:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:448531e5-a77a-4e23-986c-6370234d004e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Amanda is out of office, so I&amp;#39;m replying instead.&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t see any DNS-related logs, despite you setting CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG, probably missed CONFIG_NET_LOG&lt;/p&gt;
&lt;p&gt;Make sure you enable:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_NET_LOG=y&lt;/span&gt;&lt;br /&gt;&lt;span&gt;CONFIG_DNS_RESOLVER_LOG_LEVEL_DBG=y&lt;/span&gt;&lt;br /&gt;&lt;span&gt;CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y # (for gettaddrinfo logs)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now as for the failures:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;w/o DHCPv4 your configuration won&amp;#39;t work (unless you ommited some essential configs in the snippet you provided) as you configure DNS server to an external server (&lt;code&gt;8.8.8.8&lt;/code&gt;), but doesn&amp;#39;t set the GW address ( &lt;code&gt;DCONFIG_NET_CONFIG_MY_IPV4_GW&lt;/code&gt;) - the server won&amp;#39;t be reachable. Although I wouldn&amp;#39;t personally recommend static address configuration&lt;/li&gt;
&lt;li&gt;w/ DHCPv4 - would be good to see the log output with the configs I&amp;#39;ve mentioned above. Personally, I&amp;#39;d also enable &lt;code&gt;CONFIG_NET_SHELL=y&lt;/code&gt; and see what DNS server address gets configured with DHCPv4 ( &lt;code&gt;net dns&lt;/code&gt; command), whether it&amp;#39;s a valid one and whether you can execute simple queries ( &lt;code&gt;net dns google.com&lt;/code&gt; ) for instance.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;br /&gt;BR,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Sigurd&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/485704?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 03:12:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be44d5b4-b272-4c3d-9164-a90eae7e8519</guid><dc:creator>Rung</dc:creator><description>&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Hi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&amp;quot;&amp;lt;inf&amp;gt; main: Connected to network&amp;quot;. This log shows that my device can connect to the internet, doesn&amp;#39;t it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="77782" url="~/f/nordic-q-a/111251/nrf53-getaddrinfo-failed/485695"]the DNS server is not reachable or not working correctly.[/quote]
&lt;p&gt;Can you help clarify the important configurations that I should check?&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Additional findings from my investigation:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- The error code -11 occurs when CONFIG_NET_DHCPV4=y.&lt;br /&gt;- When CONFIG_NET_DHCPV4=n, the error code is -101.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/485695?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 21:07:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad45be72-9e58-4b12-ab10-37391c53a942</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your log, &amp;quot;&amp;lt;err&amp;gt; mqtt_helper: getaddrinfo() failed, error -11&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The&amp;nbsp;&lt;/span&gt;&lt;code dir="ltr"&gt;getaddrinfo()&lt;/code&gt;&lt;span&gt;&amp;nbsp;function is used to resolve domain names into IP addresses. If it fails with error -11, it typically means that the Domain Name System (DNS) lookup failed. This can happen if the device is not connected to the internet, or if the DNS server is not reachable or not working correctly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/485524?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 04:45:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17719516-70c5-4658-9074-f748bc4e3969</guid><dc:creator>Rung</dc:creator><description>&lt;p&gt;Yes, I have already set up my IoT hub and tested it using a Python script,&amp;nbsp;&lt;a href="https://github.com/Azure/azure-iot-sdk-python/blob/v2/samples/async-hub-scenarios/provision_x509.py"&gt;provision_x509.py&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Azure IoT Hub library
CONFIG_AZURE_IOT_HUB=y
CONFIG_AZURE_IOT_HUB_DEVICE_ID=&amp;quot;myDevice&amp;quot;
CONFIG_AZURE_IOT_HUB_DPS=y
CONFIG_AZURE_IOT_HUB_DPS_ID_SCOPE=&amp;quot;0ne00xxxxxx&amp;quot;
CONFIG_AZURE_IOT_HUB_LOG_LEVEL_DEFAULT=y
# Host name must be configured if DPS is not used
CONFIG_AZURE_IOT_HUB_HOSTNAME=&amp;quot;&amp;quot;
# Change the security tag to the tag where Azure IoT Hub certificates
# are provisioned
CONFIG_MQTT_HELPER_SEC_TAG=10
CONFIG_MQTT_HELPER_SECONDARY_SEC_TAG=11
CONFIG_MQTT_HELPER_STACK_SIZE=8192&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Certificate configuration&lt;/p&gt;
&lt;p&gt;ca-cert.pem --&amp;gt; G2&lt;/p&gt;
&lt;p&gt;client-cert.pem --&amp;gt;&amp;nbsp;myDevice-full-chain.cert.pem&lt;/p&gt;
&lt;p&gt;private-key.pem --&amp;gt; myDevice.key.pem&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1716438870071v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/485221?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 20:05:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8915f29d-1cf2-4172-9c85-c52686a8a449</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;Do you&amp;nbsp;set up and configure an Azure IoT Hub instance? See&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/networking/azure_iot_hub.html#prereq-connect-to-azure-iot-hub"&gt;&lt;span&gt;Setup and configuration&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;for information on creating an Azure IoT Hub instance and&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/net/azure_iot_hub/README.html#configure-options-azure-iot"&gt;&lt;span&gt;Additional configuration&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;for additional information on the configuration options that are available.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/484948?ContentTypeID=1</link><pubDate>Tue, 21 May 2024 03:23:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2cb6e5b-d4f7-444f-b239-a2d33aa379ed</guid><dc:creator>Rung</dc:creator><description>[quote userid="114021" url="~/f/nordic-q-a/111251/nrf53-getaddrinfo-failed"]Initially, the getaddrinfo() function returns a failure code of -101 when called in the broker_init.[/quote]
&lt;p&gt;No, before the modification, I received error code -101.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf53: getaddrinfo() failed</title><link>https://devzone.nordicsemi.com/thread/484850?ContentTypeID=1</link><pubDate>Fri, 17 May 2024 21:56:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24588f03-f126-47a8-9913-28d5e36e20cc</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you able to connect to&amp;nbsp;the&amp;nbsp;&lt;span&gt;Azure IoT hub&lt;/span&gt;&lt;span&gt;&amp;nbsp;without issue before modifying the&amp;nbsp;Azure IoT hub&amp;nbsp;example?&lt;/span&gt;&lt;/p&gt;
[quote user=""] [/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>