<?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>Simple MQTT message not publishing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94160/simple-mqtt-message-not-publishing</link><description>Hello there, I am having problems publishing a message to the server I set up on emqx. Here are the changes I made to the kconfig file (I have not changed the main.c code). 
 
 
 
 
 After making these changes, this it what appears on my AT terminal </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Nov 2022 00:19:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94160/simple-mqtt-message-not-publishing" /><item><title>RE: Simple MQTT message not publishing</title><link>https://devzone.nordicsemi.com/thread/397765?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 00:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dee7069-1799-483a-8fdd-63eea117ff9a</guid><dc:creator>AdrianV</dc:creator><description>&lt;p&gt;Thank you, I have made changes in the prj.conf according to what you sent as seen below, but I also kept my broker since it is already configured to my mobile application.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:413px;max-width:1000px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/2000x826/__key/communityserver-discussions-components-files/4/pastedimage1669594226650v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This solved my initial issue and now I can connect to the server, I also commented out these lines below so that it would stop echoing messages to my second issue&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:226px;max-width:669px;" height="226" src="https://devzone.nordicsemi.com/resized-image/__size/1338x452/__key/communityserver-discussions-components-files/4/pastedimage1669594748917v2.png" width="669" alt=" " /&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple MQTT message not publishing</title><link>https://devzone.nordicsemi.com/thread/397548?ContentTypeID=1</link><pubDate>Fri, 25 Nov 2022 07:41:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71a64c06-9940-431a-8f72-6da752374422</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Looks like there is an issue with&amp;nbsp;your broker settings. I&amp;#39;ve tested using test.mosquitt.org without issues:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;2022-11-25T07:36:06.270Z DEBUG modem &amp;lt;&amp;lt; *** Booting Zephyr OS build v3.1.99-ncs1-1  ***
2022-11-25T07:36:07.277Z DEBUG modem &amp;lt;&amp;lt; [00:00:00.508,422] [0m&amp;lt;inf&amp;gt; mqtt_simple: The MQTT simple sample started[0m
2022-11-25T07:36:07.294Z DEBUG modem &amp;lt;&amp;lt; [00:00:00.508,453] [0m&amp;lt;inf&amp;gt; mqtt_simple: Disabling PSM and eDRX[0m
2022-11-25T07:36:07.295Z DEBUG modem &amp;lt;&amp;lt; [00:00:00.509,216] [0m&amp;lt;inf&amp;gt; mqtt_simple: LTE Link Connecting...[0m
2022-11-25T07:36:09.183Z DEBUG modem &amp;lt;&amp;lt; [00:00:02.415,588] [0m&amp;lt;inf&amp;gt; mqtt_simple: LTE Link Connected![0m
2022-11-25T07:36:09.198Z DEBUG modem &amp;lt;&amp;lt; [00:00:02.726,440] [0m&amp;lt;inf&amp;gt; mqtt_simple: IPv4 Address found 91.121.93.94[0m
2022-11-25T07:36:09.200Z DEBUG modem &amp;lt;&amp;lt; [00:00:02.726,898] [0m&amp;lt;dbg&amp;gt; mqtt_simple: client_id_get: client_id = nrf-352656108600951[0m
2022-11-25T07:36:09.204Z DEBUG modem &amp;lt;&amp;lt; [00:00:02.947,387] [0m&amp;lt;inf&amp;gt; mqtt_simple: MQTT client connected[0m
2022-11-25T07:36:09.221Z DEBUG modem &amp;lt;&amp;lt; [00:00:02.947,418] [0m&amp;lt;inf&amp;gt; mqtt_simple: Subscribing to: my/subscribe/topic len 18[0m
2022-11-25T07:36:09.223Z DEBUG modem &amp;lt;&amp;lt; [00:00:03.020,416] [0m&amp;lt;inf&amp;gt; mqtt_simple: SUBACK packet id: 1234[0m
2022-11-25T07:36:15.992Z DEBUG modem &amp;lt;&amp;lt; [00:00:09.223,236] [0m&amp;lt;inf&amp;gt; mqtt_simple: Publishing: DevZone techsupport 298948[0m
2022-11-25T07:36:16.010Z DEBUG modem &amp;lt;&amp;lt; [00:00:09.223,297] [0m&amp;lt;inf&amp;gt; mqtt_simple: to topic: /testTopic len: 10[0m
2022-11-25T07:36:16.012Z DEBUG modem &amp;lt;&amp;lt; [00:00:09.427,856] [0m&amp;lt;inf&amp;gt; mqtt_simple: PUBACK packet id: 3373[0m
2022-11-25T07:37:24.967Z DEBUG modem &amp;lt;&amp;lt; [00:01:18.203,582] [0m&amp;lt;inf&amp;gt; mqtt_simple: MQTT PUBLISH result=0 len=36[0m
2022-11-25T07:37:24.985Z DEBUG modem &amp;lt;&amp;lt; [00:01:18.203,704] [0m&amp;lt;inf&amp;gt; mqtt_simple: Received: Hello to nrf-352656108600951 from PC[0m
2022-11-25T07:37:24.987Z DEBUG modem &amp;lt;&amp;lt; [00:01:18.204,254] [0m&amp;lt;inf&amp;gt; mqtt_simple: Publishing: Hello to nrf-352656108600951 from PC[0m
2022-11-25T07:37:24.990Z DEBUG modem &amp;lt;&amp;lt; [00:01:18.204,284] [0m&amp;lt;inf&amp;gt; mqtt_simple: to topic: /testTopic len: 10[0m
2022-11-25T07:37:24.996Z DEBUG modem &amp;lt;&amp;lt; [00:01:18.299,530] [0m&amp;lt;inf&amp;gt; mqtt_simple: PUBACK packet id: 20614[0m
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here I have subscribed to /testTopic as your original post. We can see that I receive both messages posted to this topic from my nRF9160DK and my computer&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/2870.pastedimage1669362032226v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Can you please retry with the same broker? Also, please use the prj.conf to configure your project and leave Kconfig untouched. Here is my prj.conf&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#
# Copyright (c) 2020 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# Modem library
CONFIG_NRF_MODEM_LIB=y

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=n
CONFIG_MQTT_CLEAN_SESSION=y

# Application
CONFIG_MQTT_PUB_TOPIC=&amp;quot;/testTopic&amp;quot;
# CONFIG_MQTT_SUB_TOPIC=&amp;quot;my/subscribe/topic&amp;quot;
# CONFIG_MQTT_CLIENT_ID=&amp;quot;my-client-id&amp;quot;
CONFIG_MQTT_BROKER_HOSTNAME=&amp;quot;test.mosquitto.org&amp;quot;
# CONFIG_MQTT_BROKER_PORT=1883
CONFIG_BUTTON_EVENT_PUBLISH_MSG=&amp;quot;DevZone techsupport 298948&amp;quot;

# Button support
CONFIG_DK_LIBRARY=y

# Enable logging
CONFIG_LOG=y
CONFIG_MQTT_SIMPLE_LOG_LEVEL_DBG=y

# Memory
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_HEAP_MEM_POOL_SIZE=2048

# NewLib C
CONFIG_NEWLIB_LIBC=y&lt;/pre&gt;&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple MQTT message not publishing</title><link>https://devzone.nordicsemi.com/thread/397523?ContentTypeID=1</link><pubDate>Fri, 25 Nov 2022 03:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68537ad6-8758-4137-9596-e1deb3528d23</guid><dc:creator>AdrianV</dc:creator><description>&lt;p&gt;I tried changing the kconfig file as seen below...&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:110px;max-width:405px;" height="110" src="https://devzone.nordicsemi.com/resized-image/__size/810x220/__key/communityserver-discussions-components-files/4/pastedimage1669345265995v2.png" width="405" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;but I am still not receiving any messages on the server, the resending of the message however, has stopped.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:207px;max-width:619px;" height="207" src="https://devzone.nordicsemi.com/resized-image/__size/1238x414/__key/communityserver-discussions-components-files/4/pastedimage1669345214644v1.png" width="619" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple MQTT message not publishing</title><link>https://devzone.nordicsemi.com/thread/397173?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 13:23:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6be227ff-72e2-4d2a-8cd1-d34f5f601b5e</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you able to publish this topic from a computer? You device does seem to receive the topic as well. Would it be possible for you to test with e.g. testopic/pub and testopic/sub to verify functionality?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>