<?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>OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86632/openthread-and-mqtt-over-tls-is-single-program</link><description>Hi, I use nrf52840 processor with esp32c3 as WiFi modem. I need to run OpenThread network and MQTT client on these processors. When I run only OpenThread network, it works correctly. When I run only MQTT client via WiFi, it works correctly too. But when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Apr 2022 17:49:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86632/openthread-and-mqtt-over-tls-is-single-program" /><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/364536?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 17:49:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecf198d7-2c9f-4874-bfd6-fd32f3dd7e57</guid><dc:creator>Grzegorz Blach</dc:creator><description>&lt;p&gt;Ok, I got it.&lt;/p&gt;
&lt;p&gt;I need to enable &lt;a href="https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MBEDTLS_CIPHER_MODE_CBC_ENABLED"&gt;CONFIG_MBEDTLS_CIPHER_MODE_CBC_ENABLED&lt;/a&gt;, because it defaults to y only if !&lt;span class="pre"&gt;CONFIG_NET_L2_OPENTHREAD.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="pre"&gt;Now I have OpenThread and encrypted MQTT working in single program.&lt;br /&gt;&lt;br /&gt;Thanks you for your help.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/364508?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 14:02:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c85aafd5-77e1-4df6-9032-7eac5c5a1e8d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have not been able to find a lot more about this quite yet.&lt;br /&gt;As you say, it is hard to reproduce for me, as I do not have an esp32c3.&lt;/p&gt;
&lt;p&gt;When looking around, I found a couple of other forums &lt;a href="https://tls.mbed.org/discussions/crypto-and-ssl/mbedtls_ssl_handshake-failed-in-ret-code-7780"&gt;[1]&lt;/a&gt;, &lt;a href="https://forums.mbed.com/t/error-0x7780-during-handshake/6883"&gt;[2]&lt;/a&gt; saying error 7780(&lt;a href="https://github.com/Mbed-TLS/mbedtls/blob/60d83f012687371998c826cb499397890079424b/include/mbedtls/ssl.h#L92"&gt;MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE&lt;/a&gt;) is due to refusal on the peer side.&lt;br /&gt;Are you able to get some logs from the peers showing why they refuse the connection?&lt;/p&gt;
&lt;p&gt;The weird thing here is that you say it works without OpenThread.&lt;br /&gt;OpenThread is closely connect to the crytpo libraries, so this may be related somehow.&lt;br /&gt;Have a look at &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/ug_thread_configuring.html#hardware-accelerated-cryptography"&gt;Hardware-accelerated cryptography&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;For our old nRF SDK for Thread and Zigbee, we had documentation on &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.2.0%2Fthread_openthread_libraries.html&amp;amp;anchor=thread_openthread_libraries_mandatory_nrfsecurity"&gt; Mandatory Mbed TLS library&lt;/a&gt;, and that thread libraries include some of mbedTLS. Keep in mind that this is for the old SDK, and might not be as relevant for the nRF Connect SDK. &lt;br /&gt;I am looking for similar documentation for the nRF Connect SDK, but have not found it yet.&lt;/p&gt;
&lt;p&gt;This is all I got for now, but I will continue looking around a bit.&lt;br /&gt;Let me know if you have found anything in the meantime.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/363687?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 16:30:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b835ff1-19d9-41df-8b00-dabeaafe1a64</guid><dc:creator>Grzegorz Blach</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve applied &lt;a href="https://gist.github.com/gblach/0ded70435ca190f47dedeacbd3da7812"&gt;this small patch&lt;/a&gt; and cleared &lt;span class="blob-code-inner blob-code-marker js-code-nav-pass "&gt;NET_IF_IPV6&lt;/span&gt; flag on default interface. Now I have&amp;nbsp;working OpenThread and unencrypted MQTT in single program. But when I&amp;#39;ve tried to enable encryption for MQTT communication I still get this error:&lt;/p&gt;
&lt;p&gt;&amp;lt;err&amp;gt; net_sock_tls: TLS handshake error: -7780&lt;br /&gt;&amp;lt;err&amp;gt; net_sock: invalid access on sock 0 by thread 0x2000137&lt;/p&gt;
&lt;p&gt;Do you have any idea where should I look to solve this problem?&lt;/p&gt;
&lt;p&gt;Unfortunately it is impossible to reproduce this error without having esp32c3 connected to nrf52840dk. I&amp;#39;m guessing you don&amp;#39;t have appropriate device, do you?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/363200?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2022 12:55:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b02531d1-5d1c-41b4-8ef0-e7eccc429a40</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Since you enabled the nrf52840dk, I were able to load your project into VS Code and debug it,&lt;br /&gt;So I have found the issue, but not a fix for it yet.&lt;/p&gt;
&lt;p&gt;When the code tries to get a socket/context from the offloaded IP stack at &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/240c7b9a691f6bcee824d1b26a40a368a916bb05/subsys/net/ip/net_context.c#L331"&gt;zephyr/subsys/net/ip/net_context.c:331&lt;/a&gt;, it will call the esp_get function from &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/drivers/wifi/esp_at/esp_offload.c#L597"&gt;zephyr/drivers/wifi/esp_at/esp_offload.c:597&lt;/a&gt;. This function returns&amp;nbsp; &lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__system__errno.html#ga4c3a793b4d51cb7dd020af92e536fe21"&gt;EAFNOSUPPORT&lt;/a&gt; (error 106), and the coap fails to create the socket.&lt;/p&gt;
&lt;p&gt;You can also see a fixme in net_context.c, which is likely what causes the issue:&lt;br /&gt;&amp;quot;&lt;br /&gt; /* FIXME - Figure out a way to get the correct network interface&lt;br /&gt; * as it is not known at this point yet.&lt;br /&gt; */&lt;br /&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;I hope this helps you some.&lt;/p&gt;
&lt;p&gt;We here on support will he at vacation the rest of the Easter. &lt;br /&gt;If you want some more help, update me sometime next week and let me know if you found anything. Then I will have another look.&lt;/p&gt;
&lt;p&gt;Happy Easter! Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/362795?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2022 09:52:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee6d47dc-8eb4-40fa-8397-f99cca972c77</guid><dc:creator>Grzegorz Blach</dc:creator><description>&lt;p&gt;I didn&amp;#39;t found any other options other than CONFIG_WIFI_ESP_AT that cause this issue. But I found -EAFNOSUPPORT cames from &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/04696829d7da967e384c6330e8191074162183fd/drivers/wifi/esp_at/esp_offload.c#L608"&gt;drivers/wifi/esp_at/esp_offload.c:608&lt;/a&gt; because family variable has the same value that I pass to &lt;a href="https://github.com/Whirla/whbr_demos/blob/bbb47a3df8d1d8e4315016742bbda5916d95b36f/whbr_ot_coap/src/openthread.c#L67"&gt;coap_init()&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve added &lt;a href="https://github.com/Whirla/whbr_demos/blob/main/whbr_ot_coap/boards/nrf52840dk_nrf52840.overlay"&gt;/boards/nrf52840dk_nrf52840.overlay&lt;/a&gt; to OpenThread only sample, so you can reproduce this issue on nrf52840dk. You don&amp;#39;t need to have esp32c3 connected, because it is not used by this program, only driver is enabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="106736" url="~/f/nordic-q-a/86632/openthread-and-mqtt-over-tls-is-single-program/362616#362616"]When you send CoAP messages over OpenThread, where do you send the data to? (another node in the network, or an external server)[/quote]
&lt;p&gt;I&amp;#39;m trying to send data to another node in the same OT network.&lt;/p&gt;
[quote userid="106736" url="~/f/nordic-q-a/86632/openthread-and-mqtt-over-tls-is-single-program/362616#362616"]Is IPv6 still supported after you select CONFIG_WIFI_ESP_AT&lt;strong&gt;?&lt;/strong&gt;[/quote]
&lt;p&gt;&amp;quot;net iface&amp;quot; command shows that OpenThread interface has assigned seven IPv6 addresses:&lt;/p&gt;
&lt;p&gt;rtt:~$ net iface&lt;br /&gt;&lt;br /&gt;Interface 0x20000a08 (IP Offload) [1]&lt;br /&gt;=====================================&lt;br /&gt;Interface is down.&lt;br /&gt;&lt;br /&gt;Interface 0x20000a14 (OpenThread) [2]&lt;br /&gt;=====================================&lt;br /&gt;Link addr : F4:CE:36:EF:04:8D:D0:E1&lt;br /&gt;MTU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 1280&lt;br /&gt;Flags&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : AUTO_START,IPv4,IPv6&lt;br /&gt;IPv6 unicast addresses (max 6):&lt;br /&gt;&amp;nbsp; fd04:93c0:e52a:0:fa7d:45d:d6e:95ca autoconf preferred infinite meshlocal&lt;br /&gt;&amp;nbsp; fe80::b8e9:def7:b096:806c autoconf preferred infinite&lt;br /&gt;IPv6 multicast addresses (max 8):&lt;br /&gt;&amp;nbsp; ff33:40:fd04:93c0:e52a::1&lt;br /&gt;&amp;nbsp; ff32:40:fd04:93c0:e52a::1&lt;br /&gt;&amp;nbsp; ff02::1&lt;br /&gt;&amp;nbsp; ff03::1&lt;br /&gt;&amp;nbsp; ff03::fc&lt;br /&gt;&amp;nbsp; ff02::2&lt;br /&gt;&amp;nbsp; ff03::2&lt;br /&gt;IPv6 prefixes (max 2):&lt;br /&gt;&amp;nbsp; &amp;lt;none&amp;gt;&lt;br /&gt;IPv6 hop limit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 64&lt;br /&gt;IPv6 base reachable time : 30000&lt;br /&gt;IPv6 reachable time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 23751&lt;br /&gt;IPv6 retransmit timer&amp;nbsp;&amp;nbsp;&amp;nbsp; : 0&lt;br /&gt;IPv4 unicast addresses (max 1):&lt;br /&gt;&amp;nbsp; &amp;lt;none&amp;gt;&lt;br /&gt;IPv4 multicast addresses (max 1):&lt;br /&gt;&amp;nbsp; &amp;lt;none&amp;gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/362616?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2022 13:07:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d18d2372-9aa8-48ae-9658-8a71c84e4ee0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I did try the configuration which I was able to build for with our coap server+client samples, and I were not able to reproduce this yet.&lt;/p&gt;
&lt;p&gt;I were able to build fine with CONFIG_WIFI, but CONFIG_WIFI_ESP_AT does not work for me.&lt;br /&gt;Therefore, I tried to set different configurations selected by &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_WIFI_ESP_AT.html#std-kconfig-CONFIG_WIFI_ESP_AT"&gt;CONFIG_WIFI_ESP_AT&lt;/a&gt; manually, but did not fine the problematic one.&lt;/p&gt;
&lt;p&gt;You could test some configurations set by of &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_WIFI_ESP_AT.html#std-kconfig-CONFIG_WIFI_ESP_AT"&gt;CONFIG_WIFI_ESP_AT&lt;/a&gt;, to find which specific config causes the error? (iterate trough the &amp;quot;&amp;quot;config selected by&amp;quot;-tree&amp;quot;)&lt;/p&gt;
&lt;p&gt;When you send CoAP messages over OpenThread, where do you send the data to? (another node in the network, or an external server)&lt;/p&gt;
&lt;p&gt;From &lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__system__errno.html"&gt;zephyr errno&lt;/a&gt;, 106 looks like &lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__system__errno.html#ga4c3a793b4d51cb7dd020af92e536fe21"&gt;EAFNOSUPPORT&lt;/a&gt;, which means that the address family is not supported. &lt;br /&gt;Is IPv6 still supported after you select CONFIG_WIFI_ESP_AT&lt;strong&gt;?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/362431?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 16:28:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38615008-a0f6-49ca-a650-999c1859d542</guid><dc:creator>Grzegorz Blach</dc:creator><description>&lt;p&gt;When I added these options to the OpenThread only sample, it still works:&lt;/p&gt;
&lt;p&gt;CONFIG_OPENTHREAD_MBEDTLS_CHOICE=y&lt;br /&gt;CONFIG_MBEDTLS=y&lt;br /&gt;CONFIG_MBEDTLS_BUILTIN=y&lt;br /&gt;CONFIG_MBEDTLS_TLS_VERSION_1_2=y&lt;br /&gt;CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED=y&lt;br /&gt;CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED=y&lt;br /&gt;CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED=y&lt;/p&gt;
&lt;p&gt;But it stops working when I also added these two options:&lt;/p&gt;
&lt;p&gt;CONFIG_WIFI=y&lt;br /&gt;CONFIG_WIFI_ESP_AT=y&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/362382?ContentTypeID=1</link><pubDate>Thu, 07 Apr 2022 13:49:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7022967a-d066-47e6-bf92-5311c2703151</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;It could be that there are some problems in adding mbedtls to OpenThread.&lt;/p&gt;
&lt;p&gt;Maybe &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/nrf/ug_thread_configuring.html#hardware-accelerated-cryptography"&gt;Openthread and MBEDTLS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Try to enable MBEDTLS in the OpenThread only sample, to see if it still works?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/362092?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 12:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:760f40c1-4b19-4079-8979-efa7b16ef817</guid><dc:creator>Grzegorz Blach</dc:creator><description>&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span class="Q4iAWc"&gt;I tried to set CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS to 2 and to 10, but that didn&amp;#39;t change anything.&lt;/span&gt;&lt;/span&gt; &lt;span class="JLqJ4b ChMk0b"&gt;&lt;span class="Q4iAWc"&gt;I still have the same two errors.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OpenThread and MQTT over TLS is single program.</title><link>https://devzone.nordicsemi.com/thread/362067?ContentTypeID=1</link><pubDate>Wed, 06 Apr 2022 11:48:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11c99d98-235e-42ee-a28f-baafd729dd88</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Grzegorz,&lt;/p&gt;
&lt;p&gt;Could the solution be as simple as adding more available sockets by increasing &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS.html#std-kconfig-CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS"&gt;CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>