<?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 mqtt_simple SES build error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54702/nrf9160-mqtt_simple-ses-build-error</link><description>Hi, Sir: 
 I am developing nRF9160 DK(pca10090) with mqtt_simple example in nRF Connect SDK(ncs/nrf/samples/nrf9160/mqtt_simple). Firstly build the example , build OK, but I set CONFIG_DNS_RESOLVER =y, rebuild again, there were 2 errors: 
 
 how to eliminate</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Nov 2019 01:58:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54702/nrf9160-mqtt_simple-ses-build-error" /><item><title>RE: nRF9160 mqtt_simple SES build error</title><link>https://devzone.nordicsemi.com/thread/221447?ContentTypeID=1</link><pubDate>Fri, 22 Nov 2019 01:58:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db8a2b4a-29c5-43a5-9361-5dc102a31ab1</guid><dc:creator>Harry Wei</dc:creator><description>&lt;p&gt;Hi, Didrik:&lt;/p&gt;
&lt;p&gt;I tested mqtt_simple in nb-lot mode, I found it always print error when the code running in nRF9160:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ERROR: getaddrinfo failed 22
ERROR: mqtt_connect -47&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have tested my SIM card in at_client with LTE Link Monitor, it works well, when I read SYSTEMMODE, it returned&lt;/p&gt;
&lt;pre style="background-color:#000000;border:initial;border-radius:initial;color:#cccccc;display:initial;font-family:Menlo, Monaco, Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:inherit;font-style:normal;font-weight:bold;letter-spacing:normal;line-height:initial;margin:initial;overflow:auto;padding:initial;text-align:left;text-indent:0px;text-transform:none;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;AT%XSYSTEMMODE?
%XSYSTEMMODE: 0,1,0,0
OK&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;AT+COPS=3,2
OK
AT+COPS?+COPS: 0,2,&amp;quot;46000&amp;quot;,9
OK
AT%XCBAND%XCBAND: 8
OK
AT+CGDCONT?+CGDCONT: 0,&amp;quot;IP&amp;quot;,&amp;quot;CMNBIOT&amp;quot;,&amp;quot;100.80.79.43&amp;quot;,0,0
OK
AT+CGACT?+CGACT: 0,1
OK&lt;/pre&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char CR" style="background-color:#000000;border:initial;border-radius:initial;color:#666666;display:initial;font-family:Menlo, Monaco, Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:inherit;font-style:normal;font-weight:bold;letter-spacing:normal;line-height:initial;margin:initial;overflow:auto;padding:initial;text-align:left;text-indent:0px;text-transform:none;"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF" style="background-color:#000000;border:initial;border-radius:initial;color:#666666;display:initial;font-family:Menlo, Monaco, Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:inherit;font-style:normal;font-weight:bold;letter-spacing:normal;line-height:initial;margin:initial;overflow:auto;padding:initial;text-align:left;text-indent:0px;text-transform:none;"&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;I guess there may be a problem with DNS, so I modified the configuration mentioned above, after that, build errors:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;  /home/hurry/ncs/nrf/samples/nrf9160/mqtt_simple/build_nrf9160_pca10090ns/zephyr/include/generated/autoconf.h (22.11.2019 09:49:50) is newer than zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj (22.11.2019 09:30:40).
  Compiling &amp;#39;empty_file.c&amp;#39;
  zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj (22.11.2019 09:50:26) is newer than zephyr/zephyr_prebuilt.elf (22.11.2019 09:30:40).
  Linking &amp;#39;zephyr_prebuilt.elf&amp;#39;
    B       976 KB     11.05%
    B       128 KB     26.83%
    B         2 KB      5.86%
    In function `dns_resolve_init&amp;#39;:
    undefined reference to `net_context_get&amp;#39;
    undefined reference to `net_context_bind&amp;#39;
    ld returned 1 exit status
Build failed&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In china , the common DNS server is 114.114.114.114, so I added this DNS serverwe,&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Harry&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 mqtt_simple SES build error</title><link>https://devzone.nordicsemi.com/thread/221334?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 13:22:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4c38624-814c-4842-a902-cdeac31f5fb1</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;May I ask what it is you want to achieve?&lt;/p&gt;
&lt;p&gt;The mqtt_simple sample already does hostname resolution (via getaddrinfo), so there should be no need for doing your own DNS lookup.&lt;/p&gt;
&lt;p&gt;Also, I can not see any errors in the picture. What were the errors you got?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>