<?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>Why failed to set apn?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82044/why-failed-to-set-apn</link><description>I used 9160 to develop a project for the customer. According to my design, an apn needs to be set before connecting to the NB-iot network. However, when I used at command to set it, the result was unsuccessful, but when I used at command to read it, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Nov 2021 09:26:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82044/why-failed-to-set-apn" /><item><title>RE: Why failed to set apn?</title><link>https://devzone.nordicsemi.com/thread/340856?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 09:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcba2c5d-c152-4807-a036-defc8103d684</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;we will need to look at the modem trace. &lt;a href="https://infocenter.nordicsemi.com/topic/ug_trace_collector/UG/trace_collector/collect_modem_trace.html"&gt;Please follow this guide&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why failed to set apn?</title><link>https://devzone.nordicsemi.com/thread/340672?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 09:21:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9152d788-6be4-4b07-b7ec-ae60e734a9ad</guid><dc:creator>duxinglang</dc:creator><description>&lt;p&gt;thanks for your reply!&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried to get the reason why the at function failed, the return is&amp;nbsp;-8, it means:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;#define ENOEXEC 8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Exec format error */&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, when I used another esIM card from another carrier that could not connect to the local network, I tried to set up apN and it showed success, which is very strange! &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/QQ_FE564772_20211125171322.png" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/QQ_FE564772_20211125170908.png" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why failed to set apn?</title><link>https://devzone.nordicsemi.com/thread/340651?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 08:05:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1140a876-b557-407b-bfea-60dafc66eedc</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Yes, this is true if successful but what about any error code returned from modem? From the Asset Tracker of nRF Connect SDK v1.2.0&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if defined(CONFIG_AT_CMD)
		err = at_cmd_write(modem_at_cmd_buff, modem_at_cmd_buff,
				sizeof(modem_at_cmd_buff), &amp;amp;state);
#else
		/* Proper error msg has already been copied to buffer */
		err = 0;
#endif
	}

	/* Get response length; same buffer was used for the response. */
	len = strlen(modem_at_cmd_buff);

	if (err) {
		len = snprintf(modem_at_cmd_buff, sizeof(modem_at_cmd_buff),
				&amp;quot;AT CMD error: %d, state %d&amp;quot;, err, state);
	} else if (len == 0) {
		len = snprintf(modem_at_cmd_buff, sizeof(modem_at_cmd_buff),
				&amp;quot;OK\r\n&amp;quot;);
	} else if (len &amp;gt; MODEM_AT_CMD_MAX_RESPONSE_LEN) {
		len = snprintf(modem_at_cmd_buff, sizeof(modem_at_cmd_buff),
				MODEM_AT_CMD_RESP_TOO_BIG_STR);
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Please verify no error is received from modem.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why failed to set apn?</title><link>https://devzone.nordicsemi.com/thread/340630?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 03:04:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed2c9766-08ee-4c4c-9986-618e7f52ae2f</guid><dc:creator>duxinglang</dc:creator><description>&lt;p&gt;HI，I am currently using ncs1.2.0, and the version of modem fw is also 1.2.0. at_cmd_write() function returns 0 to indicate that it has been executed correctly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why failed to set apn?</title><link>https://devzone.nordicsemi.com/thread/340567?ContentTypeID=1</link><pubDate>Wed, 24 Nov 2021 13:58:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f28c4f8c-8472-47a5-82f9-17cd01cecfa6</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How are&amp;nbsp; you handling the return value of the at_cmd_write() function? What version of&amp;nbsp;nRF Connect SDK&amp;nbsp;are you working on? What modem FW are you running?&lt;/p&gt;
&lt;p&gt;Please note that we do have a &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/modem/pdn.html#pdn"&gt;PDN library in our latest NCS tag v1.7.1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>