<?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>CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/129247/coap-with-dtls-on-nrf9151</link><description>Dear Nordic team, 
 I am struggling to set up CoAP with DTLS for a Thingsboard CoAP backend. The connection works just fine when using plain UDP, but when I set up a socket with DTLS I run into an error, where the CoAP client request responds with error</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Sep 2026 09:03:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/129247/coap-with-dtls-on-nrf9151" /><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571697?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2026 09:03:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28cc6c7d-a624-4043-a86a-3e20fffedc9c</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Yes, go ahead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571696?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2026 09:02:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42199eb2-cde6-4ca8-92ca-831cab494dc3</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Great to know that its working without any issue. Is it okay I close this ticket?&lt;/p&gt;
&lt;p&gt;Feel free to reach out if anything comes up. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571694?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2026 08:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3490f86-56a5-4374-abea-0fa8154ff0c0</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Hey Syed,&lt;/p&gt;
&lt;p&gt;thanks for checking that out. I&amp;#39;ve used those PSM and eDRX settings for a couple of days now and there seems to be no issue.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571693?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2026 08:13:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2458a5bf-f84d-4819-8ed9-9e8feb40c192</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Hey Achim,&lt;/p&gt;
&lt;p&gt;thanks for your insights!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll keep the socket open for as long as possible then and renew it only if we suspect that it should be renewed.&lt;/p&gt;
&lt;p&gt;This would then also make the DTLS session resumption question redundant, as a full reconnect would not occur frequently.&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll also definitely look into setting up CID properly and keep in mind your suggestion to use multiple DNS addresses. I think we might also try CID with more or less static server instances -if we do actually decide to go with more than one - and a sticky session load balancer. Thingsboard&amp;#39;s CoAP transport service is Eclipse Californium based. Good to hear that you&amp;#39;ve had positive experiences with that.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571621?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2026 17:39:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b93af35-2d9a-4855-826c-cc517debd162</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; Do you have any insights and advice on how long the socket could remain open but inactive?&lt;/p&gt;
&lt;p&gt;I use PSM and in some cases eDRX. My UDP sockets stay open for days and weeks. They mainly get closed by the modem itself, when that lost the network.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;My understanding is that the CoAP server and especially the load balancer need to be CID aware when multiple server instances are involved.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CID is used to overcome the widely used NATs. The depends a lot on your network setup, but frequently some NATs are on the path, say at the MNO outgress or your cloud ingress. In quite a lot of cases that&amp;#39;s even not known. For UDP unfortunately the most NATs uses pretty small timeouts, e.g. 30s or 120s. That means, if your device sleeps (doesn&amp;#39;t send a UDP packet), the next UDP packet may show a different public IP address to the server. Usually not bad for UDP, but the DTLS context is related to that address and if that changes, then the server will not be able to find the right DTLS context for that packet.&lt;/p&gt;
&lt;p&gt;CID simply replaces the ip-address by a much more stable Connection ID.&lt;/p&gt;
&lt;p&gt;Before the CID, one strategy to overcome the address change was to use the (D)TLS session ID to resume a session. That takes less message than a full handshake, but still additional messages.&lt;/p&gt;
&lt;p&gt;But &amp;quot;load balancer&amp;quot; is then something, which in many cases stops both, CID and session resumption, because the UDP load balancer will also be affected by the ip-address changes. And the nodes usually don&amp;#39;t share the DTLS contexts.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There some ideas to overcome that. One is to use multiple DNS entries and stick after the handshake to the chosen address. An other approach is more complex, &amp;quot;record forwarding&amp;quot; and I only know Eclipse/Californium (I&amp;#39;m one of the developers of that), which comes with such an implementation. And I still don&amp;#39;t know, if UDP loadbalancers are out, which would support routing by CID.&lt;/p&gt;
&lt;p&gt;(On more interest, you may read some pages at&amp;nbsp;&lt;a id="" href="https://github.com/eclipse-californium/californium/wiki"&gt;https://github.com/eclipse-californium/californium/wiki&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;What happens to CIDs if for example load balancer or server instances are restarted or scaled down?&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s focus on the &amp;quot;multiple DNS entries&amp;quot;. If a node crashes, it depends on your client to detect that. If the mobile network is healthy and no response nor ack is received, then a new DNS lookup and a new handshake is required. If a &amp;quot;down node&amp;quot; is chosen, the handshake times out and the client needs to check the next addresses.&lt;/p&gt;
&lt;p&gt;There are not that many implementations, which offers a DTLS graceful restart, I mainly know Eclipse/Californium. With that, a planed server update usually takes a few seconds. The most device will not recognize that at all and a few ones will need a normal CoAP retry.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571585?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2026 08:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53c9e0ab-5521-427d-98c7-354487102e9b</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi Tom,&lt;/p&gt;
&lt;p&gt;Regarding your second question there’s seems no conflict between PSM/eDRX and the CoAP client in the SDK.&lt;/p&gt;
&lt;p&gt;For client initiated CoAP without observe, that combination is fine in practice.&amp;nbsp;I tried settings close to yours on an nRF9151 and the network accepted PSM/eDRX and confirmable CoAP over DTLS completed normally. So you may run at your end however&amp;nbsp;if anything odd shows up, send logs and we’ll dig in. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571584?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2026 07:45:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a48b29c9-1739-4a0b-9937-3be0f9393519</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Hey Achim,&lt;/p&gt;
&lt;p&gt;thanks for your responses, this and the previous one.&amp;nbsp;&lt;/p&gt;
[quote userid="5203" url="~/f/nordic-q-a/129247/coap-with-dtls-on-nrf9151/571560"]&lt;p&gt;&amp;gt;&amp;nbsp;Our application will probably have to renew the socket regularly&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Why?&lt;/p&gt;[/quote]
&lt;p&gt;It might well be that my understanding of UDP sockets is not correct: Our application will have situations in which the socket will only be used every few hours, potentially even once a day. My assumption so far was that we cannot leave the socket open and inactive for long periods, because the cellular provider might close the session. Though, now that I am thinking about it, this might come down to how PSM and eDRX settings affect the session state. Do you have any insights and advice on how long the socket could remain open but inactive?&lt;/p&gt;
[quote userid="5203" url="~/f/nordic-q-a/129247/coap-with-dtls-on-nrf9151/571560"]&lt;p&gt;&amp;gt;&amp;nbsp;I am not yet sure if we will be able to use CID for session resumptions.&lt;/p&gt;
&lt;p&gt;CID is not related to session resumption. CID rather obsoletes session resumption in the most cases.&lt;/p&gt;[/quote]
&lt;p&gt;My wording is probably not correct, because this is the first time that I work with CoAP in-depth. My understanding is that the CoAP server and especially the load balancer need to be CID aware when multiple server instances are involved. I haven&amp;#39;t yet checked whether this is possible for us. Maybe you know this better: What happens to CIDs if for example load balancer or server instances are restarted or scaled down?&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571570?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2026 18:38:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:040e646b-2b72-460c-8f3e-f4ce01d1d5d5</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;If you provide an ip-capture/wireshark, we will see, what happens exactly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571563?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2026 16:24:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb1d0076-a95e-4063-8fb3-a484965596de</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi Tom,&lt;/p&gt;
&lt;p&gt;Good to know it worked.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;tested your pattern, TLS_SESSION_CACHE on a new DTLS socket, connect(), then coap_client_req close and repeat. However TLS_DTLS_HANDSHAKE_STATUS was&amp;nbsp;full on two connects, so&amp;nbsp;I did not see session resumption on my test server (not ThingsBoard). The cache option applies to DTLS like HTTPS, but I think resumption depends on the&amp;nbsp;server side&amp;nbsp;so I would suggest you&amp;nbsp;to try on your ThingsBoard.&lt;/p&gt;
&lt;p&gt;I am checking details about your second question and will get back to you&amp;nbsp;by tomorrow. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571560?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2026 15:13:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cb5d504-54d6-4e54-a7a4-1276391bf021</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;Our application will probably have to renew the socket regularly&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Why?&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;I am not yet sure if we will be able to use CID for session resumptions.&lt;/p&gt;
&lt;p&gt;CID is not related to session resumption. CID rather obsoletes session resumption in the most cases.&lt;/p&gt;
&lt;p&gt;The nasty point in Nordic&amp;#39;s DTLS modem implementation is, that the DTLS state is bound to the socket. If that socket closes, the state is usually gone. I don&amp;#39;t know, If there is a way to preserve it, but Nordic will know it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571546?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2026 12:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c611f516-117a-4444-807f-4163e90bc9f0</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Hey Syed,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks for the response. I just updated to NCS v3.4.1 and now confirmable requests work! Thanks!&lt;/p&gt;
&lt;p&gt;For the record and for the AI: CoAP with DTLS works when the socket is created, socket options for DTLS are applied and the socket is then connected manually. When using the CoAP client API, it is important to then pass NULL as the &amp;quot;addr&amp;quot; argument in the &amp;quot;coap_client_req()&amp;quot; method. This works on NCS v3.4.1.&lt;/p&gt;
&lt;p&gt;Furthermore I have two additional questions:&lt;/p&gt;
&lt;p&gt;1. Our application will probably have to renew the socket regularly and I am not yet sure if we will be able to use CID for session resumptions. For general TLS session resumption with HTTPS the following seems to work:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int32_t cache_enabled = 1;
err = setsockopt(
    fd, NRF_SOL_SECURE, NRF_SO_SEC_SESSION_CACHE, &amp;amp;cache_enabled, sizeof(cache_enabled));
if (err) {
	printk(&amp;quot;Failed to enable TLS session cache, err %d\n&amp;quot;, errno);
	return err;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Would this also apply to DTLS session resumption in the CoAP case?&lt;/p&gt;
&lt;p&gt;2. I was wondering how PSM and eDRX settings affect the inner workings of the CoAP client. We do not plan to use observe functionality. Would settings like&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# PSM
CONFIG_LTE_LC_PSM_MODULE=y
CONFIG_LTE_PSM_REQ=y
# PSM Periodic TAU (2 hours)
CONFIG_LTE_PSM_REQ_RPTAU=&amp;quot;00100010&amp;quot;
# PSM Active Time (22 seconds)
CONFIG_LTE_PSM_REQ_RAT=&amp;quot;00001011&amp;quot;
# eDRX
CONFIG_LTE_LC_EDRX_MODULE=y
CONFIG_LTE_EDRX_REQ=y
# eDRX Cycle: &amp;quot;0000&amp;quot; = 5.12 s, &amp;quot;0010&amp;quot; = 20.48 s
CONFIG_LTE_EDRX_REQ_VALUE_LTE_M=&amp;quot;0010&amp;quot;
CONFIG_LTE_EDRX_REQ_VALUE_NBIOT=&amp;quot;0010&amp;quot;
# Paging Time Window (PTW): &amp;quot;0011&amp;quot; = 5.12 s for LTE-M / 10.24 s for NB-IoT
CONFIG_LTE_PTW_VALUE_LTE_M=&amp;quot;0011&amp;quot;
CONFIG_LTE_PTW_VALUE_NBIOT=&amp;quot;0011&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;cause conflicts with the timeout and retry behavior of the CoAP client if the modem successfully negotiates them?&lt;/p&gt;
&lt;p&gt;Thanks again and best,&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571528?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2026 08:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e55ab751-63ee-4052-822a-c9b7c975a4f0</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi Tom,&lt;/p&gt;
&lt;p&gt;Thanks for the detailed CoAP debug log, it matches what we see here.&lt;/p&gt;
&lt;p&gt;On nRF9151 with your approach (DTLS, connect(), NULL address to coap_client_req()), we see the same behaviour on NCS v3.4.0 the request and response complete, then sending the empty ACK fails (Error sending a CoAP ACK-message, -106 in the callback). The same application on NCS v3.4.1 works without that error.&lt;/p&gt;
&lt;p&gt;Your tests with non-confirmable requests fit this, that path does not hit the same ACK handling. This does not indicate that confirmable CoAP is unsupported on the modem, I think it points to a CoAP client issue on v3.4.0 when acknowledging a confirmable response on a connected DTLS socket. So recommendation is to move to NCS v3.4.1. Do let me know if it runs without error on it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571518?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2026 06:24:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b26eb7dc-7797-4627-b45b-b80fc0e3b546</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;-106 =&amp;gt;&amp;nbsp;#define EAFNOSUPPORT 106&amp;nbsp; &amp;nbsp; /* Address family not supported by protocol family */&lt;/p&gt;
&lt;p&gt;I would check the &amp;quot;dest_addr&amp;quot;, &amp;quot;addrlen&amp;quot; parameters.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;I am wondering if the modem rejects that specific message for some reason.&lt;/p&gt;
&lt;p&gt;I never recognized that in all the years (sending a couple 10.000 ACKs).&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;When using a non-confirmable request, no errors occur. I&amp;#39;ve confirmed this with GET and POST requests. Data is read from and written to Thingsboard successfully.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s more a indirect effect. ThingsBoard uses a &amp;quot;Separate Response&amp;quot;, a &amp;quot;Piggybacked Response&amp;quot; would work without such an &amp;quot;ACK for Response&amp;quot;.&lt;/p&gt;
&lt;p&gt;Also not sure, if you want to use observe/notify and therefore the Responses (Notification) may be sent as CON (from time to time to check the interest). In my experience, NATs makes observe/notify pretty frequently useless. We discussed that years ago in the IETF core list.&lt;/p&gt;
&lt;p&gt;In the end, if your client is designed for &amp;quot;very low energy consumption&amp;quot;, it will frequently sleep for long. Depending on your network setup, that may already cause ip-address changes and usually makes observe/notify not longer working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571491?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2026 13:22:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26010b53-b206-4765-88f7-b0d613e0ee3e</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;I&amp;#39;ve found time to trouble-shoot this more and I think the CoAP library debug logs might reveal where the problem lies. With the request set to confirmable, the log seems to show that the request is successfully transmitted, the response successfully received, but the acknowledgement cannot be returned:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:07.596,099] &amp;lt;inf&amp;gt; coaps: IPv4 Address found 3.127.76.36
[00:00:07.596,405] &amp;lt;inf&amp;gt; coaps: sa_family = 1
[00:00:10.778,137] &amp;lt;dbg&amp;gt; net_coap: coap_client_req: Request is_observe 0
[00:00:10.778,198] &amp;lt;dbg&amp;gt; net_coap: send_request: Send CoAP Request:
                                   REDACTED_TO_HIDE_ACCESS_TOKEN 
[00:00:10.779,632] &amp;lt;inf&amp;gt; main_app: waiting
[00:00:11.101,684] &amp;lt;dbg&amp;gt; net_coap: receive: Receive CoAP Response:
                                   48 45 0c 6e 2b 8a 67 c9  42 04 52 63 c1 32 ff 7b |HE.n+.g. B.Rc.2.{
                                   22 73 68 61 72 65 64 22  3a 7b 22 73 64 6c 43 6f |&amp;quot;shared&amp;quot; :{&amp;quot;sdlCo
                                   6e 66 69 67 54 73 22 3a  36 7d 7d                |nfigTs&amp;quot;: 6}}     
[00:00:11.101,715] &amp;lt;dbg&amp;gt; net_coap: recv_response: Received 43 bytes
[00:00:11.101,745] &amp;lt;dbg&amp;gt; net_coap: send_request: Send CoAP Request:
                                   60 00 0c 6e                                      |`..n             
[00:00:11.101,776] &amp;lt;err&amp;gt; net_coap: Error sending a CoAP ACK-message
[00:00:11.101,806] &amp;lt;inf&amp;gt; main_app: Response received with error code: -106
[00:00:11.101,837] &amp;lt;inf&amp;gt; main_app: sleeping
[00:00:11.101,898] &amp;lt;err&amp;gt; net_coap: Error handling response
[00:00:13.669,830] &amp;lt;dbg&amp;gt; net_coap: receive: Receive CoAP Response:
                                   48 45 0c 6e 2b 8a 67 c9  42 04 52 63 c1 32 ff 7b |HE.n+.g. B.Rc.2.{
                                   22 73 68 61 72 65 64 22  3a 7b 22 73 64 6c 43 6f |&amp;quot;shared&amp;quot; :{&amp;quot;sdlCo
                                   6e 66 69 67 54 73 22 3a  36 7d 7d                |nfigTs&amp;quot;: 6}}     
[00:00:13.669,860] &amp;lt;dbg&amp;gt; net_coap: recv_response: Received 43 bytes
[00:00:13.669,921] &amp;lt;dbg&amp;gt; net_coap: send_request: Send CoAP Request:
                                   60 00 0c 6e                                      |`..n             
[00:00:13.669,921] &amp;lt;err&amp;gt; net_coap: Error sending a CoAP ACK-message
[00:00:13.669,952] &amp;lt;inf&amp;gt; main_app: Response received with error code: -106
[00:00:13.669,952] &amp;lt;err&amp;gt; net_coap: Error handling response&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When using a non-confirmable request, no errors occur. I&amp;#39;ve confirmed this with GET and POST requests. Data is read from and written to Thingsboard successfully.&lt;/p&gt;
&lt;p&gt;After having a look at the library&amp;#39;s code where this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static int send_ack(int sock_fd, const struct net_sockaddr *addr, net_socklen_t addrlen,
		    const struct coap_packet *req, uint8_t response_code)
{
	int ret;
	struct coap_packet ack;
	uint8_t ack_buf[COAP_FIXED_HEADER_SIZE + COAP_TOKEN_MAX_LEN];

	ret = coap_ack_init(&amp;amp;ack, req, ack_buf, sizeof(ack_buf), response_code);
	if (ret &amp;lt; 0) {
		LOG_ERR(&amp;quot;Failed to initialize CoAP ACK-message&amp;quot;);
		return ret;
	}

	ret = send_request(sock_fd, ack.data, ack.offset, 0, addr, addrlen);
	if (ret &amp;lt; 0) {
		LOG_ERR(&amp;quot;Error sending a CoAP ACK-message&amp;quot;);
		return ret;
	}

	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;seems to produce the error message, because this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static int send_request(int sock, const void *buf, size_t len, int flags,
			const struct net_sockaddr *dest_addr, net_socklen_t addrlen)
{
	int ret;

	LOG_HEXDUMP_DBG(buf, len, &amp;quot;Send CoAP Request:&amp;quot;);
	if (addrlen == 0) {
		ret = zsock_sendto(sock, buf, len, flags, NULL, 0);
	} else {
		ret = zsock_sendto(sock, buf, len, flags, dest_addr, addrlen);
	}

	return ret &amp;gt;= 0 ? ret : -errno;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;throws the error when trying to write the ACK (&amp;quot;60 00 0c 6e&amp;quot;) to the socket, I am wondering if the modem rejects that specific message for some reason. I think that this is not a general socket issue, because I can reuse the socket for multiple following requests successfully. It just seems to reject only the ACK.&lt;/p&gt;
&lt;p&gt;Do you have an idea why this happens? Are confirmable packets not supported via the modem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571470?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2026 09:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8834c3c-a7c4-4fed-98af-28ae8d8f87ba</guid><dc:creator>Tom01</dc:creator><description>&lt;p&gt;Hi Syed,&lt;/p&gt;
&lt;p&gt;thanks for trying out the sample! I&amp;#39;m using modem firmware v2.0.4.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One more thing that might cause the 106 errors inside the callback, is the path length of the request. Because of the API structure and the access token, the path is 62 characters long in this particular case. I&amp;#39;m not sure if this might be an issue, but just for the sake of completeness, here are the CoAP settings I use:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_COAP=y
CONFIG_COAP_CLIENT=y
CONFIG_COAP_CLIENT_THREAD_PRIORITY=10
CONFIG_COAP_CLIENT_MESSAGE_SIZE=512
CONFIG_COAP_CLIENT_MESSAGE_HEADER_SIZE=128
CONFIG_COAP_CLIENT_MAX_PATH_LENGTH=128&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Tom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CoAP with DTLS on nRF9151</title><link>https://devzone.nordicsemi.com/thread/571469?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2026 09:43:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcd6b691-87ec-463b-8fe3-3361c3036050</guid><dc:creator>Syed Maysum Abbas Zaidi</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for reaching out.&lt;/p&gt;
&lt;p&gt;I am trying out on my end and will get back to you soon. Although not very important, can you share the modem firmware version you are using?&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;br /&gt;Syed Maysum&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>