<?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 MQTT Connection refused</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91345/nrf9160-mqtt-connection-refused</link><description>Hi 
 I&amp;#39;m trying to send and receive data with MQTT. 
 I tried uploading asset trackerV2 bin file and it works fine with nrf cloud. 
 now I want to use the sample &amp;quot;MQTT_simple&amp;quot; to connect to nrf cloud 
 but it&amp;#39;s giving me this error ( I tried as well changing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Aug 2022 14:19:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91345/nrf9160-mqtt-connection-refused" /><item><title>RE: nRF9160 MQTT Connection refused</title><link>https://devzone.nordicsemi.com/thread/383512?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 14:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7eb6aa16-c6dd-45ac-b964-aa85bcccd7c3</guid><dc:creator>mourad</dc:creator><description>&lt;p&gt;Thanks Charlie for the clarification&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 MQTT Connection refused</title><link>https://devzone.nordicsemi.com/thread/383422?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2022 09:15:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56731f7b-78cf-4e53-adec-7acee92affdc</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Mourad,&lt;/p&gt;
&lt;p&gt;Please use your own MQTT broker or a public one like&amp;nbsp;mqtt.eclipseprojects.io to test &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/samples/nrf9160/mqtt_simple/README.html"&gt;nRF9160: Simple MQTT&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;nRF Cloud&amp;nbsp;has its private MQTT broker for its high-level application usage, it is not fit for the MQTT broker test. Please refer to nRF Cloud based samples to add devices and do tests.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/applications/asset_tracker_v2/README.html"&gt;nRF9160: Asset Tracker v2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/samples/nrf9160/nrf_cloud_mqtt_multi_service/README.html"&gt;nRF9160: nRF Cloud MQTT multi-service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/samples/nrf9160/nrf_cloud_rest_cell_pos/README.html"&gt;nRF9160: nRF Cloud REST cellular positioning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/samples/nrf9160/nrf_cloud_rest_device_message/README.html"&gt;nRF9160: nRF Cloud REST Device Message&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/samples/nrf9160/nrf_cloud_rest_fota/README.html"&gt;nRF9160: nRF Cloud REST FOTA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Do you mean you are using an AWS MQTT broker? If so, we have a dedicated sample for this:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/nrf/samples/nrf9160/aws_iot/README.html#nrf9160-aws-iot"&gt;nRF9160: AWS IoT — nRF Connect SDK 2.0.0 documentation (nordicsemi.com)&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: nRF9160 MQTT Connection refused</title><link>https://devzone.nordicsemi.com/thread/383340?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 15:41:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8260f18-a7ae-4845-bbf9-3e95f81ca0da</guid><dc:creator>mourad</dc:creator><description>&lt;p&gt;Hi paul&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your answer, I have added that line to prj.conf but it still the same problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 MQTT Connection refused</title><link>https://devzone.nordicsemi.com/thread/383328?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 14:21:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b1dd045-d418-4b9e-8d8a-a3f6196dafd3</guid><dc:creator>paul.lander</dc:creator><description>&lt;p&gt;Hi mourad,&lt;/p&gt;
&lt;p&gt;We have noticed that it can take a few seconds to connect to AWS with TLS once the connection to the cellular network has been established. Error No. 111, &amp;quot;connection refused&amp;quot; is common. Connection times range from 1 to 20 seconds and seem to depend partly on cellular signal strength. We&amp;#39;re using HTTPS and an API Gateway, not MQTT, but&amp;nbsp;our solution was to increase the connection timeout. Perhaps that will help you?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Extending socket connection timeout from default of 3,000 ms
CONFIG_NET_SOCKETS_CONNECT_TIMEOUT=60000
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>