<?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>Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79376/asset_tracker_v2-disconnect-from-aws-when-shadow-data-is-more-than-2k</link><description>Hello, 
 I&amp;#39;m using nRF SDK v1.6.0 with nRF9160 development board. I did minimum changes to Asset_Tracker_v2 application (enable debug log, set up for my aws account and to use my shadow). 
 After that, immediately after connecting to the cloud and requesting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Sep 2021 12:49:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79376/asset_tracker_v2-disconnect-from-aws-when-shadow-data-is-more-than-2k" /><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/329447?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 12:49:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a6d6602-6788-4376-ae5c-5cd6160611b4</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;Charlie, unfortunately above mentioned ticket doesn&amp;#39;t contain any answers that I can accept. It&amp;#39;s more like &amp;quot;we know about that bug, but we will call it a feature and will not fix it&amp;quot;.&lt;/p&gt;
&lt;p&gt;Main problem here is that shadow data is an external for my application and I don&amp;#39;t see any way how I can properly handle such situation when modem library doesn&amp;#39;t provide correct feedback.&lt;/p&gt;
&lt;p&gt;This unfortunately means that nRF9160 and all other NS devices that runs under your modem library can&amp;#39;t be used in commercial applications that involve using secure connections to the cloud.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/329420?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 11:48:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25083584-e802-473f-a71e-4bf3d45f23f0</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Dmitry,&lt;/p&gt;
&lt;p&gt;There is no plan to increase the TSL buffer size by now. The discussion on&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70178/nrf9160-issue-in-receiving-tls-packets-larger-than-2048-bytes/315975#315975"&gt;nRF9160 issue in receiving TLS packets larger than 2048 bytes&lt;/a&gt;&amp;nbsp;explained all your concerns and provide more details, please read it to get more information.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/329385?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 10:50:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bd76501-2e11-4671-9f1c-e02d112cbc99</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;Hi Charlie,&lt;/p&gt;
&lt;p&gt;thank you for your answer.&lt;/p&gt;
&lt;p&gt;Any plans to increase size of TLS buffer in future releases? And more important - any plans to provide correct runtime diagnostics for that particular situation and implement proper reaction in MQTT client?&lt;/p&gt;
&lt;p&gt;Right now there is no any supporting diagnostic and therefore reaction to this is very wrong, especially when you have set CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST to y. This leads to permanent disconnects from the cloud without any reasonable logs and waste payed internet traffic as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/329363?ContentTypeID=1</link><pubDate>Tue, 14 Sep 2021 09:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fa7dde0-a8cc-43d9-9795-930db8439386</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Dmitry,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. I finally figure out the cause.&lt;/p&gt;
&lt;p&gt;The limitation is from modem firmware, its TLS has a&amp;nbsp;2kB secure socket buffer size limitation according to &lt;a href="https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF9160-DK/release_notes_modemfirmware/mfw_nrf9160_1.3.0_release_notes.txt?la=en&amp;amp;hash=584A79F9BF940AE7FC7B95BCE64B3964CA0E246D"&gt;the modem firmware release notes&lt;/a&gt;. It is a hard limitation so you need to find a way to reduce the shadow size.&lt;/p&gt;
&lt;p&gt;Some useful references:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://nordicsemiconductor.github.io/asset-tracker-cloud-docs/v1.6.x/docs/aws/LimitingShadowDocumentSize.html"&gt;Limiting the shadow document size&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64491/nrf9160-issue-in-receiving-mqtt-publish-messages-larger-than-2048-bytes-over-tls"&gt;nRF9160 issue in receiving MQTT publish messages larger than 2048 bytes over TLS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/70178/nrf9160-issue-in-receiving-tls-packets-larger-than-2048-bytes/315975#315975"&gt;nRF9160 issue in receiving TLS packets larger than 2048 bytes&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328851?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 13:21:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0825558c-8908-495b-801b-d67c1c00091f</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;And one more thing - I&amp;#39;m pretty sure that CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN and CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN not related to the problem as it&amp;#39;s zsock_recv() function which returns 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328809?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 12:01:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9660541-2453-4faf-8a67-e6913093c7a3</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;Just manually write some JSON data on AWS IoT Core console.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328807?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 11:57:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6b20f01-be4c-4f69-9aa9-9618e95fa8ed</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;&lt;span&gt;NRF_MODEM_TLS_MAX_MESSAGE_SIZE&amp;nbsp; doesn&amp;#39;t affect this issue since it only decides the TCP package max size, and one MQTT message will be divided into several TCP packages if it is very bigger than&amp;nbsp;NRF_MODEM_TLS_MAX_MESSAGE_SIZE.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How did you modify the&amp;nbsp;Asset_Tracker_v2 application&amp;nbsp;to increase shadow data is more than 2k? I will try to set up a similar experimental environment to recreate this issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328799?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 11:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e785d47-f750-40af-b498-a816b71f381b</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;Because NS pre-compiled modem library has NRF_MODEM_TLS_MAX_MESSAGE_SIZE set to 2048 and I have no control on that parameter. However, of course, I&amp;#39;ve tried setting CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN and CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN for up to 8k with no effect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328798?ContentTypeID=1</link><pubDate>Thu, 09 Sep 2021 11:36:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d53d368f-54df-4df3-bd34-fd3a6ea4a036</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Why don&amp;#39;t your increase them since your&amp;nbsp;shadow data is more than 2k? 2048 maybe still not be enough.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328671?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 17:37:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27aff88a-40e6-4555-8b49-207be0e9d7ae</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried setting those two parameters for 2048 and 1024 - no visible change. Disconnect right after requested shadow data arrived.&lt;/p&gt;
&lt;p&gt;Can it be so that AWS cloud use predefined, non negotiable TLS message size? And therefore there is no other way to fix the problem as to increase or better allow user to configure MAX TLS message size in Nordic&amp;#39;s modem library?&lt;/p&gt;
&lt;p&gt;PS: any way I think it will be nice to have a warning when modem/TLS library decide to reject incoming message. Also I think that have a runtime check for the two above mentioned parameters that they should be less than MAX TLS (if TLS connection is selected) can be good as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328635?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 13:52:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:021f47ff-bd0b-4ba4-8afc-f461bab6d3f8</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;&lt;span&gt;MQTT messages can be divided into several TCP packages. NRF_MODEM_TLS_MAX_MESSAGE_SIZ decides max size per message, and you can try to adjust the following&lt;/span&gt;&amp;nbsp;parameters to adjust the max size of one MQTT message:&lt;/p&gt;
&lt;p&gt;CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048&lt;br /&gt;CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=2048&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328550?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 10:16:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0823395f-0880-4ee5-b013-5f0b8728fa7c</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;I can&amp;#39;t. It&amp;#39;s a define in header file for pre-compiled modem library.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328540?ContentTypeID=1</link><pubDate>Wed, 08 Sep 2021 09:24:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95717611-37ae-4360-99a7-aa6c494c2b2c</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Could be related, did you test with a bigger message size?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k</title><link>https://devzone.nordicsemi.com/thread/328396?ContentTypeID=1</link><pubDate>Tue, 07 Sep 2021 12:41:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f99fe90-46e0-4332-b694-7499bab8203f</guid><dc:creator>Dmitry Pogodin</dc:creator><description>&lt;p&gt;Can it be related to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Maximum TLS message size in bytes. */
#define NRF_MODEM_TLS_MAX_MESSAGE_SIZE 2048
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;from nrfxlib/nrf_modem/include/nrf_modem_limits.h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>