<?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>nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60825/nrf9160-getaddrinfo-return-error--11</link><description>Hello, 
 it&amp;#39;s been a couple of days that i have a problem with NRF9160DK. 
 The problem is related to function getaddrinfo() that is now permanently returning -11, whatever i do. The code i&amp;#39;m using as a base (and, i repeat, that worked without any changes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 May 2021 16:21:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60825/nrf9160-getaddrinfo-return-error--11" /><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/307997?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 16:21:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07e3e497-1f8d-4c69-8151-1dce1355e11c</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;I&amp;#39;ll add to this if you are using the aws_fota or other examples that require you to set the address, make sure you set it! You will get this error if your example/code is pointing to a bogus address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/267170?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 09:47:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ba4ef44-2bfd-4241-bf4d-4d3f75a0428e</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;Hi JDoc,&lt;/p&gt;
&lt;p&gt;sorry for the delay in answer but i was still on vacation. Before anything else, i want to share with you this post:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/61822/nrf9160-fails-to-connect-to-nb-iot"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/61822/nrf9160-fails-to-connect-to-nb-iot&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the continuation of the post we&amp;#39;re writing on right now. In that post you will receive further indications about how to solve your issue with error -11.&amp;nbsp;Actually the post linked represents the method that really solved my problems so i suggest you to read it.&lt;/p&gt;
&lt;p&gt;By the way, returning to what you asked me, as you probably well know, many configuration parameters need to be set on the configuration file of&amp;nbsp; the project depending on the features needed to work on the project&amp;nbsp; itself (es. NB-IoT? LTE-M? DNS? IP?). The file i&amp;#39;m speaking about is &amp;quot;prj.conf&amp;quot;.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know which features you need in your project and i would like to avoid to confuse you, so i prefer to not share my prf.conf file settings. By the way, if you still don&amp;#39;t find any solution after this post, i can share it.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Frax&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/266846?ContentTypeID=1</link><pubDate>Fri, 28 Aug 2020 01:37:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d6e12f7-bf88-4eed-8c63-734358e18819</guid><dc:creator>JDoc</dc:creator><description>&lt;p&gt;[quote userid="86927" url="~/f/nordic-q-a/60825/nrf9160-getaddrinfo-return-error--11/247492"]Please remember to set properly .config file[/quote]&lt;/p&gt;
&lt;p&gt;Can you please explain what you mean @frax84? I have used this code but I am still getting a &amp;quot;error -11&amp;quot; on getaddrinfo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/247492?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 09:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71bb10c3-5d72-4daa-bc03-5382418d0045</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/60825/nrf9160-getaddrinfo-return-error--11/247455"]It could be, but what has changed since the last time it was working?[/quote]
&lt;p&gt;&lt;span&gt;Absolutely nothing, at least from the development code point of view. I even used a working code backup from my github to be sure to have not messed up my code, but nothing changed. From the network side, unfortunately i didn&amp;#39;t saved the details about the network, so i&amp;#39;m not sure if i&amp;#39;m connecting on the same network as the previous 2 (working) months. &lt;strong&gt;Of course this could be a good point. If i&amp;#39;m connected on a different network this one could not provide DNS service&lt;/strong&gt;. I&amp;#39;ll take note of the full CEREG string from now on.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/60825/nrf9160-getaddrinfo-return-error--11/247455"]Now you are on NB1, were you always on NB1, or has it recently done the switch from LTE M1 to NB1?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m in Rome, Italy. As far as i know in Italy we have no national LTE-M network deployed. The biggest providers (Vodafone and TIM [Telecom Italia Mobile]) deployed national NB-IoT coverage, so yes, i have always been on NB1 (9 on CEREG).&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/60825/nrf9160-getaddrinfo-return-error--11/247390"]This is very common error to see if&amp;nbsp;your local carrier does not provide DNS servers. You could try setting it manually, as shown here, and see if that works?[/quote]
&lt;p&gt;&lt;strong&gt;I&amp;#39;m happy to say that, with manual DNS setup, it works!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For people who could occur in the same problem i did, this is the function i used:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void modem_configure(void)
{
  if (IS_ENABLED(CONFIG_LTE_AUTO_INIT_AND_CONNECT)) {
    /* Do nothing, modem is already turned on
    * and connected.
    */
  } else {
    //Set manually DNS server
    struct nrf_in_addr dns;
    dns.s_addr = 134744072; // Google DNS, 8.8.8.8 in u32 rapresentation
    int err = nrf_setdnsaddr(2, &amp;amp;dns);
    if (err ==0) {
      printk(&amp;quot;DNS correctly set\n&amp;quot;);
    } else {
      printk(&amp;quot;Error %d, DNS not set\n&amp;quot;, err);
    }
    
    //Init network connection
    printk(&amp;quot;LTE Link Connecting ...\n&amp;quot;);
    err = lte_lc_init_and_connect();
    __ASSERT(err == 0, &amp;quot;LTE link could not be established.&amp;quot;);
    printk(&amp;quot;LTE Link Connected!\n&amp;quot;);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please remember to set properly .config file&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the nice and fast support!&lt;/p&gt;
&lt;p&gt;Frax&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/247455?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 07:18:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a796024d-46ee-48cb-917e-e6c261712cca</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="frax84"]Could it be a temporary network provider issue?[/quote]
&lt;p&gt;It could be, but what has changed since the last time it was working?&lt;/p&gt;
&lt;p&gt;Now you are on NB1, were you always on NB1, or has it recently done the switch from LTE M1 to NB1?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there anything out-of-the-ordinary (or different from a previous working situation) if you run at_client? Is it still connecting to the same provider?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/247396?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 15:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50252327-6841-4ed9-9189-a1bbe4b5db4c</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;Hi, i&amp;#39;m going to try as soon as possible (within tomorrow probably) and provide you a feedback. By the way, i want to underline that the same code never had this problems in the last two months. I always have been able to communicate with my (or any other) server. It&amp;#39;s just the last two days i&amp;#39;m not able anymore.&lt;/p&gt;
&lt;p&gt;Could it be a temporary network provider issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/247390?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 14:42:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:daf3d3ee-d895-4651-958c-36de90d4b475</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is very common error to see if&amp;nbsp;your local carrier does not provide DNS servers. You could try setting it manually, as shown here, and see if that works?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50029/nrf9160-modem-firmware-v1-0-0-setting-custom-dns-server/235419#235419"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/50029/nrf9160-modem-firmware-v1-0-0-setting-custom-dns-server/235419#235419&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/247369?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 13:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89f8d835-5029-4c8f-a1fe-6cd4ea45c3c0</guid><dc:creator>frax84</dc:creator><description>&lt;p&gt;No,&lt;/p&gt;
&lt;p&gt;exactly the same problem occurs. This is the serial output of the mqtt_simple example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.1.99-ncs1-4-gc025ef3dd566  ***
The MQTT simple sample started
LTE Link Connecting ...
+CEREG: 2,&amp;quot;FFFE&amp;quot;,&amp;quot;FFFFFFFF&amp;quot;,7,0,0,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 0,&amp;quot;FFFE&amp;quot;,&amp;quot;FFFFFFFF&amp;quot;,7,0,0,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 2,&amp;quot;80F3&amp;quot;,&amp;quot;04987148&amp;quot;,9,0,0,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 4,&amp;quot;80F3&amp;quot;,&amp;quot;04987148&amp;quot;,9,0,15,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 4,&amp;quot;FFFE&amp;quot;,&amp;quot;FFFFFFFF&amp;quot;,9,0,15,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 2,&amp;quot;7B88&amp;quot;,&amp;quot;04DCDD86&amp;quot;,9,0,15,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 5,&amp;quot;7B88&amp;quot;,&amp;quot;04DCDD86&amp;quot;,9,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
LTE Link Connected!
ERROR: getaddrinfo failed -11
ERROR: mqtt_connect -47&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Waiting for your feedback&lt;/p&gt;
&lt;p&gt;Frax&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 getaddrinfo() return error -11</title><link>https://devzone.nordicsemi.com/thread/247341?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 12:38:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04c92edf-def3-4e87-a871-96071e943f79</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do other examples, like mqtt_simple, resolve DNS and connect properly?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>