<?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>LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93983/lte-link-monitor-not-accepting-any-at-commands-after-publishing-to-mqtt-broker-in-data-mode-with-nrf9160dk-and-slm</link><description>Hi, 
 after connecting to our mqtt broker I set nrf9160DK to data mode and publish data to our mqtt broker: 
 
 After this LTE link monitor is not accepting any AT commands. It keeps receiving mqtt connection ping though: #XMQTTEVT: 9,0 
 Here is RTT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Nov 2022 08:05:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93983/lte-link-monitor-not-accepting-any-at-commands-after-publishing-to-mqtt-broker-in-data-mode-with-nrf9160dk-and-slm" /><item><title>RE: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/397066?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 08:05:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dac720c-3c11-45d3-9fa6-1057b17f2e6e</guid><dc:creator>ericlestor</dc:creator><description>&lt;p&gt;Yes, the problem was with my code, it exited and entered back to datamode immediately. Sorry to have wasted your time and thanks again for your continued support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396877?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 11:49:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffa448a4-7c5a-4559-a581-4dda16012ff9</guid><dc:creator>ericlestor</dc:creator><description>&lt;p&gt;Other commands work fine, including the responses. I couldn&amp;#39;t get either teraterm or putty to send anything to nrf9160DK. Couldn&amp;#39;t write anything to terminal, neither program accepted any typing to terminal.&lt;/p&gt;
&lt;p&gt;EDIT: Realterm works fine, also exits data mode. I am beginning to think that there is something wrong with my code. I will&amp;nbsp;do more tests later.&lt;/p&gt;
&lt;p&gt;Thanks for your support and I will contact you again if I still cannot get my code to work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396872?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 11:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4424ba92-b762-4124-b842-f6de21f53401</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="ericlestor"]I just can&amp;#39;t get the nrf9160 to exit the datamode.[/quote]
&lt;p&gt;You should not need to append &amp;quot;\r\n&amp;quot; to exit datamode, &amp;quot;+++&amp;quot; shall be enough.&lt;/p&gt;
&lt;p&gt;Do all other AT commands work as expected, including the responses provided back from the nRF9160?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did you try this with a terminal to see if datamode works as expected there?&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: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396576?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2022 09:01:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:420ff1bb-1f7b-4335-847c-6b282ab59d25</guid><dc:creator>ericlestor</dc:creator><description>&lt;p&gt;The uart communication works fine (pins are nrf52840 RX =p0.15, TX = p0.16, nrf9160dk RX=p0.11, TX=p0.10) , that is not the issue. I just can&amp;#39;t get the nrf9160 to exit the datamode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396573?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2022 08:50:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4ee04ff-1328-46e6-94d8-128523f8820b</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;Which pins are being used on both sides?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The default pinout of the nRF9160 uart0 is routed directly to the SEGGER IC, and not the pin lists. You&amp;#39;ll need to change the SLM config to use other pins, as shown in the documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/slm_description.html#connecting-with-an-external-mcu"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/slm_description.html#connecting-with-an-external-mcu&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: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396419?ContentTypeID=1</link><pubDate>Fri, 18 Nov 2022 13:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59e5d906-bf30-46da-a693-f7c63373305a</guid><dc:creator>ericlestor</dc:creator><description>&lt;p&gt;I just can&amp;#39;t get it to work with my external MCU (nrf52840). Is this supposed to work with FIFO aswell or do I need to change my uart connection? Here is my code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void uart_init(void)
{
    uint32_t err_code;
    app_uart_comm_params_t const comm_params =
        {
            .rx_pin_no = UART_RX,
            .tx_pin_no = UART_TX,
            .rts_pin_no = NRF_UART_PSEL_DISCONNECTED,
            .cts_pin_no = NRF_UART_PSEL_DISCONNECTED,
            .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
            .use_parity = false,
            .baud_rate = NRF_UART_BAUDRATE_115200

        };
    APP_UART_FIFO_INIT(&amp;amp;comm_params,
        UART_RX_BUF_SIZE,
        UART_TX_BUF_SIZE,
        uart_event_handle,
        APP_IRQ_PRIORITY_LOWEST,
        err_code);
    APP_ERROR_CHECK(err_code);
}

int8_t send_at_command(char *at_command)
{
    while(!uart_tx_empty);
    for (int i = 0; i &amp;lt; strlen(at_command); i++)
    {
        uint32_t retval = app_uart_put(at_command[i]);
        if (retval != 0)
        {
            app_uart_flush();
            return -1;
        }
    }
    if(strstr(at_command, &amp;quot;+++&amp;quot;) == NULL)
    {
        app_uart_put(&amp;#39;\r&amp;#39;);
        app_uart_put(&amp;#39;\n&amp;#39;);
    }
    uart_tx_empty = false;
    return 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396245?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2022 14:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84d47e52-3efa-4f35-b118-4a8a349d3357</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;The default exit command out of datamode is &amp;quot;+++&amp;quot;, ie only these 3 bytes. You can change this if you want,&amp;nbsp;via CONFIG_SLM_DATAMODE_TERMINATOR.&lt;/p&gt;
&lt;p&gt;Putty probably has a different line-ending as compared to the default in SLM (which is CR+LF). You can change this by modifying either the putty settings, or the SLM firmware (CONFIG_SLM_CR_TERMINATION=y)&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: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396236?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2022 13:55:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13c30adf-c042-4830-b340-f1217063a571</guid><dc:creator>ericlestor</dc:creator><description>&lt;p&gt;I can&amp;#39;t write anything on putty or teraterm, nothing showing on terminal when i write, just &amp;quot;ready&amp;quot; when nrf9160 is reset, i.e. putty:&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1668692978114v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But this isn&amp;#39;t really the issue, I just want to know how to exit data mode. I am also using external MCU(nrf52840) with nrf9160dk and trying to publish to our mqtt broker, it publishes ok, but never exits the data mode. So whatever I write to uart after initially entering data mode are published to our mqtt broker and not handled as At commands.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LTE link monitor not accepting any AT commands after publishing to mqtt broker in data mode with nrf9160DK and SLM</title><link>https://devzone.nordicsemi.com/thread/396228?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2022 13:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d10635e-4513-4b7c-823a-72067a735a73</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;When omitting the payload in the AT#XMQTTPUB call, SLM will enter datamode, as per the documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/nrf/applications/serial_lte_modem/doc/MQTT_AT_commands.html#mqtt-publish-xmqttpub"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/nrf/applications/serial_lte_modem/doc/MQTT_AT_commands.html#mqtt-publish-xmqttpub&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When using datamode, I would recommend that you use another terminal, like realterm/teraterm/putty.&lt;/p&gt;
&lt;p&gt;LTE Link Monitor adds linebreaks to each string, which will cause problems with data mode.&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>