<?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>Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86933/azure-iot-hub-library-with-openthread</link><description>Hello Everyone, 
 We are working on a new product using the nrf52840 and OpenThread.Our current product uses the Azure IoT Hub and we were wondering if we could use the library used by the nrf91. 
 According to Didrik in a post on Devzone It should be</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Feb 2025 16:05:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86933/azure-iot-hub-library-with-openthread" /><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/524888?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 16:05:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a71739b-c010-4e13-a85c-1d69edd5bf37</guid><dc:creator>NYCdream</dc:creator><description>&lt;p&gt;Hello fhfs,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We are scoping a project where&amp;nbsp; IIOT devices on a thread network reports their data to Azure IOT hub using MQTT.&amp;nbsp; &amp;nbsp;Were you able to successfully deploy your solution using Thread and Azure?&amp;nbsp; &amp;nbsp;Any suggestions or ideas?&amp;nbsp; Is this practical?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/405039?ContentTypeID=1</link><pubDate>Mon, 16 Jan 2023 13:05:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5626a3cb-1895-4f12-8bee-991499e4ad38</guid><dc:creator>SebastianCorin</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/fhfs"&gt;fhfs&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;would you mind to share a working example I can build on?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best&lt;/p&gt;
&lt;p&gt;Sebastian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/378642?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 08:08:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bdea147-3d4c-4494-bfee-89c5ec4ab95e</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;I copied this from a MBedTLS config for Azure IoT Hub and modified some defines.&lt;pre class="ui-code" data-mode="text"&gt;/*! Size optimized TLS config to connect to Azure IoT Hub using RSA X.509 Certificates */

/* Platform has time function to provide time for certificates verifications */
// #ifndef TOOLCHAIN_ARM // Please set to 1 if you are using secure time
#ifndef MBEDTLS_HAVE_TIME
#define MBEDTLS_HAVE_TIME
#endif // MBEDTLS_HAVE_TIME

#ifndef MBEDTLS_HAVE_TIME_DATE
#define MBEDTLS_HAVE_TIME_DATE
#endif // MBEDTLS_HAVE_TIME_DATE

#ifndef MBEDTLS_PLATFORM_TIME_ALT
#define MBEDTLS_PLATFORM_TIME_ALT
#endif // MBEDTLS_PLATFORM_TIME_ALT

/* System support */
#ifndef MBEDTLS_HAVE_ASM
#define MBEDTLS_HAVE_ASM
#endif // MBEDTLS_HAVE_ASM
// #endif
/* mbed TLS feature support */
#ifndef MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#endif // MBEDTLS_ECP_DP_SECP256R1_ENABLED

#ifndef MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_ECP_NIST_OPTIM
#endif // MBEDTLS_ECP_NIST_OPTIM

#ifndef MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
#endif // MBEDTLS_SSL_MAX_FRAGMENT_LENGTH

#ifndef MBEDTLS_SSL_PROTO_TLS1_2
#define MBEDTLS_SSL_PROTO_TLS1_2
#endif // MBEDTLS_SSL_PROTO_TLS1_2

#ifndef MBEDTLS_SSL_EXPORT_KEYS
#define MBEDTLS_SSL_EXPORT_KEYS
#endif // MBEDTLS_SSL_EXPORT_KEYS

/* mbed TLS modules */
#ifndef MBEDTLS_AES_C
#define MBEDTLS_AES_C
#endif // MBEDTLS_AES_C

/* Disable some of the speed optimizations on AES code to save
 * ~6200 bytes of ROM. According to comments on the mbedtls PR 394,
 * the speed on Cortex M4 is not even reduced by this. */
#ifndef MBEDTLS_AES_FEWER_TABLES
#define MBEDTLS_AES_FEWER_TABLES
#endif // MBEDTLS_AES_FEWER_TABLES

#ifndef MBEDTLS_BIGNUM_C
#define MBEDTLS_BIGNUM_C
#endif // MBEDTLS_BIGNUM_C

#ifndef MBEDTLS_CIPHER_C
#define MBEDTLS_CIPHER_C
#endif // MBEDTLS_CIPHER_C

#ifndef MBEDTLS_CTR_DRBG_C
#define MBEDTLS_CTR_DRBG_C
#endif // MBEDTLS_CTR_DRBG_C

#ifndef MBEDTLS_ECP_C
#define MBEDTLS_ECP_C
#endif // MBEDTLS_ECP_C

#ifndef MBEDTLS_ENTROPY_C
#define MBEDTLS_ENTROPY_C
#endif // MBEDTLS_ENTROPY_C

#ifndef MBEDTLS_MD_C
#define MBEDTLS_MD_C
#endif // MBEDTLS_MD_C

#ifndef MBEDTLS_OID_C
#define MBEDTLS_OID_C
#endif // MBEDTLS_OID_C

#ifndef MBEDTLS_PK_C
#define MBEDTLS_PK_C
#endif // MBEDTLS_PK_C

#ifndef MBEDTLS_PK_PARSE_C
#define MBEDTLS_PK_PARSE_C
#endif // MBEDTLS_PK_PARSE_C

#ifndef MBEDTLS_SHA256_C
#define MBEDTLS_SHA256_C
#endif // MBEDTLS_SHA256_C

// Disable the speed optimizations of SHA256, makes binary size smaller
// on Cortex-M by 1800B with ARMCC5 and 1384B with GCC 6.3.
#ifndef MBEDTLS_SHA256_SMALLER
#define MBEDTLS_SHA256_SMALLER
#endif // MBEDTLS_SHA256_SMALLER

#ifndef MBEDTLS_SSL_COOKIE_C
#define MBEDTLS_SSL_COOKIE_C
#endif // MBEDTLS_SSL_COOKIE_C

#ifndef MBEDTLS_SSL_CLI_C
#define MBEDTLS_SSL_CLI_C
#endif // MBEDTLS_SSL_CLI_C

#ifndef MBEDTLS_SSL_TLS_C
#define MBEDTLS_SSL_TLS_C
#endif // MBEDTLS_SSL_TLS_C
// XXX mbedclient needs these: mbedtls_x509_crt_free, mbedtls_x509_crt_init, mbedtls_x509_crt_parse
#ifndef MBEDTLS_X509_USE_C
#define MBEDTLS_X509_USE_C
#endif // MBEDTLS_X509_USE_C

#ifndef MBEDTLS_X509_CRT_PARSE_C
#define MBEDTLS_X509_CRT_PARSE_C
#endif // MBEDTLS_X509_CRT_PARSE_C
// a bit wrong way to get mbedtls_ssl_conf_psk:
#ifndef MBEDTLS_CMAC_C
#define MBEDTLS_CMAC_C
#endif // MBEDTLS_CMAC_C

#ifndef MBEDTLS_ECDH_C
#define MBEDTLS_ECDH_C
#endif // MBEDTLS_ECDH_C

#ifndef MBEDTLS_ECDSA_C
#define MBEDTLS_ECDSA_C
#endif // MBEDTLS_ECDSA_C

#ifndef MBEDTLS_GCM_C
#define MBEDTLS_GCM_C
#endif // MBEDTLS_GCM_C

#ifndef MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_MODE_CBC
#endif // MBEDTLS_CIPHER_MODE_CBC

#ifndef MBEDTLS_X509_CRT_PARSE_C
#define MBEDTLS_X509_CRT_PARSE_C
#endif // MBEDTLS_X509_CRT_PARSE_C

#ifndef MBEDTLS_X509_CSR_PARSE_C
#define MBEDTLS_X509_CSR_PARSE_C
#endif // MBEDTLS_X509_CSR_PARSE_C

#ifndef MBEDTLS_SHA1_C
#define MBEDTLS_SHA1_C
#endif

// /*! All of the following definitions are optimizations (reduce mbedTLS memory usage and size),
// *   changing them is on the user responsibility since they can enlarge
// *   the binary footprint and the memory usage
// */

// define to save 8KB RAM at the expense of ROM
#ifndef MBEDTLS_AES_ROM_TABLES
#define MBEDTLS_AES_ROM_TABLES
#endif // MBEDTLS_AES_ROM_TABLES

// Reduce IO buffer to save RAM, default is 16KB
#ifndef MBEDTLS_SSL_MAX_CONTENT_LEN
#define MBEDTLS_SSL_MAX_CONTENT_LEN (10 * 1024)
#endif // MBEDTLS_SSL_MAX_CONTENT_LEN

// Multiple Precision Integers when using RSA can be smaller
#define MBEDTLS_MPI_MAX_SIZE 512
#define MBEDTLS_MPI_WINDOW_SIZE 1

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
#define MBEDTLS_DEBUG
#define MBEDTLS_DEBUG_C
#define MBEDTLS_DEBUG_LEVEL 4
#define CONFIG_MBEDTLS_DEBUG_LEVEL 0

// certificate must fit into one message, fragmenting is not supported
#undef MBEDTLS_SSL_IN_CONTENT_LEN
#undef MBEDTLS_SSL_OUT_CONTENT_LEN
#define MBEDTLS_SSL_IN_CONTENT_LEN 4096
#define MBEDTLS_SSL_OUT_CONTENT_LEN 4096

// Remove error messages, save 10KB of ROM
// #undef MBEDTLS_ERROR_C

// Remove selftesting and save 11KB of ROM
#undef MBEDTLS_SELF_TEST

#undef MBEDTLS_CERTS_C

// Reduces ROM size by 30 kB
#undef MBEDTLS_ERROR_STRERROR_DUMMY

#undef MBEDTLS_VERSION_FEATURES

// You can disable debug as long as you disable MBED_CONF_TLS_SOCKET_DEBUG_LEVEL
// #undef MBEDTLS_DEBUG_C

#undef MBEDTLS_SHA512_C

#undef MBEDTLS_SSL_SRV_C

#undef MBEDTLS_ECP_DP_SECP192R1_ENABLED
#undef MBEDTLS_ECP_DP_SECP224R1_ENABLED
#undef MBEDTLS_ECP_DP_SECP384R1_ENABLED
#undef MBEDTLS_ECP_DP_SECP521R1_ENABLED
#undef MBEDTLS_ECP_DP_SECP192K1_ENABLED
#undef MBEDTLS_ECP_DP_SECP224K1_ENABLED
#undef MBEDTLS_ECP_DP_SECP256K1_ENABLED
#undef MBEDTLS_ECP_DP_BP256R1_ENABLED
#undef MBEDTLS_ECP_DP_BP384R1_ENABLED
#undef MBEDTLS_ECP_DP_BP512R1_ENABLED
#undef MBEDTLS_ECP_DP_CURVE25519_ENABLED

// Reduces size particularly in case PSA crypto is used
#undef MBEDTLS_CHACHA20_C
#undef MBEDTLS_CHACHAPOLY_C
#undef MBEDTLS_POLY1305_C
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the define to enable CBC is &amp;quot;#define MBEDTLS_CIPHER_MODE_CBC&amp;quot;&lt;br /&gt;&lt;br /&gt;I put these defines in nrf-config-user-empty.h not sure where else to put these defines, or where the proper place for them is.&lt;/p&gt;
&lt;p&gt;MBedTLS related prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_MAIN_STACK_SIZE=4096
CONFIG_NET_BUF_RX_COUNT=100
CONFIG_NET_BUF_TX_COUNT=100

# mbedTLS tweaks
CONFIG_MBEDTLS_DEBUG_C=y
CONFIG_MBEDTLS_DEBUG=y
CONFIG_MBEDTLS_DEBUG_LEVEL=0
# Also see nrf-config-user-empty.h

# TLS configuration
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=60000
# certificate must fit into one message, fragmenting is not supported
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=10240
CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT=y
CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_MBEDTLS_SHA256_C=y
CONFIG_MBEDTLS_RSA_C=y
CONFIG_MBEDTLS_AES_C=y
CONFIG_MBEDTLS_PKCS1_V21=y

CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=4
CONFIG_NET_SOCKETS_ENABLE_DTLS=n
CONFIG_POSIX_MAX_FDS=8

CONFIG_TLS_CREDENTIALS=y
CONFIG_TLS_MAX_CREDENTIALS_NUMBER=4

# CONFIG_GENERATE_MBEDTLS_CFG_FILE=n # nrf-config.h: No such file or directory&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Goodluck!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/378562?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 14:11:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fde66dba-69e0-4974-ad2a-1542076c45fe</guid><dc:creator>brown27</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/fhfs"&gt;fhfs&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;When you say &lt;em&gt;&amp;quot;enable the CBC ciphers in MBedTLS so we can use the cipher &amp;quot;MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256&amp;quot; &amp;quot;&lt;/em&gt; in your answer, would you mind sharing the prj settings you used to do so? Also, I am&amp;nbsp;guessing&amp;nbsp;that you are using the new Connect SDK v2.0.0? I see TCP messages to/from my Azure IoT Hub and Thread node using the Wireshark sniffer dongle, but get a -22 error during mqtt_connect(). I think that this &lt;em&gt;might&lt;/em&gt; be the issue.&lt;/p&gt;
&lt;p&gt;In case it helps anyone, I have been able to retain the getaddrinfo() function as my DNS resolver in azure_iot_hub.c&amp;#39;s broker_init() by setting the following in my prj.conf. It provides the same ipv4 address that I get if I run &amp;quot;nslookup my.hostname.here.net 8.8.8.8&amp;quot; on my PC. (8.8.8.8 is Google&amp;#39;s public DNS) As you mention, this requires conversion from the returned ipv4 address to ipv6 in broker_init() so that broker4 has the right ipv6 address since we&amp;#39;re using OpenThread.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# DNS Settings
CONFIG_DNS_RESOLVER=y
CONFIG_DNS_SERVER_IP_ADDRESSES=y
CONFIG_DNS_SERVER1=&amp;quot;64:ff9b::0808:0808&amp;quot;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/377915?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2022 14:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c82110e-6065-42cf-b89b-44a330b44828</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;The answer, from a reply I made down below:&lt;br /&gt;I was using the default interface to do my DNS requests and connections to the network outside the Thread network. This was fixed when I configured my IPv6 address as &amp;quot;CONFIG_NET_CONFIG_MY_IPV6_ADDR=&amp;quot;fd3f:76ab:550:1:2a9d:e83a:3e:84a7&amp;quot;&amp;quot; &lt;br /&gt;I was using my mesh local address instead of my localaddress. Mesh Local can only talk to mesh local prefix addresses. With the correct interface I was able to do DNS requests and connections to NAT64 mapped ipv6 addresses&lt;/p&gt;
&lt;p&gt;We can configure the NAT64 address as DNS Server.&lt;/p&gt;
&lt;p&gt;The Azure IoT Hub library can be used, the azure_iot_hub.c function broker_init needs to be rewritten to resolve to ipv6 addresses.&lt;/p&gt;
&lt;p&gt;I also added SNTP to the project, I did remember from a ESP32 project, MBedTLS would need it. Since we don&amp;#39;t have an IPv6 network at home/work. I also had to find NTP servers with only IPv4 addresses so the NAT64 would translate them. Setting the server &amp;quot;eu.pool.ntp.org&amp;quot; in &amp;quot;nrf\lib\date_time\date_time_ntp.c&amp;quot; worked perfectly.&lt;/p&gt;
&lt;p&gt;And using the correct MBedTLS config we can create tls connections to the Azure IoT Hub. Here we need to enable the CBC ciphers in MBedTLS so we can use the cipher &amp;quot;MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256&amp;quot;.&lt;/p&gt;
&lt;p&gt;The same is true for using the Azure IoT Hub DPS. After fiddling with my certificates, I got that working.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks everyone for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/375316?ContentTypeID=1</link><pubDate>Mon, 04 Jul 2022 12:37:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b281357b-d3a9-4bf9-ab1f-7f94c6c28d83</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;I was using the default interface to do my DNS requests and connections to the network outside the Thread network.&lt;/p&gt;
&lt;p&gt;This was fixed when I configured my IPv6 address as &amp;quot;CONFIG_NET_CONFIG_MY_IPV6_ADDR=&amp;quot;fd3f:76ab:550:1:2a9d:e83a:3e:84a7&amp;quot;&amp;quot;&lt;br /&gt;&lt;br /&gt;I was using my mesh local address instead of my localaddress. Mesh Local can only talk to mesh local prefix addresses&lt;/p&gt;
&lt;p&gt;With the correct interface I was able to do DNS requests and connections to NAT64 mapped ipv6 addresses&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/373939?ContentTypeID=1</link><pubDate>Thu, 23 Jun 2022 12:32:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e42b791-ba2b-4752-b8ea-39f6cbf46f75</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;Don&amp;#39;t call any zephyr socket functions in any event handlers. Totally forgot I&amp;#39;m now working in a RTOS, shouldnt be doing that anyway.&lt;/p&gt;
&lt;p&gt;Zephyr sockets with MBedTLS should be working. Look at echo_client / echo_server as examples.&lt;br /&gt;You can track everything with TCPDump on your Pi.&lt;br /&gt;You can test TLS connection with socat on the Pi.&lt;br /&gt;The guys at OpenThread Github (Discussion board) are very helpful!&lt;/p&gt;
&lt;p&gt;Still have not gotten zephyr dns to work, using the OpenThread DNS works.&lt;/p&gt;
&lt;p&gt;I am now trying to connect to my Azure IoT Hub using a static ipv6 address (a mapped ipv4 address)&lt;br /&gt;I&amp;#39;ll keep you updated.&lt;br /&gt;&lt;br /&gt;How are you doing with this problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/367390?ContentTypeID=1</link><pubDate>Wed, 11 May 2022 11:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac98b09d-828b-44ae-b565-25f04e462080</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;According to zephyr\subsys\net\lib\dns\resolve.c:1153 getting mapped ipv4 through getaddrinfo will not work.&lt;br /&gt;I am able to use the OpenThread Libraries to resolve DNS requests through the NAT64 interface.&lt;br /&gt;&lt;br /&gt;I will be trying to make small modifications to the nRFConnect Azure library to use Openthread sockets to test if connections will actually work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/367055?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 06:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49272362-e723-4ebb-8979-a48d08aa02ca</guid><dc:creator>Erik Hougaard</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Were you able to make this work? I&amp;#39;d be really interested as I am about to implement a similar solution, so any head-start would be appreciated.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/365613?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2022 13:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:031c5698-892a-40bb-9cd7-9e48d2166dea</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;Debugging shows the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/reference/networking/dns_resolve.html?highlight=dns_eai_canceled#c.dns_resolve_status.DNS_EAI_CANCELED"&gt;DNS_EAI_CANCELED&lt;/a&gt; is the result of a timeout.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also getting a timeout using the OpenThread specific DNS API&amp;#39;s&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;

#include &amp;lt;openthread/dns_client.h&amp;gt;

void ot_dns_response(otError aError, const otDnsAddressResponse *aResponse, void *aContext)
{

	char address_string[OT_IP6_ADDRESS_STRING_SIZE];
	otIp6Address address;
	uint32_t ttl;

	// Fails with error 28
	// [00:00:19.219,787] &amp;lt;inf&amp;gt; net_l2_openthread: State changed! Flags: 0x00000200 Current role: 3
	// [00:00:21.184,112] &amp;lt;err&amp;gt; coap_server: ot_dns_response failed 28

	if (aError == OT_ERROR_NONE)
	{
		uint16_t index = 0;

		LOG_INF(&amp;quot;ot_dns_response Success&amp;quot;);

		while (otDnsAddressResponseGetAddress(aResponse, index, &amp;amp;address, &amp;amp;ttl) == OT_ERROR_NONE)
		{
			otIp6AddressToString(&amp;amp;address, address_string, sizeof(address_string));
			LOG_INF(&amp;quot;ip: %s, TTL:%u &amp;quot;, address_string, ttl);
			index++;
		}
	}
	else
	{
		LOG_ERR(&amp;quot;ot_dns_response failed %d&amp;quot;, aError);
	}
}

otDnsQueryConfig config;
const otDnsQueryConfig *current_config;
void set_ot_dns_config(void)
{
	otError error;
	current_config = otDnsClientGetDefaultConfig(ot_context-&amp;gt;instance);

	memcpy(&amp;amp;config, current_config, sizeof(otDnsQueryConfig));

	config.mNat64Mode = OT_DNS_NAT64_ALLOW;
	config.mRecursionFlag = OT_DNS_FLAG_RECURSION_DESIRED;
	config.mMaxTxAttempts = 2;
	config.mResponseTimeout = 1000;
	config.mServerSockAddr.mPort = 53;

	error = otIp6AddressFromString(&amp;quot;FDAA:BB:1::2&amp;quot;, &amp;amp;config.mServerSockAddr.mAddress);
	if (error != OT_ERROR_NONE)
		LOG_ERR(&amp;quot;otIp6AddressFromString failed %d&amp;quot;, error);

	otDnsClientSetDefaultConfig(ot_context-&amp;gt;instance, &amp;amp;config);

	current_config = otDnsClientGetDefaultConfig(ot_context-&amp;gt;instance);
}

void resolve_ot_dns(void)
{
	otError error;
	error = otDnsClientResolveAddress(ot_context-&amp;gt;instance, &amp;quot;ing.nl&amp;quot;, &amp;amp;ot_dns_response, ot_context-&amp;gt;instance, &amp;amp;config);
	if (error != OT_ERROR_NONE)
	{
		LOG_ERR(&amp;quot;ot_dns_response resolve_dns %d&amp;quot;, error);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your suggestions. I&amp;#39;m going to try and increase logging and let you know. Any suggestion to which NET component I should set to debug logging?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/365609?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2022 13:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27efeb31-b72e-45dc-8443-1fda05deaad5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Can you use the &lt;a href="https://github.com/openthread/openthread/blob/02e61a2edd80417e9b8f9a5f4c1b2dad4ac486b4/src/cli/cli.cpp#L1573-L1574"&gt;OpenThread specific DNS API used by the ot-cli&lt;/a&gt; in the Azure IoT Hub case as well?&lt;/p&gt;
&lt;p&gt;If not, you need to debug the application to see where it fails (increase log levels would be a good start), and/or do a &lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_802154/UG/sniffer_802154/intro_802154.html"&gt;on-air sniffer trace&lt;/a&gt; of the Thread traffic, to see if the DNS is sent to any destination.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/365577?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2022 11:59:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e0b032d-2f00-42c0-b0fa-22c7e6c366f6</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve checked by running tcpdump on the RPi OTBR device.&lt;/p&gt;
&lt;p&gt;With OT-CLI I see the DNS requests coming through in the tcpdump:&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11pt;margin:0in;padding-left:30px;" lang="en-US"&gt;pi@raspberrypi:~ $ sudo tcpdump -vnni wpan0&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11pt;margin:0in;padding-left:30px;" lang="en-US"&gt;tcpdump: listening on wpan0, link-type LINUX_SLL (Linux cooked v1), snapshot length 262144 bytes&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11pt;margin:0in;padding-left:30px;" lang="en-US"&gt;14:04:33.770137 IP6 (hlim 64, next-header UDP (17) payload length: 36) fd35:ad25:a99f:8c75:a301:6d0:492:8a96.49153 &amp;gt; fdaa:bb:1::2.53: [udp sum ok] 54430+ AAAA? reddit.com. (28)&lt;/p&gt;
&lt;p style="font-family:Calibri;font-size:11pt;margin:0in;padding-left:30px;" lang="en-US"&gt;14:04:33.831836 IP6 (flowlabel 0x67ac1, hlim 64, next-header UDP (17) payload length: 148) fdaa:bb:1::2.53 &amp;gt; fd35:ad25:a99f:8c75:a301:6d0:492:8a96.49153: [udp sum ok] 54430 4/0/0 reddit.com. AAAA 64:ff9b::9765:818c, reddit.com. AAAA 64:ff9b::9765:c18c, reddit.com. AAAA 64:ff9b::9765:18c, reddit.com. AAAA 64:ff9b::9765:418c (140)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I do not see any activity with my resolve_dns() function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/365244?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 14:53:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff8fca7f-dc75-433b-8cc3-4463c8d0e62d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Looks like error code -101 means that the request was cancelled (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/reference/networking/dns_resolve.html?highlight=dns_eai_canceled#c.dns_resolve_status.DNS_EAI_CANCELED"&gt;DNS_EAI_CANCELED&lt;/a&gt;). Have you checked with a sniffer trace if the request is actually sent over the air, and if it is sent to the correct address and port (compared to the OT CLI command)?&lt;/p&gt;
&lt;p&gt;From an earlier test case, it looks like the request will be cancelled if a &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/97b83ffc2c9b1cdde01bdea8412fc5f8a921410b/tests/net/socket/getaddrinfo/prj.conf#L26"&gt;local DNS server&lt;/a&gt; is &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/97b83ffc2c9b1cdde01bdea8412fc5f8a921410b/tests/net/socket/getaddrinfo/src/main.c#L19-L20"&gt;not present&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/364478?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 12:36:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2febe140-afaf-427c-8c04-dc06fe0f8244</guid><dc:creator>fhfs</dc:creator><description>&lt;p&gt;Hello &lt;span&gt;J&amp;oslash;rgen&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried to set the correct Server, but I am getting an error in the callback.&lt;/p&gt;
&lt;p&gt;I configure the DNS and try to resolve when the device connects to the Thread network. Also before the error in dns_result_cb, I get a error &amp;quot;&amp;lt;err&amp;gt; net_otPlat_radio: Error while calling otIp6Send&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void set_dns_config(void)
{
	int ret;
	const char *dns_server = &amp;quot;FDAA:BB:1::2&amp;quot;;
	struct dns_resolve_context *dnsctx;

	dnsctx = dns_resolve_get_default();
	ret = dns_resolve_reconfigure(dnsctx, &amp;amp;dns_server, NULL);
}

void dns_result_cb(enum dns_resolve_status status,
				   struct dns_addrinfo *info,
				   void *user_data)
{
	// fails with -101
	// &amp;lt;inf&amp;gt; net_l2_openthread: State changed! Flags: 0x00000064 Current role: 3
	// &amp;lt;err&amp;gt; net_otPlat_radio: Error while calling otIp6Send
	// &amp;lt;inf&amp;gt; coap_server: dns_result_cb Failed: -101
	if (status == 0)
	{
		LOG_INF(&amp;quot;dns_result_cb Success&amp;quot;);
	}
	else
	{
		LOG_INF(&amp;quot;dns_result_cb Failed: %d&amp;quot;, status);
	}
	return;
}

void resolve_dns(void)
{
	int ret;
	struct dns_resolve_context *dnsctx;

	dnsctx = dns_resolve_get_default();
	ret = dns_resolve_name(dnsctx,
						   &amp;quot;reddit.com&amp;quot;,
						   DNS_QUERY_TYPE_AAAA,
						   NULL,
						   dns_result_cb,
						   NULL,
						   1000);
	if (ret != 0)
	{
		LOG_ERR(&amp;quot;resolve_dns %d&amp;quot;, ret);
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Maybe I am missing a configuration, the command in OT CLI example d&lt;span class="EOP SCXO246517243 BCX8" style="background-color:#ffffff;color:windowtext;font-size:11pt;font-style:normal;font-weight:400;letter-spacing:normal;line-height:18px;margin:0px;padding:0px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;"&gt;oes work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="TextRun SCXO246517243 BCX8" style="background-color:#ffffff;color:windowtext;font-size:11pt;font-style:normal;font-weight:400;letter-spacing:normal;line-height:18px;margin:0px;padding:0px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;" lang="EN-US"&gt;&lt;span class="SpellingError SCXO246517243 BCX8" style="background-color:inherit;background-image:url(&amp;#39;data:image/gif;base64,R0lGODlhBQAEAJECAP////8AAAAAAAAAACH5BAEAAAIALAAAAAAFAAQAAAIIlGAXCCHrTCgAOw==&amp;#39;);background-position:left bottom;background-repeat:repeat-x;border-bottom:1px solid transparent;margin:0px;padding:0px;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;uart:~$ ot dns resolve reddit.com fdaa:bb:1::2 53 1000 2 1
DNS response for reddit.com. - 64:ff9b:0:0:0:0:9765:c18c TTL:67 64:ff9b:0:0:0:0:9765:818c TTL:67 64:ff9b:0:0:0:0:9765:18c TTL:67 64:ff9b:0:0:0:0:9765:418c TTL:67
Done&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="EOP SCXO246517243 BCX8" style="background-color:#ffffff;color:windowtext;font-size:11pt;font-style:normal;font-weight:400;letter-spacing:normal;line-height:18px;margin:0px;padding:0px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="EOP SCXO246517243 BCX8" style="background-color:#ffffff;color:windowtext;font-size:11pt;font-style:normal;font-weight:400;letter-spacing:normal;line-height:18px;margin:0px;padding:0px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Azure IoT Hub Library with OpenThread</title><link>https://devzone.nordicsemi.com/thread/364158?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 09:24:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:170491b9-4890-4572-8890-f7c16ce95339</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It looks like getaddrinfo() internally calls&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.99-ncs1-1/subsys/net/lib/sockets/getaddrinfo.c#L115-L117"&gt;&lt;span&gt;dns_get_addr_info()&lt;/span&gt;&lt;/a&gt;, so you may be able to call&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/reference/networking/dns_resolve.html#c.dns_resolve_init"&gt;&lt;span&gt;dns_resolve_init()&lt;/span&gt;&lt;/a&gt;&amp;nbsp;or &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/zephyr/reference/networking/dns_resolve.html#c.dns_resolve_reconfigure"&gt;dns_resolve_reconfigure&lt;/a&gt;&lt;span&gt;() to set the DNS server address.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You may also use the Kconfigs &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/CONFIG_DNS_SERVER_IP_ADDRESSES.html"&gt;DNS_SERVER_IP_ADDRESSES&lt;/a&gt;&amp;nbsp;and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.1/kconfig/search.html?q=CONFIG_DNS_SERVER"&gt;CONFIG_DNS_SERVERx&lt;/a&gt;&amp;nbsp;to specify the DNS servers used by the DNS resolve library.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>