<?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>Date time synchronization fails after nRF Connect SDK and modem firmware update - yet again</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80090/date-time-synchronization-fails-after-nrf-connect-sdk-and-modem-firmware-update---yet-again</link><description>Dear N ordic S upport Team, 
 After I updated the nRF Connect SDK (1.5.1 to 1.6.1) and the Modem firmware (1.2.3 to 1.3.0) on my nrf9160 DK device (v1.0.0, SiP revision 2), the date time isn&amp;#39;t synchronized anymore. The date time library only issues the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Oct 2021 12:33:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80090/date-time-synchronization-fails-after-nrf-connect-sdk-and-modem-firmware-update---yet-again" /><item><title>RE: Date time synchronization fails after nRF Connect SDK and modem firmware update - yet again</title><link>https://devzone.nordicsemi.com/thread/333513?ContentTypeID=1</link><pubDate>Mon, 11 Oct 2021 12:33:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1f848f0-c7b6-4d95-9a39-5ac37385e862</guid><dc:creator>Sebastian Stein</dc:creator><description>&lt;p&gt;That helped allot. Thank you for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time synchronization fails after nRF Connect SDK and modem firmware update - yet again</title><link>https://devzone.nordicsemi.com/thread/333088?ContentTypeID=1</link><pubDate>Thu, 07 Oct 2021 13:46:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e919c542-f899-4e13-90b6-15e8f1366733</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="Sebastian Stein"]Can you please help me to understand the logs in the log files I have provided (or point at the documentation) so that I can debug such issues myself in the future?[/quote]
&lt;p&gt;Here is a very quick run through of the log files as I see them. Moste of the lines are not really that :&lt;/p&gt;
&lt;p&gt;1:&lt;/p&gt;
&lt;p&gt;It starts standard stuff, the first really interresting line is&lt;/p&gt;
&lt;p&gt;[00:00:07.512,359] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 2,&amp;quot;0BF4&amp;quot;,&amp;quot;01914E01&amp;quot;,7&lt;/p&gt;
&lt;p&gt;Here, we see that the modem is trying to connect to a cell.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[00:00:07.816,497] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 2,&amp;quot;0BF4&amp;quot;,&amp;quot;01914E01&amp;quot;,7,0,15&lt;br /&gt;&lt;br /&gt;Here we see the result of the connection attempt, rejected with EMM reject cause 15.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[00:00:09.083,679] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 2&lt;/p&gt;
&lt;p&gt;This line is a bit weird. I would expect the TAC, CID, and AcT be listed here as well.&lt;/p&gt;
&lt;p&gt;[00:00:09.083,801] &amp;lt;dbg&amp;gt; lte_lc_helpers.parse_cereg: LTE mode not found, error code: -22&lt;/p&gt;
&lt;p&gt;And, it is the cause of this error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[00:00:09.122,375] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 2,&amp;quot;B293&amp;quot;,&amp;quot;00C4D302&amp;quot;,7&lt;/p&gt;
&lt;p&gt;Here it finds a new cell.&lt;/p&gt;
&lt;p&gt;[00:00:12.915,985] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 2,&amp;quot;B293&amp;quot;,&amp;quot;00C4D302&amp;quot;,7,0,17&lt;/p&gt;
&lt;p&gt;And gets rejected with cause 17.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The log is then more of the same, until&lt;/p&gt;
&lt;p&gt;[00:10:00.324,249] &amp;lt;inf&amp;gt; lte_lc: Using fallback network mode&lt;/p&gt;
&lt;p&gt;At this point, the LTE link control library has given up finding a network on LTE-M, and tries NB-IoT instead. It is not able to connect to any NB-IoT networks either, so it returns an error:&lt;/p&gt;
&lt;p&gt;Init of modem error: 1&lt;/p&gt;
&lt;p&gt;[00:20:00.349,853] &amp;lt;inf&amp;gt; lte_lc: Network connection attempt timed out&lt;/p&gt;
&lt;p&gt;(these two lines should be in the opposite order, but the logging is deferred, while printk is done in-place)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then it starts to fetch the time:&lt;/p&gt;
&lt;p&gt;[00:20:00.353,759] &amp;lt;dbg&amp;gt; date_time.new_date_time_get: Updating date time UTC...&lt;/p&gt;
&lt;p&gt;[00:20:00.353,759] &amp;lt;dbg&amp;gt; date_time.current_time_check: Date time never set&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t have one already.&lt;/p&gt;
&lt;p&gt;[00:20:00.362,426] &amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11&lt;/p&gt;
&lt;p&gt;The DNS lookup on the NTP server fails, because we are not connected to the network (-11 from getaddrinfo is EAI_SYSTEM, which tells us that the actual error code is in errno. So there can be many causes, and it is not the most helpful)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[00:20:00.362,426] &amp;lt;dbg&amp;gt; date_time.time_NTP_server_get: Trying another address...&lt;/p&gt;
&lt;p&gt;The date_time library knows of several NTP servers, so it tries the other ones. As expected, they all fail in the same way.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[00:20:00.451,416] &amp;lt;dbg&amp;gt; date_time.new_date_time_get: Fallback on cellular network time&lt;/p&gt;
&lt;p&gt;A final attempt to get the time.&lt;br /&gt;[00:20:00.552,825] &amp;lt;dbg&amp;gt; date_time.time_modem_get: Could not get cellular network time, error: -8&lt;/p&gt;
&lt;p&gt;As we are not connected to a network, this also fails.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2:&lt;/p&gt;
&lt;p&gt;A lot will be similar, so this will be a bit shorter.&lt;/p&gt;
&lt;p&gt;[00:00:09.865,173] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 5,&amp;quot;B293&amp;quot;,&amp;quot;00C4D302&amp;quot;,7,,,&amp;quot;00011110&amp;quot;,&amp;quot;1~&lt;/p&gt;
&lt;p&gt;Again, the output is a bit weird, but here we are connected to the network.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[00:00:09.940,856] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 2,&amp;quot;B293&amp;quot;,&amp;quot;00C4D302&amp;quot;,7&lt;/p&gt;
&lt;p&gt;And here, we have lost the connection, and are trying to get it back.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Init of modem error: 0&lt;/p&gt;
&lt;p&gt;Because we were connected, lte_lc_connect returns successfully.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Initialize date time&lt;br /&gt;&lt;br /&gt;[00:00:13.986,389] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 2,&amp;quot;94B4&amp;quot;,&amp;quot;0190CE00&amp;quot;,7&lt;/p&gt;
&lt;p&gt;We still haven&amp;#39;t regained the connection&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;DATE_TIME_NOT_OBTAINED&lt;/p&gt;
&lt;p&gt;So we are not able to get the time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[00:00:17.506,225] &amp;lt;dbg&amp;gt; lte_lc.at_handler: +CEREG notification: +CEREG: 5,&amp;quot;94B4&amp;quot;,&amp;quot;0190CE00&amp;quot;,7,,,&amp;quot;00100001&amp;quot;,&amp;quot;0~&lt;/p&gt;
&lt;p&gt;Here, the connection is regained.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Sebastian Stein"]In the light of the current issue, how would you suggest to establish and validate a network connection? Since lte_lc_connect() returns without an error in the second scenario, I cannot solely rely on this return value to ensure a stable connection.[/quote]
&lt;p&gt;The lte_lc library lets you register an event handler, which will be called whenever the modem sends a +CEREG update (amongst other things). You can use those events to track the status of your network connection.&lt;/p&gt;
[quote user="Sebastian Stein"]Is it possible to query some meta information from the modem which might tell me things like the current connection status, signal strength, the number of failed connection attempts after the last successful connection, the frequency of connection losses etc?[/quote]
&lt;p&gt;There are many AT commands that give you useful information. You can see the current list &lt;a href="https://infocenter.nordicsemi.com/pdf/nrf91_at_commands_v1.7.1.pdf"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But most of the useful parameters has been gathered in the &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/nw_service/xmonitor_set.html"&gt;%XMONITOR&lt;/a&gt; command.&lt;/p&gt;
[quote user="Sebastian Stein"]How would I recover from a connection loss? Do I just call lte_lc_connect() over and over again until a connection is established?[/quote]
&lt;p&gt;The modem will automatically try to reconnect, so you shouldn&amp;#39;t need to do anything.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time synchronization fails after nRF Connect SDK and modem firmware update - yet again</title><link>https://devzone.nordicsemi.com/thread/332882?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 15:18:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc0dc867-64d4-419b-b6a7-3be51a7bf1c1</guid><dc:creator>Sebastian Stein</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;thank you for taking over.&lt;/p&gt;
&lt;p&gt;As I have mentioned, I have two nrf9160 DKs one of v1.0.0 and and one of v0.9.0. So far only the v1.0.0 device showed the mentioned issue. However, after I read your post, I swapped the SIM cards. Now, the v1.0.0 works like a charm and the v0.9.0 device has issues connecting to the network. Thus, your suspicions that the issue at hand is neither related to the version of the DK nor to the new modem firmware but to the SIM card seems to be correct indeed.&lt;/p&gt;
&lt;p&gt;If its ok with you, I would like to ask a few more questions.&lt;/p&gt;
&lt;p&gt;In the field I would like the device to ensure a stable network connection, to recover from a connection loss, or at least to write some debug information into a log file.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In the light of the current issue, how would you suggest to establish and validate a network connection? Since lte_lc_connect() returns without an error in the second scenario, I cannot solely rely on this return value to ensure a stable connection.&lt;/li&gt;
&lt;li&gt;Is it possible to query some meta information from the modem which might tell me things like the current connection status, signal strength, the number of failed connection attempts after the last successful connection, the frequency of connection losses etc?&lt;/li&gt;
&lt;li&gt;How would I recover from a connection loss? Do I just call lte_lc_connect() over and over again until a connection is established?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Can you please help me to understand the logs in the log files I have provided (or point at the documentation) so that I can debug such issues myself in the future?&lt;/p&gt;
&lt;p&gt;Thank you allot for your effort!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time synchronization fails after nRF Connect SDK and modem firmware update - yet again</title><link>https://devzone.nordicsemi.com/thread/332848?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 13:02:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:498bce55-c9c7-47fe-b82c-52fdbeceb457</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Håkon is currently on vacation, so I have taken over this ticket.&lt;/p&gt;
&lt;p&gt;Based on your logs, it doesn&amp;#39;t look like the problem is in the date_time library, but in your network connection.&lt;/p&gt;
&lt;p&gt;In both logs, you are not connected to a network when the date_time library tries to get the time.&lt;/p&gt;
&lt;p&gt;In the first log, you never get connected to the network, but get reject causes 17 and 15. These point to a problem in the network, or your SIM card/subscription. I recommend you contact your SIM card provider, and ask them for help.&lt;/p&gt;
&lt;p&gt;In the second log, you do get connected, but then the modem is reporting that it is searching for a network again right after. The log shows that you do get connected again after date_time has failed, but that is of course too late.&lt;/p&gt;
&lt;p&gt;I would expect that the two behaviours are related, so contacting your SIM card provider is probably the best first step.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time synchronization fails after nRF Connect SDK and modem firmware update - yet again</title><link>https://devzone.nordicsemi.com/thread/331992?ContentTypeID=1</link><pubDate>Thu, 30 Sep 2021 15:35:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eee86e0-edac-48bf-afa5-9a45509e2e92</guid><dc:creator>Sebastian Stein</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;thank you for the reply. Out of curiosity I have reproduced the issue several times to see if the error picture changes. It does slightly. I have attached two files: &lt;em&gt;failedDateTime1.log&lt;/em&gt; and &lt;em&gt;failedDateTime2.log&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Please not the lines around the string: &lt;em&gt;&amp;quot;Init of modem error:&amp;quot;&amp;nbsp; &lt;/em&gt;in both files&lt;em&gt;. &lt;/em&gt;In both scenarios it looks to me like the modem seems to be the problem. However in the try of &lt;em&gt;failedDateTime1.log &lt;/em&gt;the function lte_lc_connect() returns an error code but it does not in the try of &lt;em&gt;failedDateTime2.log.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/failedDateTime1.log"&gt;devzone.nordicsemi.com/.../failedDateTime1.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/failedDateTime2.log"&gt;devzone.nordicsemi.com/.../failedDateTime2.log&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Date time synchronization fails after nRF Connect SDK and modem firmware update - yet again</title><link>https://devzone.nordicsemi.com/thread/331971?ContentTypeID=1</link><pubDate>Thu, 30 Sep 2021 14:05:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6453c7fa-3f28-415a-ae69-798de14bb666</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;can you try adding&lt;/p&gt;
&lt;p style="background-color:rgba(255, 255, 255, 1);color:rgba(36, 36, 36, 1);font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin:0;text-indent:0;text-transform:none;white-space:normal;"&gt;CONFIG_LOG=y&lt;/p&gt;
&lt;p style="background-color:rgba(255, 255, 255, 1);color:rgba(36, 36, 36, 1);font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin:0;text-indent:0;text-transform:none;white-space:normal;"&gt;CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y&lt;/p&gt;
&lt;p style="background-color:rgba(255, 255, 255, 1);color:rgba(36, 36, 36, 1);font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin:0;text-indent:0;text-transform:none;white-space:normal;"&gt;CONFIG_DATE_TIME_LOG_LEVEL_DBG=y&lt;/p&gt;
&lt;p style="background-color:rgba(255, 255, 255, 1);color:rgba(36, 36, 36, 1);font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin:0;text-indent:0;text-transform:none;white-space:normal;"&gt;&lt;/p&gt;
&lt;p style="background-color:rgba(255, 255, 255, 1);color:rgba(36, 36, 36, 1);font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;margin:0;text-indent:0;text-transform:none;white-space:normal;"&gt;to get more information from the logging? Then you can reproduce the issue and post the full log.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>