<?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>Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100218/modem-hangs-randomly-at-some-point</link><description>Hi, 
 I&amp;#39;ve got a custom board with nrf9160. So far everything works fine, but occasionally, approximately once or twice a month modem looses connection to the tower. 
 At that point my data provider registers significant amount of authentication and location</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 May 2023 14:06:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100218/modem-hangs-randomly-at-some-point" /><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428509?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 14:06:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6472685f-0efe-416a-884d-0d8d7d6e684b</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; but session handshake&amp;nbsp;is what eats traffic.&lt;/p&gt;
&lt;p&gt;Yes, unfortunately, there is not too much realistic information available, how frequently a TLS/TCP connection breaks. Without forecasts are very weak.&lt;/p&gt;
&lt;p&gt;Do you measure the network searches and times, the number of cell-updates and, if applies, the number of network provider changes? All that consumes sometimes a quite a lot of energy.&lt;/p&gt;
&lt;p&gt;Depending on the firmware version and the used SIM card, there may be also some HPPLMN searches, which, especially if unsuccessful and then repeated, also consumes a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428479?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 13:08:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fbddd27-8123-48f4-bdc6-4aa50b552c1c</guid><dc:creator>_dev_</dc:creator><description>&lt;p&gt;CoAP&amp;nbsp;with DTLS seems interesting. I may look at that later.&lt;/p&gt;
&lt;p&gt;At the moment I use MQTT with binary payloads, so in addition to long keep-alive there is very little overhead in the payload itself, but session handshake&amp;nbsp;is what eats traffic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428052?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 07:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:576309b6-7803-48d1-b278-774cb382de22</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; why TLS session cache doesn&amp;#39;t work&lt;/p&gt;
&lt;p&gt;Because the cloud server needs to support it. And because of some security concerns about not proper closed connection, which are still in place in many tls server implementations. The alternative, tls session ticket, seems also be considered to be deprecated (see ietf tls mailing list).&lt;/p&gt;
&lt;p&gt;That situation is in line with my observation now for years. The TLS stuff is driven by the main usage, HTTPS, and with that, considered to be more short living. I guess, many of the MQTT server implementation didn&amp;#39;t work on that lower TLS layer in order to overcome the TLS mainstream. And if so, they will be faced some argument, not being the mainstream.&lt;/p&gt;
&lt;p&gt;If you go down to the ip-base, you will see, that for device communication, especially cellular, there is no alternative to non-ip or UDP. For UDP, Eclipse/Californium (I&amp;#39;m a developer in that project) provides a mature base to implement applications. with DTLS 1.2 CID it overcomes the most pain in cellular iot, ip-address changes, either caused by longer device sleeps or provider change. Also for CoAP/DTLS 1.2 CID it&amp;#39;s not too easy to find a matching pair for the device and cloud, therefore I spend the last months in providing that by improving Eclipse/tinydtls and my own simple demonstration project&amp;nbsp;&lt;a href="https://github.com/boaks/zephyr-coaps-client/tree/main"&gt;Zephyr - coaps-client&lt;/a&gt; .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428046?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 06:41:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16d54bdc-9aea-4a49-b1af-5df3b43f1382</guid><dc:creator>_dev_</dc:creator><description>&lt;p&gt;Thanks, I will have a look.&lt;/p&gt;
&lt;p&gt;Network reliability and traffic control is a whole separate thing &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;E.g. I still can&amp;#39;t understand why TLS session cache doesn&amp;#39;t work all the time. It&amp;nbsp;consumes extra 10kb of traffic for the handshake process, which is a public key and few other things. Over the period of a month it wastes hundreds of kilobytes,&amp;nbsp;which my tiny sim plans can&amp;#39;t easily afford. But that is a different topic &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428041?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 06:26:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3b812b5-9b71-4ba9-9fbd-6f1e371a169c</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;At least, if you detect an communication issue, you may apply a more sophisticated procedure:&lt;/p&gt;
&lt;p&gt;1. restart only the modem&lt;/p&gt;
&lt;p&gt;2. reconnect (that&amp;#39;s for mqtt done implicit, I use CoAP/DTLS 1.2 CID and my encryption sessions survives the modem restart or even a network provider change.)&lt;/p&gt;
&lt;p&gt;3. reboot&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://github.com/boaks/zephyr-coaps-client/blob/main/src/dtls_client.c#L843-L859"&gt;recover procedure&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In some rare cases, I also execute a modem factory reset.&lt;/p&gt;
&lt;p&gt;(You may find also other similar issues here in the forum, e.g. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/94288/doc-for-reliable-connection-missing"&gt;discussion / doc for reliable connection missing&lt;/a&gt; . And some &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_modem/doc/sockets.html#handling-pdn-errors-on-sockets"&gt;documentation - handling pdn errors on sockets&lt;/a&gt; .)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428038?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 06:15:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd91a804-a4c0-4383-a86b-5dae1c7c55e2</guid><dc:creator>_dev_</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;Just to mention, you may&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/boaks/zephyr-coaps-client/blob/main/src/appl_diagnose.c#L68"&gt;reboot&lt;/a&gt;&lt;span&gt;&amp;nbsp;the device without the watchdog.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;hmm, let me think if I can somehow predict such behaviour and manually reboot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428037?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 06:13:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09aaa12a-02d6-4f0a-8f9a-2fa61468de6b</guid><dc:creator>_dev_</dc:creator><description>&lt;p&gt;SIM card provider.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any activity on the MQTT side during&amp;nbsp;the glitch.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428025?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 05:18:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd210a5b-b0b4-4970-8fef-6e07ae8814b8</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; &lt;span&gt;That was precisely my idea as well, to reboot SoC&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Just to mention, you may &lt;a href="https://github.com/boaks/zephyr-coaps-client/blob/main/src/appl_diagnose.c#L68"&gt;reboot&lt;/a&gt; the device without the watchdog.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428024?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 05:15:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14fa4301-24d5-4dcf-8ec7-d0bb24383947</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; data provider registers significant amount of authentication and location update events&lt;/p&gt;
&lt;p&gt;Is that your MNO or SIM card provider? Or your MQTT server/broker?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/428023?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 04:12:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:675ffbbf-a739-4663-92eb-540b49089648</guid><dc:creator>_dev_</dc:creator><description>&lt;p&gt;Hi Achim,&lt;/p&gt;
&lt;p&gt;Thanks for the ideas.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m pretty much using the latest stuff&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;B1 revision of the chip&lt;/li&gt;
&lt;li&gt;1.3.4 version of modem firmware&lt;/li&gt;
&lt;li&gt;2.3.0 of ncs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I looked at your implementation and it is very similar to mine, maybe because I used an example from the samples folder.&lt;/p&gt;
&lt;p&gt;I actually have `WDT_FLAG_RESET_SOC` in flags as well&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;if I get for a certain amount of time no response from my server, I also reboot the device&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;That was precisely my idea as well, to reboot SoC in case if I don&amp;#39;t get PUBACK from my MQTT provider within certain interval.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I guess it can be that at some point battery can&amp;#39;t provide enough current so voltage drops to a dangerous level and everything becomes unstable. The only contradicting fact is that if I manually reboot, everything works again.&lt;/p&gt;
&lt;p&gt;I will leave the device connected to my benchtop power supply and see if that is related to battery or not.&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: Modem hangs randomly at some point</title><link>https://devzone.nordicsemi.com/thread/427983?ContentTypeID=1</link><pubDate>Mon, 29 May 2023 10:01:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9235e665-795c-49a9-94ec-62feecfd37eb</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;What happens, when the watchdog &amp;quot;bites&amp;quot;, depends on the configuration.&lt;/p&gt;
&lt;p&gt;Check the&amp;nbsp;&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/3.2.0/hardware/peripherals/watchdog.html"&gt;API docu&lt;/a&gt; of the watchdog for that.&lt;/p&gt;
&lt;p&gt;Just as inspiration, here is my&amp;nbsp;&lt;a href="https://github.com/boaks/zephyr-coaps-client/blob/main/src/appl_diagnose.c#L156-L193"&gt;watchdog setup&lt;/a&gt; .&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And just as hint:&lt;/p&gt;
&lt;p&gt;Your nRF9160 has an hardware version and a modem firmware version. I guess, if you want help, you need to provide that. Not that this is a &amp;quot;version related issue&amp;quot;.&lt;/p&gt;
&lt;p&gt;In my experience, the nRF9160 runs with some SIM cards pretty stable (e.g. MTBF 100 days), and with others less (similar as your experience e.g. 30 days). The interesting point is, that my devices are using the same base stations. My current assumption is, that some components of the SIM provider don&amp;#39;t report there issue back to the network and so the modem has no chance to get noticed. In the end, if I get for a certain amount of time no response from my server, I also reboot the device. Crossing the fingers, for now (unfortunately only 2-3 weeks for now), all outages had other explanations (e.g. removed batteries :-) ).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>