<?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>How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112363/how-to-get-the-mqtt-publisher-example-working-on-the-nrf7002dk-i-also-want-to-test-the-tls-after-that</link><description>Hi, 
 I am trying to get the MQTT publisher example working on my nrf7002DK board. For this, i have done the following things 
 - SDK version: 2.6.1 
 - Board selected: nrf7002dk_nrf5340_cpuapp 
 - Include the prj.conf, overlay-nrf700x.conf and overlay</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Jul 2024 08:27:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112363/how-to-get-the-mqtt-publisher-example-working-on-the-nrf7002dk-i-also-want-to-test-the-tls-after-that" /><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/492896?ContentTypeID=1</link><pubDate>Tue, 09 Jul 2024 08:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ed5d3ca-e8e3-4edd-9b01-8fb0e5084662</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m glad to hear that your issue has been resolved.&lt;/p&gt;
&lt;p&gt;Wishing you a great day ahead.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/492812?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 18:25:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:722b57a7-4291-4152-bfd6-9a2c1d01d2e3</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Hi Abhijith,&lt;br /&gt;Thanks alot. i was able to get it working by changing the value of&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_NET_BUF_DATA_SIZE&lt;/span&gt;&lt;span&gt;=2048&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/492755?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 14:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7fa3320-7742-43f2-8a4d-b5359eb12493</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello Arjun,&lt;/p&gt;
&lt;p&gt;Hakon is on his summer vacation, so I will be working on this while he is away.&lt;/p&gt;
&lt;p&gt;From the logs, it seems the device might be running out of memory when trying to allocate buffers for network packets. Could you try increasing `&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_NET_BUF_DATA_SIZE"&gt;CONFIG_NET_BUF_DATA_SIZE`&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/492124?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2024 19:37:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e98e056-4e62-440a-a545-9e9e5c4d0265</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Hi @&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/hkn"&gt;H&amp;aring;kon Alseth&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I was trying to add TLS client certificate support to this code. i am getting an error&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:10.666,046] &amp;lt;inf&amp;gt; mqtt: Connecting to MQTT broker
[00:00:11.825,683] &amp;lt;err&amp;gt; net_pkt: Data buffer (1035) allocation failed.
[00:00:11.825,714] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=987
[00:00:11.973,724] &amp;lt;err&amp;gt; net_pkt: Data buffer (1110) allocation failed.
[00:00:11.973,754] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1062
[00:00:12.177,917] &amp;lt;err&amp;gt; net_pkt: Data buffer (1110) allocation failed.
[00:00:12.177,917] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1062
[00:00:12.177,917] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:12.656,158] &amp;lt;err&amp;gt; net_pkt: Data buffer (1110) allocation failed.
[00:00:12.656,158] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1062
[00:00:12.656,158] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:13.323,364] &amp;lt;err&amp;gt; net_pkt: Data buffer (1110) allocation failed.
[00:00:13.323,364] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1062
[00:00:13.323,364] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:14.273,559] &amp;lt;err&amp;gt; net_pkt: Data buffer (1110) allocation failed.
[00:00:14.273,559] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1062
[00:00:14.273,559] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:15.648,803] &amp;lt;err&amp;gt; net_pkt: Data buffer (1328) allocation failed.
[00:00:15.648,803] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1280
[00:00:15.648,834] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:17.661,041] &amp;lt;err&amp;gt; net_pkt: Data buffer (1328) allocation failed.
[00:00:17.661,041] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1280
[00:00:17.661,071] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:20.629,272] &amp;lt;err&amp;gt; net_pkt: Data buffer (1328) allocation failed.
[00:00:20.629,302] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1280
[00:00:20.629,302] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:25.031,494] &amp;lt;err&amp;gt; net_pkt: Data buffer (1328) allocation failed.
[00:00:25.031,494] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1280
[00:00:25.031,524] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:31.584,716] &amp;lt;err&amp;gt; net_pkt: Data buffer (1328) allocation failed.
[00:00:31.584,747] &amp;lt;err&amp;gt; net_tcp: conn: 0x20050ba4 packet allocation failed, len=1280
[00:00:31.584,747] &amp;lt;err&amp;gt; net_tcp: TCP failed to allocate buffer in retransmission
[00:00:31.837,738] &amp;lt;err&amp;gt; mqtt: Error in mqtt_connect: -5&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is my updated code:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2570.wifistaMqtt.zip"&gt;/cfs-file/__key/communityserver-discussions-components-files/4/2570.wifistaMqtt.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please let me know if you want any thing else&lt;/p&gt;
&lt;p&gt;in brief&lt;/p&gt;
&lt;p&gt;i added the client certificate as well as the private key files&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const unsigned char ca_certificate[] = {
#include &amp;quot;mosquitto_ca_cert.h&amp;quot;
};

static const unsigned char client_certificate[] = {
#include &amp;quot;mosquitto_client_cert.h&amp;quot;
};

static const unsigned char priv_key[] = {
#include &amp;quot;mosquitto_priv_key.h&amp;quot;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have called the tls_credential_add as shown below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // CA Certificate
    err = tls_credential_add(MQTT_TLS_SEC_TAG, TLS_CREDENTIAL_CA_CERTIFICATE, ca_certificate, sizeof(ca_certificate));
	if (err &amp;lt; 0)
    {
		LOG_ERR(&amp;quot;Failed to add TLS credentials CA Certificate, err: %d&amp;quot;, err);
		return err;
	}

	// Client Certificate
    err = tls_credential_add(MQTT_TLS_SEC_TAG, TLS_CREDENTIAL_SERVER_CERTIFICATE, client_certificate, sizeof(client_certificate));
	if (err &amp;lt; 0)
    {
		LOG_ERR(&amp;quot;Failed to add TLS credentials Client Certificate, err: %d&amp;quot;, err);
		return err;
	}

	// Private Key
    err = tls_credential_add(MQTT_TLS_SEC_TAG, TLS_CREDENTIAL_PRIVATE_KEY, priv_key, sizeof(priv_key));
	if (err &amp;lt; 0)
    {
		LOG_ERR(&amp;quot;Failed to add TLS credentials Private Key, err: %d&amp;quot;, err);
		return err;
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Updated the Broket Port to 8884&lt;/p&gt;
&lt;p&gt;I have used this link to create the client certificate:&amp;nbsp;&lt;a href="https://test.mosquitto.org/ssl/"&gt;test.mosquitto.org/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490884?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 12:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b42d15d-307f-40a9-a3d8-cf26416dabad</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Arjun Kariat"]Its working thanks a lot&amp;nbsp;&lt;span title="Slight smile"&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/72575.1f642.svg" style="max-height:32px;max-width:32px;" alt="Slight smile" /&gt;&lt;/span&gt;[/quote]
&lt;p&gt;Great to hear that it is working as expected! Always happy to help out.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope you have a wonderful day!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490799?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 08:23:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c401c7f-c63e-407e-b93a-515638c215e4</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Its working thanks a lot&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Updated prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y

# WPA supplicant
CONFIG_WPA_SUPP=y

# Below configs need to be modified based on security
# CONFIG_STA_KEY_MGMT_NONE=y
CONFIG_STA_KEY_MGMT_WPA2=y
# CONFIG_STA_KEY_MGMT_WPA2_256=y
# CONFIG_STA_KEY_MGMT_WPA3=y
CONFIG_STA_SAMPLE_SSID=&amp;quot;YourSSID&amp;quot;
CONFIG_STA_SAMPLE_PASSWORD=&amp;quot;Your_Password&amp;quot;

# System settings
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_LOG=y
# CONFIG_MQTT_LOG_LEVEL_DBG=y
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=n
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_DHCPV4=y

CONFIG_NET_PKT_RX_COUNT=8
CONFIG_NET_PKT_TX_COUNT=8

# Below section is the primary contributor to SRAM and is currently
# tuned for performance, but this will be revisited in the future.
CONFIG_NET_BUF_RX_COUNT=16
CONFIG_NET_BUF_TX_COUNT=16
CONFIG_NET_BUF_DATA_SIZE=128
CONFIG_HEAP_MEM_POOL_SIZE=153600
CONFIG_NET_TC_TX_COUNT=1

CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
CONFIG_NET_MAX_CONTEXTS=5
CONFIG_NET_CONTEXT_SYNC_RECV=y

CONFIG_INIT_STACKS=y

CONFIG_NET_L2_ETHERNET=y

CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_INIT_TIMEOUT=0

CONFIG_NET_SOCKETS_POLL_MAX=10

# Memories
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096

# Debugging
CONFIG_STACK_SENTINEL=y
CONFIG_DEBUG_COREDUMP=y
CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y
CONFIG_SHELL_CMDS_RESIZE=n


# Kernel options
CONFIG_ENTROPY_GENERATOR=y

# Logging
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_POSIX_CLOCK=y

CONFIG_NET_CONFIG_MY_IPV4_ADDR=&amp;quot;192.168.1.99&amp;quot;
CONFIG_NET_CONFIG_MY_IPV4_NETMASK=&amp;quot;255.255.255.0&amp;quot;
CONFIG_NET_CONFIG_MY_IPV4_GW=&amp;quot;192.168.1.1&amp;quot;

# printing of scan results puts pressure on queues in new locking
# design in net_mgmt. So, use a higher timeout for a crowded
# environment.
CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000

#MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=y
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
CONFIG_MQTT_KEEPALIVE=5
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=81920
CONFIG_TLS_CREDENTIALS=y
CONFIG_MBEDTLS_RSA_C=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y
CONFIG_PSA_WANT_RSA_KEY_SIZE_2048=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For nrf7002DK board:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Board selected:&lt;/strong&gt; nrf7002dk_&lt;span&gt;nrf5340_cpuapp&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;For nrf7002EK Board&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Board selected:&lt;/strong&gt;&amp;nbsp;nrf5340dk_nrf5340_cpuapp&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extra Cmake Argument:&lt;/strong&gt; -DSHIELD=&amp;quot;nrf7002ek&amp;quot;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490797?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 08:20:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b88a44fd-24e1-4569-af79-468472498349</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Ok. thanks. i ll update immediately&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490796?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 08:20:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7699102e-989f-49ff-baab-7424cc905385</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;No. I just took the .zip file that you posted approx. 3 hours ago:&lt;/p&gt;
[quote user="Arjun Kariat"]&lt;p&gt;I have created a mosquitto_ca_cert.h file using the python script provided in the git link. This is the .h file created from the crt file of the ca certificate of the test.mosquitto.org.&lt;/p&gt;
&lt;p&gt;Here is the updated code&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5228.wifistaMqtt.zip"&gt;/cfs-file/__key/communityserver-discussions-components-files/4/5228.wifistaMqtt.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Please Note:&lt;/strong&gt;&amp;nbsp;I have only added the subscribe part here right now.&lt;/p&gt;
&lt;p&gt;Please let me know if you want to know anything else&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490795?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 08:19:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13eb2e56-192d-4598-b173-137ae3d8c4a1</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Do i still have to add&amp;nbsp;nrf5340dk_nrf5340_cpuapp_ns.conf file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490792?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 08:15:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca62ea8e-d911-4268-b10d-107f253b1bd4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested your latest .zip file, and it seems to work with nrf7002dk_nrf5340_cpuapp board at my end when using NCS v2.5.3:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:07.897,766] &amp;lt;inf&amp;gt; sta: State: AUTHENTICATING
[00:00:08.008,483] &amp;lt;inf&amp;gt; sta: Connected
[00:00:08.202,697] &amp;lt;inf&amp;gt; sta: ==================
[00:00:08.202,728] &amp;lt;inf&amp;gt; sta: State: COMPLETED
[00:00:08.202,758] &amp;lt;inf&amp;gt; sta: Interface Mode: STATION
[00:00:08.202,789] &amp;lt;inf&amp;gt; sta: Link Mode: WIFI 6 (802.11ax/HE)
[00:00:08.202,789] &amp;lt;inf&amp;gt; sta: SSID: OpenWrt
[00:00:08.202,819] &amp;lt;inf&amp;gt; sta: BSSID: FC:34:97:0B:F6:DC
[00:00:08.202,850] &amp;lt;inf&amp;gt; sta: Band: 5GHz
[00:00:08.202,850] &amp;lt;inf&amp;gt; sta: Channel: 36
[00:00:08.202,880] &amp;lt;inf&amp;gt; sta: Security: WPA2-PSK
[00:00:08.202,911] &amp;lt;inf&amp;gt; sta: MFP: Optional
[00:00:08.202,911] &amp;lt;inf&amp;gt; sta: RSSI: -55
[00:00:16.209,197] &amp;lt;inf&amp;gt; net_dhcpv4: Received: 192.168.32.209
[00:00:16.209,350] &amp;lt;inf&amp;gt; net_config: IPv4 address: 192.168.32.209
[00:00:16.209,350] &amp;lt;inf&amp;gt; net_config: Lease time: 600 seconds
[00:00:16.209,381] &amp;lt;inf&amp;gt; net_config: Subnet: 255.255.255.0
[00:00:16.209,411] &amp;lt;inf&amp;gt; net_config: Router: 192.168.32.1
[00:00:16.209,533] &amp;lt;inf&amp;gt; sta: DHCP IP address: 192.168.32.209
[00:00:16.209,899] &amp;lt;inf&amp;gt; mqtt: Connecting to MQTT broker
[00:00:16.838,073] &amp;lt;inf&amp;gt; net_mqtt: Connect completed
[00:00:16.894,256] &amp;lt;inf&amp;gt; mqtt: MQTT client connected
[00:00:16.894,287] &amp;lt;inf&amp;gt; mqtt: Subscribing to sensors
[00:00:16.956,604] &amp;lt;inf&amp;gt; mqtt: SUBACK packet id: 1234
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When using NCS v2.6.1, I get this warning printed:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;warning: MBEDTLS_RSA_C (defined at /opt/ncs/nrf/subsys/net/openthread/Kconfig.defconfig:174,
/opt/ncs/nrf/subsys/nrf_security/Kconfig.legacy:669) was assigned the value &amp;#39;y&amp;#39; but got the value
&amp;#39;n&amp;#39;. Check these unsatisfied dependencies: (NET_L2_OPENTHREAD || ((PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY
|| !MBEDTLS_USE_PSA_CRYPTO) &amp;amp;&amp;amp; MBEDTLS_LEGACY_CRYPTO_C &amp;amp;&amp;amp; NRF_SECURITY)) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MBEDTLS_RSA_C and/or look up MBEDTLS_RSA_C
in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Adding these two configurations will fix this and make it connect to the broker:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY=y
CONFIG_PSA_WANT_RSA_KEY_SIZE_2048=y
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try this and see if it also works on your end?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490747?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 06:19:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4b150ec-1fc3-4e93-9eae-0fa41095dcaa</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;I got the issue resolved. the invalid argument issue was due to the wrong build configuration&amp;nbsp;&lt;/p&gt;
&lt;p&gt;changing the board&amp;nbsp;to the &lt;span&gt;cpu_app_&lt;/span&gt;ns worked.&lt;/p&gt;
&lt;p&gt;is it possible to get the TLS working on the cpu_app build?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490744?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 05:36:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10dd64da-153c-40da-a0b3-20b3b38cc868</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/hkn"&gt;Håkon Alseth&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I had gone through the links you have provided. thank you for this. i tried it out in my example and im getting an invalid argument error now.&lt;/p&gt;
&lt;p&gt;I have created a mosquitto_ca_cert.h file using the python script provided in the git link. This is the .h file created from the crt file of the ca certificate of the test.mosquitto.org.&lt;/p&gt;
&lt;p&gt;Here is the updated code&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8156.wifistaMqtt.zip"&gt;/cfs-file/__key/communityserver-discussions-components-files/4/8156.wifistaMqtt.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Please Note:&lt;/strong&gt;&amp;nbsp;I have only added the subscribe part here right now.&lt;/p&gt;
&lt;p&gt;Please let me know if you want to know anything else&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490688?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2024 14:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bcba624-c51c-4485-89b7-feb6b598cbe2</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You&amp;#39;re connecting to port 1883, is this intentional?&lt;/p&gt;
&lt;p&gt;You should also wait for the MQTT_EVT_CONNACK to occur before doing a publish.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You seem to be lacking the TLS handling, ie. the mosquitto certificate?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://test.mosquitto.org/"&gt;https://test.mosquitto.org/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s not much handling of the socket itself, meaning that your mqtt_evt_handler will never be called.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This lesson can help you along the way:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/wi-fi-fundamentals/lessons/lesson-4-wifi-fundamentals/"&gt;https://academy.nordicsemi.com/courses/wi-fi-fundamentals/lessons/lesson-4-wifi-fundamentals/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicDeveloperAcademy/wifi-fund/blob/main/lesson4/wififund_less4_exer2_solution/src/main.c"&gt;https://github.com/NordicDeveloperAcademy/wifi-fund/blob/main/lesson4/wififund_less4_exer2_solution/src/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490591?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2024 11:04:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4080567f-8c51-49bf-8692-c9ed5491e961</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Hi I was able to get the TLS also working in this example.&lt;/p&gt;
&lt;p&gt;But, i dont want to set the SSID and Password via shell. So i took the Wifi station code and tried to port the mqtt APIs to it. I am able to connect to the MQTT but im getting error 128(&lt;span&gt;Socket is not connected.&lt;/span&gt;) error when im trying to publish the data&lt;/p&gt;
&lt;p&gt;.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/wifistaMqtt.zip"&gt;/cfs-file/__key/communityserver-discussions-components-files/4/wifistaMqtt.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490511?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2024 08:25:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:618c59ce-ae3f-4a20-82ca-b4f6ec25360f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Glad to hear that you got the sample up and running. Let me know if you run into any issues with enabling the TLS part.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490407?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2024 16:22:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f346ef6-67c6-40b9-a92d-6a3a4fa79701</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;I was able to get the basic mqtt work without TLS&lt;/p&gt;
&lt;p&gt;Steps involved&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Build and run the mqtt sample from /ncs/nrf/samples/net/mqtt&lt;/li&gt;
&lt;li&gt;Build config
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Board selected:&lt;/strong&gt; nrf7002dk_nrf5340_cpuapp_ns&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Config files:&lt;/strong&gt; prj.conf, boards/nrf7002dk_nrf5340_cpuapp_ns.conf&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Open the terminal:&lt;/strong&gt; Please note that you get prints on both the COM ports in this project. Connect to the COM port that supports shell&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connect to Wifi:&lt;/strong&gt; type the following commands in the shell
&lt;ul&gt;
&lt;li&gt;wifi_cred add MY_SSID WPA2-PSK My_Password&lt;/li&gt;
&lt;li&gt;wifi_cred auto_connect&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Now the device will connect to Wifi and then start publishing and subscribing to topics mentioned in the LOG&lt;/li&gt;
&lt;li&gt;Modify the KConfigs &lt;strong&gt;MQTT_SAMPLE_TRANSPORT_PUBLISH_TOPIC&lt;/strong&gt; and &lt;strong&gt;MQTT_SAMPLE_TRANSPORT_SUBSCRIBE_TOPIC&lt;/strong&gt; provided in the Kconfig.transport file&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I will test the TLS and update soon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490252?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2024 11:36:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b96c1219-2233-4a5a-ac04-37c08ad7b248</guid><dc:creator>Arjun Kariat</dc:creator><description>&lt;p&gt;Thanks for the quick reply. I ll try out this example and update&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get the MQTT publisher example working on the nrf7002DK? I also want to test the TLS after that.</title><link>https://devzone.nordicsemi.com/thread/490226?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2024 10:42:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f065c43-cdb3-41ae-891e-1231575ac721</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp; zephyr/samples/net/mqtt_publisher sample does not incorporate the net_mgmt or wifi-related calls, as seen in the nrf/samples/wifi/sta (and other nRF7002 samples):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.6.1/samples/wifi/sta/src/main.c#L290-L306"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.6.1/samples/wifi/sta/src/main.c#L290-L306&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you had a look at the ../ncs/nrf/samples/net/mqtt sample? This sample is setup to run with the nRF7002-DK.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>