<?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>Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63012/some-example-using-aws-iot-library-subsys-net-lib-aws_iot</link><description>Hello guys, 
 We are developing a device that will based on nRF9160 SiP. We use nRFConnect SDK v1.3.0 . The goal would be to connect to AWS IoT through MQTT and exchange messages. I used cloud_client example from nrf/samples/nrf9160 as a starting point</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Jul 2020 11:38:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63012/some-example-using-aws-iot-library-subsys-net-lib-aws_iot" /><item><title>RE: Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/thread/257805?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 11:38:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9b4ba25-57f6-4c33-9974-38444746b265</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hello again, if you&amp;#39;re worried about battery consumption, completely disconnecting from the network each time is not the best way to go about this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I recommend you have a look at Power Saving Mode and check if your network operator supports this feature, and then go into PSM instead of completely de-attaching from the network.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/thread/257675?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 21:34:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08bdd365-e28b-4268-b01b-c18934d20bc3</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, &lt;a href="https://devzone.nordicsemi.com/members/heidi"&gt;Heidi&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Thanks for the great explanation. You were right about both:&lt;/p&gt;
&lt;p&gt;1) There is no &lt;strong&gt;&lt;span style="background-color:#ccffff;font-family:courier new, courier;"&gt;&lt;em&gt;cloud_uninit(cloud_backend)&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;function in AWS_IoT library. Consequently, we can delete that line of the code from the disconnect procedure.&lt;/p&gt;
&lt;p&gt;2) The socket was already connected so there was no need to call &lt;strong&gt;&lt;em&gt;&lt;span style="background-color:#ccffff;font-family:courier new, courier;"&gt;modem_configure()&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So, if we disconnect from the cloud by simply calling &lt;strong&gt;&lt;span style="background-color:#ccffff;font-family:courier new, courier;"&gt;&lt;em&gt;cloud_disconnect(cloud_backend)&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;function, we were able to re-connect by omitting &lt;strong&gt;&lt;em&gt;&lt;span style="background-color:#ccffff;font-family:courier new, courier;"&gt;modem_configure()&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; function.&lt;/p&gt;
&lt;p&gt;However, in our system, the modem should be normally off and active only during the rare periods when we want to upload data. If we keep the socket connected, that would suck the juice from our battery so there is a need to completely turn off the modem between connection periods.&lt;/p&gt;
&lt;p&gt;I tried to onclude two more functions that would turn off the modem after disconnection from the cloud:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cloud_disconnect(cloud_backend);
lte_lc_offline();
lte_lc_power_off();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, with those two functions included, we were unable to re-connect (with and without &lt;strong&gt;&lt;em&gt;&lt;span style="background-color:#ccffff;font-family:courier new, courier;"&gt;modem_configure()&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; function included)!&lt;/p&gt;
&lt;p&gt;What would be the steps to completely turn off the modem and re-activate it again when we need it?&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/thread/257649?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 15:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:034a2e24-b63f-4aa8-ade0-cc5876899a94</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi! The case you linked to has been assigned to another engineer who will answer that question for you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can tell you that modem_configure returning &lt;a href="https://github.com/eblot/newlib/blob/master/newlib/libc/include/sys/errno.h#L151"&gt;error 120&lt;/a&gt;&amp;nbsp;means the socket is already connected, i.e. you don&amp;#39;t need to configure the modem again. You are disconnecting from the cloud backend, not the network, so you don&amp;#39;t need to run modem_configure every time you disconnect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;cloud_uninit returning &lt;a href="https://github.com/eblot/newlib/blob/master/newlib/libc/include/sys/errno.h#L169"&gt;error 134&lt;/a&gt;&amp;nbsp;means not supported, which I think might be because the AWS IoT library does not have an uninit function.&amp;nbsp;To disconnect from the cloud, it should be enough to run the cloud_disconnect function.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/thread/257482?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 05:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00b134d7-2cc7-43e7-8f3c-6a149671b19b</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hi, &lt;a href="https://devzone.nordicsemi.com/members/heidi"&gt;Heidi&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;If Cloud API uses the functions from the AWS IoT library then it should be OK.&lt;/p&gt;
&lt;p&gt;Can you help me understand what would be the proper (clear) way to disconnect from the Cloud? I have a hard time to disconnect and re-connect again, as I described &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63161/re-connect-to-the-aws-iot-cloud-with-nrf9160" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/thread/257463?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2020 20:14:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d98a51af-00a6-48df-862d-5686411247c4</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi, the Cloud API uses the functions you list, just not directly. But that&amp;#39;s what the application is using when you enable the AWS IoT backend.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;With regard to the benefit of using the AWS IoT library directly, I&amp;#39;ll have to get back to you.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/thread/257053?ContentTypeID=1</link><pubDate>Fri, 26 Jun 2020 07:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7336e212-d6ba-4c45-a846-5230b45b24c8</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Thanks for your clarification,&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/heidi"&gt;Heidi&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;I indeed specified&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;config CLOUD_BACKEND
	string &amp;quot;String that selects the cloud backend to be used&amp;quot;
	default &amp;quot;AWS_IOT&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;in my &lt;span style="background-color:#ffcc99;"&gt;&lt;em&gt;&lt;strong&gt;Kconfig&lt;/strong&gt;&amp;nbsp;&lt;/em&gt;&lt;/span&gt; file.&lt;/p&gt;
&lt;p&gt;Please help me to understand better, can I replace generic&lt;em&gt;&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/net/cloud.html#cloud-api-readme" rel="noopener noreferrer" target="_blank"&gt;&lt;span&gt;Cloud API&lt;/span&gt;&lt;/a&gt; &lt;/em&gt;and use the API functions from &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/net/aws_iot.html" rel="noopener noreferrer" target="_blank"&gt;AWS IoT library&lt;/a&gt; (e. g. &lt;code class="xref cpp cpp-func docutils literal notranslate"&gt;&lt;span class="pre"&gt;aws_iot_init()&lt;/span&gt;&lt;/code&gt;, &lt;code class="xref c c-type docutils literal notranslate"&gt;&lt;span class="pre"&gt;aws_iot_config&lt;/span&gt;&lt;/code&gt;, &lt;code class="xref cpp cpp-func docutils literal notranslate"&gt;&lt;span class="pre"&gt;aws_iot_connect()&lt;/span&gt;&lt;/code&gt; etc.)?&lt;/p&gt;
&lt;p&gt;Is there any benefit of replacing generic Cloud APIs with the APIs from AWS IoT library?&lt;/p&gt;
&lt;p&gt;Of course, I would need to include the library with:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;include/net/aws_iot.h
subsys/net/lib/aws_iot/src/&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Some example using AWS IoT library (subsys/net/lib/aws_iot/)</title><link>https://devzone.nordicsemi.com/thread/256882?ContentTypeID=1</link><pubDate>Thu, 25 Jun 2020 11:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:565d97b3-051b-4d4e-bbd2-41d21b94cd8a</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;When you enable the AWS IoT backend, using CONFIG_CLOUD_BACKEND, the Cloud client sample uses the AWS IoT library.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;See the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/cloud_client/README.html"&gt;Cloud client sample documentation&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The Cloud client sample demonstrates how the generic&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/net/cloud.html#cloud-api-readme"&gt;&lt;span&gt;Cloud API&lt;/span&gt;&lt;/a&gt;&amp;nbsp;can be used to interface with multiple cloud backends. The current version of the sample supports the following libraries as cloud backends:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/net/nrf_cloud.html#lib-nrf-cloud"&gt;&lt;span&gt;nRF Cloud&lt;/span&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/net/aws_iot.html#lib-aws-iot"&gt;&lt;span&gt;AWS IoT&lt;/span&gt;&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Heidi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>