<?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>DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47019/dtls-psk-coap-client</link><description>Hello, 
 we try to add DTLS to the CoAP client example . We have problems with the DTLS connection. The handshake with PSK works. The first CON or NON query works also without problems. (See on the attached picture) However, the following requests can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Oct 2021 08:41:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47019/dtls-psk-coap-client" /><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/335421?ContentTypeID=1</link><pubDate>Fri, 22 Oct 2021 08:41:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45490985-7a81-4431-8176-66c8c6eb5661</guid><dc:creator>ced27</dc:creator><description>&lt;p&gt;Hi Dennis,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i am trying to add dtls to coap client, please can you help me with some advise on how to go about it. I am really stuck right now.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Cedric&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/205471?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2019 08:24:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:170b0ade-a957-41e7-bf07-6652b91a1629</guid><dc:creator>Giang</dc:creator><description>&lt;p&gt;Hi Dennis ,&lt;/p&gt;
&lt;p&gt;Can you give me some advise about how to add dtls library to simple_coap_client or server ?&lt;/p&gt;
&lt;p&gt;Thank !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/204896?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 05:20:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39510f1b-4e9d-4c0c-be36-e0e1285eacf7</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;i was able to implement the new coap library into our project now. During a short test there were no problems and also no memory overflows. The updated library solved my problems, thanks.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/196619?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 14:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20de1cb2-9fc5-46e4-9073-e708286fec26</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;i was already notified this morning by Thomas that the new version is available. So I tried my code directly. Unfortunately I had to adjust some things to make it work with the new version (I used version v0.4.0 before). The CoAP library seems to have been completely revised. This also changed the API. So a migration &lt;span&gt;is not possible so easily. Because of this I c&lt;/span&gt;urrently use the old coap library. The first look at the reworked coap library suggests that the problems have been fixed.&lt;/p&gt;
&lt;p&gt;I also updated the modem firmware to 1.0.0. unfortunately i had more problems with connecting via nb-iot during the day than with the old firmware. Sometimes i had to reboot the board 2 times until it was able to establish the connection. But it could also be due to the base station...&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/196576?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2019 13:31:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8cc6d66-892a-4a30-99c7-cf52947cfec5</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Dennis,&lt;br /&gt;I am sincerely sorry for the delay.&lt;br /&gt;&lt;br /&gt;I suppose that there are some updates regarding this issue?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/49264/unable-to-update-firmware-on-nrf9160/196300#196300" rel="noopener noreferrer" target="_blank"&gt;I would like you to upgrade to v1.0.0 if you already haven&amp;#39;t which has introduced a lot of fixes.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/187438?ContentTypeID=1</link><pubDate>Thu, 16 May 2019 08:05:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b99db7e-5847-4740-b7f1-c5b2bfbbd1bc</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;I have logged the dynamic memory allocation of the coap client and displayed it in an Excel table.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="539" src="https://devzone.nordicsemi.com/resized-image/__size/532x673/__key/communityserver-discussions-components-files/4/malloc_5F00_free.PNG" width="426" /&gt;&lt;/p&gt;
&lt;p&gt;as you can see not all allocated memory areas are released again. Is there a function in the coab lib that releases the memory or can a variable be set that releases the memory after use?&lt;/p&gt;
&lt;p&gt;I have already written a function that allocates the memory. This function is passed with the function coap_init(). I use a buffer according to the FIFO principle which automatically releases the oldest memory area. An empty function was passed as free function, because the memory is now released automatically. This method works without problems so far. &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/187326?ContentTypeID=1</link><pubDate>Wed, 15 May 2019 15:05:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7966db1e-47ee-4f57-95e3-83044cdc054a</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;i have already set the varable CONFIG_HEAP_MEM_POOL_SIZE=16384 in the prj.conf. As I understand it, 16384 is the largest possible number (see: &lt;a href="https://docs.zephyrproject.org/latest/reference/kernel/memory/heap.html?highlight=heap%20malloc"&gt;zephyr_doc&lt;/a&gt;). Also increasing the CONFIG_MAIN_STACK_SIZE did not bring any improvement.&amp;nbsp;After the successful exchange of several coap messages, the function coap_message_new from the library returns the error code 12.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/187280?ContentTypeID=1</link><pubDate>Wed, 15 May 2019 13:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9443cce0-338c-457c-89e8-21dc0f4e20a6</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Dennis,&lt;/p&gt;
&lt;p&gt;Great work that you found out the issue.&lt;/p&gt;
&lt;p&gt;Could you try to increase the memory in the prj.conf file?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-e315ea1399b04790b11ee9ce30f67cc8/pastedimage1557925834259v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/187172?ContentTypeID=1</link><pubDate>Wed, 15 May 2019 09:16:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4c2ee90-f54d-4c6d-86bc-0af2e6577c9b</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;after long debunging sessions i found out how to get the coap client to run with dtls:&lt;/p&gt;
&lt;p&gt;If the parameter &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/reference/kconfig/CONFIG_NRF_COAP_PORT_COUNT.html"&gt;CONFIG_NRF_COAP_PORT_COUNT&lt;/a&gt; is set to 0 (the default value is 1), it is possible to exchange more than one data using dtls + coap.&lt;/p&gt;
&lt;p&gt;But now I&amp;#39;ve got a new problem:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="79" src="https://devzone.nordicsemi.com/resized-image/__size/800x120/__key/communityserver-discussions-components-files/4/allocation_5F00_failed.PNG" width="658" /&gt;&lt;/p&gt;
&lt;p&gt;After the successful exchange of several coap messages, the function coap_message_new from the library returns the error code 12 (Not enough core) when creating a new get request message (because no new memory can be allocated). Even a longer wait and a new coap_message_new() request throw this error. Only a complete restart can solve the problem!&lt;/p&gt;
&lt;p&gt;How can I solve this problem, without making a restart? Do I have to provide my own function for allocating the memory and empty this pool accordingly or is there a better solution?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/187115?ContentTypeID=1</link><pubDate>Wed, 15 May 2019 06:06:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25f0f711-89e5-4cd2-a6f1-5f8550b43527</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Dennis,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it possible for you to share the capture file and PSK so we could analyze it?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(We can make this case private if there is some sensitive information.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/187082?ContentTypeID=1</link><pubDate>Tue, 14 May 2019 20:21:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5316132-af6a-4855-b054-a8686072b818</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Just, if it&amp;#39;s possible:&lt;/p&gt;
&lt;p&gt;Can you capture without decrypting the dtls records?&lt;/p&gt;
&lt;p&gt;If &amp;quot;e958...&amp;quot; is the raw/encrypted &amp;quot;fragment&amp;quot; (part after the length field, see RFC6347, 4.3.1) of dtls record and your using TLS_PSK_WITH_AES_128_CCM_8 then the record seems to be wrong, it should start with the &amp;quot;epoch:seqn&amp;quot; . May be you can show the working records also without decryption.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/186211?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 13:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afca9896-2509-4a08-8716-2174c1ce9a39</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hi Martin&lt;/p&gt;
&lt;p&gt;ah, now I get it &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f606.svg" title="Laughing"&gt;&amp;#x1f606;&lt;/span&gt;. Yes I am using version 3.0.1&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/186205?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 13:05:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69fc991a-f699-4d5b-8367-38127d8a8792</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Dennis,&lt;br /&gt;I was talking about the latest stable Wireshark version 3.0.x.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/186191?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 12:49:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79d0796a-63b9-44cc-91c8-50619547103a</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;&lt;em&gt;# If both connections use the same PSK, then this could be a Wireshark issue.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately, I can&amp;#39;t follow them mentally. As I already wrote Wireshark is able to decrypt all messages even after the first data exchange during a test setup from Californium DTLS Server + Californium DTLS Client. So the function PSK decryption with Wireshark works without problme. That&amp;#39;s why it shouldn&amp;#39;t be a problem for Wireshark, or should it? When using the nRF9160 Modem + Californium DTLS Server, the message cannot be decrypted after the first data exchange (see Wireshark screenshot).&lt;em&gt; The 18.197.48.88 ip is the nRF9160 DK.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;# I cannot see which version you are using, but I would recommend either way to update to the latest 3.0 release to see if that makes a difference.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Do you mean version v0.3.0? -&amp;gt; if yes: i&amp;#39;ve already written above that i used version v0.4.0-c1 and other untagged versions. &lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I think version &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/tree/v0.3.0/subsys/net/lib"&gt;0.3.0&lt;/a&gt; doesn&amp;#39;t fully support coap. (the coap files don&amp;#39;t exist - compare with &lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/tree/v0.4.0-rc1/subsys/net/lib"&gt;v0.4.0-rc1&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/186175?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 12:19:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95acd812-53f6-484e-afa3-0bda7faacea0</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Dennis,&lt;/p&gt;
&lt;p&gt;If both connections use the same PSK, then this could be a Wireshark issue.&lt;/p&gt;
&lt;p&gt;I cannot see which version you are using, but I would recommend either way to update to the latest 3.0 release to see if that makes a difference.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;br /&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/186058?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 05:49:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3ceb249-4c47-4bc9-8265-4c7e44bce427</guid><dc:creator>[Stihl] Dennis</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;we have also tested the code with the latest firmware. The program still has the same behavior.&lt;/p&gt;
&lt;p&gt;One indicator for the behavior of the program is that it hangs after the first data exchange. (See timestamp between package 15 and 16 in Wireshark screenshot)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Dennis B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DTLS PSK CoAP Client</title><link>https://devzone.nordicsemi.com/thread/186009?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 14:23:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf943058-6e3e-40b5-a180-436550167306</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Dennis,&lt;br /&gt;Are you using the newest modem firmware?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if not, please upgrade:&amp;nbsp;&lt;a href="https://www.nordicsemi.com/Products/Low-power-cellular-IoT/nRF9160/Download#infotabs"&gt;https://www.nordicsemi.com/Products/Low-power-cellular-IoT/nRF9160/Download#infotabs&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I would need some more time to look into this, since there is nothing that comes to my mind right away.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your patience.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>