Using PSM for a tracking application roaming in Europe, should I maintain the PDP context or close it and re-open for each session ?
Activation and deactivation of PDP context is managed automatically between the modem and network following 3GPP procedures. So, normally, you have nothing to do. From the host point of view, you may control PDP context through AT+CGACT or even AT+CFUN, but the host cannot know when to trigger closing/re-opening of a PDP context.
The purpose of PSM is specifically to maintain PDP context during sleep period instead of powering off the modem. So, normally you have nothing to do.
An important point to check with your SIM profile provider is if PSM is supported with all carriers that your device may connect to with the roaming SIM profile. If PSM is not supported in some location or carrier, the modem will remain in RRC IDLE and consume more than PSM and will impact expected battery lifetime.
There are 2 potential issues to monitor:
1. Case of waking up from PSM under a different roaming operator coverage
2. Case of PDN lifetime expiration during the PSM sleep period
1. At wake up from PSM sleep, the modem finds a suitable cell. If the roaming carrier has changed, the network will decide whether PDP context must be deactivated and activated or even if deregistration and new registration must be performed.
* If nothing happens and data traffic fails to your servers, then, you should open a ticket to your SIM profile provider. by describing the failing scenario.
* If PDP context is renewed, opened TCP/UDP will be closed, and the host will be notified of socket closing by the URC “+SQNSH: ”, so it knowns that socket must be re-opened. You may monitor PDP context activation/deactivation by enabling +CGEV URC with AT+CGEREP=2,1
2. If the sleep duration exceeds the PDN lifetime, the PDP context is deleted on network side, therefore, the next time the modem will try to send data or perform periodic tracking area update (T3412 epxiration), the network will reject the service request or tracking area request with EMM cause #10 Implicitly detached (3GPP TS 24.301). The modem will automatically re-register to the network, but this causes additional signaling and power consumption for the battery powered device. Unfortunately, the PDN lifetime value is not advertised by the network. The modem does not know about it, so you cannot retrieve it through any URC or AT Command. It is necessary to check it by asking to the carriers or to your SIM provider.