<?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 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52819/nrf9160-modem-not-responding-after-switching-to-offline-mode</link><description>My application uses the nrf9160 in eDRX mode. I regularly have the problem, that when switching the modem to OFFLINE mode (same for POWER-OFF mode), the modem is not responding anymore to any AT commands. I need to switch to OFFLINE mode for battery saving</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Jul 2020 14:15:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52819/nrf9160-modem-not-responding-after-switching-to-offline-mode" /><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/262026?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2020 14:15:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5041970-140c-4645-ae59-4f4837a79210</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/arvinf"&gt;af2377&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My apologies for the late response.&lt;/p&gt;
&lt;p&gt;This sounds a bit more complex in terms of execution (several things happening at the same time), and will likely depend on how you handle events from mqtt as well. Could you create a new thread with detailed information related to how you reproduce this locked scenario?&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 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/258708?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2020 04:25:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9444b527-00fe-4602-b87e-09ca103e4e9f</guid><dc:creator>af2377</dc:creator><description>&lt;p&gt;I am seeing a similar issue and reproduces rather easily for me.&amp;nbsp;I am&amp;nbsp;using ncs1.3 and modem v1.2.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Here are the steps:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Go online:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;lte_lc_init();
lte_lc_system_mode_set(LTE_LC_SYSTEM_MODE_LTEM_GPS);
lte_lc_connect_async();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once network is connected, connect to AWS MQTT using mqtt lib. Then send some data. Then disconnect by calling mqtt_disconnect. Once disconnected call lte_lc_offline(). This call never returns.&lt;br /&gt;&lt;br /&gt;Here is the at_cmd trace after calling lte_lc_offline:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:20.072,967] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CEREG=5
[00:00:20.073,211] &amp;lt;dbg&amp;gt; at_cmd.at_write: Awaiting response for AT+CEREG=5
[00:00:20.073,364] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: at_cmd_rx 5 bytes, OK

[00:00:20.073,394] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 10
[00:00:20.073,425] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CEREG?
[00:00:20.073,486] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: Allocating memory slab for AT socket
[00:00:20.073,486] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: Allocation done
[00:00:20.073,638] &amp;lt;dbg&amp;gt; at_cmd.at_write: Awaiting response for AT+CEREG?
[00:00:20.073,883] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: at_cmd_rx 62 bytes, +CEREG: 5,1,&amp;quot;D6E0&amp;quot;,&amp;quot;084C890D&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,~
[00:00:20.073,944] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 9
[00:00:20.078,430] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CFUN=4
[00:00:20.078,491] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: Allocating memory slab for AT socket
[00:00:20.078,521] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: Allocation done
[00:00:20.078,674] &amp;lt;dbg&amp;gt; at_cmd.at_write: Awaiting response for AT+CFUN=4
[00:00:20.335,266] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: at_cmd_rx 58 bytes, +CEREG: 0,&amp;quot;D6E0&amp;quot;,&amp;quot;084C890D&amp;quot;,7,0,0,&amp;quot;11100000&amp;quot;,~
[00:00:20.335,357] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: Allocating memory slab for AT socket
[00:00:20.335,357] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: Allocation done
[00:00:21.673,126] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: at_cmd_rx 12 bytes, +CSCON: 0

[00:00:21.673,187] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: Allocating memory slab for AT socket&lt;/pre&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span class="s1"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/250679?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 11:19:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36989200-0560-45f2-8538-96e3fda970b0</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Marcus,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The former issue was confirmed, and seems to be slightly different in behavior compared to your issue, but that specific should have been fixed (on tag v1.1.0 and newer, should have been fixed by &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/pull/1242"&gt;this PR&lt;/a&gt;). If the issue is not fixed on newer bsdlib versions, I think we should look into taking a modem trace, but I would first recommend that you try to reproduce this on a newer branch of nrf and bsdlib v0.7.1 to see if the problem still exist there.&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 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/250661?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 10:27:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fd5ab4d-59a1-4048-ac16-65a79b969f83</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;Thanks for your answer. I will try it with the master branch of the SDK.&lt;br /&gt;Unfortunately this issue is not so easy to reproduce, as it happens sporadically, but mostly after the modem appears to have lost the connection. It does not happen every time I turn the modem off or offline.&lt;br /&gt;It seems like I am not the only one having that problem: mlang3440 and lobaro-theo saw this issue too, and there are some more threads reporting on this issue.&lt;br /&gt;Best regards,&lt;br /&gt;Marcus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/250609?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 08:33:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ac0e7e8-b613-4b56-8751-f7c309a2f2f2</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Marcus,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My apologies for the late reply. I have checked around in R&amp;amp;D, and we have not seen this behavior before. This could be a side-effect of another issue, as we have done several bug&amp;nbsp;fixes in bsdlib lately:&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nrfxlib/blob/master/bsdlib/doc/CHANGELOG.rst"&gt;https://github.com/NordicPlayground/nrfxlib/blob/master/bsdlib/doc/CHANGELOG.rst&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Could you try to rebase your current project on master, to see if this issue still occurs?&lt;/p&gt;
&lt;p&gt;Could you explain a bit more about the issue at hand, is it easily reproducible, or is this something that can happen after days of running?&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 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/250249?ContentTypeID=1</link><pubDate>Fri, 15 May 2020 15:50:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8eabdee-76b5-49ed-9e4f-35d9649b1f7c</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;Hi, any update o this issue?&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m working with modem firmware 1.2.0 and nRF SDK version 1.2, and I still have the same issue occasionally. It usually happens when the signal is rather weak, the modem probably lost connection (without notifying me about it by CEREG) and I turn the modem off with AT+CFUN=0. Then the modem does not respond. I implemented a timeout in the at_cmd_write() function, so that the driver does not hang forever. Any subsequent commands also hang / time out. Then I close and reopen the AT socket. Does not help. So a reset is the only way to get the modem working again.&lt;/p&gt;
&lt;p&gt;The peculiar thing is, that the modem in the background still shows 4 short moments of activity each 82 seconds, which is our eDRX interval. So it&amp;#39;s definitely not turned off, but it&amp;#39;s stuck.&lt;/p&gt;
&lt;p&gt;Out in the field, we cannot do a hard reset to bring our devices back online. Please help us with this issue.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marcus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/229191?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2020 10:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82968e08-6e3a-43a9-8858-114251239f5d</guid><dc:creator>lobaro-theo</dc:creator><description>&lt;p&gt;We have the same issue as mlang3440.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/56167/nrf9160-modem-frozen-after-put-into-offline-mode"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/56167/nrf9160-modem-frozen-after-put-into-offline-mode&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/227704?ContentTypeID=1</link><pubDate>Mon, 06 Jan 2020 14:05:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70b45655-7725-43bc-a907-a52d0f3eb6f4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;this was an issue in the ncs codebase, not on the modem side, and should be fixed now.&lt;/p&gt;
&lt;p&gt;Are you running ncs v1.1.0 or newer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/227316?ContentTypeID=1</link><pubDate>Thu, 02 Jan 2020 22:18:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dde418a-28cf-4c36-a6bb-6a11f8abeb87</guid><dc:creator>mlang3440</dc:creator><description>&lt;p&gt;I just saw this issue on my board with modem firmware 1.1. Went to set the modem into Offline mode and the command never returned, freezing my application. We aren&amp;#39;t using eDRX.&lt;/p&gt;
&lt;p&gt;Is this still a known issue? Is there any way to stop this from happening?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213939?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 13:25:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:162f767e-60ff-46a3-8380-bc59464cbc48</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Its the at_host / at_cmd that misbehaves. There&amp;#39;s something with the UART handling, where the interrupt is kept disabled after this happens.&lt;/p&gt;
&lt;p&gt;Haven&amp;#39;t figured out the details yet.&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 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213929?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 13:07:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d6a6b11-3589-4768-abe6-ec498fc33f47</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;Thanks for reproducing the issue. Btw, even without registering any unsolicited notifications I am able to send the modem into Nirwana...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213911?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 12:30:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c0c1ed-68ee-40af-bc50-bc812e71b9c7</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;Sorry for me being a bit slow. I see what you&amp;#39;re saying now and I see the same behavior.&lt;/p&gt;
&lt;p&gt;So, if you get a notification or similar (Like registering AT%CESQ=1 or any other form of notification), then sending AT+CFUN=4 hangs the application afterwards.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks again for the detailed description, I&amp;#39;ll make sure that this is reported back to the developers.&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 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213477?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 17:28:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0032aa7-93ac-487b-b307-9c5ffb864a10</guid><dc:creator>jbrzozoski</dc:creator><description>&lt;p&gt;Yep.&amp;nbsp; This is surprisingly easy to reproduce.&amp;nbsp; I rebuilt at_client with debug logging enabled, loaded it on my dev kit, and did this on my second try (leftmost timestamps from TeraTerm):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[2019-10-04 12:54:35.031] ***** Booting Zephyr OS build zephyr-v2.0.0-875-gd6e67554cfeb *****
[2019-10-04 12:54:35.031] The AT host sample started
[2019-10-04 12:54:36.016] [00:00:00.270,935] &amp;lt;dbg&amp;gt; at_cmd.at_cmd_driver_init: Common AT socket created
[2019-10-04 12:54:36.016] [00:00:00.270,965] &amp;lt;dbg&amp;gt; at_cmd.at_cmd_driver_init: Common AT socket processing thread created
[2019-10-04 12:54:36.032] [00:00:00.273,437] &amp;lt;dbg&amp;gt; at_cmd.socket_thread_fn: AT socket thread started
[2019-10-04 12:54:37.329] AT
[2019-10-04 12:54:37.846] OK
[2019-10-04 12:54:38.033] [00:00:03.070,739] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT
[2019-10-04 12:54:38.049] 
[2019-10-04 12:54:38.049] [00:00:03.079,467] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 3
[2019-10-04 12:54:53.861] AT+CFUN?
[2019-10-04 12:54:53.877] +CFUN: 4
[2019-10-04 12:54:53.877] OK
[2019-10-04 12:54:54.049] [00:00:19.108,978] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CFUN?
[2019-10-04 12:54:54.064] 
[2019-10-04 12:54:54.064] [00:00:19.117,828] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 9
[2019-10-04 12:55:00.743] AT+CEREG=3
[2019-10-04 12:55:00.758] OK
[2019-10-04 12:55:01.071] [00:00:25.990,020] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CEREG=3
[2019-10-04 12:55:01.071] 
[2019-10-04 12:55:01.071] [00:00:25.998,840] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 11
[2019-10-04 12:55:05.292] AT%CESQ=1
[2019-10-04 12:55:05.308] OK
[2019-10-04 12:55:06.074] [00:00:30.533,386] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT%CESQ=1
[2019-10-04 12:55:06.090] 
[2019-10-04 12:55:06.090] [00:00:30.542,175] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 10
[2019-10-04 12:55:10.404] AT%XSYSTEMMODE=1,0,0,0
[2019-10-04 12:55:10.420] OK
[2019-10-04 12:55:11.092] [00:00:35.654,785] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT%XSYSTEMMODE=1,0,0,0
[2019-10-04 12:55:11.107] 
[2019-10-04 12:55:11.107] [00:00:35.665,130] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 23
[2019-10-04 12:55:15.952] AT+CEDRXS=2,4,&amp;quot;0101&amp;quot;
[2019-10-04 12:55:15.952] OK
[2019-10-04 12:55:16.108] [00:00:41.190,765] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CEDRXS=2,4,&amp;quot;0101&amp;quot;
[2019-10-04 12:55:16.108] 
[2019-10-04 12:55:16.108] [00:00:41.199,645] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 21
[2019-10-04 12:55:21.844] AT+CFUN=1
[2019-10-04 12:55:21.891] OK
[2019-10-04 12:55:22.125] [00:00:47.093,719] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CFUN=1
[2019-10-04 12:55:22.125] 
[2019-10-04 12:55:22.125] [00:00:47.133,117] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 10
[2019-10-04 12:55:31.753] AT
[2019-10-04 12:55:32.065] OK
[2019-10-04 12:55:32.127] [00:00:57.311,767] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT
[2019-10-04 12:55:32.143] 
[2019-10-04 12:55:32.143] [00:00:57.312,103] &amp;lt;dbg&amp;gt; at_cmd.at_write: Bytes sent: 3
[2019-10-04 12:56:54.363] %CESQ: 34,1
[2019-10-04 12:56:54.363] +CEREG: 2,&amp;quot;0411&amp;quot;,&amp;quot;00F63F11&amp;quot;,7,0,0
[2019-10-04 12:56:56.019] +CEREG: 5,&amp;quot;0411&amp;quot;,&amp;quot;00F63F11&amp;quot;,7
[2019-10-04 12:56:56.035] +CEDRXP: 4,&amp;quot;0101&amp;quot;,&amp;quot;0101&amp;quot;,&amp;quot;0000&amp;quot;
[2019-10-04 12:57:07.841] AT+CFUN=4
[2019-10-04 12:57:08.153] [00:02:33.082,122] &amp;lt;dbg&amp;gt; at_cmd.at_write: Sending command AT+CFUN=4
[2019-10-04 12:57:08.153] 
[2019-10-04 12:58:05.442] 
[2019-10-04 12:58:05.886] at
[2019-10-04 12:58:09.858] AT
[2019-10-04 12:58:10.427] AT&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In my case, it actually froze up when I was trying to send it the CFUN=4 to disconnect.&amp;nbsp; Based on the log messages, it looks like the call to send() the command over the socket never returned.&amp;nbsp; (I let it sit for tens of minutes...)&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve never been able to prove it, but I&amp;#39;ve always been suspicious that the AT send command will lockup&amp;nbsp;if there is data coming back the other way from a modem status message at exactly the wrong time.&amp;nbsp; Early on in our development, while we were still deciding which messages were useful or interesting, we enabled *every* unsolicited message for the modem and just logged everything.&amp;nbsp; Things used to lock up all the damn time.&amp;nbsp; Over time, we turned off most of the messages and things got more stable.&amp;nbsp; Admittedly, this was also as we were moving up through modem firmware versions, so it&amp;#39;s likely the fixes in there also resolved most of the lockups, but I&amp;#39;m still suspicious...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213442?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 13:56:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a361b74a-8b02-43db-9977-831c586daeff</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;Also in Tera Term the following sequence of AT commands results in modem hang-up:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;AT+CFUN?
AT+CEREG=3
AT%CESQ=1
AT%XSYSTEMMODE=1,0,0,0
AT+CEDRXS=2,4,&amp;quot;0101&amp;quot;
AT+CFUN=1
&amp;lt;&amp;lt;&amp;lt; wait until +CEREG: 1 (or 5) shows &amp;gt;&amp;gt;&amp;gt;
AT+CFUN=4
AT+CFUN=1
&amp;lt;&amp;lt;&amp;lt; wait until +CEREG: 2 shows &amp;gt;&amp;gt;&amp;gt;
AT+CFUN=4
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;AT_CMD debug messages in the application do not show anything out of the ordinary...&lt;/p&gt;
&lt;p&gt;Could you please try to reproduce it? Maybe you can see what&amp;#39;s happening here.&lt;/p&gt;
&lt;p&gt;Our use case does not allow power cycling the device, so a hung up modem is a No-Go for our application. We really need to know what&amp;#39;s going on here and how to prevent modem hang-up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213416?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 12:21:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e1f3cb5-59c1-4cb2-ab00-7789e3dc8f79</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;Cycling between CFUN=1 and CFUN=4 shouldn&amp;#39;t be a problem. But, as &lt;a href="https://devzone.nordicsemi.com/members/jbrzozoski"&gt;jbrzozoski&lt;/a&gt; mentions, please update to the latest modem fw on all boards.&lt;/p&gt;
&lt;p&gt;I have seen behavior like this in LTE Link Monitor, if I get many debug prints incoming and also sending commands back-and-forth, where the GUI can drag on, but haven&amp;#39;t seen this sort of behavior when using a terminal (putty, teraterm etc).&lt;/p&gt;
&lt;p&gt;I would recommend checking the return value for the at_cmd calls, in case any of them fail.&lt;/p&gt;
&lt;p&gt;Also try setting CONFIG_LOG=y, and CONFIG_AT_CMD_LOG_LEVEL_DBG=y to get debug logs from the at_cmd module.&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 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213319?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 07:37:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04274e2c-76f1-4a39-a689-5c8f8ce8baa1</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;Yes, signal strength is rather low in here. I get RSRP values of 24 and 28, that&amp;#39;s around -120 dBm. But anyway, that shouldn&amp;#39;t not hang up the modem FW... Maybe I should record a modem trace, so a Nordic engineer can look into what&amp;#39;s going on&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213265?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 18:59:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6791d435-5315-4fb3-b05c-00ac2250455e</guid><dc:creator>jbrzozoski</dc:creator><description>[quote userid="83854" url="~/f/nordic-q-a/52819/nrf9160-modem-not-responding-after-switching-to-offline-mode/213260"]In my simplified program I do not open any other sockets as far as I see. And I see the same behavior also with the AT_CLIENT sample.[/quote]
&lt;p&gt;Can you run AT%CESQ=1 to enable RSRP reports before trying it again in at_client?&amp;nbsp; I&amp;#39;m wondering if your modem is right on the fringe of unusable signal strength.&amp;nbsp; That still shouldn&amp;#39;t be causing this issue, but it would be interesting to know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213260?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 17:56:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51fb88e6-8b66-4ea4-ae9a-bb88b6123646</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;I just checked, I am using MFW 1.0.1 on our custom board and 1.0.0 on the demo board.&lt;/p&gt;
&lt;p&gt;I now updated also the demo board to 1.0.1, and I still see the same behavior. Thanks for pointing that out!&lt;/p&gt;
&lt;p&gt;According to the AT Command Manual, the modem must be switched to OFFLINE when the XSYSTEMMODE is changed.&amp;nbsp;I guess the issue is somehow connected to the eDRX mode. I also tried the CEDRX command after going ONLINE, but I does not make a difference.&lt;/p&gt;
&lt;p&gt;In my simplified program I do not open any other sockets as far as I see. And I see the same behavior also with the AT_CLIENT sample.&lt;/p&gt;
&lt;p&gt;Another Observation maybe worth noting is that for some time I still get CEREG notifications occasionally in multiples of the eDRX interval (82 seconds). So the modem is still running somehow and occasionally switches to a different cell, but is not responding&amp;hellip;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213247?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 16:04:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a12fb89-fc71-41c0-a7ac-2f97e2ea8652</guid><dc:creator>jbrzozoski</dc:creator><description>[quote userid="83854" url="~/f/nordic-q-a/52819/nrf9160-modem-not-responding-after-switching-to-offline-mode"]modem Firmware 1.0.0[/quote]
&lt;p&gt;There is a MFW 1.0.1 out now for a while.&amp;nbsp; I don&amp;#39;t know of any specific mentions in the changelog related to this, but you should probably try it out just in case.&lt;/p&gt;
&lt;p&gt;And I agree that this should not happen when you go OFFLINE and back, but it&amp;#39;s actually the behavior I would expect going to POWER-OFF and back.&amp;nbsp; Nordic has confirmed that once you put a modem in POWER OFF mode you shouldn&amp;#39;t expect it to do *anything* until after the next reboot.&amp;nbsp; Putting the modem into POWER OFF is a one-way trip.&lt;/p&gt;
&lt;p&gt;EDIT: We are using EDRX in our application and can go online/offline repeatedly without issue.&amp;nbsp; I&amp;#39;m wondering if it&amp;#39;s somehow related to the CEDRXS or XSYSTEMMODE swtiching while offline.&amp;nbsp; We rarely do either.&amp;nbsp; The CEDRXS you can actually do while online.&amp;nbsp; One possibly related issue I&amp;#39;ve seen is that if you have other sockets open to the modem for things like TCP/UDP traffic and are not servicing them, they can block the whole subsystem and cause the AT socket to block.&amp;nbsp; But it doesn&amp;#39;t look like you have other sockets open in this case...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213170?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 11:10:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dc3be2b-fa8c-45cc-83d6-82b6f63229df</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;Our application is battery constrained, so the device is in eDRX mode as long as it is connected to the network.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213126?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 08:33:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c21261d-27a5-4898-b72a-c745d5fa503b</guid><dc:creator>MJD093</dc:creator><description>&lt;p&gt;Have you considered only using eDRX when your device is going to be idle for a reasonable period and disabling eDRX when activily using the modem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213067?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 18:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee103d1a-0ced-46bb-9bdc-f919a0e5f632</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;Thank you for your sample. It seems to work as expected. But I don&amp;#39;t think there&amp;#39;s a problem with the sockets, but with the specific sequence of commands and the state the modem is in at that instant. The problem occurs when the modem is in eDRX mode, has no active connection (network status == 2) and is then set to OFFLINE or POWER_OFF.&lt;/p&gt;
&lt;p&gt;No issue when not in eDRX, as in your example.&lt;/p&gt;
&lt;p&gt;BTW, I see the same behavior with the AT_HOST sample, as I posted above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213066?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 18:12:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7356fd9-e4ee-4093-a884-2df862aac7a7</guid><dc:creator>MJD093</dc:creator><description>&lt;p&gt;That&amp;#39;s fair enough.&lt;/p&gt;
&lt;p&gt;main.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*
 * Copyright (c) 2018 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
 */

#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;uart.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;bsd.h&amp;gt;
#include &amp;lt;net/socket.h&amp;gt;

#define AT_XSYSTEMMODE_GPS 			&amp;quot;AT\%XSYSTEMMODE=0,0,1,0&amp;quot;
#define AT_MAGPIO_GPS      			&amp;quot;AT\%XMAGPIO=1,0,0,1,1,1574,1577&amp;quot;
#define AT_CFUN_ON        			&amp;quot;AT+CFUN=1&amp;quot;
#define AT_XSYSTEMMODE_LTE			&amp;quot;AT\%XSYSTEMMODE=0,1,0,0&amp;quot;
#define AT_CFUN_OFF							&amp;quot;AT+CFUN=4&amp;quot;
#define AT_MAGPIO_CLEAR					&amp;quot;AT\%XMAGPIO&amp;quot;
#define AT_CEREG_LVL1						&amp;quot;AT+CEREG=1&amp;quot;
#define AT_CEREG_CHECK					&amp;quot;AT+CEREG?&amp;quot;

static const char			at_commands_LTE[][31]  = { AT_CFUN_OFF, AT_XSYSTEMMODE_LTE, AT_MAGPIO_CLEAR, AT_CFUN_ON };

#if defined(CONFIG_BSD_LIBRARY)

/**@brief Recoverable BSD library error. */
void bsd_recoverable_error_handler(uint32_t err)
{
	printk(&amp;quot;bsdlib recoverable error: %lu\n&amp;quot;, err);
}

/**@brief Irrecoverable BSD library error. */
void bsd_irrecoverable_error_handler(uint32_t err)
{
	printk(&amp;quot;bsdlib irrecoverable error: %lu\n&amp;quot;, err);

	__ASSERT_NO_MSG(false);
}

#endif /* defined(CONFIG_BSD_LIBRARY) */

static int send_at_command(int pSelector)
{
	int  at_sock;
	int  bytes_sent;
	int  bytes_received;
	char buf[20];
  char at_command[4][31];

	switch (pSelector)
	{
		case 0:
			memcpy(at_command, at_commands_LTE, sizeof(at_commands_LTE));
			break;
		default:
			printk(&amp;quot;Error setting AT commands\n&amp;quot;);
			break;
	}
	printk(&amp;quot;Checking the network\n&amp;quot;);
	at_sock = socket(AF_LTE, 0, NPROTO_AT);

	if (at_sock &amp;lt; 0) {
		printk(&amp;quot;Socket failed to open\n&amp;quot;);
		return -1;
	}
	printk(&amp;quot;Socket ID: %d\n&amp;quot;, at_sock);

	for (int i = 0; i &amp;lt; ARRAY_SIZE(at_command); i++)
	{
		printk(&amp;quot;Sending AT command: %s\n&amp;quot;, at_command[i]);
		bytes_sent = send(at_sock, at_command[i],
				  strlen(at_command[i]), 0);

		if (bytes_sent &amp;lt; 0) {
			close(at_sock);
			return -1;
		}

		do {
			bytes_received = recv(at_sock, buf, 50, 0);
		} while (bytes_received == 0);
		printk(&amp;quot;Modem response: %s\n&amp;quot;,buf);
		printk(&amp;quot;Bytes received: %d\n&amp;quot;,bytes_received);
		switch (bytes_received)
		{
			case 5:
				if (memcmp(buf, &amp;quot;OK&amp;quot;, 2) != 0)
				{
					printk(&amp;quot;Error with Modem Bytes received\n&amp;quot;);
					close(at_sock);
					return -1;
				}
				break;
			default:
				printk(&amp;quot;Invalid case for AT Check\n&amp;quot;);
		}
	}
	close(at_sock);
	return 0;
}

void main(void)
{
	printk(&amp;quot;Application started\n&amp;quot;);
	while(1)
	{
		printk(&amp;quot;Testing Modem\n&amp;quot;);
		send_at_command(0);
		printk(&amp;quot;Waiting 5 seconds\n&amp;quot;);
		k_sleep(K_MSEC(5000));
	}
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Use the development test RNG (not for production)
CONFIG_TEST_RANDOM_GENERATOR=y

# Networking, enable networking APIs
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y

# Allow Socket APIs to use POSIX names like socket(), send(), etc
# Careful with close(), close() only works on sockets when enabled
CONFIG_NET_SOCKETS_POSIX_NAMES=y

# BSD library
CONFIG_BSD_LIBRARY=y

# Main thread, reuse init stack
CONFIG_MAIN_THREAD_PRIORITY=7
CONFIG_MAIN_STACK_SIZE=4096

# Available memory for k_malloc
CONFIG_HEAP_MEM_POOL_SIZE=1024

# Enable stdout for printfs
CONFIG_STDOUT_CONSOLE=y

# Logging
CONFIG_LOG=y
CONFIG_LOG_DEFAULT_LEVEL=4

# Build with newlib c library
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

# Enable non-secure firmware as Normal mode
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;CMakeLists.txt:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

cmake_minimum_required(VERSION 3.8.2)

set(BOARD nrf9160_pca10090ns)

include(../../../cmake/boilerplate.cmake NO_POLICY_SCOPE)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(Socket)

target_sources(app PRIVATE src/main.c)
zephyr_include_directories(src)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213064?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 18:03:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b485ea90-ec92-459e-9a47-24dc11285624</guid><dc:creator>Marcus_S</dc:creator><description>&lt;p&gt;I&amp;#39;m afraid I cannot blindly install software from a source that is not validated - I would violate our company policy ;-)&lt;/p&gt;
&lt;p&gt;But I will be happy to try it if you could send the source code, so I can check it out and compile it myself!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160 modem not responding after switching to offline mode</title><link>https://devzone.nordicsemi.com/thread/213063?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 17:53:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aecc3025-61fe-4690-8b26-b3fdaa3da3f1</guid><dc:creator>MJD093</dc:creator><description>&lt;p&gt;Can you please flash this to your Development Kit witht the nRF Programmer application in the nRF Connect app, just want to check if this just a code issue or something related to the specific at commands you are sending.&lt;/p&gt;
&lt;p&gt;This is a basic application I made a long time ago when I was new to socket programming that simply configures the modem for NB-IoT and repeats the process every 5 seconds. Tested this on my DK there and it still works. You won&amp;#39;t get any CEREG notifications as it&amp;#39;s not configured to do that but you should get the modem firing out AT commands happily.&lt;/p&gt;
&lt;p&gt;The code is based off the source code for the at_client application. Do remove the numbers at the start of the file name, it&amp;#39;s randomly added by the DevZone when I upload these hex files&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f605.svg" title="Sweat smile"&gt;&amp;#x1f605;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5025.merged.hex"&gt;devzone.nordicsemi.com/.../5025.merged.hex&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>