<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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>AWS MQTT IP connect with domain fallback</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88118/aws-mqtt-ip-connect-with-domain-fallback</link><description>Hi, 
 I wonder if there is a smart and easy way to implement a fallback if I use the MQTT connection with a static IP. What I want is if the IP fails to connect it tries again with the defined domain (dns). 
 Is there already a example for this or a plan</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Mon, 23 May 2022 13:40:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88118/aws-mqtt-ip-connect-with-domain-fallback" /><item><title>RE: AWS MQTT IP connect with domain fallback</title><link>https://test-devzone.nordicsemi.com/thread/369066?ContentTypeID=1</link><pubDate>Mon, 23 May 2022 13:40:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:746d288c-3337-4b5e-b159-f8813490da49</guid><dc:creator>user93921</dc:creator><description>&lt;p&gt;Hi Daniel,&lt;/p&gt;
&lt;p&gt;Yes, it is not easy for was it lib, because it assumes you only connect with&amp;nbsp;one aws iot sever.&lt;/p&gt;
&lt;p&gt;Also it is&amp;nbsp;less chance that the AWS IoT server will have a connection issue. If you do need one solution for a backup server, you may need to modify and maintain a custom aws_iot library. You can refer to the open-source&amp;nbsp;nrf\subsys\net\lib\aws_iot\src\aws_iot.c as reference.&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: AWS MQTT IP connect with domain fallback</title><link>https://test-devzone.nordicsemi.com/thread/368872?ContentTypeID=1</link><pubDate>Fri, 20 May 2022 17:52:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e61998e-000a-4da3-a6b7-0dd639d2e5cb</guid><dc:creator>user86703</dc:creator><description>&lt;p&gt;is there also something like this for aws iot lib? because I think the client can not be set there&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AWS MQTT IP connect with domain fallback</title><link>https://test-devzone.nordicsemi.com/thread/368761?ContentTypeID=1</link><pubDate>Fri, 20 May 2022 09:11:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d345239-ef00-41d6-8611-5f7e7cfe54b1</guid><dc:creator>user93921</dc:creator><description>&lt;p&gt;Hi Daniel,&lt;/p&gt;
&lt;p&gt;We do not have an example&amp;nbsp;specifically for this feature, but I do not think it is hard to implement such application-level codes.&lt;/p&gt;
&lt;p&gt;You can modify the following codes from github.com/.../main.c add alternative MQTT server options:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;do_connect:
	if (connect_attempt++ &amp;gt; 0) {
		LOG_INF(&amp;quot;Reconnecting in %d seconds...&amp;quot;,
			CONFIG_MQTT_RECONNECT_DELAY_S);
		k_sleep(K_SECONDS(CONFIG_MQTT_RECONNECT_DELAY_S));
	}
	err = mqtt_connect(&amp;amp;client);
	if (err != 0) {
		LOG_ERR(&amp;quot;mqtt_connect %d&amp;quot;, err);
		goto do_connect;
	}
&lt;/pre&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></channel></rss>