BG77 NB-IoT with PSM and GPS

Hello,

We have a project which is a low power GPS tracker and we’d like to send the location over NB-IoT. This is what I want to achieve:

  • 1: Initialization: power on modem, connect to NB-IoT network, go to PSM mode
  • 2: Wake up from PSM mode
  • 3: Get GPS data
  • 4: Send GPS data over NB-IoT (through UDP socket)
  • 5: Enter PSM mode
  • 6: Sleep for X time, then go to step #2

I’ve read several Quectel documentations, however I cannot find a proper example of AT commands. The BG95&BG77&BG600L Series GNSS Application Note says something about the GPS & network coexistence (time multiplexed) with PSM mode:

I’ve followed the instructions, but either the modem does not go to PSM mode sometimes, or when it tries to get GPS fix, it cannot (CME ERROR 516). Sometimes it gets GPS fix, but then cannot send the message over the UDP socket. Sometimes the modem does not wake up with the pulse on PWR_KEY, and I need to powercycle the modem. So as you can see there are multiple issues.

The AT commands that are used (in order):
– Initialization
ATE0
AT+CPIN?
AT+QCFG=“iotopmode”,1,1
AT+COPS=1,2,“21670”,9
AT+QICSGP=1,1,“APN”,“USER”,“PASSWORD”,1
AT+QIACT=1
AT+CPSMS=1,“01100000”,“00000000”

– Loop:
** Wakeup modem by pulling up PON_TRIG for 20 msec **
AT+CPSMS=0 // disable PSM so the modem does not go to sleep while trying to get GPS fix
AT+QGPSCFG=“priority”,0 // switch to GNSS priority
AT+QGPS=1
AT+QGPSLOC=2 // repeat this command until we get fix
AT+QGPSEND
AT+QGPSCFG=“priority”,1 // switch to WWAN priority
AT+CPSMS=1,“01100000”,“00000000”
** open UDP socket with AT+QIOPEN **
** send data with AT+QISEND **
** close socket with AT+QICLOSE **
** MCU sleeps for X time, so the modem can enter PSM mode **

If I don’t enable the PSM mode, everything works fine. (Both GPS & NB-IoT)

Can you please help with these issues? A proper example with AT commands would be also helpful.

Best regards,
Bence

if you want to konw detail , we need Qwinlog for the more analysis’

https://cnquectel-my.sharepoint.com/:f:/g/personal/america-fae_quectel_com/EshySx-KDThCpg_N_DtiJT0BblIPwcu-9Obs2hpEvINR3Q?e=O4FdBE

Hi Bence,

I have some experience using PSM+GPS with BG77 on Cat M1 network. I am no expert but here are my pointers-

  1. I am in USA using AT&T network. This network auto enables LwM2M function. For PSM to function consistently, I had disable this function by this AT command: AT+QCFGEXT=“attm2mfeat”,1. Try doing that during initialization. Maybe it will help on your network too.

  2. Before setting PSM each time with AT+CPSMS=1…, do AT+CGATT=1 and AT+QIACT=1, not only during initialization.

  3. Make sure you get correct response to AT+QGPSEND, AT+CGATT=1 and AT+QIACT=1 before setting PSM.

  4. PSM is not really ‘set’ but requested by module. The cell tower ‘allows’ the module to enter and wake up from PSM. So maybe you can try at another location with different cell tower connection to see if you get any better result.

  5. Good practice to turn off GPS & switching priority to WWAN before using PSM. You are doing that. So that is ok.

-Kunal

1 Like

Hello,
Try do not switch to WWAN priority. AT+QGPSCFG=“priority” And use new FW version!!!.
AT+QGPSCFG=“priority”,1 - This function is not friendly with GPS

1 Like

Hi @kunal and @KvX ,

Thank you very much for your advice, I’ll be able to try them on Monday next week. I’ll write about my results.

Best regards,
Bence

Hi rbence,

besides all the mode priority switching discussion - I think you are setting the wrong timers with your PSM command. The first two timers are for GPRS…

If you want to set the LTE PSM timers T3412 (extended periodic TAU) and T3324 (active time), you have to issue a command like that (without the spaces in between): AT+CPSMS = 1 , , , “00000100” , “00001111”.
Also trying to set the active time to 0 isn’t a good idea…

And as Kunal already mentioned in his post (point no. 4), this is just a “wish” you make to the network. You have to check afterwards which settings your network provider is really offering you.
You can query the REALLY set PSM parameters by issueing “AT+QPSMS?”

Cheers,
Lars

Hi,

I’m getting close to the solution:

  • the modem enters the PSM mode successfully
  • current consumption is low
  • I can wake up the modem from PSM with PON TRIG
  • I never change the GNSS/WWAN priority, it is always GNSS priority.

However it seems to me that sometimes the BG77 enters the PSM mode when the GNSS is active (trying to get fix).

My question is the following: How should I ‘block’ the BG77 from entering PSM mode, when the GNSS is running?

Should I use the AT+CPSMS=1,... command after the GPS then AT+CPSMS=0 before the GPS session? Won’t this wear the BG77’s internal flash memory?

EDIT:

I’ve found this in the Quectel BG77 GNSS Application Note

So this means that if the PSM is enabled, the modem can go into PSM mode regardless the GNSS/WWAN priority mode even if the GNSS engine is active. I cannot understand what is the reason behind this.

Is there a way to restart the PSM active timer? So I could always reset the counter while I’m trying to get a GPS fix, and when I get one, I’ll leave the timer running so it will eventually go into PSM.

What I want to achive is the following:

  • 1: Initialization: power on modem, connect to NB-IoT network, go to PSM mode
  • 2: Wake up from PSM mode
  • 3: Start GNSS engine
  • 4: Get GPS data, store it into a buffer in the microcontroller
  • 5: Stop GNSS engine
  • 5a: If the buffer is not full go back to PSM mode, sleep for X time, then repeat from #2
  • 5b: If the buffer is full, I need to stop the BG77 from entering PSM mode, open a socket and send data over NB-IoT
  • 6: If the communication was successfull, the BG77 can enter PSM mode.
  • 7: Sleep for X time, then go to step #2

I also sometimes have other messages for example “Motion start” events, and I need to wake up the modem, send the message, then go back to PSM.

Thank you in advance,
Bence

Hello,

I have added some further information about my issue with the PSM mode:

My problem with always enabled PSM is that the module does not care about if the GNSS engine is active or not, and also it can go into PSM during communication with the host microcontroller (which is really annoying). So in other words the module is able to enter PSM mode even it is the GNSS is active. For example let’s assume my Active Period timer (T3324) is 60 seconds. I wake up the modem from PSM and if I don’t have any network communication I believe the T3324 starts counting almost immediately (maybe some not user iniatiated communication happens between the module and the network). So this means I have about 60 seconds to find a GNSS fix and also send it when needed. But if for some reason the GNSS fix takes longer (because weak signal for example), and the timer reaches 0, the modem will go into PSM without letting me finish either the GNSS or the network communication session.

You could say that I need longer T3324 period (for example 10 minutes) but if I get a fix after 15 seconds, and send it (another 15 seconds) the BG77 will stay in Idle mode for another 9,5 minutes with an X mA current consumption. (Which is far more than the 10-20 uA in PSM mode.)

What I need is a method to control the timing of entering the PSM state so that the module will not turn off mid communication with the microcontroller / during GNSS sessions.

One solution is the following:

  • when I wake up the module from PSM, I immediately turn off PSM mode with AT+CPSMS
  • when I finish my “stuff” (GNSS session, network communication, some module configuration with AT commands), I don’t need to communicate with the BG77 for a while, so I turn back on the PSM mode with a short (2 second) Active Timer. --> after about 2 seconds the modem enters PSM mode

For me this solution would be totally fine, but I don’t know if changing frequently the PSM config has any drawbacks. (BG77 internel flash wearing for example) Do you have some information about this?

Another solution can be the following:

  • PSM mode is always enabled with a long active timer (10 minutes for example). I assume that 10 minutes is always enough to do my stuff
  • PSM config is never changed
  • after I’ve done with the module what I wanted, I somehow signal to the BG77 that it can now enter PSM mode. Do you know if such AT commands exists?

Do you maybe have another solution?

Best regards,
Bence

Hello rbence!
Have you finished project? and does it work well?
I’m also learning BC660k with PSM mode and don’t really understand PSM! T3412 and T3324 are not working as expected same as setting value.

Hello @Son_Goku ,

We are currently dealing with other issues of the project, however if I remember correctly we did some progresss with the PSM timer issue with the following:

Dear Bence,

Please find below command implemented in FW BG77LAR02A04_01.005.01.005:


This adds an additional timer called “activetimer”, than can prevent module from entering PSM.

By default, module will enter PSM after T3324 expires (this is also called ActiveTimer or IDLE timer, but will keep T3324 name from 3GPP to avoid confusion).

With this command, you can override T3324 (option 2) or add to T3324 (option 1) this activetimer which is restarted after each AT command input.

So for your case, set T3324 short or 0, then set option 2 with your activetimer = AT poll time + reply time + some margin

Then query periodically (poll) before the timer expires.

Once you get fix, you can stop query, then timer will expire and module will enter PSM.

No, it will not work with URCs, timer is restarted only when you input an AT command request, so you need to poll for fix.

https://cnquectel-my.sharepoint.com/:f:/g/personal/europe-fae_quectel_com/Eh01kn-Vn-ZAt7w2lXIvEjUBoRqZ4-wK-JwZtGIlY_jCOg?e=EjTU2T

These are differential DFOTA files, you can upgrade or downgrade from X to Y version.

However the PSM is definetely not robust, so we are not satisfied with this product at all. Currently we have issues with higher priority, but soon we will have to deal with this PSM/GPS and NBIOT/low power mode problem.

Hope I could help.

Best regards,
Bence

1 Like

thank you so much and happy new year!