<?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>set APN</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70961/set-apn</link><description>I&amp;#39;m new to develop firmware on nRF9160-DK, and my first target to add APN to use LTE-M. 
 For now, I&amp;#39;d like to do a simple way in the below even this is temporary. 
 =&amp;gt; Hard-code in code. Have to re-build if APN needs tp be changed. 
 I&amp;#39;ve added the code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jan 2021 15:51:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70961/set-apn" /><item><title>RE: set APN</title><link>https://devzone.nordicsemi.com/thread/291576?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 15:51:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45acd8ba-b831-499d-92d9-5b91064d69aa</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;From the log, I can see that your device is crashing shortly after startup.&lt;/p&gt;
&lt;p&gt;The reason for this is twofold:&lt;/p&gt;
&lt;p&gt;1.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&amp;#39;AT+CGDCONT=1,&amp;quot;IP&amp;quot;,&amp;quot;isp.telus.com&amp;quot;&amp;#39;[/quote]
&lt;p&gt;&amp;nbsp;This is not a valid character. In C &amp;#39; is used for char literals, while &amp;quot; is used for string literals. If you want to use &amp;quot; inside a string, it must be escaped with \.&lt;/p&gt;
&lt;p&gt;Your AT command string should therefore be:&lt;code&gt; &amp;quot;AT+CGDCONT=1,\&amp;quot;IP\&amp;quot;,\&amp;quot;isp.telus.com\&amp;quot;&amp;quot;.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;2. This would normally be caught by the compiler, but it also doesn&amp;#39;t seem like you have included &amp;lt;modem/at_cmd.h&amp;gt; in your .c file. Because of this, the compiler doesn&amp;#39;t know what type you are intending to have, and only issues a warning.&lt;/p&gt;
&lt;p&gt;Finally, to set the APN used by the default bearer, you must use cid 0, not 1.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: set APN</title><link>https://devzone.nordicsemi.com/thread/291382?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 21:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45600813-3b41-4608-98c2-839ce1a9a8c4</guid><dc:creator>shin_cnx</dc:creator><description>&lt;p&gt;This message was from nRF Connect::LTE Link Monitor.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>