Second HTTP request on NRF91 isn't going into PSM mode.

I'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've configured the a 2 minute PSM. Every 2 minutes I send establish a connection to my server with a new socket, send the data, then close the socket (both server side and client side).

The first time I do this, everything works fine. After sending data and closing the connection the modem goes into psm mode with a very low ~2.9ua current, but when i go ahead and establish the second connection, that never happens. instead after going to sleep i see regular 428 ua spikes.

I know i can reuse the socket, but i'd rather not. My understanding is the modem should be detecting that there's no more data available on the network and should be putting the modem to sleep.

my config is as follows. I'm including a modem trace as well, and some screenshots of my power profile. I'm at a bit of a loss here.

CONFIG_NRF_MODEM_LIB=y

CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_NATIVE=n

CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_MAIN_STACK_SIZE=2048

CONFIG_MODEM_KEY_MGMT=y
CONFIG_LTE_LINK_CONTROL=y
# Request eDRX from the network

# https://aeriscom.zendesk.com/hc/en-us/articles/360049848254-Understanding-LTE-M-Power-Management-Modes
# PSM requested periodic TAU 1 hours
# CONFIG_LTE_PSM_REQ_RPTAU="00100001"
# PSM requested periodic TAU 2 minutes
CONFIG_LTE_PSM_REQ_RPTAU="10100010"
# PSM requested active time 1 seconds (immediate PSM)
CONFIG_LTE_PSM_REQ_RAT="00011111"
# edrx value ~ 1 hour
# CONFIG_LTE_RAI_REQ_VALUE="4"

CONFIG_LTE_AUTO_INIT_AND_CONNECT=y

CONFIG_NEWLIB_LIBC=y


# General options to reduce code size
CONFIG_CONSOLE=n
CONFIG_GPIO=n
CONFIG_LOG=n
CONFIG_PRINTK=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n   # Set explicitly to 'n' to avoid Kconfig warning
CONFIG_USE_SEGGER_RTT=n
CONFIG_BOOT_BANNER=n
CONFIG_NET_SOCKETS_OFFLOAD=y

CONFIG_NRF_MODEM_LIB_TRACE=n

trace-2023-03-07T16-34-51.160Z.pcapng

After the first connection:

After any subsequent connections:

Parents Reply Children
  • Hi Simon,

    I am not sure how you check the values. If you read the pages I suggested, you would find that only CEREG and XMONITOR contain the PSM configuration accepted by the network, which I only see "11100000" in the modem trace files.

    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.

    Let's see if other TAU timer values can be properly accepted by the network first.

    Best regards,

    Charlie

  • I verified it in 2 ways.

    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).

    Also, when viewing the power consumption with the DK i'd see the active timer play out as expected with an event 6 seconds after the modem goes idle.

    I have seen different behaviour depending on where I am connecting. In some locations i've seen seemingly random values returned from the network, without any apparent connection to what i've requested. 

    I'll enable XMONITOR and see what I find and get back to you. I will also get a local SIM tomorrow and try that.

    Simon

  • > %XMONITOR: 5,"","","42502","03AE",7,3,"00364A1F",189,1400,34,22,"1101","00000011","11100000","01001010"

    > which I only see "11100000"

    There is a "01001010" as well.

    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.

    > "00000011","11100000","01001010"

    "00000011": PSM active time 6s

    "11100000": Periodic-TAU-ext deactivated

    "01001010": Periodic-TAU (6 minutes * 10 => 60 minutes)

  • the issue is the roaming sim. i've switched to a local one, the PSM values are now consistent. I'm now trying to figure out what values my provider will accept.

    If you have a similar issue and are using an MVNO sim, try switching to a local sim.

Related