GNSS AT commands

The following commands list contains GNSS-related AT commands.

Run GNSS

The #XGPS command controls the GNSS.

Set command

The set command allows you to start and stop the GNSS.

Syntax

#XGPS=<op>[,<interval>[,<timeout>]]

The <op> parameter accepts the following integer values:

  • 0 - Stop GNSS

  • 1 - Start GNSS

The <interval> parameter represents the GNSS fix interval in seconds. It must be set when starting the GNSS. It accepts the following integer values:

  • 0 - Single-fix navigation mode.

  • 1 - Continuous navigation mode. The fix interval is set to 1 second

  • Ranging from 10 to 1800 - Periodic navigation mode. The fix interval is set to the specified value.

In periodic navigation mode, the <timeout> parameter controls the maximum time in seconds that the GNSS receiver is allowed to run while trying to produce a valid PVT estimate. In continuous navigation mode, this parameter doesn’t have any effect. It accepts the following integer values:

  • 0 - the GNSS receiver runs indefinitely until a valid PVT estimate is produced.

  • Any positive integer lower than the <interval> value - the GNSS receiver is turned off after the specified time is up, even if a valid PVT estimate was not produced.

When not specified, it defaults to a timeout value of 60 seconds.

Unsolicited notification

#XGPS: <latitude>,<longitude>,<altitude>,<accuracy>,<speed>,<heading>,<datetime>
  • The <latitude> value represents the latitude in degrees.

  • The <longitude> value represents the longitude in degrees.

  • The <altitude> value represents the altitude above the WGS-84 ellipsoid in meters.

  • The <accuracy> value represents the accuracy (2D 1-sigma) in meters.

  • The <speed> value represents the horizontal speed in meters.

  • The <heading> value represents the heading of the movement of the user in degrees.

  • The <datetime> value represents the UTC date-time.

Example

AT%XSYSTEMMODE=0,0,1,0

OK
AT%XCOEX0=1,1,1565,1586

OK
AT+CFUN=31

OK
at#xgps=1,1

OK

#XGPS: 35.457576,139.625090,121.473785,22.199919,0.442868,0.000000,"2021-06-02 06:25:48"

#XGPS: 35.457550,139.625115,124.293533,15.679427,0.263094,0.000000,"2021-06-02 06:25:49"

#XGPS: 35.457517,139.625094,120.865372,12.768595,0.166673,0.000000,"2021-06-02 06:25:50"

Read command

The read command is not supported.

Test command

The test command tests the existence of the command and provides information about the type of its subparameters.

Syntax

#XGPS=?

Example

AT#XGPS=?

#XGPS: (0,1),<interval>,<timeout>

OK

Connect to nRF Cloud

The #XNRFCLOUD command controls the connection to the nRF Cloud service.

Set command

The set command allows you to connect and disconnect the nRF Cloud service.

Syntax

#XNRFCLOUD=<op>[,<signify>]

The <op> parameter accepts the following integer values:

  • 0 - Disconnect from the nRF Cloud service.

  • 1 - Connect to the nRF Cloud service.

  • 2 - Send a message in the JSON format to the nRF Cloud service.

When <op> is 2, SLM enters slm_data_mode.

The <signify> parameter is used only when the <op> value is 1 It accepts the following integer values:

  • 0 - It does not signify the location info to nRF Cloud.

  • 1 - It does signify the location info to nRF Cloud.

When the <signify> parameter is not specified, it does not signify the location info to nRF Cloud.

Unsolicited notification

#XNRFCLOUD: <ready>,<signify>
  • The <ready> value indicates whether the nRF Cloud connection is ready or not.

  • The <signify> value indicates whether the location info will be signified to nRF Cloud or not.

#XNRFCLOUD: <message>
  • The <message> value indicates the nRF Cloud data received when A-GPS, P-GPS, and Cell_Pos are not active.

Example

AT#XNRFCLOUD=1

OK
#XNRFCLOUD: 1,0

AT#XNRFCLOUD=2
{"msg":"Hello, nRF Cloud"}
OK

#XNRFCLOUD: {"msg":"Hello"}

AT#XNRFCLOUD=0

AT#XNRFCLOUD: 0,0

OK
AT#XNRFCLOUD=1,1

OK
#XNRFCLOUD: 1,1
AT#XNRFCLOUD=0

AT#XNRFCLOUD: 0,1

OK

Read command

The read command checks if nRF Cloud is connected or not.

Syntax

#XNRFCLOUD?

Response syntax

#XNRFCLOUD: <ready>,<signify>,<sec_tag>,<device_id>
  • The <ready> value indicates whether the nRF Cloud connection is ready or not.

  • The <signify> value indicates whether the location info will be signified to nRF Cloud or not.

  • The <sec_tag> value indicates the sec_tag used for accessing nRF Cloud.

  • The <device_id> value indicates the device ID used for accessing nRF Cloud.

Example

AT#XNRFCLOUD?

#XNRFCLOUD: 1,0,16842753,"nrf-352656106443792"

OK
AT#XNRFCLOUD?

#XNRFCLOUD: 1,0,8888,"50503041-3633-4261-803d-1e2b8f70111a"

OK

Test command

The test command tests the existence of the command and provides information about the type of its subparameters.

Syntax

#XNRFCLOUD=?

Example

AT#XXNRFCLOUD=?

#XNRFCLOUD: (0,1,2),<signify>

OK

Run GNSS with nRF Cloud A-GPS

The #XAGPS command runs the GNSS together with the nRF Cloud A-GPS service. This requires access to nRF Cloud through the LTE network for receiving A-GPS data.

Set command

The set command allows you to start and stop the GNSS together with the nRF Cloud A-GPS service.

Syntax

#XAGPS=<op>[,<interval>[,<timeout>]]

The <op> parameter accepts the following integer values:

  • 0 - Stop GNSS with A-GPS

  • 1 - Start GNSS with A-GPS

The <interval> parameter represents the GNSS fix interval in seconds. It must be set when starting the GNSS. It accepts the following integer values:

  • 0 - Single-fix navigation mode.

  • 1 - Continuous navigation mode. The fix interval is set to 1 second

  • Ranging from 10 to 1800 - Periodic navigation mode. The fix interval is set to the specified value.

In periodic navigation mode, the <timeout> parameter controls the maximum time in seconds that the GNSS receiver is allowed to run while trying to produce a valid PVT estimate. In continuous navigation mode, this parameter doesn’t have any effect. It accepts the following integer values:

  • 0 - the GNSS receiver runs indefinitely until a valid PVT estimate is produced.

  • Any positive integer lower than the <interval> value - the GNSS receiver is turned off after the specified time is up, even if a valid PVT estimate was not produced.

When not specified, it defaults to a timeout value of 60 seconds.

Unsolicited notification

#XGPS: <latitude>,<longitude>,<altitude>,<accuracy>,<speed>,<heading>,<datetime>
  • The <latitude> value represents the latitude in degrees.

  • The <longitude> value represents the longitude in degrees.

  • The <altitude> value represents the altitude above the WGS-84 ellipsoid in meters.

  • The <accuracy> value represents the accuracy (2D 1-sigma) in meters.

  • The <speed> value represents the horizontal speed in meters.

  • The <heading> value represents the heading of the movement of the user in degrees.

  • The <datetime> value represents the UTC date-time.

Example

AT%XSYSTEMMODE=1,0,1,0

OK
AT%XCOEX0=1,1,1565,1586

OK
AT+CPSMS=1

OK
AT+CFUN=1

OK
AT#XNRFCLOUD=1

OK
#XNRFCLOUD: 1,0
AT#XAGPS=1,1

OK

#XGPS: 35.457417,139.625211,162.850952,15.621976,1.418092,0.000000,"2021-06-02 05:21:31"

#XGPS: 35.457435,139.625348,176.104797,14.245458,1.598184,69.148659,"2021-06-02 05:21:32"

#XGPS: 35.457417,139.625415,179.132980,13.318132,1.235241,69.148659,"2021-06-02 05:21:33"

#XGPS: 35.457410,139.625469,181.223541,12.667312,0.803951,69.148659,"2021-06-02 05:21:34"

Read command

The read command is not supported.

Test command

The test command tests the existence of the command and provides information about the type of its subparameters.

Syntax

#XAGPS=?

Example

AT#XAGPS=?

#XAGPS: (0,1),<interval>,<timeout>

OK

Run GNSS with nRF Cloud P-GPS

The #XPGPS command runs the GNSS together with the nRF Cloud P-GPS service. This requires access to nRF Cloud through the LTE network for receiving P-GPS data.

Set command

The set command allows you to start and stop the GNSS together with the nRF Cloud P-GPS service.

Syntax

#XPGPS=<op>[,<interval>[,<timeout>]]

The <op> parameter accepts the following integer values:

  • 0 - Stop GNSS with P-GPS

  • 1 - Start GNSS with P-GPS

The <interval> parameter represents the GNSS fix interval in seconds. It must be set when starting the GNSS. It accepts the following integer values:

  • Ranging from 10 to 1800 - Periodic navigation mode. The fix interval is set to the specified value.

In periodic navigation mode, the <timeout> parameter controls the maximum time in seconds that the GNSS receiver is allowed to run while trying to produce a valid PVT estimate. In continuous navigation mode, this parameter doesn’t have any effect. It accepts the following integer values:

  • 0 - the GNSS receiver runs indefinitely until a valid PVT estimate is produced.

  • Any positive integer lower than the <interval> value - the GNSS receiver is turned off after the specified time is up, even if a valid PVT estimate was not produced.

When not specified, it defaults to a timeout value of 60 seconds.

Unsolicited notification

#XGPS: <latitude>,<longitude>,<altitude>,<accuracy>,<speed>,<heading>,<datetime>
  • The <latitude> value represents the latitude in degrees.

  • The <longitude> value represents the longitude in degrees.

  • The <altitude> value represents the altitude above the WGS-84 ellipsoid in meters.

  • The <accuracy> value represents the accuracy (2D 1-sigma) in meters.

  • The <speed> value represents the horizontal speed in meters.

  • The <heading> value represents the heading of the movement of the user in degrees.

  • The <datetime> value represents the UTC date-time.

Example

AT%XSYSTEMMODE=1,0,1,0

OK
AT%XCOEX0=1,1,1565,1586

OK
AT+CPSMS=1

OK
AT+CFUN=1

OK
AT#XNRFCLOUD=1

OK
#XNRFCLOUD: 1,0
AT#XPGPS=1,30

OK

#XGPS: 35.457243,139.625435,149.005020,28.184258,10.431827,281.446014,"2021-06-24 04:35:52"

#XGPS: 35.457189,139.625602,176.811203,43.015198,0.601837,281.446014,"2021-06-24 04:36:28"

#XGPS: 35.457498,139.625422,168.243591,31.753956,0.191195,281.446014,"2021-06-24 04:36:41"

#XGPS: 35.457524,139.624667,100.745979,25.324850,6.347160,94.699837,"2021-06-24 04:37:10"

Read command

The read command is not supported.

Test command

The test command tests the existence of the command and provides information about the type of its subparameters.

Syntax

#XPGPS=?

Example

AT#XPGPS=?

#XPGPS: (0,1),<interval>,<timeout>

OK

Run nRF Cloud cellular positioning

The #XCELLPOS command runs the nRF Cloud cellular positioning service for position information. This requires to define CONFIG_SLM_CELL_POS and to access nRF Cloud through the LTE network.

Set command

The set command allows you to start and stop the nRF Cloud cellular positioning service.

Syntax

#XCELLPOS=<op>

The <op> parameter accepts the following integer values:

  • 0 - Stop cellular positioning.

  • 1 - Start cellular positioning in single-cell mode.

  • 2 - Start cellular positioning in multi-cell mode. To use 2, you must issue the AT%NCELLMEAS command first.

Unsolicited notification

#XCELLPOS: <type>,<latitude>,<longitude>,<uncertainty>
  • The <type> value indicates in which mode the cellular positioning server is running:

    • 0 - The server is running in single-cell mode

    • 1 - The server is running in multi-cell mode

  • The <latitude> value represents the latitude in degrees.

  • The <longitude> value represents the longitude in degrees.

  • The <uncertainty> value represents the certainty of the result.

Example

AT%XSYSTEMMODE=1,0,0,0

OK
AT+CFUN=1

OK
AT#XNRFCLOUD=1

OK
#XNRFCLOUD: 1,0
AT#XCELLPOS=1

OK

#XCELLPOS: 0,35.455833,139.626111,1094

AT%NCELLMEAS

OK

%NCELLMEAS: 0,"0199F10A","44020","107E",65535,3750,5,49,27,107504,3750,251,33,4,0,475,107,26,14,25,475,58,26,17,25,475,277,24,9,25,475,51,18,1,25

AT#XCELLPOS=2

OK

#XCELLPOS: 1,35.534999,139.722362,1801
AT#XCELLPOS=0

OK

Read command

The read command is not supported.

Test command

The test command tests the existence of the command and provides information about the type of its subparameters.

Syntax

#XCELLPOS=?

Example

AT#XCELLPOS=?

#XCELLPOS: (0,1,2)

OK