<?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 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96020/nrf9160-asset-tracker-v2-aws---power-consumption-problem-with-mqtt_keepalive</link><description>I have an application modified from the Asset Tracker V2. It is on the 1.8 SDK. 
 I am able to get the power consumption low, but every 20 minutes the application starts the modem and pings AWS. This is because of: 
 
 # Maximum specified MQTT keepalive</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 05 Feb 2023 10:31:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96020/nrf9160-asset-tracker-v2-aws---power-consumption-problem-with-mqtt_keepalive" /><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/408141?ContentTypeID=1</link><pubDate>Sun, 05 Feb 2023 10:31:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e2c9ca4-2cd5-4614-85c6-8a259a612f7b</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;I guess you need to decide, which way to go:&lt;/p&gt;
&lt;p&gt;- TCP based:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; - always connected&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; - always connecting&lt;/p&gt;
&lt;p&gt;- UDP based:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; - connection less&lt;/p&gt;
&lt;p&gt;That means, neglecting encryption ((D)TLS), for TCP you either need frequently (here 20 min) messages, or you need a TCP connect ahead of sending application data. With MQTT that results with the TCP injected messages easily in about 8 IP-packets instead of 2 for UDP.&lt;/p&gt;
&lt;p&gt;Also enables UDP to use RAI, which also reduces the energy consumption.&lt;/p&gt;
&lt;p&gt;Considering encryption, &amp;quot;connecting&amp;quot; requires an additional TLS handshake, with that it&amp;#39;s about 20 IP messages instead of 2.&lt;/p&gt;
&lt;p&gt;Using DTLS 1.2 (6347) usually requires also handshakes, because in the most cases the client&amp;#39;s IP-address is changing. You may be able to configure the client&amp;#39;s IP-address in a static manner, but that may be harder than expected. Without, an handshake is required and will also end up in about 10 IP messages instead of 2.&lt;/p&gt;
&lt;p&gt;For such cases, where the IP-addess is changing, DTLS 1.2 Connection ID (RFC 9146) was introduced. That enables you again to exchange data with mainly 2 IP-messages.&lt;/p&gt;
&lt;p&gt;Currently there are 3 implementation I know, Eclipse/Californium (java, client and server), Eclipse/tinydtls (C, only client, currently in develop), and recently mbedtls (C).&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re interested, you may check my demonstration client, &lt;a id="" href="https://github.com/boaks/zephyr-coaps-client"&gt;https://github.com/boaks/zephyr-coaps-client&lt;/a&gt;. It uses tinydtls and Californium as cloud-server. It only demonstrates the use of CoAP/DTLS CID, it&amp;#39;s no tracker app. Using a Thingy:91 exchanging a message every hour it reaches 1/2 a year from the internal battery.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/407997?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 12:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8eb27b9-5314-477d-9a12-39cc87429bb8</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Please note that t&lt;span&gt;he Asset Tracker v2 is a real-time configurable &lt;em&gt;ultra-low power capable&lt;/em&gt; application. This does not mean that it is by default configured to lowest possible configuration. The application is a demonstration of what our nRF9160 is capable&amp;nbsp;of, but will not reflect all use cases.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/407994?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 12:18:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:070f3e01-e568-4298-988d-1f1f435a02c2</guid><dc:creator>Dev123</dc:creator><description>&lt;p&gt;In the end, I set it very high and use it as a safety to make sure device talks. So if it is scheduled to talk every 12 hours, I set it to 25 hours to ensure it does not miss. May move it farther out than that.&lt;/p&gt;
&lt;p&gt;So now I have a solution for me, but I think a robust sample app for a low power solution should be handling this better (probably disconnecting).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/407993?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 12:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fca5dfb0-f1ee-4fa5-b298-ff9886f764be</guid><dc:creator>Lorenzo Amicucci</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;have you considered using Lwm2m or other coap based solutions?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/407991?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 12:07:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e3cdc8b-c5f4-4a0b-9c50-565f79d2f466</guid><dc:creator>Dev123</dc:creator><description>&lt;p&gt;My power consumption is 18 ua when in psm. I have not measured the energy consumption of waking up the radio every twenty minutes, but I know it will be non-trivial on a device meant to last years. Radio is not just turned on, it needs to transmit and it does this 72 times a day.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/407913?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 08:51:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf354b78-ae3c-446d-bbe0-9962ddd107c0</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello, sorry for the late reply.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What is the power consumption you measured on you device? What exactly&amp;nbsp;is the power consumption problem that you see?&lt;/p&gt;
&lt;p&gt;Have you verified that you device is actually in PSM? How often do you want to send data to AWS?&lt;/p&gt;
&lt;p&gt;Is there a reason for why you are using nRF Connect SDK v1.8.0? Several improvements have been introduced to our latest version i.e. v2.2.0.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We will need some more information in order to provide you with an answer.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/406561?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 22:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d5ee5aa-a394-4f76-8898-dae463658042</guid><dc:creator>Dev123</dc:creator><description>&lt;p&gt;I am using the Asset Tracker V2. It manages connection. My assumption is that it was built for low power. I do not understand how it can be low power if it turns the radio on every twenty minutes. I am assuming I am missing some configuration.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 / Asset Tracker V2 / AWS - Power consumption problem with MQTT_KEEPALIVE</title><link>https://devzone.nordicsemi.com/thread/406459?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 13:08:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33c030a1-276c-442d-b284-f475cf97c96e</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Could you elaborate more on how you try to disconnect from AWS? Can you use i.e. &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrf/libraries/networking/aws_iot.html#c.aws_iot_disconnect"&gt;aws_iot_disconnect&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>