<?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>nRF9160: Serial LTE modem + MQTT publish</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84030/nrf9160-serial-lte-modem-mqtt-publish</link><description>Hi 
 This question is based on the NCS tag v1.8.0. 
 I am using nRF9160DK SLM application to evaluate the MQTT AT command function. 
 
 I got OK if I send a plain text to AWS. But I got an ERROR when I try to send message in JSON format like example above</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Jan 2022 02:57:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84030/nrf9160-serial-lte-modem-mqtt-publish" /><item><title>RE: nRF9160: Serial LTE modem + MQTT publish</title><link>https://devzone.nordicsemi.com/thread/349861?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 02:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:111162d5-588d-4378-b039-5c93c683580f</guid><dc:creator>TimYang</dc:creator><description>&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;I appreciate your help very much.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Sincerely,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Tim&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: Serial LTE modem + MQTT publish</title><link>https://devzone.nordicsemi.com/thread/349776?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 13:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd10c2ab-f8b3-47eb-afd5-350376dd20aa</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Tim,&lt;/p&gt;
&lt;p&gt;1. AT#XMQTTPUB=&amp;quot;nrf91/slm/mqtt/topic0&amp;quot;,,2,0 # You can keep second parameter empty and configure the third option for QoS.&lt;/p&gt;
&lt;p&gt;2. You need to add a proper delay between two messages depending on your network environment and message length(which affects time length for data transmassion). If your application needs a very high-frequency data update rate, you have to think about other solutions.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: Serial LTE modem + MQTT publish</title><link>https://devzone.nordicsemi.com/thread/349693?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 09:01:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1060980-0320-4aac-9143-30198b581e12</guid><dc:creator>TimYang</dc:creator><description>&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Hi Charlie,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;May I ask you some questions about MQTT message in JSON format?&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Could I adjust the QoS level when I&amp;#39;m going to&amp;nbsp;enable slm data mode?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;I got an issue like below(JSON&amp;nbsp;format content was&amp;nbsp;divided into two separate messages) if I run my python code in high frequency(about once per second).&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;import serial

ser = serial.Serial()
ser.baudrate = 115200
ser.port = &amp;#39;COM3&amp;#39;

# Connecting code...

message = {&amp;#39;timestamp&amp;#39;: TIMESTAMP, &amp;#39;pulse&amp;#39;: PULSE, &amp;#39;spo2&amp;#39;: SPO2}
message_json = json.dumps(message).encode(&amp;quot;ascii&amp;quot;)
ser.write(message_json)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1643186122744v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there anything I can do to prevent this problem?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Tim&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: Serial LTE modem + MQTT publish</title><link>https://devzone.nordicsemi.com/thread/349659?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 02:38:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3743719a-a3a4-4864-a0c6-e2e9fac44c01</guid><dc:creator>TimYang</dc:creator><description>&lt;p&gt;Hi Charlie,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. I finally figured out why Link Monitor keeps sending me timed-out ERROR after I enabled data mode.&lt;span&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f605.svg" title="Sweat smile"&gt;&amp;#x1f605;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Tim&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160: Serial LTE modem + MQTT publish</title><link>https://devzone.nordicsemi.com/thread/349529?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 12:58:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae26336a-14ac-46ba-a8c9-0fd92ff547b3</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Tim,&lt;/p&gt;
&lt;p&gt;The correct way should be like the following steps:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&lt;span&gt;AT&lt;/span&gt;&lt;span&gt;#XMQTTPUB=&amp;quot;nrf91/slm/mqtt/topic0&amp;quot;&amp;nbsp; #enable slm data mode&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2.&amp;nbsp;&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;span&gt;&amp;quot;msg&amp;quot;&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;&amp;quot;Test Json publish&amp;quot;&lt;/span&gt;&lt;span&gt;}&amp;nbsp; &amp;nbsp; # json format content, could be data in any format&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. +++&amp;nbsp; &amp;nbsp; #Exit slm data mode.&amp;nbsp;&lt;span&gt;Link Monitor attaches CRLF always, this will not stop slm data mode, use serial terminals like&amp;nbsp;use Teraterm, Termite on Windows and Cutecome on Ubuntu, they support sending only +++.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>