<?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>Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51718/simple-modem-on-off-test</link><description>I&amp;#39;m working on an application where I will need to initialize the modem, send/receive messages and then turn it down to low power until the next checkin. I did a real simple loop in a thread that turned on and off the modem and it always ends up locking</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Nov 2019 13:09:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51718/simple-modem-on-off-test" /><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/218227?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2019 13:09:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e8890cc-c240-4d37-862f-57200f2d9d01</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;The online/offline issue was what they claimed.&amp;nbsp; The cell phone providers will shutdown any LTE-M connection from a device that happens more than 30 times in one hour.&amp;nbsp; The other piece of advice I received is that you don&amp;#39;t put the modem in and out of low power.&amp;nbsp; Once you set the PSM and eDRX parameters, the modem takes care of it itself.&amp;nbsp; So that is what I&amp;#39;ve been doing and it seems to work fine.&amp;nbsp; There is some issue that PSM seems to work only with some carriers, but I&amp;#39;ve come to rely on eDRX because my modem use frequency is too high for PSM to be of any use.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or is it the mbedtls problem that you&amp;#39;re talking about?&amp;nbsp; I&amp;#39;ve just reverted back to v1.0.0.&amp;nbsp; I&amp;#39;ve also upgraded my modem firmware to the latest 1.0.1.&amp;nbsp; As long as I don&amp;#39;t send repeat CPSMS messages.&amp;nbsp; It works fine.&amp;nbsp; I&amp;#39;ve run it for several days and a time and it doesn&amp;#39;t crash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/218069?ContentTypeID=1</link><pubDate>Sun, 03 Nov 2019 03:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0318f376-4094-4551-be91-9d80f93f652b</guid><dc:creator>arthurkoroghlian</dc:creator><description>&lt;p&gt;Did you ever receive a solution for this?&amp;nbsp; We are at this same exact issue at this current moment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/209836?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2019 12:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc415ea3-b2ed-4de4-8ccc-ee5729a6761d</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;I&amp;#39;m now just leaving CFUN=1 and continuing.&amp;nbsp; I&amp;#39;ve discovered that you can set the power saving mode (psm) and things still work.&amp;nbsp; I&amp;#39;m assuming that it allows the modem to go into power saving mode when not actively communicating.&amp;nbsp; I haven&amp;#39;t tested this all out yet, but that is the track I&amp;#39;m proceeding on.&lt;/p&gt;
&lt;p&gt;I had the same problem with mbedtls and had to revert back to v1.0.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/209828?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2019 12:37:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:344373e4-a3ba-4685-b420-45c78dac176f</guid><dc:creator>RonanB96</dc:creator><description>&lt;p&gt;I&amp;#39;m seeing issues with CFUN=1 hanging after disconnecting and reconnecting, sometimes the first reconnect, sometimes more. I tried to change the nrfxlib revision but this gave me cmake errors with mbedtls not being found. Have you found another way around this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208771?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 20:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4bc86e9-834c-4e94-8681-f4d7ec56d18c</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;So how is this supposed to be done.&amp;nbsp; I&amp;#39;m trying to put together a system that periodically connects to the cloud sends update messages and then goes back into low power.&amp;nbsp; I tried doing the same thing but staying in CFUN=1 mode and just putting it in low power after each simulated send.&amp;nbsp; Then it starts giving me the &amp;quot;[01:10:12.218,963] &amp;lt;err&amp;gt; at_cmd: Failed to send AT command&amp;quot; error.&amp;nbsp; And I&amp;#39;ve even updated the nrfxlib per your instructions.&amp;nbsp; Is there any way to accomplish the goal I have?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208758?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 17:48:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd112579-b7aa-4cd1-bd3a-e91a52605f9f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There are some bugfixes in the latest &lt;a href="https://github.com/NordicPlayground/nrfxlib/blob/master/bsdlib/CHANGELOG.rst"&gt;bsdlib versions&lt;/a&gt;. If you are on the ncs v1.0.0 tag, then it will by default use&amp;nbsp;bsdlib v0.3.3. You can change it to use the latest verision by modifying the &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/v1.0-branch/west.yml"&gt;west.yml file&lt;/a&gt;, and point nrfxlib to the latest &lt;span&gt;revision/commit. (There is currently a &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/pull/1122"&gt;active PR&lt;/a&gt; for this on master branch to move from v0.3.3 to v0.4.0).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;- name: nrfxlib
path: nrfxlib
revision: 35120d32233dc354c89d8c62eaa6267093c7e35b&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BUT, if you are seeing that you are not able to connect after exactly 30 times, then this is not a bug. This is the GSMA specified Radio Policy Manager (RPM) feature which is blocking the ATTACH command. RPM is used for protecting the network from excessive signalling loads in various scenarios. In this case default value 30 is used for PDP Context Activation Requests (TS.34_8.2.4_REQ_010, See page 43 in &lt;a href="https://www.gsma.com/iot/wp-content/uploads/2016/11/TS.34_v4.0-1.pdf"&gt;this pdf&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208692?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 12:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9830a767-e027-475c-8b9c-fe1c2a01f6be</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;I&amp;#39;ve eliminated the use of the lte_lc module and gone to directly using the at_cmd module.&amp;nbsp; I&amp;#39;m using the at_cmd_write_with_callback function as well as setting the notification handler to the same funciton that prints out what responses I get from the modem.&amp;nbsp; I appear to be battling 2 problems.&amp;nbsp; Sometimes the modem gets stuck and the last feeback message I see is &amp;quot;+CEREG: 2,&amp;quot;4311&amp;quot;,&amp;quot;049C6410&amp;quot;,7&amp;quot;.&amp;nbsp; So the program is in perpetual unregistered mode.&amp;nbsp; &amp;nbsp;I&amp;#39;ve also turned on the Debug logging of the AT_CMD and on some other runs I will start getting &amp;quot;[00:28:05.921,997] &amp;lt;err&amp;gt; at_cmd: Failed to send AT command&amp;quot;.&amp;nbsp; So it seems I&amp;#39;m doing something to the modem to lock it up.&amp;nbsp; Is there a way to programmatically to reset the modem without reseting the rest of the program?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208565?ContentTypeID=1</link><pubDate>Sun, 08 Sep 2019 22:26:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0739af3f-4d7f-4bec-bf51-aa752c98b0f0</guid><dc:creator>E3V3A</dc:creator><description>&lt;p&gt;Sound like a memory leak. Try to check the heap...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div id="simple-translate"&gt;
&lt;div&gt;
&lt;div class="simple-translate-button " style="height:22px;left:10px;top:10px;width:22px;"&gt;&lt;/div&gt;
&lt;div class="simple-translate-panel " style="background-color:#ffffff;font-size:13px;height:200px;left:0px;top:0px;width:300px;"&gt;
&lt;div class="simple-translate-result-wrapper" style="overflow:hidden;"&gt;
&lt;p class="simple-translate-result" style="color:#000000;"&gt;&lt;/p&gt;
&lt;p class="simple-translate-candidate" style="color:#737373;"&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208524?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 17:34:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfa2a9a4-1098-4ca0-984f-ae1212fe576a</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;Even with Modem Firmware 1.0.1 it still locks up.&amp;nbsp; It goes into&amp;nbsp;lte_lc_init_and_connect()&amp;nbsp;after about 30 loops and doesn&amp;#39;t come back.&amp;nbsp; It&amp;#39;s doing the same thing you are doing, but in a different thread that is kicked off by the main function.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208517?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 15:56:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56bd8ee3-5acc-42c3-8bc7-399e6526b85d</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;How long did you run it?&amp;nbsp; It takes several loops before it locks up, but usually within a day.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am still running modem firmware v1.0.0, I will upgrade and start running a new round of tests.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208499?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 14:29:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef71afdf-04e4-4d69-9c8b-ee86b489613a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;I have not been able to reproduce this lockup. Here is the code I used to test this:&lt;/p&gt;
&lt;p&gt;main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&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;lte_lc.h&amp;gt;
#include &amp;lt;dk_buttons_and_leds.h&amp;gt;


/**@brief Recoverable BSD library error. */
void bsd_recoverable_error_handler(uint32_t err)
{
	printk(&amp;quot;bsdlib recoverable error: %u\n&amp;quot;, err);
}

/**@brief Irrecoverable BSD library error. */
void bsd_irrecoverable_error_handler(uint32_t err)
{
	printk(&amp;quot;bsdlib irrecoverable error: %u\n&amp;quot;, err);

	__ASSERT_NO_MSG(false);
}

void main(void)
{
	printk(&amp;quot;The test sample started\n&amp;quot;);
	
	bool testing = true;
	
	int err = 0;
	
	while(testing){
			
	printk( &amp;quot;Initializing Modem\n&amp;quot; );
	printk(&amp;quot;LTE Link Connecting ...\n&amp;quot;);
	
	err = lte_lc_init_and_connect();
	
	if(err == 0)
	{
		printk(&amp;quot;LTE Link Connected!\n&amp;quot;);
	}
	else{
		printk(&amp;quot;LTE link could not be established.\n&amp;quot;);
	}
	
	
	lte_lc_psm_req(true);
	
	printk( &amp;quot;Pretending to connect to Cloud\n&amp;quot; );
	k_sleep(5000);
	//dk_set_led_on(2);
	k_sleep(5000);
	//dk_set_led_off(2);
	
	lte_lc_psm_req(false);
	
	printk( &amp;quot;Turning off Modem\n&amp;quot; );
	
	if ( (err = lte_lc_offline() ) )
	{
	printk( &amp;quot;Failure turning off Modem: %d\n&amp;quot;, err );
	}
	else{
		printk(&amp;quot;Modem turned off\n&amp;quot;);
	}
	
	k_sleep(1000);
	
    }

}&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;#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#
# General config
CONFIG_ASSERT=y
CONFIG_TEST_RANDOM_GENERATOR=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_OFFLOAD=y

CONFIG_LOG=y
CONFIG_LOG_IMMEDIATE=y
#CONFIG_AT_CMD_LOG_LEVEL_DBG=y
#CONFIG_LOG_DEFAULT_LEVEL=3
#CONFIG_LOG_OVERRIDE_LEVEL=3
CONFIG_DEBUG=y


# BSD library
CONFIG_BSD_LIBRARY=y

# AT host library
CONFIG_AT_HOST_LIBRARY=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Stacks and heaps
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_HEAP_MEM_POOL_SIZE=16384

# Disable native network stack to save some memory
CONFIG_NET_IPV4=n
CONFIG_NET_IPV6=n
CONFIG_NET_UDP=n
CONFIG_NET_TCP=n

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# Library for buttons and LEDs
CONFIG_DK_LIBRARY=y
CONFIG_DK_LIBRARY_INVERT_LEDS=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I used this command to build and flash the sample:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfjprog -e &amp;amp;&amp;amp; west build -b nrf9160_pca10090ns -d build -p &amp;amp;&amp;amp; west flash -d build&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;PS: Modem firmware v1.0.1 was released this week. If you haven&amp;#39;t already updated, I recommend to update. You can download the latest modem version from&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Products/Low-power-cellular-IoT/nRF9160/Download#infotabs"&gt;this page.&lt;/a&gt;&amp;nbsp;This &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-to-get-production-version-v1-0-0-to-nrf9160"&gt;blog post here&lt;/a&gt; is for v1.0.0, but the end of the blog post shows you how to update the modem firmware using the programmer app in nRF Connect for desktop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208465?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 12:05:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e943a8b1-dd00-4636-9413-6333775f63dc</guid><dc:creator>Randall</dc:creator><description>&lt;p&gt;I&amp;#39;m not sending any data.&amp;nbsp; That is the point.&amp;nbsp; I&amp;#39;m enabling the modem, waiting 10 seconds, then disabling the modem. The CHECK_IN_INTERVAL is another 10 seconds so it isn&amp;#39;t connecting every second.&amp;nbsp; I&amp;#39;m just using this as a cycle test to experiment with turning on and off the modem.&amp;nbsp; It will be difficult to send the whole project.&amp;nbsp; This is part of a separate thread that is managing modem communications.&amp;nbsp; I also have another thread that I&amp;#39;m working on that is handling communications with peripherals.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Modem on/off test</title><link>https://devzone.nordicsemi.com/thread/208405?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2019 08:25:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:363baa73-c8f5-46f6-bd93-de1277675bf9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I don&amp;rsquo;t see anything immediately wrong with your code. Could you post the code that shows how you are sending the data as well ? I.e. the place where you think it&amp;rsquo;s locking up ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also if you post the whole main.c and prj.conf, it will be easier to reproduce&amp;nbsp;the issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also note that if you are disconnecting/connecting to the network every 1 second, you will likely use more power on that compared to just staying connected with eDRX and/or PSM enabled.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>