<?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 sample aws_fota</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72821/nrf9160-sample-aws_fota</link><description>I am trying to implement the AWS FOTA sample from SDK V1.4.2. 
 I have already implemented the AWS IOT sample which works fine. 
 However, the AWS FOTA fails with mqtt_connect errror -22. 
 The log is shown below: 
 *** Booting Zephyr OS build v2.4.0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Apr 2021 12:51:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72821/nrf9160-sample-aws_fota" /><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/304017?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 12:51:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c05b622-9d76-4ccd-943e-d531997de1cf</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It seems like the trace doesn&amp;#39;t&amp;nbsp;show the whole exchange, but it looks like the server closes the connection for some reason. I haven&amp;#39;t figured out why yet, but it might be that the server times out. If so, requesting smaller fragments might help.&lt;/p&gt;
&lt;p&gt;You could also try to see if AWS IoT has reported the reason for the disconnect. AWS IoT publishes connect and disconnect events to some MQTT topics,&amp;nbsp;and you can also see this in&amp;nbsp;your device&amp;#39;s shadow, as I mentioned in an earlier reply.&amp;nbsp;&lt;span&gt;Go to&amp;nbsp;&lt;strong&gt;AWS IoT&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Manage&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Things&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;&amp;lt;your thing&amp;gt;&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Shadows&lt;/strong&gt;. A disconnect message will contain the element &amp;quot;disconnectReason&amp;quot;, which will have one of the following valid values as the reason for the disconnect:&lt;/span&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Disconnect reason&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AUTH_ERROR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client failed to authenticate or authorization failed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CLIENT_INITIATED_DISCONNECT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client indicates that it will disconnect. The client can do this by sending either a MQTT&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;DISCONNECT&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;control packet or a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;Close frame&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;if the client is using a WebSocket connection.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CLIENT_ERROR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client did something wrong that causes it to disconnect. For example, a client will be disconnected for sending more than 1 MQTT&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;CONNECT&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;packet on the same connection or if the client attempts to publish with a payload that exceeds the payload limit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CONNECTION_LOST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client-server connection is cut off. This can happen during a period of high network latency or when the internet connection is lost.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DUPLICATE_CLIENTID&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client is using a client ID that is already in use. In this case, the client that is already connected will be disconnected with this disconnect reason.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FORBIDDEN_ACCESS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client is not allowed to be connected. For example, a client with a denied IP address will fail to connect.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MQTT_KEEP_ALIVE_TIMEOUT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;If there is no client-server communication for 1.5x of the client&amp;#39;s keep-alive time, the client is disconnected.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SERVER_ERROR&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Disconnected due to unexpected server issues.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SERVER_INITIATED_DISCONNECT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Server intentionally disconnects a client for operational reasons.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;THROTTLED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client is disconnected for exceeding a throttling limit.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WEBSOCKET_TTL_EXPIRATION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The client is disconnected because a WebSocket has been connected longer than its time-to-live value.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;span&gt;This can also be found&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html"&gt;here&lt;/a&gt;&lt;span&gt;.&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;Marte&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/302769?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 13:38:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d13fc33-b9d4-4fb2-8ddd-1d907a6d66a0</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have started looking at your log and modem trace, but I have not been able to figure out what the issue is yet. Due to Easter we are short staffed, so response time might be longer than usual, but I will get back to you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/302410?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2021 14:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0206985-f531-48d2-bf04-4214d6e5692e</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte,&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;reset the system and queued a job which downloaded and rebooted the system.&lt;/p&gt;
&lt;p&gt;Then I queued a new job.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There was a long delay and then it seemed to start the new job - but then failed.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Attaching the modem trace.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;D&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/trace_2D00_2021_2D00_03_2D00_29T14_2D00_06_2D00_40.238Z.bin"&gt;devzone.nordicsemi.com/.../trace_2D00_2021_2D00_03_2D00_29T14_2D00_06_2D00_40.238Z.bin&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/302353?ContentTypeID=1</link><pubDate>Mon, 29 Mar 2021 11:36:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49b85982-056a-47fd-81f6-182a539e5073</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Good to hear that updating to v1.5.0 fixed your previous issue!&lt;/p&gt;
&lt;p&gt;How often does the disconnect happen?&lt;/p&gt;
&lt;p&gt;The only difference I can see between&amp;nbsp;when it succeeded and when it failed is that&amp;nbsp;right&amp;nbsp;after the transport write is complete, the modem sends the AT command &lt;em&gt;+CSCON: 0&lt;/em&gt; to the MCU, which indicates that the modem is in idle mode. This happens on line line 795 in your log (compared to line 157 and after, where the download succeeded). I also see that the modem starts switching between being in idle and connected (&lt;span&gt;&lt;em&gt;+CSCON: 1&lt;/em&gt;)&lt;/span&gt;&amp;nbsp;mode after some time,&amp;nbsp;from line 708 and on. I am not sure why this is happening.&lt;/p&gt;
&lt;p&gt;Could you get a modem trace of this happening?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/302253?ContentTypeID=1</link><pubDate>Sun, 28 Mar 2021 12:36:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5a4dbd1-4f4f-4e34-baa2-8e829901b648</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte,&lt;/p&gt;
&lt;p&gt;Thanks you for that.&lt;/p&gt;
&lt;p&gt;I updated to V1.5.0.&lt;/p&gt;
&lt;p&gt;The FOTA has now worked.&lt;/p&gt;
&lt;p&gt;I have tested it multiple times and it downloads and resets correctly.&lt;/p&gt;
&lt;p&gt;However,&amp;nbsp;sometimes the MQTT client disconnects and the download doesn&amp;#39;t complete as can be seen in the attached log.&lt;/p&gt;
&lt;p&gt;can you advise why this might be?&lt;/p&gt;
&lt;p&gt;The AT command at the end i triggered myself to see if the system was still alive&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Dermot&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/log_5F00_28_5F00_03.txt"&gt;devzone.nordicsemi.com/.../log_5F00_28_5F00_03.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/302153?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 13:55:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2e9b11c-ef0f-4ee0-944b-03e56bdf97f0</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The developers said that it looks like you are receiving the job twice. This was an issue that was fixed before the 1.5.0 release of NCS. The changes that were done in regards to this can be found&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/commit/004f8092d7b295a95d394b53d781edbcaeacf17e#diff-3be2efd8e80c580e7251d3efba3cfceab5ab7074bdc24d72c81f445fce7f933a"&gt;here&lt;/a&gt;, where you can also find a description of the issue and what was done to fix this, which I have copied below:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;When entering PSM the network will cache TCP packets. This lead to
multiple notify-next messages being sent when the device was in PSM as
the MQTT ack was never recived so the server would do retrasmission.

To combat this we check what state we are in when we receive a
notify-next topic so that we won&amp;#39;t accept it and break the download.

Addition to this we add a timeout on accepted so that things running in
the same context won&amp;#39;t be blocked forever.&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;To solve this issue you can either update to NCS v1.5.0, or add the changes&amp;nbsp;to your SDK.&lt;span&gt;&amp;nbsp;&lt;/span&gt;All the necessary changes can be found in the link above, but I have also added them myself in v1.4.2 and attached them here, so you can just replace the relevant files. The zip file contains the files&amp;nbsp;Kconfig and&amp;nbsp;aws_fota.c. Replace them with the corresponding files found in &amp;lt;ncs_folder&amp;gt;/nrf/subsys/net/lib/aws_fota and &amp;lt;ncs_folder&amp;gt;/nrf/subsys/net/lib/aws_fota/src&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/aws_5F00_fota.zip"&gt;devzone.nordicsemi.com/.../aws_5F00_fota.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/302089?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 09:56:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1bbbed8-3b86-4344-b219-5955002077ca</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for clarifying. I have asked our developers for help with this, so I will get back to you when I have more information.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/301698?ContentTypeID=1</link><pubDate>Wed, 24 Mar 2021 13:53:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2662086-e823-4a90-8379-57ab9f8abd94</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte,&lt;/p&gt;
&lt;p&gt;Sorry I meant to send you just the log from the most recent rest - attached now.&lt;/p&gt;
&lt;p&gt;The previous resets I did myself.&lt;/p&gt;
&lt;p&gt;For this log I deleted all job files on AWS and started a new one.&lt;/p&gt;
&lt;p&gt;It looks like it is starting to do the down load but gets stuck.&lt;/p&gt;
&lt;p&gt;On AWS its says the download is &amp;#39;in progress&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/log_5F00_24_5F00_03_5F00_nbr2.txt"&gt;devzone.nordicsemi.com/.../log_5F00_24_5F00_03_5F00_nbr2.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/301684?ContentTypeID=1</link><pubDate>Wed, 24 Mar 2021 13:13:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b21334d-388a-4608-8d52-db92ef7c959b</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Good to hear that you got a bit further. I have started looking at your log, but I will need some more time before I can say what is wrong. I also have some questions that might help me figuring this out.&lt;/p&gt;
&lt;p&gt;I see that your device restarted several times during the log. Did you restart it yourself, or did it restart on its own? Does the download get stuck every time, or only sometimes? Can you point me to when in the log it gets stuck, is it when you get &amp;quot;Job document update was rejected&amp;quot;, or is it somewhere else?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/301673?ContentTypeID=1</link><pubDate>Wed, 24 Mar 2021 12:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ebe807e-dd9f-4f07-bf8f-3d53a26f2ba3</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte&lt;/p&gt;
&lt;p&gt;Got a bit further with this.&lt;/p&gt;
&lt;p&gt;But now the download gets stuck as can be seen in the attached log file.&lt;/p&gt;
&lt;p&gt;Any idea why this might be?&lt;/p&gt;
&lt;p&gt;Tks&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/log_5F00_24_5F00_03_5F00_nbr1.txt"&gt;devzone.nordicsemi.com/.../log_5F00_24_5F00_03_5F00_nbr1.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300970?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 14:10:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c7c404c-c107-4fe2-bb35-dc5bf8a7950f</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte,&lt;/p&gt;
&lt;p&gt;Here is the terminal log.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Dermot&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2021_2D00_03_2D00_19T12_5F00_07_5F00_08.380Z_2D00_log.txt"&gt;devzone.nordicsemi.com/.../2021_2D00_03_2D00_19T12_5F00_07_5F00_08.380Z_2D00_log.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300964?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 13:58:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4451c5cb-64ba-40cd-ad1f-07815b1c7363</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you also try going into AWS IoT, Manage, Tings, &amp;lt;your thing&amp;gt;, Shadows and look at the&amp;nbsp;device&amp;#39;s shadow there? You might be able to find a reason for the disconnect there, under &amp;quot;disconnectReason&amp;quot;. The description of the different disconnect reasons can be found&amp;nbsp;&lt;a href="https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300955?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 13:43:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2852af27-e15d-4c73-8e09-d39cb1d12a5f</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you share the output log from the terminal? If you are using LTE Link Monitor you can get this by clicking on the &amp;quot;Open log file&amp;quot; button.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/500x500/__key/communityserver-discussions-components-files/4/2425.open_5F00_log_5F00_lte_5F00_link_5F00_monitor.png" /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300940?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 13:10:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:998ec2ae-de97-4d64-85e4-59fed15f58fa</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte,&lt;/p&gt;
&lt;p&gt;I have done that and attached the new log file.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Dermot&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/trace_2D00_2021_2D00_03_2D00_19T12_2D00_08_2D00_38.774Z.bin"&gt;devzone.nordicsemi.com/.../trace_2D00_2021_2D00_03_2D00_19T12_2D00_08_2D00_38.774Z.bin&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300924?ContentTypeID=1</link><pubDate>Fri, 19 Mar 2021 12:42:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69a02996-bf5d-4fab-b14e-d276d5982423</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The server is sending an encrypted alert that closes the TLS session. This happens right after something is sent, so the problem might be what is being sent. Could you enable more logging so we can see what is being sent right before the connection is closed? You can enable it by adding the following to prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_NET_LOG=y
CONFIG_MQTT_LOG_LEVEL_DBG=y
CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y
CONFIG_AWS_FOTA_LOG_LEVEL_DBG=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300710?ContentTypeID=1</link><pubDate>Thu, 18 Mar 2021 14:19:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a7df47e-30ab-443d-82d4-72e5f8773c6b</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I will look at the modem trace and come back to you when I find anything.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300511?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 17:26:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b758b9c-893a-4aa4-9936-0db56ff0d3bd</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte,&lt;/p&gt;
&lt;p&gt;We did follow the guide for setting up the S2 bucket and creating a thing in AWS IoT - and correctly I think.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m attaching the modem trace.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am using nrF9160DK.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/trace_2D00_2021_2D00_03_2D00_17T16_2D00_20_2D00_13.110Z.bin"&gt;devzone.nordicsemi.com/.../trace_2D00_2021_2D00_03_2D00_17T16_2D00_20_2D00_13.110Z.bin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;,Thanks for your help,&lt;/p&gt;
&lt;p&gt;Dermot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300445?ContentTypeID=1</link><pubDate>Wed, 17 Mar 2021 14:03:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8dac6be-2ec5-4d02-9b72-ddba2f1ad60e</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Error -128 is&amp;nbsp;ENOTCONN, s&lt;span&gt;ocket is not connected. The device is being disconnected, but I do not know why. Is the cloud side configured correctly? Did you follow the guide for the sample when creating a thing in AWS IoT and setting up an AWS S3 bucket?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you please take a&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/cellular-iot-guides/b/getting-started-cellular/posts/how-to-get-modem-trace-using-trace-collector-in-nrf-connect"&gt;modem trace&lt;/a&gt;? This will help me figure out why you are being disconnected.&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;Marte&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300178?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 14:35:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91fb2d7c-2e00-47ab-96a7-bd6ba16461b6</guid><dc:creator>dermot geraghty</dc:creator><description>&lt;p&gt;Hi Marte,&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;I have changed the&amp;nbsp;prj.conf file as per your directions and moved things on a bit.&lt;/p&gt;
&lt;p&gt;It does successfully connect to the MQTT broker but I&amp;#39;m not seeing that it is susbcribing to the topic (as per Nordic documentation)&lt;/p&gt;
&lt;pre&gt;[mqtt_evt_handler:129] MQTT client connected!
[00:00:14.106,140] &amp;lt;inf&amp;gt; aws_jobs: Subscribe: $aws/things/nrf-aws-fota/jobs/notify-next&lt;br /&gt;&lt;br /&gt;My topic is:&lt;/pre&gt;
&lt;pre&gt;$aws/things/TDG_logger_thing/jobs/notify-next&lt;/pre&gt;
&lt;pre&gt;Here is what I am seeing:&lt;br /&gt;&lt;span class="unsolicited"&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;client_id: TDG_logger_thing&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;hostname: a3vecosqszzrnz-ats.iot.eu-west-1.amazonaws.com&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;[mqtt_evt_handler:182] MQTT client connected!&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre&gt;[mqtt_evt_handler:235] PUBACK packet id: 50475&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;[mqtt_evt_handler:245] SUBACK packet id: 2114&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;[mqtt_evt_handler:193] MQTT client disconnected -128&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;ERROR: mqtt_input -128&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;Disconnecting MQTT client...&lt;/pre&gt;
&lt;pre class="ctrl-char CR"&gt;&lt;/pre&gt;
&lt;pre class="ctrl-char LF"&gt;&lt;/pre&gt;
&lt;pre&gt;Could not disconnect MQTT client. Error: -128&lt;/pre&gt;
&lt;pre&gt;&lt;span class="unsolicited"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Can you tell me what is wrong here?&lt;br /&gt;&lt;br /&gt;Many thanks&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrF9160 sample aws_fota</title><link>https://devzone.nordicsemi.com/thread/300037?ContentTypeID=1</link><pubDate>Tue, 16 Mar 2021 09:12:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cff8310c-7d86-44c6-b7a7-c4e99d02b699</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;mqtt_connect -22 is the error EINVAL, which means invalid argument. This is most likely caused because the MQTT configuration is incorrect.&lt;/p&gt;
&lt;p&gt;From your prj.conf I see that you have copied configurations from the AWS IoT sample. The AWS FOTA sample does not use the AWS IoT library, but the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.2/nrf/include/net/aws_fota.html#lib-aws-fota"&gt;AWS FOTA library&lt;/a&gt;, which you can see under&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.2/nrf/samples/nrf9160/aws_fota/README.html#dependencies"&gt;dependencies&lt;/a&gt;&amp;nbsp;in the documentation of the sample. Therefore, you should not use CONFIG_AWS_IOT to configure your sample. Instead, you should configure it as described in the sample, under&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.2/nrf/samples/nrf9160/aws_fota/README.html#sample-configuration"&gt;sample configuration&lt;/a&gt;. This description is for how to configure it using menuconfig in SES (SEGGER Embedded Studio), but if you instead want to configure it in prj.conf, which I recommend using instead of SES and menuconfig, you should add the following configs, and switch out the values&amp;nbsp;so they correspond with your values:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# AWS FOTA
CONFIG_CLOUD_CERT_SEC_TAG=12345678
CONFIG_USE_CLOUD_CLIENT_ID=y
CONFIG_CLOUD_CLIENT_ID=&amp;quot;your_client_id&amp;quot;
CONFIG_MQTT_BROKER_HOSTNAME=&amp;quot;your_aws_mqtt_broker_hostname.amazonaws.com&amp;quot;
CONFIG_MQTT_BROKER_PORT=8883&lt;/pre&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The reason I recommend changing configurations in prj.conf and not in menuconfig in SES is because the changes done in menuconfig are only done in your current project, so if you reload the project or close it and open it again, the changes will not be there anymore, as they will be overwritten by prj.conf when you run CMake, which is run when you open a project in SES.&lt;/p&gt;
&lt;p&gt;For later projects, if it is unclear what&amp;nbsp;configs you have to&amp;nbsp;set in&amp;nbsp;prj.conf and the documentation&amp;nbsp;only explains how to configure the project using menuconfig, you can find the configs by doing the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open the project in SES&lt;/li&gt;
&lt;li&gt;Go to&amp;nbsp;&lt;span&gt;Project &amp;gt; Configure nRF Connect SDK Project &amp;gt; menuconfig&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Press the + next to the&amp;nbsp;project settings to open up the settings (in AWS FOTA this is&amp;nbsp;&lt;strong&gt;MQTT FOTA Sample Settings&lt;/strong&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Select and change the configurations you want to use in your project&lt;/li&gt;
&lt;li&gt;When you are done select Configure and wait for the configuration to&amp;nbsp;finish&lt;/li&gt;
&lt;li&gt;There will now be a file in your build folder with the generated configs for your project, in &amp;lt;build_folder&amp;gt;/zephyr/.config, so in the case of the AWS FOTA sample this will be &amp;lt;ncs_folder&amp;gt;/nrf/samples/nrf9160/aws_fota/build/zephyr/.config.&lt;/li&gt;
&lt;li&gt;You can then copy the relevant configs from the .config file to your prj.conf. The relevant MQTT configs in the case of AWS FOTA can be found under&amp;nbsp;# MQTT FOTA Sample Settings&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>