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

nrf9160 AT comamnds to connect and switch to psm

Hi,

can someone tell me the correct order of AT commands to connect to LTE, activate PSM?

My findings so far:

AT%XSYSTEMMODE=1,0,1,0 => set LTE-M and GPS mode

AT+CFUN=21 => activate LTE

AT+CEREG=2 => to get result codes

wait until CEREG returns stat 1 (home network, connected) or 5 (roaming network, connected)

AT+CPSMS=1,,,"RPTAU vals","RAT vals" => switch to PSM



Afterwards I create a gps nrf_socket with an interval of 1 to get the location every sec. But when I do it like this, It is not possible to get a gps fix (it is tracking 7+ satelites). When I deactivate the LTE with  AT+CFUN=20 I get a fix after a few sec.
Are my at commands correct? Why cant I get a gps fix when I do it like this?
best regards,
Markus Schweitzer
Parents
  • Hello Markus, 

    Please read the nRF9160 Product Specification on GPS receiver. It states the following:
    "The GPS receiver supports GPS L1 C/A reception. Operation is time multiplexed with LTE modem, and it is possible to obtain the GPS position either while the LTE is in RRC Idle mode or power saving mode (PSM), or when the LTE modem is completely deactivated."

    Which means that you are doing correct in regards to the AT commands. I also suggest looking at our samples i.e. the Asset Tracker on how it supports GPS and LTE connection. 

    Kind regards,
    Øyvind

  • Thanks for your anwser. I had a look in the asset_tracker sample, but sine I need a interval time of < 10 sec for gps samples, I switched to the gps sample (where lte and gps get activated and deactivated). There a interval of <5 sec (getting gps fix, conenct to lte, http post request) is currently possible, but when I completely activate and deactivate the LTE everytime, this only works a few minutes, until the LTE modem gets stuck with CEREG: 2 => searching, not connected).

  • Hello, Markus, 

    My apologies for the late reply. 

    Markus Schweitzer said:
    ut when I completely activate and deactivate the LTE everytime, this only works a few minutes

    Can you please elaborate? The timing is important, and how you handle the connection. Are you in PSM when trying to activate GPS? Can you provide more log output?

    You could try to activate the GPS first in order to try to get a GPS fix first, before you start sending any data. Once you have gotten a fix, the GPS should have downloaded all the necessary information, and therefore interfere less with the LTE stack.

    Thanks!
    Kind regards,
    Øyvind

Reply
  • Hello, Markus, 

    My apologies for the late reply. 

    Markus Schweitzer said:
    ut when I completely activate and deactivate the LTE everytime, this only works a few minutes

    Can you please elaborate? The timing is important, and how you handle the connection. Are you in PSM when trying to activate GPS? Can you provide more log output?

    You could try to activate the GPS first in order to try to get a GPS fix first, before you start sending any data. Once you have gotten a fix, the GPS should have downloaded all the necessary information, and therefore interfere less with the LTE stack.

    Thanks!
    Kind regards,
    Øyvind

Children
No Data
Related