<?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>AT Command interface hangs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43620/at-command-interface-hangs</link><description>Hi, 
 without providing too much code right away, I would like to ask how I could circumvent AT command interface hangups. My current test application calls AT commands like 
 static const char cereg[] = &amp;quot;AT+CEREG?&amp;quot;; 
 static const char cesq[] = &amp;quot;AT+CESQ</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Feb 2019 14:46:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43620/at-command-interface-hangs" /><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/172339?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 14:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6fd3052-cb79-4712-95d3-9f181961abae</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;I&amp;#39;ll do that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/172240?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 08:35:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:198de6e7-26e0-4cbc-9795-1e4223a2ca87</guid><dc:creator>Jan Tore Guggedal</dc:creator><description>&lt;p&gt;I think it would be good if you created a new, private ticket her on DevZone, for these more complex issues so that the support engineers can provide the best help and you can keep your code confidential.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/172238?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 08:28:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b11eb5fd-861f-48e2-bdeb-812ffc6d3309</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;I&amp;#39;m working towards getting you access to the repository, I&amp;#39;ll have to recreate the EEEEEEEEE code since I scrapped it. I also have another issue now where a socket fails after 15 mins with &amp;quot;Operation not supported on socket&amp;quot; and then hours later the nRF91 resets itself.&lt;/p&gt;
&lt;p&gt;The sleep fix has been in my code since you first mentioned it.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/172229?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 08:01:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:229aa6ae-937c-4dea-98a9-e4b000ba189b</guid><dc:creator>Jan Tore Guggedal</dc:creator><description>&lt;p&gt;And then there&amp;#39;s also a possibility that your seeing this error:&lt;br /&gt;&lt;a href="https://www.nordicsemi.com/DocLib/Content/Errata/nRF9160_EngA/latest/ERR/nRF9160/EngineeringA/latest/anomaly_160_17"&gt;https://www.nordicsemi.com/DocLib/Content/Errata/nRF9160_EngA/latest/ERR/nRF9160/EngineeringA/latest/anomaly_160_17&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can apply the workaround described in the document and see if that helps with your issues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/172227?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 07:36:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e4507bc-8d9f-4611-949a-ba96e8ed84cc</guid><dc:creator>Jan Tore Guggedal</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve never seen that. It&amp;#39;s really curious.&lt;/p&gt;
&lt;p&gt;It would be very useful for both others and me to see a repository or something with your codebase so that we can reproduce locally and get to the bottom of this.&lt;br /&gt;&lt;br /&gt;One thing you could try just to eliminate one thing, is to include a k_sleep(100) or k_sleep(10) in the bsd_os_timedwait function i mentioned earlier. That might help narrow things down a bit.&lt;br /&gt;&lt;br /&gt;BR,&lt;br /&gt;Jan Tore&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/172063?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 09:58:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb63b84e-7bda-4d7c-a2c2-1e1d3491e663</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;I found some time. I tried to setup a thread that creates the socket to the AT command interface, reads and send bytes to the AT socket and fills and empties a queue for rx and tx bytes that connects with the main task .While I can read from the socket it only ever returns &amp;#39;E&amp;#39; characters&lt;/p&gt;
&lt;p&gt;Line1: EEEEEEEEE&lt;/p&gt;
&lt;p&gt;This result came about when I sent &amp;quot;AT+CGSN=1\r\n&amp;quot;. This happens only once. I didn&amp;#39;t use any mutexes since I expected the queues to be sufficiently protected and the socket was only used in the read/write task.&lt;/p&gt;
&lt;p&gt;If you have seen this before let me know, otherwise I will get rid of the threadding and just don&amp;#39;t close the socket in lte_lc.c&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/171387?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 12:48:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67cb5142-1bba-43fc-9785-74a2cc636917</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;Unfortunately I don&amp;#39;t have time next week. So I&amp;#39;ll have to let the case linger for a bit. Also since at_host behaves much better and I strongly believe that since recv() is meant to be called with way more error handling and retries anyway, I would rather change my code to something like at_host has to offer.&lt;/p&gt;
&lt;p&gt;On the other hand if you think that there might be some issue with the modem or the binary code in nrfxlib I would be happy if it can become more stable.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/171371?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 12:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9283a87a-c35e-46b2-a0f1-95e21c21b23e</guid><dc:creator>Jan Tore Guggedal</dc:creator><description>&lt;p&gt;Bummer, then I&amp;#39;m starting to run out of ideas, but will come back to you if I can find something. If your code is on a public git branch somewhere, that would be great, to reproduce it exactly as you have it locally. If you don&amp;#39;t want to have it public, you can open a private ticket and share your code only with tech support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/171359?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 12:00:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5a36b58-f27a-47ae-82bb-78b16deec585</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;I tried this, it doesn&amp;#39;t prevent recv() from hanging.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/171351?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 11:41:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7df1752b-cba3-4cd4-9455-778fecfba7ac</guid><dc:creator>Jan Tore Guggedal</dc:creator><description>&lt;p&gt;Thanks for the log output! I was able to reproduce locally, and it seems you&amp;#39;ve hit a bump with regards to missing implementation of the function bsd_os_timedwait(). Could you try this hack in nrf/lib/bsdlib/bsd_os.c :&lt;pre class="ui-code" data-mode="text"&gt;int32_t bsd_os_timedwait(uint32_t context, uint32_t timeout)
{
	    /* TODO: to be implemented */
    	k_sleep(timeout);
	    return 0;
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is not a long term solution, but it can help you overcome this weird issue for now and isolate the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/171334?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 10:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b79e9135-d278-41f0-b3d1-1a07fc685b7c</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tried instrumenting the code around socket() and found that the socket descriptor never changes its value and stays at 2, also it never reaches return -EFAULT.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int exl_lte_lc_get_cereg(exl_lte_lc_cereg_t * const pCereg)
{
    int errVal;
    int at_socket_fd;
    u8_t buffer[LC_MAX_READ_LENGTH];

    at_socket_fd = socket(AF_LTE, 0, NPROTO_AT);
    if (at_socket_fd == -1)
    {
        printk(&amp;quot;%s:%u: Error EFAULT\n&amp;quot;,__FUNCTION__,__LINE__);
        return -EFAULT;
    }

    printk(&amp;quot;%s:%u: Socket: %d\n&amp;quot;,__FUNCTION__,__LINE__,at_socket_fd);

    errVal = at_cmd_wret(at_socket_fd, cereg, AT_CMD_SIZE(cereg), buffer);

    if (errVal == 0L)
    {
        // &amp;quot;+CEREG: 2,5,\&amp;quot;C76A\&amp;quot;,\&amp;quot;01ACB906\&amp;quot;,9&amp;quot;

        sscanf(&amp;amp;buffer[8], &amp;quot;%u,%u,\&amp;quot;%[^\&amp;quot;]\&amp;quot;,\&amp;quot;%[^\&amp;quot;]\&amp;quot;,%u&amp;quot;, (unsigned int *)&amp;amp;pCereg-&amp;gt;n, (unsigned int *)&amp;amp;pCereg-&amp;gt;stat, pCereg-&amp;gt;tac,
                pCereg-&amp;gt;ci, (unsigned int *)&amp;amp;pCereg-&amp;gt;act);

    }
    else
    {
        return errVal;
    }

    close(at_socket_fd);
    return 0;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There is a high consistency in reaching the 140 seconds mark and not getting further. Also it hangs in&amp;nbsp;at_cmd_wret():recv() and not elsewhere. All this lets me think that awneil is on the right track, despite my sloppy coding involving not checkng return values and returning from a function in more than one place.&lt;/p&gt;
&lt;p&gt;Let me add a bit of output from UART_0:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;s
exl_lte_lc_get_cesq:312: Socket: 2
Before recv
After recv
rx1: +CESQ: 99,99,255,255,255,61
rx2: OK

rx3: +CESQ: 99,99,255,255,255,61
352656100000036?b=[s=&amp;quot;Test&amp;quot;,c=01ACB906,tc=C76A,r=-79.0,ti=&amp;quot;127&amp;quot;,a=0]Sent 68 Bytes
352656100000036?b=[s=&amp;quot;Test&amp;quot;,c=01ACB906,tc=C76A,r=-79.0,ti=&amp;quot;137&amp;quot;,a=0]Sent 68 Bytes
exl_lte_lc_get_cereg:247: Socket: 2
Before recv
After recv
rx1: +CEREG: 0,5,&amp;quot;C76A&amp;quot;,&amp;quot;01ACB906&amp;quot;,9
rx2: OK

rx3: +CEREG: 0,5,&amp;quot;C76A&amp;quot;,&amp;quot;01ACB906&amp;quot;,9
352656100000036?b=[s=&amp;quot;Test&amp;quot;,c=01ACB906,tc=C76A,r=-79.0,ti=&amp;quot;147&amp;quot;,a=0]Sent 68 Bytes
exl_lte_lc_get_cesq:312: Socket: 2
Before recv
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the update about at_host.c I&amp;#39;m using this in its older form already. Using a separate thread for reading the interface is something I may also try in the future.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/171213?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 16:21:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4b09931-c5a2-440e-9150-b2eb4c40dfe8</guid><dc:creator>Jan Tore Guggedal</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I think the problem is on line 25 in the middle code block you posted. In case of return, the socket remains open, but a new one is opened in the next run. In the end you run out of available sockets, and I guess you would see -EFAULT returned from exl_lte_lc_get_cereg(). You can either just keep the socket open all the time, or ensure that you close it also when something fails.&lt;br /&gt;&lt;br /&gt;Update: You can see the new implementation of the AT host for tips on how you can send and receive AT commands in a dedicated thread, and receive callbacks whenever there&amp;#39;s data on the socket:&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/lib/at_host/at_host.c"&gt;https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/lib/at_host/at_host.c&lt;/a&gt;&amp;nbsp;&lt;br /&gt;This allows you to receive notifications for example when the signal strength changes, without having to poll the modem, using the Nordic proprietary AT command AT%CESQ:&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/User_Guides/at_commands/latest/REF/at_commands/mob_termination_ctrl_status/proc_cesq"&gt;www.nordicsemi.com/.../proc_cesq&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/171013?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 06:43:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:743b509d-13fa-4aa9-b741-bf4af4335c09</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;Well the tags are:&lt;/p&gt;
&lt;p&gt;\zephyr&amp;gt;git log&lt;br /&gt;commit 82fe1f9dfcf0e100d6fc952c07cf63d63aa08a0e (HEAD, tag: v1.13.99-ncs2-rc2, tag: v1.13.99-ncs2)&lt;/p&gt;
&lt;p&gt;\nrf&amp;gt;git log&lt;br /&gt;commit 5ad94691363cb0832943d8cb759df7db982a2e63 (HEAD, tag: v0.3.0)&lt;/p&gt;
&lt;p&gt;\nrfxlib&amp;gt;git log&lt;br /&gt;commit 891c089577857d8a197b7360e007a0d84e6dbe54 (HEAD, tag: v0.3.0)&lt;/p&gt;
&lt;p&gt;any newer versions would be great to have, I just went through the Getting Started App for this.&lt;/p&gt;
&lt;p&gt;The modem firmware is:&lt;/p&gt;
&lt;p&gt;mfw_nb1_nrf9160_0.3.0-73.prealpha.zip&lt;/p&gt;
&lt;p&gt;The main change to lte_lc.c is:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static int at_cmd_wret(int fd, const char *cmd, size_t size, char * const ret)
{
    int len;
    uint32_t retCount = 0;
    int fnc_return;
    u8_t buffer[LC_MAX_READ_LENGTH];

    char *pLine[2] =
    { NULL, NULL };

    LOG_DBG(&amp;quot;send: %s&amp;quot;, cmd);
    len = send(fd, cmd, size, 0);
    if (len != size)
    {
        LOG_ERR(&amp;quot;send: failed&amp;quot;);
        return -EIO;
    }

    len = recv(fd, buffer, LC_MAX_READ_LENGTH, 0);

    memset(ret,0,LC_MAX_READ_LENGTH);
    do
    {
        if (len &amp;lt; AT_CMD_SIZE(success))
        {
            LOG_ERR(&amp;quot;recv: %s&amp;quot;, buffer);
            fnc_return = -EIO;
        }
        else
        {
            pLine[0] = buffer;
            pLine[1] = memchr(buffer, &amp;#39;\n&amp;#39;, LC_MAX_READ_LENGTH);
            pLine[1][0]=&amp;#39;\0&amp;#39;;
            pLine[1]++;
            if (memcmp(success, &amp;amp;pLine[1][0], AT_CMD_SIZE(success)) == 0)
            {
                memmove(ret, pLine[0], strlen(pLine[0]));
                fnc_return = 0L;
            }
            else
            {
                LOG_ERR(&amp;quot;recv: %s&amp;quot;, buffer);
                fnc_return = -EIO;
            }

        }

        printk(&amp;quot;rx1: %s\n&amp;quot;, pLine[0]);
        printk(&amp;quot;rx2: %s\n&amp;quot;, pLine[1]);
        printk(&amp;quot;rx3: %s\n&amp;quot;, ret);
        retCount++;
    }
    while (retCount &amp;lt; 1U);

    return fnc_return;
}&lt;/pre&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;and to give an example of using this function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int exl_lte_lc_get_cereg(exl_lte_lc_cereg_t * const pCereg)
{
    int errVal;
    int at_socket_fd;
    u8_t buffer[LC_MAX_READ_LENGTH];

    at_socket_fd = socket(AF_LTE, 0, NPROTO_AT);
    if (at_socket_fd == -1)
    {
        return -EFAULT;
    }

    errVal = at_cmd_wret(at_socket_fd, cereg, AT_CMD_SIZE(cereg), buffer);

    if (errVal == 0L)
    {
        // &amp;quot;+CEREG: 2,5,\&amp;quot;C76A\&amp;quot;,\&amp;quot;01ACB906\&amp;quot;,9&amp;quot;

        sscanf(&amp;amp;buffer[8], &amp;quot;%u,%u,\&amp;quot;%[^\&amp;quot;]\&amp;quot;,\&amp;quot;%[^\&amp;quot;]\&amp;quot;,%u&amp;quot;, (unsigned int *)&amp;amp;pCereg-&amp;gt;n, (unsigned int *)&amp;amp;pCereg-&amp;gt;stat, pCereg-&amp;gt;tac,
                pCereg-&amp;gt;ci, (unsigned int *)&amp;amp;pCereg-&amp;gt;act);

    }
    else
    {
        return errVal;
    }

    close(at_socket_fd);
    return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The main loop looks like the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
    int32_t s;
    char imei[16];
    uint8_t stage = 0U;
    char dgram[256];
    int32_t Rsrp;
    uint32_t uptime;
    uint32_t vbat;
    exl_lte_lc_cereg_t Cereg;


    printk(&amp;quot;Application started\n&amp;quot;);

    memset(dgram,0,sizeof(dgram));
    memset(&amp;amp;Rsrp,0,sizeof(Rsrp));
    memset(&amp;amp;uptime,0,sizeof(uptime));
    memset(&amp;amp;vbat,0,sizeof(vbat));
    memset(&amp;amp;Cereg,0,sizeof(Cereg));
    memset(imei,0,sizeof(imei));

    buttons_leds_init();
    work_init();
    modem_configure();

    s = udp_connect();

    if (IS_ENABLED(CONFIG_CLOUD_UA_CONSOLE))
    {
        console_init();
    }

    // get imei
    exl_lte_lc_get_imei(imei);

    while (true)
    {
        if (s &amp;gt;= 0L)
        {
            uint32_t slen;


            uptime = (uint32_t)(k_uptime_get() / 1000L);


            switch (stage)
            {

            case 0:
                stage=0U;
                break;
            case 1:
                exl_lte_lc_get_cereg(&amp;amp;Cereg);
                stage=2U;
                break;
            case 2:
                exl_lte_lc_get_cesq(&amp;amp;Rsrp);
                stage=0U;
                break;
            case 3:
                exl_lte_lc_get_vbat(&amp;amp;vbat);
                stage=0U;
                break;

            default:
                stage=0U;
            }

            sprintf(dgram, &amp;quot;%s?b=[s=\&amp;quot;Test\&amp;quot;,c=%s,tc=%s,r=%.1f,ti=\&amp;quot;%u\&amp;quot;,a=%u]&amp;quot;, imei, Cereg.ci, Cereg.tac,
                    (float)1.0f * Rsrp, (unsigned int)uptime, (unsigned int)((100 * vbat) / 5000U));

            printk(&amp;quot;%s&amp;quot;, dgram);

            slen = nrf_strnlen(dgram, sizeof(dgram));
            if (send(s, dgram, slen, 0L) != slen)
            {
                printk(&amp;quot;partial/failed write\n&amp;quot;);
            }
            else
            {
                printk(&amp;quot;Sent %u Bytes\n&amp;quot;, (unsigned int)slen);
            }


        }
        /* if logging is enabled, sleep */
        k_sleep(K_MSEC(10000));

    }

    return 0L;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Should&amp;nbsp; I change the approach in exl_lte_lc_* I&amp;#39;ll go with the one used in at_client. For now I don&amp;#39;t need to use AT_commands in the main loop.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170977?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 18:47:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69baec77-4449-4cd8-83ab-cb463d88b2b0</guid><dc:creator>Jan Tore Guggedal</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/kt1024"&gt;kt1024&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Could you share the changes that you&amp;#39;ve made in lte_lc.c/h and how you call the functions?&lt;br /&gt;It would also be good to know which versions of the SDK your working on, for example the latest commits of the -zephyr and -nrf repositories in particular, along with modem version. That way others can replicate what your setup and possibly provide better help.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jan Tore&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170936?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 14:51:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9faa67b9-850b-46d8-8e54-a8e99c5bc2f4</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;Appearently I changed from proactive to grumpy. In conclusion I would say that I have no problem switching to better socket handling than is done now. Since this is only an evaluation project I could also do without polling, but there are enough good reasons to use it in the end product to not yield on this. &lt;/p&gt;
&lt;p&gt;Thanks for your help,&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170922?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 14:16:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d0c03ca-acae-4b67-bdac-eda795d24ef4</guid><dc:creator>awneil</dc:creator><description>[quote userid="76865" url="~/f/nordic-q-a/43620/at-command-interface-hangs/170917"]I expressly do not think about the impact on the modem[/quote]
&lt;p&gt;I was referring to your opening question:&lt;/p&gt;
[quote userid="76865" url="~/f/nordic-q-a/43620/at-command-interface-hangs"]how I can prevent the AT command interface hangup[/quote]
&lt;p&gt;which seemed to be a &amp;quot;modem impact&amp;quot; thing.&lt;/p&gt;
&lt;p&gt;I think I&amp;#39;ve lost track of where you&amp;#39;re at/going - if I ever understood it in the first place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170917?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 14:09:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60720dc4-94a0-4103-bb0f-fd882dc485be</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;I expressly do not think about the impact on the modem. How would you treat an output buffer overrun ? Is there any reason not to just empty it and dump more stuff in. There are perfectly good ways of being responsive about it. There is no reason to go into a corner and sulk forever.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170841?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 11:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a2aff87-7d08-40a3-84db-98e8bee543ee</guid><dc:creator>awneil</dc:creator><description>[quote userid="76865" url="~/f/nordic-q-a/43620/at-command-interface-hangs/170837"]polling is ok for me[/quote]
&lt;p&gt;I was thinking of the impact on the modem.&lt;/p&gt;
[quote userid="76865" url="~/f/nordic-q-a/43620/at-command-interface-hangs/170837"]if URCs are your only means of getting information from the modem, then you can&amp;#39;t decide whether a process on the modem isn&amp;#39;t working or whether it just has no reason to generate a URC.[/quote]
&lt;p&gt;Fair point.&lt;/p&gt;
&lt;p&gt;Maybe a combination of URCs and the occasional poll as a &amp;quot;sanity check&amp;quot; ... ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170837?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 11:32:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c77d85f7-9a79-4548-b45d-a5a4491b8194</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;If I run my own lte_lc.? this could work, but I&amp;#39;ve had bad experiences with URCs elsewhere so polling is ok for me. I could imagine that powerconsumption and used interface bandwidth could be reduced if polling is avoided but sometimes I just have to get a piece of information at a certain time. &lt;/p&gt;
&lt;p&gt;Another issue arises if URCs are your only means of getting information from the modem, then you can&amp;#39;t decide whether a process on the modem isn&amp;#39;t working or whether it just has no reason to generate a URC.&lt;/p&gt;
&lt;p&gt;So while I&amp;#39;m at it, if you have a flakey modem only providing URCs and no means to poll for that information is a bad idea.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170826?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 10:45:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50496862-91b6-44e1-8082-6d0cad1fc9d4</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Rather than keep polling the interface, can you just use &lt;em&gt;unsolicited&lt;/em&gt; responses ... ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170819?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 10:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fd89a4b-65a0-4ab6-85d2-12c0ca8dd0be</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;I tried the at_client example with TeraTerm and AT%XVBAT for a while and I couldn&amp;#39;t hang up the modem yet so it is capable of answering AT commands for longer than 2 minutes. So there is a way to make it work properly. Ok I guess I know enough for now lets close this issue, the modem reset is worth its own question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170755?ContentTypeID=1</link><pubDate>Wed, 13 Feb 2019 07:02:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84746464-ddf5-4585-9dcf-f91d83835a15</guid><dc:creator>kt1024</dc:creator><description>&lt;p&gt;Well that makes sense, I could just port one of the multiple thousand lines of state machine code we have for our other projects to really pay attention to the modem. That state machine would probably run but it also has the ability to reset the modem - just in case. &lt;/p&gt;
&lt;p&gt;What I should do, is scrap the lte_lc.? code that just writes something, reads without paying much attention and closes the interface socket again, and replace it with a reader writer task based on nonblocking sockets and fill the results into a queue. That should present a nice facade of attention and caring to the modem.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t feel like I&amp;#39;m being paid to do this right now so it will have to wait until later.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;KT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT Command interface hangs</title><link>https://devzone.nordicsemi.com/thread/170681?ContentTypeID=1</link><pubDate>Tue, 12 Feb 2019 15:00:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36508557-a0c9-4f9a-95a5-bd48b22434ef</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;The commonest mistake people make with AT commands is failing to &lt;strong&gt;wait for &lt;em&gt;and pay attention to&lt;/em&gt; the responses from the modem&lt;/strong&gt; - instead just relying upon blind delays:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.avrfreaks.net/comment/2209136#comment-2209136"&gt;https://www.avrfreaks.net/comment/2209136#comment-2209136&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.avrfreaks.net/comment/2139451#comment-2139451"&gt;https://www.avrfreaks.net/comment/2139451#comment-2139451&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>