PSM application example

Hello everyone,
trying to implement PSM on a BG95 module.
I have the “PSM application note” document from Quectel, however, I can’t find a real world example application, only the list of commands involved.
The concept of timers etc are clear to me, but I have a lot of doubts about the functioning of the whole thing, for example:

  • What is kept and what’s not during PSM? Do I simply attach to the network, send the module to PSM, wake up and simply use QIOPEN and SENDEX to send data to my socket?
  • Am I stuck with the TAU timers provided by the network? Is it better to send data during the Active-Time asked by the network, or can I send data whenever I want?
  • How do I detect that module woke up, thus I am able to send?

Several doubts, before starting tinkering randomly, it would be nice to have some kind of track to follow…

1、If your SIM card does not support the PSM feature or if you disable the PSM function of the module, you can keep the module out of the PSM;You can also circumvent entry into the PSM by sending data or heartbeat packets.
2、The TAU timer is determined by the network (related to the parameters configured by the SIM card provider and APN).
3、PON_TRIG PIN wakeup PSM,then send your data

So, I would save more power if I send data when the module wakes up because of T3412, correct?
Can I just wait the “APP RDY” message to monitor when that happens?

TAU is variable and can be configured with APN or SIM card parameters. The normal application is mainly through the pin wake up, you can also use TAU wake up;
“APP RDY” should instruct the module to wake up,I suggest you try debugging

Quectel_BG95&BG77&BG600L_Series_PSM_Application_Note_V1.0.pdf (467.7 KB)

Thank you, I have the same version of the Application note.
I am doing debug, and found a few issues, after issuing a number of commands and tests:

  • The module does not enter PSM, even after waiting the Active-Time. [EDIT] this happens when tau and active timer are changed via AT+CPSMS. You first need to disable PSM and then re-enable it, then PSM starts working again.
  • AT+QCFG=“psm/enter”, which is supposed to trigger PSM mode immediately, has no effect
  • AT+CEREG never gives me a TAU value, even if PSM mode seems working correctly, the module goes to sleep as planned.
+QPSMTIMER: 8280,32\r
+CEREG: 0,1\r

Are you looking at power consumption changes?

Not yet, but I usually got the “PSM POWER DOWN” message.
I will hook up a current meter here, definitely useful.

The URC output “PSM POWER DOWN” indicates that the module can enter the PSM successfully

Oh ok, so that doesn’t mean that it’s actually entering PSM?
When I get that message the module usually stops answering UART messages until the next PWRKEY.
Do I have a way to detect PSM is entered successfully from my microcontroller?

URC:PSM POWER DOWN indicates the actual entry into the PSM, and you can measure the power consumption to observe

Am I supposed to check CEREG after waking up from PSM before attempting a socket connection?
In some cases, after wakeup from PWRKEY, it still takes quite some time to get the first +CEREG: 0,5\r

Also: why is PON_TRIG preferred against PWRKEY?

Hi Vitom,
please take into account, that the value set via at+cpsms is only a ‘wish’ from the module side.
Finally the network decides which values are set. Depending on the network operator they are able to achnowledge your wished values or may set a minum and maximum or a default one.
Please set
(or at+cereg=5 )
and then query the at+cereg again to get the values which have been assigned from the network:
+CEREG: 4,5,“C37C”,“01D02F08”,9,“00001111”,“01011111”

Confusing thing is, that the PSM values are in different order if you compare at+cpsms and at+cereg:

I finally found the at+cereg=5.
Thanks for highlighting the ordering between the two commands!
I currently check with AT+QPSMS the values decided by the network, the datasheet highlight that they are network values and not requested ones.
I also notice that the URC +QPSMTIMER pops up after any AT+CPSMS;1,… command, and I suppose it shows both the values agreed by the network and the start of the PSM timers countdown.

My question was: If I wake up frome a PSM (and I have network coverage), can I suppose I am still attached to the network?

Yes you are attached. The network remembers the device if it goes to sleep.
As soon as you start to send data, the module will send a update location and then the data part (as in the image above).
After RRC connected time and T3324, the module should go to sleep again for the agreed time T3412.
If no wakeup is done and no data sent, the module will wake up after T3412, does a location update, has to wait RRC connected time and T3324 again before going to sleep.
Due to this module saves power as no startup, initial cell search & attach needs to be done.
Power saving is less in case of moving devices during sleep…they need to do cell search again, if same network is found they do update location. If they do not find the same network of course they need to start attach procedure.

Thanks this answer helps a lot