This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PSM on nRF9160 custom board

Hi,

I'm using latest master branch of nRF Connect SDK and pre-released modem FW 1.1.2 which is including ANT->AUX switching. I'm developing a firmware for a custom board that has nRF9160 SiP. I'm from Finland and currently using LTE-M SIM cards provided by DNA.

EDIT: The firmware is based on Asset Tracker application and here is some other stuff I have implemented:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/asset_tracker/README.html
- the debug console is modified version of the Serial LTE Modem sample
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/serial_lte_modem/README.html
- FOTA is from HTTP application update sample
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/http_application_update/README.html
- NVS (non-volatile storage) is from Zephyr's NVS sample
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/nvs/README.html
- ADC is from Rallare's ADC sample
https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/adc
- data sending to the server is from HTTPS Client sample with help of Rallare's HTTP and HTTPS simple samples
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/https_client/README.html
https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/http
https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/https_simple

So, for now, I'm trying to get PSM (Power Saving Mode) to use but I'm actually not sure how it should really work. We have a combined antenna for LTE and GPS so we can't use them at the same time. It's been planned that our device would be 1 week in PSM but it could be sending data to our server if the device has not moved lately enough (triggered by accelerometer).

Currently I'm using lte_lc_psm_req(true) after lte_lc_connect() has been done successfully.

  1. First of all, do I even need the PSM because "is for receive "polling" only, you can send data at any time."? We are not receiving any other stuff than responses when data has been sent to the server. I think the only benefit would be that it would be already registered to network when the device is waking up and sending data again.
  2. Should I power off (or send to offline) the modem after entering PSM? Or should I let the modem be on, is the modem automatically "sleeping" when PSM is enabled?
  3. Do I have to request PSM every time I connect to LTE or just in LTE LC initialization or in first connection?
  4. Does the PSM timer start again if I send data to our server?
  5. If I set the CONFIG_LTE_PSM_REQ_RPTAU to "00010100" which is 200min/12000s (EDIT: seems to be that this values is the lowest possible) why does it set PTAU to 12000-15600? Does it depend on operator or is there some bug on your LTE LC driver? The get function (lte_lc_psm_get(&tau, &active_time);) gives this kind of log (and yes, I have set the active time to 0):
    [00:01:26.414,611] [1B][0m<dbg> lte_lc.lte_lc_psm_get: TAU: 14400 sec, active time: 0 sec
  6. How to get a certain information that the device is in PSM? Is there any other ways than just measuring the current or in software using lte_lc_psm_get()? How should the device be tested while in PSM?
  7. Should I need a some kind of timer to put the device sleeping while in PSM like Rallare has done in his udp_with_psm sample?
    https://github.com/Rallare/fw-nrfconnect-nrf/blob/nrf9160_samples/samples/nrf9160/udp_with_psm/src/main.c

I have gathered some information mainly from DevZone and collected them in one document. Please correct if there are some wrong information.
PSM.docx

This is a pretty complicated thing for me so I hope I will get some help from here. My post could be a little unclear but please ask me if you don't understand something. I would really appreciate any help!

Regards,
Tero

  • Hi Tero,

     

     

    First of all, do I even need the PSM because "is for receive "polling" only, you can send data at any time."? We are not receiving any other stuff than responses when data has been sent to the server. I think the only benefit would be that it would be already registered to network when the device is waking up and sending data again.

     PSM allows the modem to not go into RX mode for longer periods, so if you are concerned about power consumption, you want to use PSM (or eDRX).

    Should I power off (or send to offline) the modem after entering PSM? Or should I let the modem be on, is the modem automatically "sleeping" when PSM is enabled?

     No need to power off. You should request PSM, then the modem will start to negotiate with the eNB.

    Do I have to request PSM every time I connect to LTE or just in LTE LC initialization or in first connection?

     No, you do not need to do this, the modem will do this for you, as long as CPSMS holds valid PSM values.

    Does the PSM timer start again if I send data to our server?

     Yes. You will go out of PSM and start communicating with the network, and after a while (idle connection set by eNB, will differ from network-to-network), you'll enter PSM again.

    f I set the CONFIG_LTE_PSM_REQ_RPTAU to "00010100" which is 200min/12000s (EDIT: seems to be that this values is the lowest possible) why does it set PTAU to 12000-15600? Does it depend on operator or is there some bug on your LTE LC driver? The get function (lte_lc_psm_get(&tau, &active_time);) gives this kind of log (and yes, I have set the active time to 0):

    You can request a interval, but the network ultimately sets the interval. 60 minutes is the lowest I get in my area. You can still send data when-ever-you-want, the PSM value should be set to when your application expect to receive data.

    How to get a certain information that the device is in PSM? Is there any other ways than just measuring the current or in software using lte_lc_psm_get()? How should the device be tested while in PSM?

    AT+CEREG=5, then query AT+CEREG?, the last two bit patterns will return your current PSM. Unfortunately, you cannot get specific information on where you are in the current PSM "window".

    Should I need a some kind of timer to put the device sleeping while in PSM like Rallare has done in his udp_with_psm sample?
    https://github.com/Rallare/fw-nrfconnect-nrf/blob/nrf9160_samples/samples/nrf9160/udp_with_psm/src/main.c

    Very much depends on your application. If you send data periodically, send periodically. If you send data based on external asynchronous signals (like an accelerometer), then you can asynchronously. 

    I have gathered some information mainly from DevZone and collected them in one document. Please correct if there are some wrong information.
    PSM.docx

    Looks good, the only thing I can spot is the usage of GPS. GPS can be used in DRX/eDRX as well, as quoted from the modem fw v1.1.0 release notes:

    - GNSS interoperability and tracking during LTE idle mode DRx and idle mode eDRx.

     

    Kind regards,

    Håkon

  • Hi 

    Thanks a lot for your response!

    No, you do not need to do this, the modem will do this for you, as long as CPSMS holds valid PSM values.

    So, do I have to request PSM in first connection or in LTE LC initialization which does only the lte_lc_init() and not connect?

    Does the PSM timer start again if I send data to our server?
    Yes. You will go out of PSM and start communicating with the network, and after a while (idle connection set by eNB, will differ from network-to-network), you'll enter PSM again.

    Does the device resume the timer where it stayed before data sending or start again and be in PSM again the defined PTAU interval?

    If I set the CONFIG_LTE_PSM_REQ_RPTAU to "00010100" which is 200min/12000s (EDIT: seems to be that this values is the lowest possible) why does it set PTAU to 12000-15600?
    You can request a interval, but the network ultimately sets the interval.

    Why does it not set the exact defined value? Does the operator set the interval?

    EDIT:

    Should I power off (or send to offline) the modem after entering PSM? Or should I let the modem be on, is the modem automatically "sleeping" when PSM is enabled?
    No need to power off. You should request PSM, then the modem will start to negotiate with the eNB.

    What happens if I power off the modem? Or send it to offline mode? Does it disable the PSM or?

    Regards,
    Tero

  • Hi Tero,

     

    anicare-tero said:
    So, do I have to request PSM in first connection or in LTE LC initialization which does only the lte_lc_init() and not connect?

     You have to request PSM once in your application, via AT+CPSMS. There's helper functions that does this for you in lte_lc.

    anicare-tero said:
    Does the device resume the timer where it stayed before data sending or start again and be in PSM again the defined PTAU interval?

     No, it'll do a TAU and eventually renegotiate a new PSM. If you get 2 days, but start sending data after 1 hour, you do not have 1 day and 23 hours interval, but you renegotiate and (very likely) get the same 2 days back.

    anicare-tero said:
    Why does it not set the exact defined value? Does the operator set the interval?

     Its because the eNB is the master, and if they do not allow your requested interval, you'll get something else. If you ask for 120 minutes, you even might get it back as 2 hours instead (ie: a different bitmask, same timing). It all depends on what the eNB is configured to do.

    anicare-tero said:
    What happens if I power off the modem? Or send it to offline mode? Does it disable the PSM or?

    If you mean if it stores it locally or not, that is a quick test you can try with at_client + lte link monitor, then issue AT+CPSMS = <whatever>, CFUN=0 or 4, then read it back again.

     

    Kind regards,

    Håkon

  • Hi Håkon,

    Thanks again, this helped me a lot!

    What happens if I power off the modem? Or send it to offline mode? Does it disable the PSM or?
    If you mean if it stores it locally or not, that is a quick test you can try with at_client + lte link monitor, then issue AT+CPSMS = <whatever>, CFUN=0 or 4, then read it back again.

    It seems that AT+CPSMS holds the values when modem is offline. But lte_lc_psm_get() gives -1 for both PTAU and Active Time so I guess it means that PSM is disabled. What do you think? Or is it even possible to track programmatically or with AT commands?

    AT+CPSMS?
    +CPSMS: 1,,,"01011111","00000000"
    OK

    [00][00:05:09.051,269] [1B][0m<inf> anicare_rudolf: Modem entered to offline mode.[1B][0m
    [00:05:09.065,582] [1B][0m<dbg> lte_lc.lte_lc_psm_get: TAU: -1 sec, active time: -1 sec
    [1B][0m

    We are setting the PTAU to "01011111" which is 310h (~12,91 days), because it seems that 320h multiplier is not working so that's the maximum value we can set. We want the maximum value because we are not actually receiving anything from our server or from anywhere else.

    Our plan is to send data to the server once a week. Before sending data we have to do these:

    1. Check if there is a network available (any suggestions how to do this?)
    2. Send the modem to offline
    3. Switch to GPS and start to get a fix
    4. Send the modem to offline
    5. Switch to LTE and send data

    Modem going to offline before switching between LTE and GPS is because we have that combined antenna so they can't work at the same time.

    What do you suggest what I should do of the list below? I mean after data has been sent so it would be a week in that mode. What should consume the least power?

    1. Send the modem to offline mode
    2. MCU on IDLE, modem off, RTC on
    3. Let the modem be on and in PSM
    4. Go to System OFF mode

    If the device is in System OFF mode, should the accelerometer (in our case LIS2DW12) work normally and wakeup the device if there comes a trigger interrupt?

    I guess there won't work any timers (like RTC) while in System OFF so it could not be woken up after a week, right? If there isn't any that kind of timers/counters, that option is not valid for us.

    - Tero

  • Hi,

     

    anicare-tero said:
    It seems that AT+CPSMS holds the values when modem is offline. But lte_lc_psm_get() gives -1 for both PTAU and Active Time so I guess it means that PSM is disabled. What do you think? Or is it even possible to track programmatically or with AT commands?

    Its a difference between your local settings, and the PSM settings applied to your link. You cannot check the state of something that is already shut down. 

     

    anicare-tero said:
    What do you suggest what I should do of the list below? I mean after data has been sent so it would be a week in that mode. What should consume the least power?

     You list two options, where you enter PSM and keep the modem on, and one where you turn the modem off/on based on when you want to send data.

    The option to use PSM is normally the most power efficient (unless you send data very seldom), and will also give the lowest latency of those options.

     

    An initial ATTACH to the network costs both current and time, and if you do this once every hour, it'll cost more than PSM does.

      

    anicare-tero said:
    If the device is in System OFF mode, should the accelerometer (in our case LIS2DW12) work normally and wakeup the device if there comes a trigger interrupt?

    SystemOFF mode doesn't allow any clocks running, and wake up from this mode causes a reset. Since you require timers, this is not the mode I would recommend for your application

    Kind regards,

    Håkon

  • Related