<?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>Second HTTP request on NRF91 isn&amp;#39;t going into PSM mode.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97416/second-http-request-on-nrf91-isn-t-going-into-psm-mode</link><description>I&amp;#39;m experimenting with the nrf91 https example to simulate my use case. In general my device will come online hourly and send some data, get a 204 response back from the server, then go to sleep again until the next hour. 
 
 For development i&amp;#39;ve configured</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Mar 2023 12:30:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97416/second-http-request-on-nrf91-isn-t-going-into-psm-mode" /><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/415442?ContentTypeID=1</link><pubDate>Wed, 15 Mar 2023 12:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f5d3713-2ac3-4a4b-afa5-ba0156c52474</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;the issue is the roaming sim. i&amp;#39;ve switched to a local one, the PSM values are now consistent. I&amp;#39;m now trying to figure out what values my provider will accept.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you have a similar issue and are using an MVNO sim, try switching to a local sim.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/415146?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 11:25:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:257b3a11-97af-4d27-ae42-6480db467675</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;&amp;gt; &lt;span&gt;%XMONITOR: 5,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;42502&amp;quot;,&amp;quot;03AE&amp;quot;,7,3,&amp;quot;00364A1F&amp;quot;,189,1400,34,22,&amp;quot;1101&amp;quot;,&amp;quot;00000011&amp;quot;,&amp;quot;11100000&amp;quot;,&amp;quot;01001010&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; w&lt;span&gt;hich I only see &amp;quot;11100000&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;There is a &amp;quot;01001010&amp;quot; as well. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;XMONITOR is so helpful! But the version variants, include the special encoding of the value (different to CPSMS) is such a pain. Especially, if someone is already struggling to sort out a lot of information. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;gt; &amp;quot;00000011&amp;quot;,&amp;quot;11100000&amp;quot;,&amp;quot;01001010&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;00000011&amp;quot;: PSM active time 6s&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;11100000&amp;quot;: Periodic-TAU-ext deactivated&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;quot;01001010&amp;quot;:&amp;nbsp;Periodic-TAU (6 minutes * 10 =&amp;gt; 60 minutes) &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/415143?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 11:16:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b025d4d3-1c51-4f1a-9951-1b3a879913e9</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;I verified it in 2 ways.&lt;br /&gt;&lt;br /&gt;the lte_handler callback function handles PSM update events and prints the values it receives to the logs. In the example you can see that in the config files I request a 1 hour TUA and a 6 second Active Timer. I would see these values printed to the logs (3600 TUA, 6 Active time).&lt;/p&gt;
&lt;p&gt;Also, when viewing the power consumption with the DK i&amp;#39;d see the active timer play out as expected with an event 6 seconds after the modem goes idle.&lt;/p&gt;
&lt;p&gt;I have seen different behaviour depending on where I am connecting. In some locations i&amp;#39;ve seen seemingly random values returned from the network, without any apparent connection to what i&amp;#39;ve requested.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll enable&amp;nbsp;&lt;span&gt;XMONITOR and see what I find and get back to you. I will also get a local SIM tomorrow and try that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/415118?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 10:17:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d850c9e-79cd-4d59-9f95-9e1e58802289</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I am not sure how you check the&amp;nbsp;&lt;span&gt;values. If you read the pages I suggested, you would find that only CEREG and XMONITOR contain the PSM configuration&amp;nbsp;accepted by the network, which I only see &amp;quot;11100000&amp;quot; in the modem trace files.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The modem trace also shows that you using a roaming network and it is a chance that PSM may not be supported by the local network. You need to confirm with your SIM card provider or choose a local network operator.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let&amp;#39;s see if other TAU timer values can be properly accepted by the network first.&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;Charlie&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/415091?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 09:20:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8da38930-0f96-4433-a6a4-b4d93c18a6c4</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;yes, i verified it via the ppk, and also via the logs if you enable them. I could see the same values I requested coming back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/415088?ContentTypeID=1</link><pubDate>Tue, 14 Mar 2023 09:16:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4008e80-87fe-4cd5-a0de-f89f5a8f2922</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I checked all your modem trace files, and all the TAU timer is&amp;nbsp;&lt;span&gt;&amp;quot;11100000&amp;quot; which means PSM is deactivated, this is suspicious.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CEREG: 5,&amp;quot;03AE&amp;quot;,&amp;quot;00364A1F&amp;quot;,7,,,&amp;quot;00000011&amp;quot;,&amp;quot;11100000&amp;quot;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;%XMONITOR: 5,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;42502&amp;quot;,&amp;quot;03AE&amp;quot;,7,3,&amp;quot;00364A1F&amp;quot;,189,1400,34,22,&amp;quot;1101&amp;quot;,&amp;quot;00000011&amp;quot;,&amp;quot;11100000&amp;quot;,&amp;quot;01001010&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;How do you know PSM works? did you check with a current meter like PPK2?&amp;nbsp; Could you try to set a bigger TAU timer to see if it can be properly accepted by the network?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The following two pages of the&amp;nbsp;&lt;span&gt;Cellular IoT Fundamentals course cover commands about PSM usage.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/topic/lesson-2-at-commands/"&gt;AT commands – Nordic Developer Academy (nordicsemi.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/topic/lesson-2-exercise-1/"&gt;Exercise 1 – Nordic Developer Academy (nordicsemi.com)&lt;/a&gt;&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: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414904?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2023 12:15:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bd28936-084c-4bd5-8b76-2a4a0e5dec9b</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;here are the modem traces.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;6k.bin shows the psm working correctly&lt;/p&gt;
&lt;p&gt;100k.bin, the first time the psm works. second time it doesn&amp;#39;t&lt;/p&gt;
&lt;p&gt;400k.bin, psm never works correctly.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/400k.bin"&gt;devzone.nordicsemi.com/.../400k.bin&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/100k.bin"&gt;devzone.nordicsemi.com/.../100k.bin&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6k.bin"&gt;devzone.nordicsemi.com/.../6k.bin&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414830?ContentTypeID=1</link><pubDate>Mon, 13 Mar 2023 09:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c56d0e4-fe3d-48be-9e5a-2c391a6a1aaa</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;hey charlie, i now have the issue isolated.&lt;br /&gt;&lt;br /&gt;your example works. i&amp;#39;ve edited it slightly to send a put request, with a configurable amount of data. (BYTES_TO_SEND &amp;amp; BYTES_TO_SEND_STR)&lt;br /&gt;&lt;br /&gt;- if you configure the project to send 6000 bytes, the psm works every transmission&lt;/p&gt;
&lt;p&gt;- if you configure the project to send 100000 bytes, the first psm works properly, and the second fails&lt;/p&gt;
&lt;p&gt;- if you configure the project to send 400000 bytes, the first psm fails&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll also include a modem trace shortly. You can point this project to a simple python http server that handles PUT requests to see the behavior.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6472.ncs230_5F00_https_5F00_client_5F00_psm_5F00_put.zip"&gt;devzone.nordicsemi.com/.../6472.ncs230_5F00_https_5F00_client_5F00_psm_5F00_put.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414377?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 12:53:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c178bbf-3cd4-4de4-90ab-71a4acce4120</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I reviewed your source codes and looks server_transmission_work_fn is too heavy, the PSM parameters are also not set and also no LTE connection operations.&lt;/p&gt;
&lt;p&gt;I just modified the original&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/nrf/samples/nrf9160/https_client/README.html"&gt;nRF9160: HTTPS Client — nRF Connect SDK 2.3.0 documentation (nordicsemi.com)&lt;/a&gt;&amp;nbsp;and it seems to work as expected. You can find PSM current is around 2.58uA. overlay-low-power.conf is used for building firmware. I tested on nRF9160DK using a local LTE-M network.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:600px;max-width:800px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1600x1200/__key/communityserver-discussions-components-files/4/8750.TCP_5F00_PSM.png" /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ncs230_5F00_https_5F00_client_5F00_psm_5F00_20230309.zip"&gt;devzone.nordicsemi.com/.../ncs230_5F00_https_5F00_client_5F00_psm_5F00_20230309.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please realize this is just a simple demo for reference, there might be some bugs&amp;nbsp;or errors in it, but we do not provide further maintenance for this modified demo.&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: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414223?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 17:24:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6bccff5-2464-419f-91f3-57d91010ebce</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;I&amp;#39;ll also add i&amp;#39;m&amp;nbsp;now seeing the high power state all the time. Not sure what was going on previously. I&amp;#39;m also talking to my SIM provider to see if it&amp;#39;s a SIM related issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414221?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 17:18:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:750f008a-0104-4338-93a9-89c61ba1c019</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;Hi charlie,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve included a zip of my source. Please let me know if anything stands out to you, i&amp;#39;ve made it as minimal as possible. Besides SIM issues, i&amp;#39;m out of ideas.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The server i&amp;#39;m using is a python3 http.server instance, just returning a 204 header and a content-length of 0. I can see the full response if I turn logging on.&lt;/p&gt;
&lt;p&gt;In this project i&amp;#39;ve set the TUA to 1 hour and 6 seconds of active time, sending 200 bytes of data.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll also add main.c here so people can see what we are discussing without downloading the file. Note this is using NCS 1.9.1, although I didn&amp;#39;t note any difference by trying to update to 2.2.0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;string.h&amp;gt;
#include &amp;lt;zephyr.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;net/socket.h&amp;gt;
#include &amp;lt;modem/nrf_modem_lib.h&amp;gt;
#include &amp;lt;net/tls_credentials.h&amp;gt;
#include &amp;lt;modem/lte_lc.h&amp;gt;
#include &amp;lt;modem/modem_key_mgmt.h&amp;gt;

#define HTTP_PORT xxxx

#define HTTP_HOSTNAME &amp;quot;xxxxxxxxxxxxxxx&amp;quot;

#define HTTP_HEAD \
	&amp;quot;PUT /xxxxxxxxxxxxxx HTTP/1.1\r\n&amp;quot; \
	&amp;quot;Host: &amp;quot;HTTP_HOSTNAME&amp;quot;:xxxx\r\n&amp;quot; \
    &amp;quot;Connection: close\r\n&amp;quot; \
	&amp;quot;Content-Length: 200&amp;quot; \
    &amp;quot;\r\n\r\n&amp;quot;

#define HTTP_HEAD_LEN (sizeof(HTTP_HEAD) - 1)

#define RECV_BUF_SIZE 200

static char recv_buf[RECV_BUF_SIZE + 1] = {&amp;#39;\0&amp;#39;};

static const char head_buf[] = HTTP_HEAD;
static uint8_t data_buf[200] = {100};

static struct k_work_delayable server_transmission_work;

static void server_transmission_work_fn(struct k_work *work)
{
    int err;
	int fd;
	char *p;
	int bytes;
	size_t off;
	struct addrinfo *res;
	struct addrinfo hints = {
		.ai_family = AF_INET,
		.ai_socktype = SOCK_STREAM,
	};

    printk(&amp;quot;starting run&amp;quot;);
    err = getaddrinfo(HTTP_HOSTNAME, NULL, &amp;amp;hints, &amp;amp;res);
    if (err) {
        printk(&amp;quot;getaddrinfo() failed, err %d\n&amp;quot;, errno);
        return;
    }

    ((struct sockaddr_in *)res-&amp;gt;ai_addr)-&amp;gt;sin_port = htons(HTTP_PORT);


    if (IS_ENABLED(CONFIG_SAMPLE_TFM_MBEDTLS)) {
        fd = socket(AF_INET, SOCK_STREAM | SOCK_NATIVE_TLS, IPPROTO_TLS_1_2);
    } else {
        fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    }
    if (fd == -1) {
        printk(&amp;quot;Failed to open socket!\n&amp;quot;);
        goto clean_up;
    }

    struct timeval tv;
    tv.tv_sec = 10;
    tv.tv_usec = 0;
    setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (const char*)&amp;amp;tv, sizeof tv);
    // setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (const char*)&amp;amp;tv, sizeof tv);

    printk(&amp;quot;Connecting to %s\n&amp;quot;, HTTP_HOSTNAME);
    err = connect(fd, res-&amp;gt;ai_addr, sizeof(struct sockaddr_in));
    if (err) {
        printk(&amp;quot;connect() failed, err: %d\n&amp;quot;, errno);
        goto clean_up;
    }

    printk(&amp;quot;start test\n&amp;quot;);
    // send head
    off = 0;
    do {
        bytes = send(fd, &amp;amp;head_buf[off], HTTP_HEAD_LEN - off, 0);
        if (bytes &amp;lt; 0) {
            printk(&amp;quot;send() failed, err %d\n&amp;quot;, errno);
            goto clean_up;
        }
        printk(&amp;quot;sending %d head bytes\n&amp;quot;, bytes);
        off += bytes;
    } while (off &amp;lt; HTTP_HEAD_LEN);

    // send data
    off = 0;
    do {
        bytes = send(fd, &amp;amp;data_buf[off], sizeof(data_buf) - off, 0);
        if (bytes &amp;lt; 0) {
            printk(&amp;quot;send() failed, err %d\n&amp;quot;, errno);
            goto clean_up;
        }
        off += bytes;
    } while (off &amp;lt; sizeof(data_buf));

    printk(&amp;quot;Sent %d bytes\n&amp;quot;, off);

    off = 0;
    do {
        bytes = recv(fd, &amp;amp;recv_buf[off], RECV_BUF_SIZE - off, 0);
        if (bytes &amp;lt; 0) {
            if (errno != EAGAIN) {
                printk(&amp;quot;recv() failed, err %d\n&amp;quot;, errno);
                goto clean_up;
            }
        }
        off += bytes;
    } while (bytes != 0 /* peer closed connection */);

    printk(&amp;quot;Received %d bytes\n&amp;quot;, off);

    /* Make sure recv_buf is NULL terminated (for safe use with strstr) */
    if (off &amp;lt; sizeof(recv_buf)) {
        recv_buf[off] = &amp;#39;\0&amp;#39;;
    } else {
        recv_buf[sizeof(recv_buf) - 1] = &amp;#39;\0&amp;#39;;
    }

    printk(&amp;quot;\n&amp;gt;\t %s\n\n&amp;quot;, recv_buf);

    freeaddrinfo(res);
    (void)close(fd);
    return;
clean_up:
	freeaddrinfo(res);
	(void)close(fd);

    while (true) {

    }
}

void main(void)
{
	printk(&amp;quot;HTTPS client sample started\n\r&amp;quot;);
    k_work_init_delayable(&amp;amp;server_transmission_work,
			      server_transmission_work_fn);

    k_work_schedule(&amp;amp;server_transmission_work, K_NO_WAIT);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/simon_5F00_test_5F00_sanatized.zip"&gt;devzone.nordicsemi.com/.../simon_5F00_test_5F00_sanatized.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414208?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 16:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b9da37e-6e0f-490c-a5ff-e69deb924e78</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;changing the settings doesn&amp;#39;t seem to change anything. when i&amp;nbsp;set&amp;nbsp;CONFIG_LTE_AUTO_INIT_AND_CONNECT=n and set up the callback i can see I am receiving the values i expect from the network.&lt;br /&gt;&lt;br /&gt;interestingly when using the UDP example, it goes to the low power state as expected. This makes me think it must be something i&amp;#39;m doing, so i&amp;#39;m setting up a minimalistic project that will demonstrate the situation. I&amp;#39;ll post the source here after.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414196?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 15:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:732f4f95-80a3-42e4-b822-c4999346e60d</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;1) Looks like your active timer is set to 31x2=62 seconds instead of 1s.&lt;/p&gt;
&lt;p&gt;2) For the extra power consumption, the potential reason could be PSM is set too short and so SIM card will not be shut down during PSM period. Could you test with a longer PSM period?&lt;/p&gt;
&lt;p&gt;Note:&amp;nbsp;&amp;nbsp;+CPSMS can be used to set PSM period and active timers, but the value may not accept by the network operator, using %XMONITOR to check the actual timer values. See&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/topic/lesson-2-exercise-1/"&gt;Exercise 1 – Nordic Developer Academy (nordicsemi.com)&lt;/a&gt;&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: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414030?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 08:43:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2987c29-a6a7-414f-ac02-7ddaa3985aeb</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;The UART was just a guess, and if &amp;quot;CONFIG_SERIAL=n&amp;quot; is used, it shouldn&amp;#39;t be the cause.&lt;/p&gt;
&lt;p&gt;Maybe you detected a new mystical, which requires some internal expertise.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414023?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 08:39:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abfbfdd5-228a-42b6-bf62-8127c7169061</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;I will try explicitly shutting off uart, but at the moment i am setting CONFIG_SERIAL=n, so I wasn&amp;#39;t expecting to see that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/414011?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 07:42:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28a5f94c-77d5-4c7b-a740-fe2d78085cae</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Hm, the chart shows a peaks about 500&amp;micro;A, right?&lt;/p&gt;
&lt;p&gt;In my experience, the modem consumes much more.&lt;/p&gt;
&lt;p&gt;For me, 500&amp;micro;A points more to the usage of the UART (or other pheripherials). But sure, I may be wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/413958?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 20:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:885f45ae-4b79-42b9-8603-d4f822c18e4f</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;Nope. I&amp;#39;m able to induce the high power consumption&amp;nbsp; state following the first transmission by not properly closing the connection server side after returning the 204 status.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also able to force the low power state following the first transmission by calling &lt;span&gt;lte_lc_power_off,&amp;nbsp;&lt;/span&gt;so my current theory is the modem is staying awake for some reason. I&amp;#39;m trying to make sense of the modem trace to understand more, but it&amp;#39;s difficult to understand.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/413955?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 20:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:111cc245-2b37-4883-83ca-90d9a16ccfb3</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Are any sensors enabled? you may check the interval of the peaks, maybe that helps to see, what causes the peaks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Second HTTP request on NRF91 isn't going into PSM mode.</title><link>https://devzone.nordicsemi.com/thread/413949?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2023 18:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f19eb9f-ece4-41fd-9f6f-6581dde7c0ea</guid><dc:creator>SimonBursten</dc:creator><description>&lt;p&gt;also, doesn&amp;#39;t seem to be an issue server side as If i restart my nrf91dk without restarting the server it goes into PSM correctly, as expected for the first request. is there a limitation on fully initializing multiple sockets? i.e. creating the socket, connecting it, sending some data and then closing it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>